/*mm_Loader.js
* by Peter Belesis. v4.1.3 011108
* Copyright (c) 2001 Peter Belesis. All Rights Reserved.
*/

HM_DOM = (document.getElementById) ? true : false;
HM_NS4 = (document.layers) ? true : false;
HM_IE = (document.all) ? true : false;
HM_IE4 = HM_IE && !HM_DOM;
HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
HM_IE4M = HM_IE4 && HM_Mac;
HM_Opera = (navigator.userAgent.indexOf("Opera")!=-1);
HM_Konqueror = (navigator.userAgent.indexOf("Konqueror")!=-1);

HM_IsMenu = !HM_Opera && !HM_Konqueror && !HM_IE4M && (HM_DOM || HM_NS4 || HM_IE4);

HM_BrowserString = HM_NS4 ? "NS4" : HM_DOM ? "DOM" : "IE4";

if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

HM_GL_MenuWidth          = 170;
HM_PG_FontFamily         = "Verdana,Arial,sans-serif";
HM_PG_FontSize           = 8;
HM_PG_FontBold           = false;
HM_PG_FontItalic         = false;
HM_PG_FontColor          = "#000000";
HM_PG_FontColorOver      = "#FFFFFF";
HM_PG_BGColor            = "#DDDDDD";
HM_PG_BGColorOver        = "#006699";
HM_PG_ItemPadding        = 2;

HM_PG_BorderWidth        = 1;
HM_PG_BorderColor        = "#666666";
HM_PG_BorderStyle        = "solid";
HM_PG_SeparatorSize      = 1;
HM_PG_SeparatorColor     = "#666666";

HM_PG_ImageSize          = 16;
HM_PG_ImageHorizSpace    = 0;
HM_PG_ImageVertSpace     = -3;

HM_PG_KeepHilite         = true;
HM_PG_ClickStart         = false;
HM_PG_ClickKill          = 0;
HM_PG_ChildOverlap       = 1;
HM_PG_ChildOffset        = -1;
HM_PG_ChildPerCentOver   = null;
HM_PG_TopSecondsVisible  = .2;
HM_PG_ChildSecondsVisible = .3;
HM_PG_StatusDisplayBuild = 0;
HM_PG_StatusDisplayLink  = 1;
HM_PG_UponDisplay        = null;
HM_PG_UponHide           = null;

HM_PG_RightToLeft      = false;
HM_PG_CreateTopOnly      = HM_NS4 ? true : false;
HM_PG_ShowLinkCursor     = true;

// the following function is included to illustrate the improved JS expression handling of
// the left_position and top_position parameters introduced in 4.0.9
// and modified in 4.1.3 to account for IE6 standards-compliance mode
// you may delete if you have no use for it

function HM_f_CenterMenu(topmenuid) {
	var MinimumPixelLeft = 0;
	var TheMenu = HM_DOM ? document.getElementById(topmenuid) : HM_IE4 ? document.all(topmenuid) : eval("window." + topmenuid);
	var TheMenuWidth = HM_DOM ? parseInt(TheMenu.style.width) : HM_IE4 ? TheMenu.style.pixelWidth : TheMenu.clip.width;
	var TheWindowWidth = HM_IE ? (HM_DOM ? HM_IEcanvas.clientWidth : document.body.clientWidth) : window.innerWidth;
	return Math.max(parseInt((TheWindowWidth-TheMenuWidth) / 2),MinimumPixelLeft);
}

if(HM_IsMenu) {
	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='http://www.primary-image.com/HM_Arrays.js' TYPE='text/javascript'><\/SCR" + "IPT>");
	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='http://www.primary-image.com/HM_Script"+ HM_BrowserString +".js' TYPE='text/javascript'><\/SCR" + "IPT>");
}

// The following is based upon the original PI drop down javascript

