// JavaScript Document
bLoad = false
function addListener(element, type, expression, bubbling){
	bubbling = bubbling || false;
	if(window.addEventListener)	{// Standard
		element.addEventListener(type, expression, bubbling);
		return true;
	} else if(window.attachEvent) {// IE
		element.attachEvent('on' + type, expression);
		return true;
	} else return false;
}

//addListener(window,'resize',setHeight)
//addListener(window,'load',setHeight)

bLoad = addListener(window,'load',setLoad)

function setHeight() {
  var myWidth = 0, myHeight = 0, contentHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  iSubHeight = 145
  myHeight = myHeight - iSubHeight
  document.getElementById('ContentCell').style.height = myHeight + "px"

}
function toggleMenu(menuId, mmenuId){
	if(bLoad){
		hideMenu(menuId)
		document.getElementById('SubMenuCell').style.display = "block"
		oMenu = document.getElementById(menuId)
		oMenu.style.display = "block"
	}
}
function hideMenu(menuId){
	if(menuId!='menu01') document.getElementById('menu01').style.display="none"
	if(menuId!='menu02') document.getElementById('menu02').style.display="none"
	if(menuId!='menu03') document.getElementById('menu03').style.display="none"
	if(menuId!='menu04') document.getElementById('menu04').style.display="none"
}
function subOver(subId){
	oCell = document.getElementById(subId)
	if(oCell.style.backgroundColor == ""){
		//oCell.style.backgroundColor = "#dbcdbf"
		oCell.style.backgroundColor = "#ced1d4"
		oCell.style.color = "3366ff"
		oCell.style.fontWeight = "bold"
	}else{
		oCell.style.backgroundColor = ""
		oCell.style.color =  ""
		oCell.style.fontWeight = ""
	}
}

MMenu01On = new Image()
MMenu01On.src = "Images/sysimages/menu/menu01on.gif"
MMenu01Off = new Image()
MMenu01Off.src = "Images/sysimages/menu/menu01Off.gif"
MMenu02On = new Image()
MMenu02On.src = "Images/sysimages/menu/menu02on.gif"
MMenu02Off = new Image()
MMenu02Off.src = "Images/sysimages/menu/menu02Off.gif"
MMenu03On = new Image()
MMenu03On.src = "Images/sysimages/menu/menu03on.gif"
MMenu03Off = new Image()
MMenu03Off.src = "Images/sysimages/menu/menu03Off.gif"
MMenu04On = new Image()
MMenu04On.src = "Images/sysimages/menu/menu04on.gif"
MMenu04Off = new Image()
MMenu04Off.src = "Images/sysimages/menu/menu04Off.gif"
MMenu05On = new Image()
MMenu05On.src = "Images/sysimages/menu/menu05on.gif"
MMenu05Off = new Image()
MMenu05Off.src = "Images/sysimages/menu/menu05Off.gif"
subMenu01On = new Image()
subMenu01On.src = "Images/sysimages/menu/subMenu01On.gif"
subMenu01Off = new Image()
subMenu01Off.src = "Images/sysimages/menu/subMenu01Off.gif"
subMenu02On = new Image()
subMenu02On.src = "Images/sysimages/menu/subMenu02On.gif"
subMenu02Off = new Image()
subMenu02Off.src = "Images/sysimages/menu/subMenu02Off.gif"
subMenu03On = new Image()
subMenu03On.src = "Images/sysimages/menu/subMenu03On.gif"
subMenu03Off = new Image()
subMenu03Off.src = "Images/sysimages/menu/subMenu03Off.gif"
subMenu04On = new Image()
subMenu04On.src = "Images/sysimages/menu/subMenu04On.gif"
subMenu04Off = new Image()
subMenu04Off.src = "Images/sysimages/menu/subMenu04Off.gif"
subMenu05On = new Image()
subMenu05On.src = "Images/sysimages/menu/subMenu05On.gif"
subMenu05Off = new Image()
subMenu05Off.src = "Images/sysimages/menu/subMenu05Off.gif"
subMenu06On = new Image()
subMenu06On.src = "Images/sysimages/menu/subMenu06On.gif"
subMenu06Off = new Image()
subMenu06Off.src = "Images/sysimages/menu/subMenu06Off.gif"

function flipMenu(id){
	bOn = document.getElementById(id).src.indexOf('Off')==-1
	if(bOn){
		document.getElementById(id).src = eval(id+"Off.src")
	}else{
		document.getElementById(id).src = eval(id+"On.src")
	}
}

function MenuOn(id){
	document.getElementById(id).src = eval(id+"On.src")
}
function MenuOff(id){
	document.getElementById(id).src = eval(id+"Off.src")
}


function keyPressEnter(e){
	var keynum							
	if(window.event) // IE
		{
		keynum = e.keyCode
		}
	else if(e.which) // Netscape/Firefox/Opera
		{
		keynum = e.which
		}
	if(keynum==13){
		sendLogin()
	}
	return
}
function setFieldValue(chkBox, fileName) {
	formField = document.getElementById(fileName + "__" + chkBox.name);
	if(chkBox.checked) { formField.value = "Y"; }
	else { formField.value = ""; }
}

function getPage(sPage, sHost, sServer, sReferer, sSoftware){
	var xmlHttp;
	sPage+="?scrWidth="+window.screen.width+"&scrHeight="+window.screen.height+"&sHost="+sHost+"&sServer="+sServer+"&sReferer="+sReferer+"&sSoftware="+sSoftware
	// Uncomment line below to make every call unique and bypass cache
	
try{    
	// Firefox, Opera 8.0+, Safari    
		xmlHttp=new XMLHttpRequest();
		xmlHttp.overrideMimeType('text/xml')   
	}catch (e){
	// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e){
				alert("Your browser does not support AJAX!");
				return false;        
			}      
		}    
	}	
	//alert(xmlHttp.onreadystatechange)
	xmlHttp.onreadystatechange=function(){
		//alert(xmlHttp.status)
		if(xmlHttp.readyState==4){
			try{
				//alert("how"+xmlHttp.responseText)
				//Use Below to show outputted html as code
				//document.getElementById("look").innerText=xmlHttp.responseText;
				
				//Use Below to show outputted HTML
				//document.getElementById("MainContentTable").style.top = '0px'
				//prompt('',xmlHttp.responseText)
				//document.getElementById("look").innerHTML=xmlHttp.responseText;
				
				//document.getElementById("look").style.visibility="visible"
			}catch(err){
				//document.getElementById("look").innerHTML="Error: " + err.description
			}
		}
	}
	//alert(sPage)
	try{
	xmlHttp.open("GET",sPage,true);
	}catch(e){alert(e.description)}
	
	//alert("what"+xmlHttp.responseText);
	
	xmlHttp.send(null);
	
}
function setLoad(){return true;}