﻿// JScript File



function GoTo(pstrGoWhere) {
	//Set FY and Tab selected
	//document.forms[0].hidFY.value = document.forms[0].selFY.value;
	//alert("In javascript");
	document.forms[0].hidGoWhere.value = pstrGoWhere;
}

function GoToBreadCrumbBill(pstrGoWhere) {
	//Set FY and Tab selected
	//document.forms[0].hidFY.value = document.forms[0].selFY.value;
	//alert(document.forms[0].selFY.value);
	//alert(document.forms[0].hidPage.value);
	if (pstrGoWhere.toUpperCase() == "BILLVIEW.ASPX") {
	    location.href = pstrGoWhere + "?FY=" + document.forms[0].hidFY.value + "&PG=" + document.forms[0].hidPage.value + "&Opt="  + document.forms[0].hidOpt.value + "&M="  + document.forms[0].hidMenu.value;
	    
	}
//	else if (pstrGoWhere.toUpperCase() == "BILLSEARCH.ASPX") { 
//	    location.href = "BillView.aspx?FY=" + document.forms[0].hidFY.value + "&PG=" + document.forms[0].hidPage.value + "&Opt=S" ;
//	}
	else if (pstrGoWhere.toUpperCase() == "AGENCYDETAILLEVEL.ASPX") { 
	    location.href = pstrGoWhere + "?FY=" + document.forms[0].hidFY.value + "&BE=" + document.forms[0].hidBE.value + "&M="  + document.forms[0].hidMenu.value;
	}
	else {
	    location.href = pstrGoWhere + "?FY=" + document.forms[0].hidFY.value + "&BE=" + document.forms[0].hidLastBE.value + "&M="  + document.forms[0].hidMenu.value;
	}
}

function GoToBreadCrumbFTE(pstrGoWhere) {
	//Set FY and Tab selected
	//document.forms[0].hidFY.value = document.forms[0].selFY.value;
	//alert(document.forms[0].selFY.value);
	//alert(document.forms[0].hidPage.value);
	location.href = pstrGoWhere + "?FY=" + document.forms[0].hidFY.value + "&PG=" + document.forms[0].hidPage.value  + "&BE=" + document.forms[0].hidBE.value + "&R=" + document.forms[0].hidReferrer.value;
}

function GoToBreadCrumb(pstrGoWhere) {
	//Set FY and Tab selected
	//document.forms[0].hidFY.value = document.forms[0].selFY.value;
	//alert(document.forms[0].selFY.value);
	//alert(document.forms[0].hidPage.value);
	location.href = pstrGoWhere + "?FY=" + document.forms[0].hidFY.value;
}

function ChangeAGY() {
	//Set flag that Agency update button was pressed
	document.forms[0].hidChgAgy.value = "T";
}

 function ExportToExcel(strButton) {
	if (strButton == '1') {
		document.forms[0].hidAction.value = "E1";
    }
    else {
        document.forms[0].hidAction.value = "E2";
    }
}

function PrintPage() {
		//open the current page in another browser for printing
		var pstrURL, pstrQS, pstrPrint;
        pstrPrint = "&Print=Y";
        pstrQS = document.forms[0].hidQS.value;
        //pstrQS should contain the page name and the query string
        pstrURL = pstrQS + pstrPrint;
        //alert(pstrURL);
        //window.open(pstrURL, 'PrintWindow', 'toolbar=0, menubar=0, location=0,  height=500, width=1000, resizable=1, scrollbars=yes',false);
        window.open(pstrURL, 'PrintWindow', 'scrollbars,resizable,height=500,width=1000', false);
        return false;
    }

	function ltrim(str){
        return str.replace(/^\s+/, '');
    }

    function rtrim(str) {
        return str.replace(/\s+$/, '');
    }

    function trim(str) {
        return str.replace(/^\s+|\s+$/g, '');
    }
