﻿CV_DOM = (document.getElementById) ? true : false;
CV_NS4 = (document.layers) ? true : false;
CV_IE = (document.all) ? true : false;
CV_IE4 = CV_IE && !CV_DOM;
CV_Mac = (navigator.appVersion.indexOf("Mac") != -1);
CV_IE4M = CV_IE4 && CV_Mac;
CV_IsMenu = (CV_DOM || CV_NS4 || (CV_IE4 && !CV_IE4M));

CV_BrowserString = CV_NS4 ? "NS4" : CV_DOM ? "DOM" : "IE4";
//alert('Browser: '+CV_BrowserString+'\n CV_DOM: '+CV_DOM+'\n CV_NS4: '+CV_NS4+'\n CV_IE4: '+CV_IE4+'\n CV_IE: '+CV_IE );

// the following function is included to illustrate the improved JS expression handling of
// the left_position and top_position parameters
// you may delete if you have no use for it

function HM_f_CenterMenu(topmenuid) {
	var MinimumPixelLeft = 19;
	var TheMenu = CV_DOM ? document.getElementById(topmenuid) : CV_IE4 ? document.all(topmenuid) : eval("window." + topmenuid);
	var TheMenuWidth = CV_DOM ? parseInt(TheMenu.style.width) : CV_IE4 ? TheMenu.style.pixelWidth : TheMenu.clip.width;
	var TheWindowWidth = CV_IE ? document.body.clientWidth : window.innerWidth;
	return Math.max(parseInt((TheWindowWidth-TheMenuWidth) / 2),MinimumPixelLeft);
}

function HM_f_MenuLeft(topmenuid) {
	var MinimumPixelLeft = 00;
    var TheMenu = CV_DOM ? document.getElementById(topmenuid) : CV_IE4 ? document.all(b1) : eval("window." + topmenuid);
    var Width = CV_IE ? document.body.clientWidth : window.innerWidth;
    var Left = Math.max(CV_NS4 ? parseInt(Width-740)/2-9: 0,MinimumPixelLeft);
    //alert( TheMenu+' '+Left +'\n' );
    return (Left);
}


function HM_f_MenuRight(topmenuid) {
	var MinimumPixelLeft = 0;
    var TheMenu = CV_DOM ? document.getElementById(topmenuid) : CV_IE4 ? document.all(b1) : eval("window." + topmenuid);
    var Width = CV_IE ? document.body.clientWidth : window.innerWidth;
    Width = Width < 770 ? 770 : Width;
    var Left = Math.max(parseInt(Width-575),MinimumPixelLeft);
    //alert( TheMenu+' '+Left +'\n' );
    return (Left);
}

if(CV_IsMenu) {
	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='/navdata/rootmenu.js' TYPE='text/javascript'><\/SCR" + "IPT>");
	//document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='/aCV_Script"+ CV_BrowserString +".js' TYPE='text/javascript'><\/SCR" + "IPT>");
}


//end
