


function doLoad() {
}


	
function doResize() {
 
}

function whatSection() {
	if (typeof section == "undefined") return null;
	return section;
}

function whatSubSection() {
	if (typeof subSection == "undefined") return null;
	return subSection;
}

function whatSubSubSection() {
	if (typeof subSubSection == "undefined") return null;
	return subSubSection;
}

function whatSubSubSubSection() {
	if (typeof subSubSubSection == "undefined") return null;
	return subSubSubSection;
}


function goToPage(newLocation) {
	window.location = newLocation;
}

function standardOver(t) {
	t.className += " " + t.className + "Over";
}

function standardOut(t) {
	var classNames = t.className.split(" ");
	t.className = classNames[0];
}

function getElement(id) {
	var e = document.getElementById(id);
	
	if (!e) alert('bad element id: ', id);
	
	return e;
}

function Chart_OnClick(theURL, selectionParameter, selectionstartdate, selectionenddate) {
window.open(theURL+"?"+"item="+ selectionParameter+"&Reportstartdate="+selectionstartdate+"&Reportenddate="+selectionenddate, 'mywindow', 'menubar=0, toolbar=0, resizeable=0, status=0, location=0'); 

return ;
}

function New_Window(theURL1, selectionParameter1, selectionstartdate1, selectionenddate1) {
window.open(theURL1+"?"+"item1="+ selectionParameter1+"&Reportstartdate1="+selectionstartdate1+"&Reportenddate1="+selectionenddate1, 'mywindow1', 'menubar=0, toolbar=0, resizeable=1, status=0, location=0, directories=0, scrollbars=1'); 

return ;
}

function Long_Window(theURL2, selectionParameter2, selectionstartdate2, selectionenddate2, ssecondselection2,thirdselection2) {
window.open(theURL2+"?"+"item2="+ selectionParameter2+"&Reportstartdate2="+selectionstartdate2+"&Reportenddate2="+selectionenddate2+"&secondselection2="+ssecondselection2+"&thirdselection2="+thirdselection2, 'mywindow3', 'menubar=0, toolbar=0, resizeable=1, status=0, location=0, directories=0, scrollbars=1'); 

return ;
}

function Group_Window(theURL3, selectionParameter3, selectionstartdate3, selectionenddate3, secondselection3) {
window.open(theURL3+"?"+"data1="+ selectionParameter3+
"&data2="+selectionstartdate3+"&data3="+selectionenddate3+"&data4="+secondselection3, "ReportWindow", "menubar=0, toolbar=0, status=0, location=0, directories=0, scrollbars=Yes, resizable=yes, width=1075, height=770, left=270, screenx=200");

return ;
}

function RealLong_Window(theURL11, selectionParameter11, selectionstartdate11, selectionenddate11, secondselection11, thirdselection11) {
window.open(theURL11+"?"+"item11="+ selectionParameter11+"&item12="+selectionstartdate11+"&item13="+selectionenddate11+"&item14="+secondselection2+"&item15="+thirdselection11, 'mywindow5', 'menubar=0, toolbar=0, resizeable=1, status=0, location=0, directories=0, scrollbars=1'); 

return ;
}

function LongLong_Window(theURL22, selectionParameter22, selectionstartdate22, selectionenddate22, selectionparm22, selectionparm23) {
window.open(theURL22+"?"+"item22="+ selectionParameter22+"&Reportstartdate22="+selectionstartdate22+"&Reportenddate22="+selectionenddate22+"&selectionparm22="+selectionparm22+"&selectionparm23="+selectionparm23, "Longwindow", "menubar=no, toolbar=yes, resizable=yes,  scrollbars=yes, width=800, height=600"); 

return ;
}


 formatStatus = function(data,cell,record,row,col,store) {
    cell.css = 'gridAlign';
    data = usmoney(data);
	return data
 }

 formatStatusPercent = function(data,cell,record,row,col,store) {
    cell.css = 'gridAlign';
    data = uspercent(data);
	return data
 }

