function doLeave() {	 
	document.calcsubmit.btnCallCalc.focus();
}

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 Netscape 7 or higher.<p>";
    }
    if ( IEMAC ) {
      return "Internet Explorer for Macintosh is unable to support our detailed reports.  Please use Safari or Firefox.<p>";
    }

    return "<form name=calcsubmit class='applet-controls'><input type='button' value='Calculate' name='btnCallCalc' onClick='document.calculator.calculate()' /><input type='button' value='View Report' name='btnOpenNote' onClick='openNote()' /></form>";
}

function openNote() { 
	leftpos=0;
	if (screen) {
		leftpos=screen.width/2 - 400;
	} 
	var OpenWindow=window.open("","_blank","toolbar=yes,menubar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height="+(screen.height-120)+",left="+leftpos+",top=5");
	var s = " ";
	s=document.calculator.sJavaScriptReport('HTML');
	OpenWindow.document.write(s);
	OpenWindow.document.close(); 
	OpenWindow.focus();
}
