<!--

// change this line with your address to the root folder:
//var path="http://www.megahz.com/"
var path=""




// ############################################ DO NOT MODIFY BELOW ############################################

// browser detection:
var ua = navigator.userAgent;
var ns = (navigator.appName.toLowerCase().indexOf("netscape")!=-1)?1:0;
var ns6 = (document.getElementById && ns)?1:0;
var mac = (navigator.userAgent.toLowerCase().indexOf("mac")!=-1)?1:0;
var macie4 = (mac && !ns && parseInt(ua.substr(ua.indexOf("MSIE")+4,2)) <= 4)?1:0;
var macie = (mac && !ns)?1:0;

document.write('<LINK rel="stylesheet" type="text/css" href="'+path+'mhz.css">')

// array for global menu:
var arrGlobal=new Array(
path+"images/mnu_glo_hom_off.gif",path+"images/mnu_glo_hom_on.gif",path+"Default_OLD-11-17-2009.asp","Home",29,6,"hom",
path+"images/mnu_glo_abo_off.gif",path+"images/mnu_glo_abo_on.gif",path+"AboutUs.asp","About Us",46,6,"abo",
path+"images/mnu_glo_faq_off.gif",path+"images/mnu_glo_faq_on.gif",path+"FAQs.asp","FAQ",21,6,"faq",
path+"images/mnu_glo_map_off.gif",path+"images/mnu_glo_map_on.gif",path+"SiteMap.asp","Site Map",43,6,"map",
path+"images/mnu_glo_dow_off.gif",path+"images/mnu_glo_dow_on.gif",path+"Demos.asp","Download Demos",53,6,"dow"
)
var step1=7

// array for top menu:
var arrTopMnu=new Array(
path+"images/mnu_top_pro_off.gif",path+"images/mnu_top_pro_on.gif",path+"images/mnu_top_pro_act.gif",path+"Products.asp","Products",66,19,"pro",
path+"images/mnu_top_eas_off.gif",path+"images/mnu_top_eas_on.gif",path+"images/mnu_top_eas_act.gif",path+"EAS.asp","EAS",34,19,"eas",
path+"images/mnu_top_eng_off.gif",path+"images/mnu_top_eng_on.gif",path+"images/mnu_top_eng_act.gif",path+"Engineering.asp","Engineering",79,19,"eng",
path+"images/mnu_top_prr_off.gif",path+"images/mnu_top_prr_on.gif",path+"images/mnu_top_prr_act.gif",path+"Press.asp","Press Releases",91,19,"prr",
path+"images/mnu_top_new_off.gif",path+"images/mnu_top_new_on.gif",path+"images/mnu_top_new_act.gif",path+"News.asp","News &amp; Stocks",95,19,"new",
path+"images/mnu_top_ofl_off.gif",path+"images/mnu_top_ofl_on.gif",path+"images/mnu_top_ofl_act.gif",path+"Locations.asp","Office Locations",95,19,"ofl",
path+"images/mnu_top_sho_off.gif",path+"images/mnu_top_sho_on.gif",path+"images/mnu_top_sho_act.gif",path+"Events.asp","Shows &amp; Events",95,19,"sho",
path+"images/mnu_top_car_off.gif",path+"images/mnu_top_car_on.gif",path+"images/mnu_top_car_act.gif",path+"Careers.asp","Careers",59,19,"car",
path+"images/mnu_top_con_off.gif",path+"images/mnu_top_con_on.gif",path+"images/mnu_top_con_act.gif",path+"Contact.asp","Contact MHz",80,19,"con"
)
var step2=8

// array for footer links:
var arrFooter=new Array(
"Home",path+"Default_OLD-11-17-2009.asp","hom",
"About Us",path+"AboutUs.asp","abo",
"Careers",path+"Careers.asp","car",
"Contact MHz",path+"Contact.asp","con",
"Office Locations",path+"Locations.asp","ofl",
"Stocks, Shows &amp; &nbsp;&nbsp;&nbsp;&nbsp;Events",path+"Events.asp","sho",
"Press Releases",path+"Press.asp","prr",
"FAQ",path+"FAQs.asp","faq",
//"Site Map",path+"SiteMap.asp","map",
//"News &amp; Stocks",path+"News.asp","new",
//"Download",path+"Demos.asp","dow",
"Engineering",path+"Engineering.asp","eng",
"Terms &amp; Conditions",path+"TermsAndConditions.asp","tco",
//"Excess Inventory",path+"ExcessInventory.asp","exi",
"Order Status",path+"OrderStatusReport.asp","ord"
)
var step3=3