function usmoney(v) {
	v = (Math.round((v-0)*100))/100;
	v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v);
	v = String(v);
	var ps = v.split('.');
	var whole = ps[0];
	var sub = ps[1] ? '.'+ ps[1] : '.00';
	var r = /(\d+)(\d{3})/;
	while (r.test(whole)) {
		whole = whole.replace(r, '$1' + ',' + '$2');
	}
	return "$" + whole;
}
function uspercent(v) {
	v = (Math.round((v-0)*100))/100;
	v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v);
	v = String(v);
	var ps = v.split('.');
	var whole = ps[0];
	var sub = ps[1] ? '.'+ ps[1] : '.00';
	var r = /(\d+)(\d{3})/;
	while (r.test(whole)) {
		whole = whole.replace(r, '$1' + ',' + '$2');
	}
	return whole + sub + '%' ;
}

function init(){  

  var tb = ColdFusion.Grid.getTopToolbar("PayrollDisplay");  
        tb.add('-', {
		  pressed: false,
          enableToggle:false,
          icon:'excel-small.png',//Icon graphic
          cls: 'x-btn-text-icon',//The ext class that will display the button with text/icon properly
          handler:btnHandler//Our javascript               
		});  

		tb.add('-', {
		  pressed: false,
          enableToggle:false,
          icon:'helpicon.png',//Icon graphic
          cls: 'x-btn-text-icon',//The ext class that will display the button with text/icon properly
          handler:btnHandlerhelp//Our javascript               
		});  

     ColdFusion.Grid.showTopToolbar('PayrollDisplay');  
 }  
 
function btnHandlerhelp(b,e){  
	  helpwindow = window.open('help.pdf', 'HelpFile', 'menubar=0, toolbar=0, resizeable=1, status=0, location=0, directories=0, scrollbars=1');		
	 }

function btnHandler(b,e){  
    createpayrollspreadsheet();      
} 

function init2(){  

  var tb = ColdFusion.Grid.getTopToolbar("ClaimsDisplay");  
        tb.add('-', {
		  pressed: false,
		    enableToggle:false,
          icon:'excel-small.png',//Icon graphic
          cls: 'x-btn-text-icon',//The ext class that will display the button with text/icon properly
          handler:btnHandler2//Our javascript               
		});  

     ColdFusion.Grid.showTopToolbar('ClaimsDisplay');  
 }  

 function btnHandler2(b,e){  
    createclaimsspreadsheet();      
} 
 function btnHandler3(b,e){  

			location.reload(true);

} 

	 

function OpenTicketWin(){  
	  helpwindow = window.open('opentickets.cfm', 'OpenTickets', 'menubar=0, toolbar=0, resizeable=1, status=0, location=0, directories=0, scrollbars=1, height=300, width=900');		
	 }

function CallCFMPage()  
	 { 	 ColdFusion.Window.create('Window1','Upload Finished', 'sendmail.cfm',{x:25,y:25,height:200,width:300});
	 }

function enableField(fieldtoenable)
{
document.getcriteria.fieldtoenable.disabled=false;
}


function CheckEntries(formfield, formnumber1,currentfield)
{
   var x=document.forms["getcriteria"][formfield].value
	if (x==null || x=="")
   { 
      alert('You have not entered a Payroll Amount') 
      return false; 
   } 
  else {
	  ShowHide(formnumber1);
	  return false;
  }
}

  
function CheckEntries1(formfield, formnumber1,currentfield, minusid)
{
   var x=document.forms["getcriteria"][formfield].value
   var mytext = document.getElementById(formfield); 

	if (x==null || x=="")
   { 
      alert('You have not entered a Payroll Amount') 
	  mytext.focus(); 
      return false; 
   } 
  else {
	  ShowHide(formnumber1);
	  change(currentfield);
	  change1(minusid);
 	  return false;
  }
}


