/* DHTML FUNCTIONS */
//
function openwinMov(URL,Name) {
  popupWin = window.open(URL, Name, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=616,height=480,left=120,top=120')
}
function setPositionDiv()
{
	if (self.innerWidth)
	{
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}
	else return;
	var offsetLeftDiv = (frameWidth/2)+190;
	var offsetLeftDivFF = (frameWidth/2)+180;
	var offsetLeftDiv2 = (frameWidth/2)-200;

    document.getElementById('panelDiv').style.marginLeft = offsetLeftDiv2 + 'px';
    if (navigator.appVersion.indexOf("MSIE")!=-1){
        document.getElementById('msviMasthead').style.marginLeft = offsetLeftDiv + 'px';
        document.getElementById('panelDiv').style.marginTop = -8 + 'px';
        } else {
        document.getElementById('msviMasthead').style.marginLeft = offsetLeftDivFF + 'px';
        document.getElementById('panelDiv').style.marginTop = -25 + 'px';
        }          
	}
	
//window.onResize = setPositionDiv;
window.onload = setPositionDiv;

function setChromPosition(){
	var iWidth =  document.getElementById('mainpage').offsetLeft;
	//alert (iWidth);
	//document.getElementById('msviMasthead').style.Left=document.getElementById('mainpage').offsetLeft+90;
}
var isNav4, isIE4, isNav6 = false; var range = ""; var styleObj = "";
if (navigator.appVersion.charAt(0) >= 4) {
	if (navigator.appName == "Netscape") { if (navigator.appVersion.charAt(0) >= 5) {isNav6 = true;} else {isNav4 = true;}}
	else {isIE4 = true; range = "all."; styleObj = ".style";}
}
function getObject(obj) {var theObj;
	if (typeof obj == "string") {
		if (isNav6) {theObj = document.getElementById(obj); if (theObj != null) theObj = theObj.style;}
		else {theObj = eval("document." + range + obj); if (theObj != null) theObj = eval("theObj" + styleObj);}}
	else {theObj = obj;} return theObj;
}
function show () {var theObj;
	for (var i = 0; i < show.arguments.length; i++) { theObj = getObject(show.arguments[i]);
		if (theObj != null) { theObj.display = "block"; theObj.visibility = "visible";}}
}
function hide () {var theObj;
	for (var i = 0; i < hide.arguments.length; i++) { theObj = getObject(hide.arguments[i]);
		if (theObj != null) { theObj.display = "none"; theObj.visibility = "hidden";}}
}
function menuActive () {var theObj;
	for (var i = 0; i < menuActive.arguments.length; i++) { theObj = getObject(menuActive.arguments[i]);
		if (theObj != null) { theObj.color = "#536D89"; theObj.backgroundColor = "#FFFFFF";}}
}
function menuInActive () {var theObj;
	for (var i = 0; i < menuInActive.arguments.length; i++) {theObj = getObject(menuInActive.arguments[i]);
		if (theObj != null) { theObj.color = "#FFFFFF"; theObj.backgroundColor = "";}}
}


function tabStatus(tabBox){
	var tabCount = 4;
	for (var i = 1; i <= tabCount; i++)
	{
		var tabID = i;
		var tabName = "tab" + tabID;
		var tabHead = "tabHeader" + tabID;
		var tabLinkHead = "tabLinkBlock" + tabID;
		
		var arrowName = "arrow" + tabID;
		var tabBlock = "tabContent" + tabID;
		
		if (tabBox == tabName)
		{
			document.getElementById(tabName).className='tabOn';
			document.getElementById(tabHead).className='tabHeaderOn';
			/*document.getElementById(tabLinkHead).className='tabLinkBlockOn';*/
			
			
			show(arrowName, tabBlock);
		}
		else
		{
			document.getElementById(tabName).className='tabOff';
			document.getElementById(tabHead).className='tabHeaderOff';
			/*document.getElementById(tabLinkHead).className='tabLinkBlockOff';*/
			
			
			hide(arrowName, tabBlock);
		}
	}
}

function miniTabStatus(miniTabBox){
	var tabCount = 3;
	for (var i = 1; i <= tabCount; i++)
	{
		var tabID = i;
		var tabName = "tab" + tabID;
		var tabHead = "tabHeader" + tabID;
		
		var arrowName = "arrow" + tabID;
		var tabBlock = "tabContent" + tabID;
		
		if (miniTabBox == tabName)
		{
			document.getElementById(tabName).className='miniTabOn';
			document.getElementById(tabHead).className='tabHeaderOn';
			
			show(arrowName, tabBlock);
		}
		else
		{
			document.getElementById(tabName).className='miniTabOff';
			document.getElementById(tabHead).className='tabHeaderOff';
			
			hide(arrowName, tabBlock);
		}
	}
}







function goToReg() {
	var CurrentOpt = document.registrationMenu.regLocation.options;
	var CurrentVal = CurrentOpt[document.registrationMenu.regLocation.selectedIndex].value;	
  
	if (CurrentVal != ""){
		window.location = CurrentVal;
	}
	else {
		return;
	}
}


/* DHTML FUNCTIONS */
function menuActivate(menuBox,num) {
for (var i = 1; i <= num; i++)
{var menuID = "0" + i; var menuName = "menu" + menuID; if (menuBox == menuID) {menuActive(menuName);} else {menuInActive(menuName);}}
}

function boxActivate(offerBox,num) {
for (var i = 1; i <= num; i++)
{var boxID = "0" + i; var boxName = "box" + boxID; if (offerBox == boxID) {show(boxName);} else {hide(boxName);}}
}





function openDownload()
{
     menuSet=false;
     var obj = document.getElementById("divDownloadBox");            
     mavGetObjectPosition('aDownload');                    
     obj .style.top = yPos + 20+ 'px';
     obj .style.left = xPos - 190 + 'px';
     obj .style.display="";
}


function changeMenuClass()
{
     var pageName = mavGetPageName();
     alert(pageName);
     mavSetClass("linkCurrent",pageName)
}

function setUpPage()
{
    
     //Home
    mavRotateTabs(5);
    
     mavRightMenu(xmlFile)     
     //For Tab Rollovers
     try{
     boxActivate('01'); menuActivate('01');}
     catch(e){}
}


