﻿// JScript File
    //Fires when page opens - Hidden variable is created if JavaScript is enabled.  
    //Check for value in other JS functions.    if (document.all.hidJSEnabled != null)
    document.write('<input type="hidden" id="hidJSEnabled" name="hidJSEnabled" value="true">');


//    function window.onbeforeprint() { >> only works for IE
	function window_onbeforeprint() {
		var hidJS;
		hidJS = document.getElementById("hidJSEnabled");
		var strNotChart, strLogo;
		strNotChart = document.getElementById("divApp");
		strLogo = document.getElementById("divFixedMenu");
		
        if (hidJS != null) {
			var hidValue;
			hidValue = document.getElementById("hidBrowser");
			if (hidValue.value.substr(0,1) == "I") {
				//Make sure the browser is IE
				//Before printing document, hide Menu and other objects
				//divMenuOB.style.display = "none";
				if (strLogo != null) {
					//divLogo.style.display = "none";
					divFixedMenu.className = "fixed_menu2_print";
					divFixedMenu.style.display = "none";
					divScrollable.className = "scrollareaPrint";
					tblBC.style.display = "none";
					tblTabs.style.paddingTop = "5px";
					tdTab1.style.display = "none";
					tdTab2.style.display = "none";
					divAgyDDL.style.display = "none";
					if (document.all.btnExport1 != null) {
						document.all.btnExport1.style.display = "none";
					}
					document.all.btnPrint.style.display = "none";
					divHeaders.style.paddingTop = "5px";
					if (strNotChart != null) {
						//only exists when NOT a chart
						divApp.className = "divAppPrint";
					}
				}
			}
        }
    }

//    function window.onafterprint() { >> only works for IE
    function window_onafterprint() {
		var hidJS;
		hidJS = document.getElementById("hidJSEnabled");
  		var strNotChart, strLogo;
		strNotChart = document.getElementById("divApp");
		strLogo = document.getElementById("divFixedMenu");

		if (hidJS != null) {
			var hidValue;
			hidValue = document.getElementById("hidBrowser");
			if (hidValue.value.substr(0,1) == "I") {
				//Make sure the browser is IE
				//After printing document, redisplay Menu and other objects
				//divMenuOB.style.display = "";
				if (strLogo != null) {
					//divLogo.style.display = "";
					divFixedMenu.style.display = "";
					divFixedMenu.className = "fixed_menu_New";
					divScrollable.className = "scrollarea";
					tblBC.style.display = "";
					tblTabs.style.paddingTop = "";
					tdTab1.style.display = "";
					tdTab2.style.display = "";
					divAgyDDL.style.display = "";
					if (document.all.btnExport1 != null) {
 						document.all.btnExport1.style.display = "";
 					}
					document.all.btnPrint.style.display = "";
					divHeaders.style.paddingTop = "";
					if (strNotChart != null) { 				
						//only exists when NOT a chart
						//divApp.className  = "divAppDisplay";
						divApp.className = document.getElementById("hidAppClass").value
					}
				}
			}   
       }
    }
    
//    function PrintPage() {
//        if (document.all.hidJSEnabled != null) {
//            //Display print dialog box
//            window.print();
//        }
//    }