//preloading "Go" button:
var arrGo_on=new Array(path+"images/btn_go_on.gif")
var arrGo_off=new Array(path+"images/btn_go_off.gif")
var imgGo_on = new Array;
var imgGo_off = new Array;
Preload("arrGo","imgGo",0);

// building the global menu:
var arrGlo_on = new Array;
var arrGlo_off = new Array;
var j=0
var strGlo=""
for (var i=0; i<arrGlobal.length; i+=step1) {
	j=parseInt(i/step1)
	
	arrGlo_on[j]=arrGlobal[i+1]
	arrGlo_off[j]=arrGlobal[i]
	
	if (idPage==arrGlobal[i+6]) strGlo+='<IMG src="'+arrGlobal[i+1]+'" width="'+arrGlobal[i+4]+'" height="'+arrGlobal[i+5]+'" border=0 alt="'+arrGlobal[i+3]+'" title="'+arrGlobal[i+3]+'" name="imgGlo'+j+'" hspace=5>'
	else strGlo+='<A href="'+arrGlobal[i+2]+'" onmouseover="Swap('+j+',\'on\',\'imgGlo\')" onmouseout="Swap('+j+',\'off\',\'imgGlo\')"><IMG src="'+arrGlobal[i]+'" width="'+arrGlobal[i+4]+'" height="'+arrGlobal[i+5]+'" border=0 alt="'+arrGlobal[i+3]+'" title="'+arrGlobal[i+3]+'" name="imgGlo'+j+'" hspace=5></A>'
}
//preloading global menu images:
var imgGlo_on = new Array;
var imgGlo_off = new Array;
Preload("arrGlo","imgGlo",0);


// building the top menu:
var arrTop_on = new Array;
var arrTop_off = new Array;
var arrTop_act = new Array;
var j=0
var strTop=""
for (var i=0; i<arrTopMnu.length; i+=step2) {
	j=parseInt(i/step2)
	
	arrTop_on[j]=arrTopMnu[i+1]
	arrTop_off[j]=arrTopMnu[i]
	arrTop_act[j]=arrTopMnu[i+2]
	
	if (idPage==arrTopMnu[i+7]) strTop+='<IMG src="'+arrTopMnu[i+2]+'" width="'+arrTopMnu[i+5]+'" height="'+arrTopMnu[i+6]+'" border=0 alt="'+arrTopMnu[i+4]+'" title="'+arrTopMnu[i+4]+'" name="imgTop'+j+'">'
	else strTop+='<A href="'+arrTopMnu[i+3]+'" onmouseover="Swap('+j+',\'on\',\'imgTop\')" onmouseout="Swap('+j+',\'off\',\'imgTop\')"><IMG src="'+arrTopMnu[i]+'" width="'+arrTopMnu[i+5]+'" height="'+arrTopMnu[i+6]+'" border=0 alt="'+arrTopMnu[i+4]+'" title="'+arrTopMnu[i+4]+'" name="imgTop'+j+'"></A>'
}
//preloading top menu images:
var imgTop_on = new Array;
var imgTop_off = new Array;
var imgTop_act = new Array;
Preload("arrTop","imgTop",1);


// writes the footer links:
function WriteFooterLinks(){
	var str=""
	for (var i=0; i<arrFooter.length; i+=step3){
		var j=parseInt(i/step3)
		var targetStr = new String("");
		if (arrFooter[i+2]=="bri") targetStr = "target=\"_blank\""
		if (idPage==arrFooter[i+2]) str+='<IMG src="images/mnu_arrow.gif" border=0 width=14 height=15 align=absmiddle vspace=2><FONT class=blueLink>'+arrFooter[i]+'</FONT><BR>'
		else str+='<IMG src="images/mnu_arrow.gif" border=0 width=14 height=15 align=absmiddle vspace=2><A href="'+arrFooter[i+1]+'" class=blueLink '+targetStr+'>'+arrFooter[i]+'</A><BR>'
		//if (j==5 || j==13) str+='<BR>'
		//else if (j!=parseInt(arrFooter.length/step3)-1) str+=' | '
	}
	document.write(str)
}

//getting the content height:
var contH="100%"
function GetContentH(){
	if (ns) contH=window.innerHeight-139-100
	else if (ua.toLowerCase().indexOf("windows")==-1) contH=document.body.clientHeight-139-100
}