function mmLoadMenus() {
  if (window.mm_menu_aboutus_0) return;

window.mm_menu_aboutus_0 = new Menu("root",110,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#ffffff","#DDDDDD","#000066","center","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  mm_menu_aboutus_0.addMenuItem("Who&nbsp;are&nbsp;we?","location='../about_us/about.htm'");
  mm_menu_aboutus_0.addMenuItem("Careers","location='../about_us/careers.htm'");
  mm_menu_aboutus_0.addMenuItem("About PI Vision","location='../about_us/vision.htm'");
   mm_menu_aboutus_0.hideOnMouseOut=true;
   mm_menu_aboutus_0.bgColor='#000000';
   mm_menu_aboutus_0.menuBorder=1;
   mm_menu_aboutus_0.menuLiteBgColor='#FFFFFF';
   mm_menu_aboutus_0.menuBorderBgColor='#FFFFFF';
                
window.mm_menu_products_0 = new Menu("root",110,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#FFFFFF","#DDDDDD","#000066","center","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  mm_menu_products_0.addMenuItem("Overview","location='../products/products.htm'");
  mm_menu_products_0.addMenuItem("What&nbsp;is&nbsp;Fabriano?","location='../products/fabriano.htm'");
  mm_menu_products_0.addMenuItem("Fabriano&nbsp;features","location='../products/fabriano2.htm'");
  mm_menu_products_0.addMenuItem("Tempest","location='../products/tempest.htm'");
  mm_menu_products_0.addMenuItem("Databasing","location='../products/database.htm'");
  mm_menu_products_0.addMenuItem("Marshalling&nbsp;Sim","location='../training_solutions/marshal.htm'");
  mm_menu_products_0.addMenuItem("P10&nbsp;+","location='../products/P10.htm'");
  mm_menu_products_0.addMenuItem("SimView","location='../training_solutions/simview.htm'");
  mm_menu_products_0.addMenuItem("WeSTT&nbsp;Trainer","location='../training_solutions/westt.htm'");
    
  mm_menu_products_0.hideOnMouseOut=true;
   mm_menu_products_0.bgColor='#000000';
   mm_menu_products_0.menuBorder=1;
   mm_menu_products_0.menuLiteBgColor='#FFFFFF';
   mm_menu_products_0.menuBorderBgColor='#000000';

window.mm_menu_solutions_0 = new Menu("root",193,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#ffffff","#dddddd","#000066","center","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  mm_menu_solutions_0.addMenuItem("Training&nbsp;Overview","location='../training_solutions/training_solutions.htm'");
  mm_menu_solutions_0.addMenuItem("Air Traffic Control Simulation","location='../training_solutions/atc.htm'");
  mm_menu_solutions_0.addMenuItem("Custom&nbsp;designs","location='../training_solutions/custom_designs.htm'");
  mm_menu_solutions_0.addMenuItem("Commercial&nbsp;Flight&nbsp;Sim","location='../training_solutions/flightcom.htm'");
  mm_menu_solutions_0.addMenuItem("Direct&nbsp;Fire&nbsp;Trainers","location='../training_solutions/direct.htm'");
  mm_menu_solutions_0.addMenuItem("Fast&nbsp;Jet&nbsp;Trainer","location='../training_solutions/fastjet.htm'");
  mm_menu_solutions_0.addMenuItem("Forward Observation Trainers","location='../training_solutions/forward_obs.htm'");
  mm_menu_solutions_0.addMenuItem("Ground&nbsp;Vehicle&nbsp;Sim","location='../training_solutions/groundveh.htm'");
  mm_menu_solutions_0.addMenuItem("Helicopter&nbsp;Sim","location='../training_solutions/helicopter.htm'");
  mm_menu_solutions_0.addMenuItem("Indirect&nbsp;Fire&nbsp;Trainers","location='../training_solutions/indirect.htm'");
  mm_menu_solutions_0.addMenuItem("Maritime&nbsp;Sim","location='../training_solutions/maritime.htm'");
  mm_menu_solutions_0.addMenuItem("Marshalling&nbsp;Sim","location='../training_solutions/marshal.htm'");
  mm_menu_solutions_0.addMenuItem("Rail&nbsp;Sim","location='../training_solutions/rail.htm'");
  mm_menu_solutions_0.addMenuItem("Sensor&nbsp;Solution","location='../training_solutions/simview.htm'");
  mm_menu_solutions_0.addMenuItem("Tank&nbsp;Sim","location='../training_solutions/tank.htm'");
  mm_menu_solutions_0.addMenuItem("WeSTT&nbsp;Trainer","location='../training_solutions/westt.htm'");
  mm_menu_solutions_0.hideOnMouseOut=true;
  mm_menu_solutions_0.bgColor='#000000';
  mm_menu_solutions_0.menuBorder=1;
  mm_menu_solutions_0.menuLiteBgColor='#ffffff';
  mm_menu_solutions_0.menuBorderBgColor='#000000';

window.mm_menu_news_0 = new Menu("root",110,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#FFFFFF","#DDDDDD","#000066","center","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  mm_menu_news_0.addMenuItem("Latest&nbsp;News","location='../news/news.htm'");
  mm_menu_news_0.addMenuItem("2003&nbsp;Archive","location='../news/newsarchive2003.htm'");
  mm_menu_news_0.addMenuItem("2002&nbsp;Archive","location='../news/newsarchive2002.htm'");
  mm_menu_news_0.addMenuItem("2001&nbsp;Archive","location='../news/newsarchive2001.htm'");
  mm_menu_news_0.hideOnMouseOut=true;
  mm_menu_news_0.bgColor='#000000';
  mm_menu_news_0.menuBorder=1;
  mm_menu_news_0.menuLiteBgColor='#FFFFFF';
  mm_menu_news_0.menuBorderBgColor='#000000';
   
window.mm_menu_contact_0 = new Menu("root",160,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#FFFFFF","#DDDDDD","#000066","center","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  mm_menu_contact_0.addMenuItem("Contact&nbsp;Details","location='../contact/contact.htm'");
  mm_menu_contact_0.addMenuItem("How To Find Us In The UK","location='../contact/map.htm'");
  mm_menu_contact_0.addMenuItem("Query&nbsp;Form","location='../contact/query.htm'");
  mm_menu_contact_0.hideOnMouseOut=true;
  mm_menu_contact_0.bgColor='#000000';
  mm_menu_contact_0.menuBorder=1;
  mm_menu_contact_0.menuLiteBgColor='#FFFFFF';
  mm_menu_contact_0.menuBorderBgColor='#000000';

window.mm_menu_support_0 = new Menu("root",110,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#FFFFFF","#DDDDDD","#000066","center","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  mm_menu_support_0.addMenuItem("Support&nbsp;Details","location='../support/supportdetails.htm'");
  mm_menu_support_0.hideOnMouseOut=true;
  mm_menu_support_0.bgColor='#000000';
  mm_menu_support_0.menuBorder=1;
  mm_menu_support_0.menuLiteBgColor='#FFFFFF';
  mm_menu_support_0.menuBorderBgColor='#000000';

window.mm_menu_downloads_0 = new Menu("root",118,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#FFFFFF","#DDDDDD","#000066","center","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  mm_menu_downloads_0.addMenuItem("Unregistered&nbsp;users","location='../downloads/downloads.htm'");
  mm_menu_downloads_0.addMenuItem("Registered&nbsp;users","location='../registered/registered.htm'");
  mm_menu_downloads_0.hideOnMouseOut=true;
  mm_menu_downloads_0.bgColor='#000000';
  mm_menu_downloads_0.menuBorder=1;
  mm_menu_downloads_0.menuLiteBgColor='#FFFFFF';
  mm_menu_downloads_0.menuBorderBgColor='#000000';

window.mm_menu_0311145409_0 = new Menu("root",85,18,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#FFFFFF","#DDDDDD","#000066","center","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0311145409_0.addMenuItem("New&nbsp;Item");
  mm_menu_0311145409_0.fontWeight="bold";
  mm_menu_0311145409_0.fontStyle="italic";
  mm_menu_0311145409_0.hideOnMouseOut=true;
  mm_menu_0311145409_0.bgColor='#000000';
  mm_menu_0311145409_0.menuBorder=1;
  mm_menu_0311145409_0.menuLiteBgColor='#FFFFFF';
  mm_menu_0311145409_0.menuBorderBgColor='#FFFFFF';

mm_menu_0311145409_0.writeMenus();
} // mmLoadMenus()

function MM_showMenu(menu, x, y, child, imgname) {
	if (!window.mmWroteMenu) return;
	MM_clearTimeout();
	if (menu) {
		var obj = FIND(imgname) || document.images[imgname] || document.links[imgname] || document.anchors[imgname];
		x = moveXbySlicePos (x, obj);
		y = moveYbySlicePos (y, obj);
	}
	if (document.layers) {
		if (menu) {
			var l = menu.menuLayer || menu;
			l.top = l.left = 1;
			hideActiveMenus();
			if (this.visibility) l = this;
			window.ActiveMenu = l;
		} else {
			var l = child;
		}
		if (!l) return;
		for (var i=0; i<l.layers.length; i++) { 			   
			if (!l.layers[i].isHilite) l.layers[i].visibility = "inherit";
			if (l.layers[i].document.layers.length > 0) MM_showMenu(null, "relative", "relative", l.layers[i]);
		}
		if (l.parentLayer) {
			if (x != "relative") l.parentLayer.left = x || window.pageX || 0;
			if (l.parentLayer.left + l.clip.width > window.innerWidth) l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth);
			if (y != "relative") l.parentLayer.top = y || window.pageY || 0;
			if (l.parentLayer.isContainer) {
				l.Menu.xOffset = window.pageXOffset;
				l.Menu.yOffset = window.pageYOffset;
				l.parentLayer.clip.width = window.ActiveMenu.clip.width +2;
				l.parentLayer.clip.height = window.ActiveMenu.clip.height +2;
				if (l.parentLayer.menuContainerBgColor && l.Menu.menuBgOpaque ) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor;
			}
		}
		l.visibility = "inherit";
		if (l.Menu) l.Menu.container.visibility = "inherit";
	} else if (FIND("menuItem0")) {
		var l = menu.menuLayer || menu;	
		hideActiveMenus();
		if (typeof(l) == "string") l = FIND(l);
		window.ActiveMenu = l;
		var s = l.style;
		s.visibility = "inherit";
		if (x != "relative") {
			s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0;
			s.left = s.pixelLeft + 'px';
		}
		if (y != "relative") {
			s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0;
			s.top = s.pixelTop + 'px';
		}
		l.Menu.xOffset = document.body.scrollLeft;
		l.Menu.yOffset = document.body.scrollTop;
	}
	if (menu) window.activeMenus[window.activeMenus.length] = l;
	MM_clearTimeout();
}

//end
