//paym jscript

//menu code begin

var cssmenuids=["cssmenu1"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.

function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"
    	var spanref=document.createElement("span")
			spanref.className="arrowdiv"
			spanref.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;"
			ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    	ultags[t].parentNode.onmouseover=function(){
    	this.getElementsByTagName("ul")[0].style.visibility="visible"
    	}
    	ultags[t].parentNode.onmouseout=function(){
			this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)

//menu code end

//open new window special begin

function wopen(url, w, h)
{
w += 32;
h += 96;
 var win = window.open(url,
  'popup', 
  'width=' + w + ', height=' + h + ', ' +
  'location=no, menubar=no, ' +
  'status=no, toolbar=no, scrollbars=yes, resizable=no');
 win.resizeTo(w, h);
 win.focus();
 window.opener = top; 
}

//open new window special end

//evodlaccess.asp begin

function validateedla(){

if(frmEvoDLAccess.User.value == "")

	{

	alert("Required Field ERROR: You must provide a user name in order to proceed.");
	frmEvoDLAccess.User.focus()
	return(false);

	}
	
if(frmEvoDLAccess.PW.value == "")

	{

	alert("Required Field ERROR: You must provide a password in order to proceed.");
	frmEvoDLAccess.PW.focus()
	return(false);

	}
	
return(true);
	
}

//evodlaccess.asp end

//contactus.asp begin

function validatecu() {

var vINT = false;
var vINTCount = 0;
var vINTDescrip = "";
var vProceed = false;
var vProceedCount = 0;
var vTOB = false;
var vTOBCount = 0;
var vTOBDescrip = "";
var vNOE = false;
var vNOECount = 0;

if(frmContactUs.txtFirstName.value == "")

	{

	alert("Required Field ERROR: Please provide a first name.");
	frmContactUs.txtFirstName.focus()
	return(false);

	}

if(frmContactUs.txtLastName.value == "")

	{

	alert("Required Field ERROR: Please provide a last name.");
	frmContactUs.txtLastName.focus()
	return(false);

	}

if(frmContactUs.txtCompName.value == "")

	{

	alert("Required Field ERROR: Please provide a company name.");
	frmContactUs.txtCompName.focus()
	return(false);

	}

if(frmContactUs.txtPhone.value == "")

	{

	alert("Required Field ERROR: Please provide a phone number.");
	frmContactUs.txtPhone.focus()
	return(false);

	}

if(frmContactUs.txtEmail.value == "")

	{

	alert("Required Field ERROR: Please provide an e-mail address.");
	frmContactUs.txtEmail.focus()
	return(false);

	}

if(frmContactUs.txtEmail.value.indexOf("@") == -1 || frmContactUs.txtEmail.value.lastIndexOf(".") == -1)

	{

	alert("Require Field Syntax ERROR: The e-mail address you've provided appears to be invalid.")
	frmContactUs.txtEmail.focus()
	return(false);

	}

if(frmContactUs.txtEmail.value.lastIndexOf(".") < frmContactUs.txtEmail.value.indexOf("@"))

	{

	alert("Require Field Syntax ERROR: The e-mail address you've provided appears to be invalid.")
	frmContactUs.txtEmail.focus()
	return(false);

	}

if(frmContactUs.txtNOE.value == "")

	{

	alert("Required Field ERROR: Please provide the number of employees you process payroll for.");
	frmContactUs.txtNOE.focus()
	return(false);

	}


if(frmContactUs.chkPFW.checked == false && frmContactUs.chkPFB.checked == false && frmContactUs.chkPFSM.checked == false && frmContactUs.chkPFM.checked == false && frmContactUs.chkPFSA.checked == false && frmContactUs.chkPFA.checked == false)

	{
	
	alert("Required Field ERROR: Please choose a pay frequency.");
	frmContactUs.chkPFW.focus()
	return(false);

	}

return(true);

}

//contactus.asp end

//payroll calculator start

function validatepayrollcalc() {

var TaxFreqVeri = false;
var MSVeri = false;
var Ded1Veri = false;
var Ded2Veri = false;
var Ded3Veri = false;

if(frmPayrollCalc.txtGross.value == "")

	{

	alert("ERROR: The gross field can not be left blank.");
	frmPayrollCalc.txtGross.focus()
	return(false);

	}

if(frmPayrollCalc.txtGross.value <= 0)

	{

	alert("ERROR: The gross has to be greater than zero.");
	frmPayrollCalc.txtGross.focus()
	return(false);

	}
	
if(frmPayrollCalc.TaxFreq.value == "CO")

	{
	
	alert("ERROR: You have to select a tax frequency.");
	frmPayrollCalc.TaxFreq.focus()
	return(false);
	
	}
	
if(frmPayrollCalc.MS.value == "CO")

	{
	
	alert("ERROR: You have to select a marital status.");
	frmPayrollCalc.MS.focus()
	return(false);
	
	}

if(frmPayrollCalc.txtNOD.value == "")

	{

	alert("ERROR: The number of dependents field can not be left blank.");
	frmPayrollCalc.txtNOD.focus()
	return(false);

	}

if(frmPayrollCalc.txtDed1.value != 0 && frmPayrollCalc.HVDed1.value == "")

	{
	
	alert("ERROR: If you provide a deduction amount, you must also provide the type of deduction. (1)");
	frmPayrollCalc.txtDed1.focus()
	return(false);
	
	}
	
if(frmPayrollCalc.txtDed2.value != 0 && frmPayrollCalc.HVDed2.value == "")

	{
	
	alert("ERROR: If you provide a deduction amount, you must also provide the type of deduction. (2)");
	frmPayrollCalc.txtDed2.focus()
	return(false);
	
	}
	
if(frmPayrollCalc.txtDed3.value != 0 && frmPayrollCalc.HVDed3.value == "")

	{
	
	alert("ERROR: If you provide a deduction amount, you must also provide the type of deduction. (3)");
	frmPayrollCalc.txtDed3.focus()
	return(false);
	
	}
	
return(true);

}

function calcgross(){

	h = Number(frmPayrollCalc.txtHours.value)
	r = Number(frmPayrollCalc.txtRate.value)
	
	gross = (h * r)
	
	frmPayrollCalc.txtGross.value = gross.toFixed(2)

}

//payroll calculator end

//a2e upload submission code begin

function SubmitUpload() {

	var vHeaderCount = 0;
	var formDOMObj = document.fUploadFile;

	if(fUploadFile.cFileType.value == "Delimited" && fUploadFile.tDelimiter.value == "")
	
	{
	
	alert("ERROR: If your file type is delimited, you must set a delimiter.")
	fUploadFile.tDelimiter.focus()
	return(false);
	
	}
	
	for(cHeaders = 0; cHeaders < fUploadFile.rHeaders.length; cHeaders++) 

	if(fUploadFile.rHeaders[cHeaders].checked == true)

	{

	vHeaderCount = vHeaderCount + 1;

	}

	if(vHeaderCount < 1)

	{

	alert("ERROR: You must indicate whether a header record is included in your file or not.");
	fUploadFile.rHeaders[0].focus()
	return(false);

	}
	
	if (formDOMObj.attach1.value == "")
	
		alert("ERROR: You must select a file to upload in order to proceed.")
		
    else
    
		return true;

    return false;
	
return(true);

}

//SubmitCustomUpload
function SubmitCustomUpload() {

	var formDOMObj = document.fUploadFile;
	
	if (formDOMObj.attach1.value == "")
	
		alert("ERROR: You must select a file to upload in order to proceed.")
		
    else
    
		return true;

    return false;
	
return(true);

}


function SubmitColumnDefs() {

	//alert("you submitted column defs!")

}

function TransmitEvoFile() {

	var t=setTimeout("window.open('http://www.google.com')", 3000); // 3 secs

}

//a2e upload submission code end

