function Layout_Base() { this.loaded = 0; this.root = ""; this.menus = new Array(); //this.menus[0] = new Array("network",105,210); this.hl = []; this.lt = []; } function layout_base_initialize() { with (this) { if (Site.loaded == 1) { loaded = 1; root = "http://www.petermackay.ca/"; Site.layout_w = 1090; Layout.Align(); } else { window.setTimeout('Layout.Initialize()',10); } } } function layout_base_align(d,y,x,v,h) { with (this) { if (loaded == 1) { Site.Align(null,0,0,'','',0); Site.Align($('layout_staff_menu'),22,154,'top','layout'); } } } function layout_base_menu(d) { var name = ""; var num = -1; with (this) { if (loaded == 1) { d.style.cursor = "pointer"; if (d.id && $('layout_menus')) { name = (d.id.search(/layout_header_/gi) != -1 ? d.id.substr('layout_header_'.length,d.id.length) : ""); for (i = 0; i < menus.length; i++) { if ($('layout_menu_'+menus[i][0])) { $('layout_menu_'+menus[i][0]).style.visibility = "hidden"; $('layout_menu_'+menus[i][0]).style.display = "none"; } if (menus[i][0] == name && num == -1) { num = i; } } if (name != "" && $('layout_menu_'+name)) { $('layout_menu_'+name).style.visibility = "visible"; $('layout_menu_'+name).style.display = "inline"; } Site.Align($('layout_menus'),menus[num][1],menus[num][2],'top','layout'); $('layout_menus').style.visibility = "visible"; $('layout_menus').style.display = "inline"; } } } } function layout_base_staffmenu(d,n,left) { var exists = false; with (this) { if (loaded == 1) { for (i = 0; i < menus.length; i++) { if (menus[i][0] == "staff_"+n && exists === false) { exists = true; } } if (exists === false) { menus[menus.length] = new Array("staff_"+n,189,left); } Menu(d); } } } function layout_base_menuitem(d,c) { var opt = ""; with (this) { if (loaded == 1) { if (d) { if (c != undefined) { opt = (c == "image" ? "image" : (c != "" ? "color" : "")); } if (d.style.cursor != "pointer") { d.style.cursor = "pointer"; if (opt != "image") { if (opt != "color") { d.style.backgroundColor = "#16416D"; } else { d.style.backgroundColor = c; } d.style.color = "#FFFFFF"; } } else { d.style.cursor = ""; if (opt != "image") { d.style.backgroundColor = ""; if (opt != "color") { d.style.color = "#12293F"; } else { d.style.color = c; } } } } } } } function layout_base_highlight(item) { var src = ""; var slice = 0; var file = ""; with (this) { if (loaded == 1) { if ($("pm_"+item)) { if (hl[item]) { hl[item] = (hl[item] == 1 ? 0 : 1); } else { hl[item] = 1; } slice = ($("pm_"+item).src.length - (hl[item] == 0 ? (item+"1.png").length : (item+".png").length)); src = $("pm_"+item).src.substr(0,slice) + (hl[item] == 1 ? item+"1.png" : item+".png"); $("pm_"+item).src = src; $("pm_"+item).style.cursor = (hl[item] == 1 ? "pointer" : ""); } } } } function layout_base_lighttext(id,oc,nc,tc) { with (this) { if (loaded == 1) { if ($("lt-"+id)) { if (lt[id]) { lt[id][0] = (lt[id][0] == 1 ? 0 : 1); } else { lt[id] = new Array(1,oc,nc,tc,(tc == "#000000" || tc == "" ? "#FFFFFF" : "#000000")); } $("lt-"+id).style.backgroundColor = (lt[id][0] == 1 ? lt[id][2] : lt[id][1]); for (i = 1; i < 11; i++) { if ($("lt-"+id+"-text-"+i)) { $("lt-"+id+"-text-"+i).style.color = (lt[id][0] == 1 ? lt[id][4] : lt[id][3]); } } } } } } function layout_base_mouse(ev) { with (this) { if (loaded == 1) { // Check to see if a navigation menu is open, // and if it is, check to see if the mouse is a certain distance away // (and if it is, close the menu) // --------------------------------- if ($('layout_menus')) { if ($('layout_menus').style.visibility == "visible") { if (ev.clientX < ($('layout_menus').offsetLeft - 65) || ev.clientX > ($('layout_menus').offsetLeft + $('layout_menus').scrollWidth + 65) || ev.clientY > ($('layout_menus').offsetTop + $('layout_menus').scrollHeight + 45)) { $('layout_menus').style.visibility = "hidden"; $('layout_menus').style.display = "none"; // "close" all menus // ---------------------------- for (i = 0; i < menus.length; i++) { if ($('layout_menu_'+menus[i][0])) { $('layout_menu_'+menus[i][0]).style.visibility = "hidden"; $('layout_menu_'+menus[i][0]).style.display = "none"; } } } } } } } } Layout_Base.prototype.Initialize = layout_base_initialize; Layout_Base.prototype.Align = layout_base_align; Layout_Base.prototype.Menu = layout_base_menu; Layout_Base.prototype.StaffMenu = layout_base_staffmenu; Layout_Base.prototype.MenuItem = layout_base_menuitem; Layout_Base.prototype.Highlight = layout_base_highlight; Layout_Base.prototype.LightText = layout_base_lighttext; Layout_Base.prototype.Mouse = layout_base_mouse; var Layout = new Layout_Base(); Layout.Initialize();