function Layout_Base() { this.loaded = 0; this.root = ""; this.menus = new Array(); this.menus[0] = new Array("staff",32,102); this.menus[1] = new Array("crosswords",32,174); this.menus[2] = new Array("news",163,69); this.menus[3] = new Array("employment",163,177); this.menus[4] = new Array("awards",163,273); this.menus[5] = new Array("biz",163,435); this.menus[6] = new Array("sponsors",163,621); this.menus[7] = new Array("links",163,707); this.menus[8] = new Array("contact",163,808); this.hl = []; this.lt = []; } function layout_base_initialize() { with (this) { if (Site.loaded == 1) { loaded = 1; root = "http://mns-firstnet.ca/"; Site.layout_w = 970; 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_header'),0,0,'top','layout'); Site.Align($('layout_body'),166,0,'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(/fn_/gi) != -1 ? d.id.substr('fn_'.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 = "#554130"; } 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 = "#554130"; } else { d.style.color = c; } } } } } } } function layout_base_highlight(item) { var src = ""; var slice = 0; var file = ""; with (this) { if (loaded == 1) { if ($("fn_"+item)) { if (hl[item]) { hl[item] = (hl[item] == 1 ? 0 : 1); } else { hl[item] = 1; } slice = ($("fn_"+item).src.length - (hl[item] == 0 ? (item+"1.png").length : (item+".png").length)); src = $("fn_"+item).src.substr(0,slice) + (hl[item] == 1 ? item+"1.png" : item+".png"); $("fn_"+item).src = src; $("fn_"+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 - 30) || ev.clientX > ($('layout_menus').offsetLeft + $('layout_menus').scrollWidth + 30) || 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();