 document.write('<link href="scripts/menus.css" rel="stylesheet" type="text/css">');

function initializepage (nav) {
	activateMenu(nav);
	DisplayCalcInfo(0);
	document.getElementById('AllOpts').style.display="block";
}

activateMenu=function(nav) {
    /* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) {  
		var navroot=document.getElementById(nav);
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");  
		for (i=0; i<lis.length; i++) {
            /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {		
                   /* display the inner menu */
                   this.lastChild.style.display="block";
      			}
				lis[i].onmouseout=function() {                       
                    this.lastChild.style.display="none";
				}
            }
		}
	}

	var winWidth = 0;
	if (window.innerWidth)	{
		winWidth=eval(window.innerWidth-840);
		winWidth=eval(winWidth/2);
		if (winWidth<0) {winWidth=0};
		document.getElementById('holdm').style.marginTop="0";
		document.getElementById('holdm').style.marginLeft=winWidth;
	}
	if (document.body.clientWidth)	{
		if (screen.width<1024) {
			document.getElementById('holdm').style.marginLeft=0;
		}
	}
}
 
function DisplayCalcInfo(i) {
var optname = new String() ;
var picname = new String();
picname = "Pic"+i

	for (var k = 1; k < 13; k++) {
		optname = "Opt" + k;
		document.getElementById(optname).style.display="none";
		}
	if (i > 0) {
		optname = "Opt"+ i;
		document.getElementById(optname).style.display="block";
		document.getElementById(optname).scrollIntoView(false);
		document.getElementById(picname+1).style.display="block";
	 	document.getElementById(picname+2).style.display="none";
	   	document.getElementById(picname+3).style.display="none";
	}
}

function DisplayCalcChart(i,j) {
var divname = new String();
var idname = new String() ;
var picname = new String();
divname = "Pic"+i
picname = "Pic"+i+j

	for (var k = 1; k < 4; k++) {
		var idname = divname + k;
		document.getElementById(idname).style.display="none";
		}
 	  	document.getElementById(picname).style.display="block";
		document.getElementById(picname).scrollIntoView(false);
}

function DisplayOptInfo(i) {
var optname = new String() ;

	for (var k = 1; k < 5; k++) {
		optname = "Opt" + k;
		document.getElementById(optname).style.display="none";
		}
	optname = "Opt" + i;
    document.getElementById(optname).style.display="block";
	document.getElementById(optname).scrollIntoView(false);
 }
 
 
function preservechecks () {
	DisplayCallBlock()
	DisplayMailBlock()
}
function DisplayCallBlock() {
	if (document.Form1.cbxCallBlock.checked)
	{
    document.getElementById('pnlCall').style.display="block";
	document.getElementById('pnlCall').scrollIntoView(false);
	}
	else
	{
    document.getElementById('pnlCall').style.display="none";
	}
 }
function DisplayMailBlock() {
	if (document.Form1.cbxMailBlock.checked)
	{
    document.getElementById('pnlMail').style.display="block";
	document.getElementById('pnlMail').scrollIntoView(false);
	}
	else
	{
    document.getElementById('pnlMail').style.display="none";
	}
 }
  