function Layout_Base() { this.loaded = 0; this.root = ""; this.menus = new Array(); this.menus[0] = new Array("network",105,210); this.menus[1] = new Array("service",105,325); this.menus[2] = new Array("sales",105,435); this.menus[3] = new Array("web",105,540); this.menus[4] = new Array("info",105,660); } function layout_base_initialize() { with (this) { if (Site.loaded == 1) { loaded = 1; root = "http://www.gmf.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_logo'),20,8,'top','layout'); Site.Align($('layout_bg_header'),0,0,'top','layout'); Site.Align($('layout_header'),0,0,'top','layout'); Site.Align($('layout_title'),105,129,'top','layout'); Site.Align($('layout_body'),127,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(/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_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.Mouse = layout_base_mouse; var Layout = new Layout_Base(); Layout.Initialize();