﻿function disableButtons(f)
{
    for (i=1; i<f.elements.length; i++)
    {
        if (f.elements[i].type == 'submit')
            f.elements[i].disabled = true;
    }
}



function disableButtons(f)
{
    for (i=1; i<f.elements.length; i++)
    {
        if (f.elements[i].type == 'submit')
            f.elements[i].disabled = true;
    }
}


//------------------------------------------------------------------



function showbuttons() {   
 
    var agt       = navigator.userAgent.toLowerCase();
    var IEMAC     = ((agt.indexOf("msie") != -1) && agt.indexOf("mac")!=-1);
    var N6        = (agt.indexOf("netscape6") != -1 || (agt.indexOf("netscape/6") !=-1 ));
 
    if ( N6 ) {
      return "Netscape 6 is unable to support our detailed reports.  Please upgrade to Nescape 7 or higher.<P>";
    }
    if ( IEMAC ) {
      return "<P>";
    }
 
    return "<P><FORM><INPUT TYPE='button' value='Calculate' Name='btnCallCalc' onClick='document.calculator.calculate()'><INPUT TYPE='button' value='View Report' Name='btnOpenNote' onClick='openNote()'></FORM>";
}
 
function openNote()
 { 
 
 var agt=navigator.userAgent.toLowerCase(); 
 var is_aol   = (agt.indexOf("aol") != -1);
 
 leftpos=0;
 if (screen) {
   leftpos=screen.width/2 - 300;
 } 
 
 if (is_aol) {
   var s = " ";
   s=document.calculator.sJavaScriptReport('HTML');
    document.write(s);
 }
 else {
   var OpenWindow=window.open("","newwin","toolbar=yes,menubar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height="+(screen.height-120)+",left="+leftpos+",top=5");
   var s = " ";
   s=document.calculator.sJavaScriptReport('HTML');
   OpenWindow.document.write(s);
   OpenWindow.document.close(); 
   OpenWindow.focus();
 }
 }
 
 
 
 
//------------------------------------------------------------------
 
 

function makeWin(tUrl, strheight, strwidth) {
	agent = navigator.userAgent;
	windowName = "DefinitionWindow";
	
	var vwidth = strwidth;
	var vheight = strheight;
	var vtop = ((screen.height - vheight)/2);
	var vleft = ((screen.width - vwidth)/2); 
	params  = "";
	params += "toolbar=0,";
	params += "location=0,";
	params += "directories=0,";
	params += "status=0,";
	params += "menubar=0,";
	params += "scrollbars=1,";
	params += "resizable=1,";
	params += "width=" + vwidth + ",";
	params += "height=" + vheight + ",";
	params += "top=" + vtop + ",";
	params += "left=" + vleft;
	
	win = window.open(tUrl, windowName, params);
	if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
	    win = window.open(url, windowName , params);
	}
	if (!win.opener) {
	    win.opener = window;
	}
}


	function showDiv(e)
		{		
		    document.getElementById(e).style.display = 'block';   
		}
		
	function openCloseDiv(e)
	{		
	    if (document.getElementById(e).style.display == 'block')
	    {
	        document.getElementById(e).style.display = 'none'; 
	    }
	    else
	    {
	        document.getElementById(e).style.display = 'block';
	    }	    
	}
		
	function checkIfIE()
	    {
	        var browserName=navigator.appName; 

	        if (browserName=="Microsoft Internet Explorer")
                 {
                  document.getElementById('LoginTextboxLiner').style.backgroundPosition="left 1px";
                  document.getElementById('ZipTextboxLiner').style.backgroundPosition="left 1px";
                  document.getElementById('SearchTextboxLiner').style.backgroundPosition="left 1px";
                 }
	    }
		
	function toogleLogInOption(e)
	    {
	        if (e == 'switchToPersonal')
	        {
	            document.getElementById('logIntoPersonal').style.display = 'block';
	            document.getElementById('logIntoBusiness').style.display = 'none';
	        }
	        
	        if (e == 'switchToBusiness')
	        {
	            document.getElementById('logIntoPersonal').style.display = 'none';
	            document.getElementById('logIntoBusiness').style.display = 'block';
	        }
	    }
		
	function collapseTierThreeMenu()
	    {
	        document.getElementById('tier3Subs').style.overflow = 'hidden';	  
	        document.getElementById('tier3Subs').style.height = '30px'; 
	        document.getElementById('OpenButtonTD').style.display = 'block';   
	         
	        
	        var allHTMLTags=document.getElementsByTagName('*');
	        
                 for (i=0; i<allHTMLTags.length; i++) 
                 {
                     if (allHTMLTags[i].className == 'subListHeader') 
                     {
                        allHTMLTags[i].style.border = 'none';
                     }
                 }	        
	    }
	    
	 function openTierThreeMenu()
	    {
	        document.getElementById('tier3Subs').style.overflow = 'auto';	  
	        document.getElementById('tier3Subs').style.height = 'auto';  
	        
	        var allHTMLTags=document.getElementsByTagName('*');
	        
                 for (i=0; i<allHTMLTags.length; i++) 
                 {
                     if (allHTMLTags[i].className == 'subListHeader') 
                     {
                        allHTMLTags[i].style.borderBottom = 'solid 1px #000';
                     }
                 }	        
	    }
	    
	 
	 function imageOver(id, filepath)
	 {
	    document.getElementById(id).src=filepath;	 
	 }
	 
	 function imageOut(id, filepath)
	 {
	    document.getElementById(id).src=filepath;	 
	 }
	 
	 
	
	    
	    
	    