// START: Rollover functions >>>
function Preload(arrFrom,arrToGen,act) {
	var l = eval(arrFrom + '_on.length');
	for (var i=0; i<l; i++) {
		eval(arrToGen + '_on[i] = new Image()');
		eval(arrToGen + '_on[i].src = ' + arrFrom + '_on[i]');
		
		eval(arrToGen + '_off[i] = new Image()');
		eval(arrToGen + '_off[i].src = ' + arrFrom + '_off[i]');
		
		if (act==1) {
			eval(arrToGen + '_act[i] = new Image()');
			eval(arrToGen + '_act[i].src = ' + arrFrom + '_act[i]');
		}
	}
}

function Swap() {
	var imgName = Swap.arguments[2] + Swap.arguments[0];
	var index = (Swap.arguments.length >= 4) ? parseInt(Swap.arguments[3]) : parseInt(Swap.arguments[0]);
	document.images[imgName].src = eval(Swap.arguments[2] + '_' + Swap.arguments[1] + '[' + index + '].src');
}
// <<< END: Rollover functions

// START: fixing the page content on resize >>>
FixNSWindow();
function FixNSWindow() {
	if (ns6 || ns && (parseInt(navigator.appVersion) == 4)) {
		if (typeof document.NS == 'undefined') document.NS = new Object;
		if (typeof document.NS.NS_scaleFont == 'undefined') {
			document.NS.FixCssInNS = new Object;
			document.NS.FixCssInNS.initWindowWidth = window.innerWidth;
			document.NS.FixCssInNS.initWindowHeight = window.innerHeight;
		}
		window.onresize = FixCssInNS;
	}
}
function FixCssInNS() {
	if (document.NS.FixCssInNS.initWindowWidth != window.innerWidth || document.NS.FixCssInNS.initWindowHeight != window.innerHeight) document.location = document.location;
}
ReloadWindow();
function ReloadWindow(){if (!ns && (ua.toLowerCase()).indexOf("windows")<0) setTimeout("window.onresize=new Function('window.location.reload()')",200);}
// <<< END: fixing the page content on resize

// Trims the leading and trailing blanks from a given string:
function Trim(strToTrim) {
	while(strToTrim.charAt(0)==' '){strToTrim = strToTrim.substring(1,strToTrim.length);}
	while(strToTrim.charAt(strToTrim.length-1)==' '){strToTrim = strToTrim.substring(0,strToTrim.length-1);}
	return strToTrim;
}

//Show/Hide map tooltip
function showTip(text,ev){
	if(!ns) { //Explorer
		document.all.tooltip.innerHTML = text;
		document.all.tooltip.style.pixelLeft = event.clientX - 25;
		document.all.tooltip.style.pixelTop = event.clientY - 20;
		document.all.tooltip.style.visibility = "visible";
	}
	else { 
		if (!ns6){//Netscape 4
			document.tooltip.document.open();
			document.tooltip.document.write("<layer class='layerNS'><TABLE border='0' cellpadding='0' cellspacing='0'><TR><TD colspan='3' bgcolor='#333333' height='1'><IMG src='images/spacer.gif' width='1' height='1'></TD></TR><TR><TD bgcolor='#333333' height='1'><IMG src='images/spacer.gif' width='1' width='1'></TD><TD class='tooltipTxt'>"+text+"</TD><TD bgcolor='#333333' height='1'><IMG src='images/spacer.gif' width='1' width='1'></TD></TR><TR><TD colspan='3' bgcolor='#333333' height='1'><IMG src='images/spacer.gif' width='1' height='1'></TD></TR></TABLE></layer>");
			document.tooltip.document.close();
			document.tooltip.left = ev.pageX - 25;
			document.tooltip.top = ev.pageY - 25;
			document.tooltip.visibility = "show";
		}
		else { //Netscape 6
			var obj = document.getElementById("tooltip");
			obj.innerHTML = text;
			obj.style.left = ev.pageX - 25;
			obj.style.top = ev.pageY - 20;
			obj.style.visibility = "visible";
		}
	} 
}
	
function hideTip(){
	if(!ns) { //Explorer
		document.all.tooltip.style.visibility="hidden";
	}
	else {
		if (!ns6)//Netscape 4
			document.tooltip.visibility = "hide";
		else {//Netscape 6
			var obj = document.getElementById("tooltip");
			obj.style.visibility = "hidden";
		}
	} 
}

function GoToDWL(prodID,dwlID){
	document.frmDWL.hidPagID.value=prodID
	document.frmDWL.dnid.value=dwlID
	document.frmDWL.action="download.asp"
	document.frmDWL.submit()
}

function GoToDWLContact(prodID,dwlID,filename){
	document.frmDWL.hidPagID.value=prodID
	document.frmDWL.dnid.value=dwlID
	document.frmDWL.hidFilename.value=filename
	document.frmDWL.action="contact.asp?download=1"
	document.frmDWL.submit()
}

//-->

