// jump to a page in a list
function _jumpToPage( vUrl, vPageNum, vPerPage )
{
	var cp = vPageNum;
	var ci = (vPageNum * vPerPage) - (vPerPage - 1);
	
	if (vUrl.indexOf("?")<1)
		window.self.location = vUrl + "?cp=" + cp + "&ci=" + ci;
	else
		window.self.location = vUrl + "&cp=" + cp + "&ci=" + ci;
}

// submits the career search
function _submitCareerSearch()
{
	if (document.career1.slt_Position.value=="-1"&&document.career1.slt_Location.value=="-1"&&document.career1.txt_Keywords.value=="")
	{
		alert("Please choose and enter search criteria before continuing.");
		document.career1.txt_Keywords.focus();
	}
	else
		document.career1.submit();

}

// accepts the terms and conditions and passes on the initials to the next step of the application
function _acceptTerms()
{
	if (document.career1.chk_Accept.value!="Yes"||!document.career1.chk_Accept.checked)
	{
		alert("Please check the box next to the agreement statement above.");
	}
	else
	{
		document.career1.action = "application1.asp";
		document.career1.submit();
	}
}

// does not accept the terms and conditions and will kick the user to the careers home page
function _denyTerms()
{
	window.location = "/index/careers";
}

// checks to see if the user has filled out everything on page one correctly
function _nextStepVerify1()
{
	var vResponse = "Please correct the following fields before continuing: <ul class=\"errorMessage\">";
	var invalidFields = 0;
	
	// check all of the required fields to be sure that they are filled out correctly
	if (!document.career1.chk_CreditReport.checked)
	{
		vResponse = vResponse + "<li>Please accept the Consumer Credit Report Disclosure before continuing.</li>";
		invalidFields++;
	}
	
	if (invalidFields>0)
	{
		vResponse = vResponse + "</ul>";
		document.getElementById("errMsg").innerHTML = vResponse;
		vResponse = "";
		window.self.scrollTo(0,0);
	}
	else
	{
		document.career1.action = "application2.asp";
		document.career1.submit();
	}
}

// goes back a step based on location in the application
function _backStep( vStep )
{
	document.career1.encoding = "application/x-www-form-urlencoded";
	document.career1.action = "application" + vStep + ".asp?action=back";
	document.career1.submit();
}

// finishes and verifies step 2 is correct in the application
// checks to see if the user has filled out everything on page one correctly
function _nextStepVerify2()
{
	var vResponse = "Please correct the following fields before continuing: <ul class=\"errorMessage\">";
	var invalidFields = 0;
	
	// check all of the required fields to be sure that they are filled out correctly
	if ((document.career1.txt_SSN1.value.length<3||!IsNumeric(document.career1.txt_SSN1.value))||(document.career1.txt_SSN2.value.length<2||!IsNumeric(document.career1.txt_SSN2.value))||(document.career1.txt_SSN3.value.length<4||!IsNumeric(document.career1.txt_SSN3.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid social security number.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_DOB1.value.length<1||document.career1.txt_DOB2.value.length<1||document.career1.txt_DOB3.value.length<4)||(!IsNumeric(document.career1.txt_DOB1.value)||!IsNumeric(document.career1.txt_DOB2.value)||!IsNumeric(document.career1.txt_DOB3.value))||!isDate(document.career1.txt_DOB1.value + "/" + document.career1.txt_DOB2.value + "/" + document.career1.txt_DOB3.value))
	{
		vResponse = vResponse + "<li>Please provide a valid date of birth.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_FirstName.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide a first name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_LastName.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide a last name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Address1.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide a main address.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_City.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide a city.</li>";
		invalidFields++;
	}
	
	if (document.career1.slt_State.value.length==0)
	{
		vResponse = vResponse + "<li>Please select a state.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_ZipCode.value.length==0||document.career1.txt_ZipCode.value.length<5||!IsNumeric(document.career1.txt_ZipCode.value))
	{
		vResponse = vResponse + "<li>Please provide a zip code.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_Phone1.value.length<3||document.career1.txt_Phone2.value.length<3||document.career1.txt_Phone3.value.length<4)||(!IsNumeric(document.career1.txt_Phone1.value)||!IsNumeric(document.career1.txt_Phone2.value)||!IsNumeric(document.career1.txt_Phone3.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid phone number.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Email.value.length==0||document.career1.txt_Email.value.indexOf("@")<2||document.career1.txt_Email.value.indexOf(".")<2)
	{
		vResponse = vResponse + "<li>Please provide a valid email address.</li>";
		invalidFields++;
	}
	
	if (document.career1.slt_LocationID.value==""||document.career1.slt_LocationID.value=="-1")
	{
		vResponse = vResponse + "<li>Please select the work location desired.</li>";
		invalidFields++;
	}
	
	if (invalidFields>0)
	{
		vResponse = vResponse + "</ul>";
		document.getElementById("errMsg").innerHTML = vResponse;
		vResponse = "";
		window.self.scrollTo(0,0);
	}
	else
	{
		document.career1.action = "application3.asp?action=next";
		document.career1.submit();
	}
}

// finishes and verifies step 3 is correct in the application
// checks to see if the user has filled out everything on page one correctly
function _nextStepVerify3()
{
	var vResponse = "Please correct the following fields before continuing: <ul class=\"errorMessage\">";
	var invalidFields = 0;
	
	if (document.career1.slt_EmployDesire.value=="")
	{
		vResponse = vResponse + "<li>Please select the type of employment desired.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_HoursPerWeek.value.length==0||!IsNumeric(document.career1.txt_HoursPerWeek.value))
	{
		vResponse = vResponse + "<li>Please let us know approximately the number of hours per week.</li>";
		invalidFields++;
	}
	
	if (document.career1.slt_PositionID1.value=="-1")
	{
		vResponse = vResponse + "<li>Please let us know the position desired.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SalaryDesire.value.length==0||(!IsNumeric(document.career1.txt_SalaryDesire.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid desired salary. Numeric values only.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_StartDate1.value.length<1||document.career1.txt_StartDate2.value.length<1||document.career1.txt_StartDate3.value.length<4)||(!IsNumeric(document.career1.txt_StartDate1.value)||!IsNumeric(document.career1.txt_StartDate2.value)||!IsNumeric(document.career1.txt_StartDate3.value))||!isDate(document.career1.txt_StartDate1.value + "/" + document.career1.txt_StartDate2.value + "/" + document.career1.txt_StartDate3.value))
	{
		vResponse = vResponse + "<li>Please provide a valid available start date.</li>";
		invalidFields++;
	}
	
	if (!document.career1.rad_Overtime[0].checked&&!document.career1.rad_Overtime[1].checked)
	{
		vResponse = vResponse + "<li>Please let us know if you are available for overtime work.</li>";
		invalidFields++;
	}
	
	if (!document.career1.rad_LegalEmployee[0].checked&&!document.career1.rad_LegalEmployee[1].checked)
	{
		vResponse = vResponse + "<li>Please let us know if you are legally eligible for employment.</li>";
		invalidFields++;
	}
	
	if (!document.career1.rad_Bonded[0].checked&&!document.career1.rad_Bonded[1].checked)
	{
		vResponse = vResponse + "<li>Please let us know if you have ever been bonded.</li>";
		invalidFields++;
	}
	
	if (!document.career1.rad_ConvictedCrime[0].checked&&!document.career1.rad_ConvictedCrime[1].checked)
	{
		vResponse = vResponse + "<li>Please let us know if you have been convicted of or entered a plea to a crime.</li>";
		invalidFields++;
	}
	
	if (document.career1.rad_ConvictedCrime[0].checked&&document.career1.txt_CrimeHistory.value.length==0)
	{
		vResponse = vResponse + "<li>Please let us know details of the convicted crime or plea.</li>";
		invalidFields++;
	}
	
	if (invalidFields>0)
	{
		vResponse = vResponse + "</ul>";
		document.getElementById("errMsg").innerHTML = vResponse;
		vResponse = "";
		window.self.scrollTo(0,0);
	}
	else
	{
		document.career1.action = "application4.asp?action=next";
		document.career1.submit();
	}
}

// finishes and verifies step 4 is correct in the application
// checks to see if the user has filled out everything on page one correctly
function _nextStepVerify4( vURL )
{
	var vResponse = "Please correct the following fields before continuing: <ul class=\"errorMessage\">";
	var invalidFields = 0;
	
	if (document.career1.txt_EmployerName1.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide an employer name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_EmployerAddress1a.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide an employer address.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_EmployerCity1.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide an employer city.</li>";
		invalidFields++;
	}
	
	if (document.career1.slt_EmployerState1.value.length==0)
	{
		vResponse = vResponse + "<li>Please select an employer state.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_EmployerZipCode1.value.length==0||document.career1.txt_EmployerZipCode1.value.length<5||!IsNumeric(document.career1.txt_EmployerZipCode1.value))
	{
		vResponse = vResponse + "<li>Please provide an employer zip code.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_EmployerPhone1a.value.length<3||document.career1.txt_EmployerPhone1b.value.length<3||document.career1.txt_EmployerPhone1c.value.length<4)||(!IsNumeric(document.career1.txt_EmployerPhone1a.value)||!IsNumeric(document.career1.txt_EmployerPhone1b.value)||!IsNumeric(document.career1.txt_EmployerPhone1c.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid employer phone number.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SupervisorName1.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide a supervisor name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SupervisorTitle1.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide a supervisor title.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_EmployedFrom1a.value.length<1||document.career1.txt_EmployedFrom1b.value.length<1||document.career1.txt_EmployedFrom1c.value.length<4)||(!IsNumeric(document.career1.txt_EmployedFrom1a.value)||!IsNumeric(document.career1.txt_EmployedFrom1b.value)||!IsNumeric(document.career1.txt_EmployedFrom1c.value))||!isDate(document.career1.txt_EmployedFrom1a.value + "/" + document.career1.txt_EmployedFrom1b.value + "/" + document.career1.txt_EmployedFrom1c.value))
	{
		vResponse = vResponse + "<li>Please provide a valid starting date. If you do not know the exact date, at least choose the month and year.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_EmployedTo1a.value.length<1||document.career1.txt_EmployedTo1b.value.length<1||document.career1.txt_EmployedTo1c.value.length<4)||(!IsNumeric(document.career1.txt_EmployedTo1a.value)||!IsNumeric(document.career1.txt_EmployedTo1b.value)||!IsNumeric(document.career1.txt_EmployedTo1c.value))||!isDate(document.career1.txt_EmployedTo1a.value + "/" + document.career1.txt_EmployedTo1b.value + "/" + document.career1.txt_EmployedTo1c.value))
	{
		vResponse = vResponse + "<li>Please provide a valid end date. If you do not know the exact date, at least choose the month and year.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SalaryStart1.value.length==0||(!IsNumeric(document.career1.txt_SalaryStart1.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid starting salary. Numeric values only.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SalaryEnd1.value.length==0||(!IsNumeric(document.career1.txt_SalaryEnd1.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid ending salary. Numeric values only.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Hours1.value.length==0||!IsNumeric(document.career1.txt_Hours1.value))
	{	
		vResponse = vResponse + "<li>Please provide the hours per week worked.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_LastPosition1.value.length==0)
	{	
		vResponse = vResponse + "<li>Please provide the last position held.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Duties1.value.length==0)
	{	
		vResponse = vResponse + "<li>Please provide the duties performed with this employer.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_ReasonLeft1.value.length==0)
	{	
		vResponse = vResponse + "<li>Please provide the reason for leaving.</li>";
		invalidFields++;
	}
	
	if (invalidFields>0)
	{
		vResponse = vResponse + "</ul>";
		document.getElementById("errMsg").innerHTML = vResponse;
		vResponse = "";
		window.self.scrollTo(0,0);
	}
	else
	{
		document.career1.action = vURL + ".asp";
		document.career1.submit();
	}
}

// finishes and verifies step 4 is correct in the application
// checks to see if the user has filled out everything on page one correctly
function _nextStepVerify4b( vURL )
{
	var vResponse = "Please correct the following fields before continuing: <ul class=\"errorMessage\">";
	var invalidFields = 0;
	
	if (document.career1.txt_EmployerName2.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide an employer name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_EmployerAddress2a.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide an employer address.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_EmployerCity2.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide an employer city.</li>";
		invalidFields++;
	}
	
	if (document.career1.slt_EmployerState2.value.length==0)
	{
		vResponse = vResponse + "<li>Please select an employer state.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_EmployerZipCode2.value.length==0||document.career1.txt_EmployerZipCode2.value.length<5||!IsNumeric(document.career1.txt_EmployerZipCode2.value))
	{
		vResponse = vResponse + "<li>Please provide an employer zip code.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_EmployerPhone2a.value.length<3||document.career1.txt_EmployerPhone2b.value.length<3||document.career1.txt_EmployerPhone2c.value.length<4)||(!IsNumeric(document.career1.txt_EmployerPhone2a.value)||!IsNumeric(document.career1.txt_EmployerPhone2b.value)||!IsNumeric(document.career1.txt_EmployerPhone2c.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid employer phone number.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SupervisorName2.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide a supervisor name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SupervisorTitle2.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide a supervisor title.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_EmployedFrom2a.value.length<1||document.career1.txt_EmployedFrom2b.value.length<1||document.career1.txt_EmployedFrom2c.value.length<4)||(!IsNumeric(document.career1.txt_EmployedFrom2a.value)||!IsNumeric(document.career1.txt_EmployedFrom2b.value)||!IsNumeric(document.career1.txt_EmployedFrom2c.value))||!isDate(document.career1.txt_EmployedFrom2a.value + "/" + document.career1.txt_EmployedFrom2b.value + "/" + document.career1.txt_EmployedFrom2c.value))
	{
		vResponse = vResponse + "<li>Please provide a valid starting date. If you do not know the exact date, at least choose the month and year.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_EmployedTo2a.value.length<1||document.career1.txt_EmployedTo2b.value.length<1||document.career1.txt_EmployedTo2c.value.length<4)||(!IsNumeric(document.career1.txt_EmployedTo2a.value)||!IsNumeric(document.career1.txt_EmployedTo2b.value)||!IsNumeric(document.career1.txt_EmployedTo2c.value))||!isDate(document.career1.txt_EmployedTo2a.value + "/" + document.career1.txt_EmployedTo2b.value + "/" + document.career1.txt_EmployedTo2c.value))
	{
		vResponse = vResponse + "<li>Please provide a valid end date. If you do not know the exact date, at least choose the month and year.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SalaryStart2.value.length==0||(!IsNumeric(document.career1.txt_SalaryStart2.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid starting salary. Numeric values only.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SalaryEnd2.value.length==0||(!IsNumeric(document.career1.txt_SalaryEnd2.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid ending salary. Numeric values only.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Hours2.value.length==0||!IsNumeric(document.career1.txt_Hours2.value))
	{	
		vResponse = vResponse + "<li>Please provide the hours per week worked.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_LastPosition2.value.length==0)
	{	
		vResponse = vResponse + "<li>Please provide the last position held.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Duties2.value.length==0)
	{	
		vResponse = vResponse + "<li>Please provide the duties performed with this employer.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_ReasonLeft2.value.length==0)
	{	
		vResponse = vResponse + "<li>Please provide the reason for leaving.</li>";
		invalidFields++;
	}
	
	if (invalidFields>0)
	{
		vResponse = vResponse + "</ul>";
		document.getElementById("errMsg").innerHTML = vResponse;
		vResponse = "";
		window.self.scrollTo(0,0);
	}
	else
	{
		document.career1.action = vURL + ".asp";
		document.career1.submit();
	}
}

// finishes and verifies step 4 is correct in the application
// checks to see if the user has filled out everything on page one correctly
function _nextStepVerify4c( vURL )
{
	var vResponse = "Please correct the following fields before continuing: <ul class=\"errorMessage\">";
	var invalidFields = 0;
	
	if (document.career1.txt_EmployerName3.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide an employer name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_EmployerAddress3a.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide an employer address.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_EmployerCity3.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide an employer city.</li>";
		invalidFields++;
	}
	
	if (document.career1.slt_EmployerState3.value.length==0)
	{
		vResponse = vResponse + "<li>Please select an employer state.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_EmployerZipCode3.value.length==0||document.career1.txt_EmployerZipCode3.value.length<5||!IsNumeric(document.career1.txt_EmployerZipCode3.value))
	{
		vResponse = vResponse + "<li>Please provide an employer zip code.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_EmployerPhone3a.value.length<3||document.career1.txt_EmployerPhone3b.value.length<3||document.career1.txt_EmployerPhone3c.value.length<4)||(!IsNumeric(document.career1.txt_EmployerPhone3a.value)||!IsNumeric(document.career1.txt_EmployerPhone3b.value)||!IsNumeric(document.career1.txt_EmployerPhone3c.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid employer phone number.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SupervisorName3.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide a supervisor name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SupervisorTitle3.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide a supervisor title.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_EmployedFrom3a.value.length<1||document.career1.txt_EmployedFrom3b.value.length<1||document.career1.txt_EmployedFrom3c.value.length<4)||(!IsNumeric(document.career1.txt_EmployedFrom3a.value)||!IsNumeric(document.career1.txt_EmployedFrom3b.value)||!IsNumeric(document.career1.txt_EmployedFrom3c.value))||!isDate(document.career1.txt_EmployedFrom3a.value + "/" + document.career1.txt_EmployedFrom3b.value + "/" + document.career1.txt_EmployedFrom3c.value))
	{
		vResponse = vResponse + "<li>Please provide a valid starting date. If you do not know the exact date, at least choose the month and year.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_EmployedTo3a.value.length<1||document.career1.txt_EmployedTo3b.value.length<1||document.career1.txt_EmployedTo3c.value.length<4)||(!IsNumeric(document.career1.txt_EmployedTo3a.value)||!IsNumeric(document.career1.txt_EmployedTo3b.value)||!IsNumeric(document.career1.txt_EmployedTo3c.value))||!isDate(document.career1.txt_EmployedTo3a.value + "/" + document.career1.txt_EmployedTo3b.value + "/" + document.career1.txt_EmployedTo3c.value))
	{
		vResponse = vResponse + "<li>Please provide a valid end date. If you do not know the exact date, at least choose the month and year.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SalaryStart3.value.length==0||(!IsNumeric(document.career1.txt_SalaryStart3.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid starting salary. Numeric values only.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SalaryEnd3.value.length==0||(!IsNumeric(document.career1.txt_SalaryEnd3.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid ending salary. Numeric values only.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Hours3.value.length==0||!IsNumeric(document.career1.txt_Hours3.value))
	{	
		vResponse = vResponse + "<li>Please provide the hours per week worked.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_LastPosition3.value.length==0)
	{	
		vResponse = vResponse + "<li>Please provide the last position held.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Duties3.value.length==0)
	{	
		vResponse = vResponse + "<li>Please provide the duties performed with this employer.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_ReasonLeft3.value.length==0)
	{	
		vResponse = vResponse + "<li>Please provide the reason for leaving.</li>";
		invalidFields++;
	}
	
	if (invalidFields>0)
	{
		vResponse = vResponse + "</ul>";
		document.getElementById("errMsg").innerHTML = vResponse;
		vResponse = "";
		window.self.scrollTo(0,0);
	}
	else
	{
		document.career1.action = vURL + ".asp?action=next";
		document.career1.submit();
	}
}


// skips the adding of another employer
function _skipExperience()
{
	document.career1.action = "application5.asp?action=next";
	document.career1.submit();
}

// cancel employer
function _cancelExperienceb(vURL)
{
	document.career1.txt_EmployerName2.value = "";
	document.career1.txt_EmployerAddress2a.value = "";
	document.career1.txt_EmployerAddress2b.value = "";
	document.career1.txt_EmployerCity2.value = "";
	document.career1.slt_EmployerState2.value = "";
	document.career1.txt_EmployerZipCode2.value = "";
	document.career1.txt_EmployerPhone2a.value = "";
	document.career1.txt_EmployerPhone2b.value = "";
	document.career1.txt_EmployerPhone2c.value = "";
	document.career1.txt_SupervisorName2.value = "";
	document.career1.txt_SupervisorTitle2.value = "";
	document.career1.txt_EmployedFrom2a.value = "";
	document.career1.txt_EmployedFrom2b.value = "";
	document.career1.txt_EmployedFrom2c.value = "";
	document.career1.txt_EmployedTo2a.value = "";
	document.career1.txt_EmployedTo2b.value = "";
	document.career1.txt_EmployedTo2c.value = "";
	document.career1.txt_SalaryStart2.value = "";
	document.career1.slt_SalaryStart2.value = "";
	document.career1.txt_SalaryEnd2.value = "";
	document.career1.slt_SalaryEnd2.value = "";
	document.career1.txt_Hours2.value = "";
	document.career1.txt_LastPosition2.value = "";
	document.career1.txt_Duties2.value = "";
	document.career1.txt_ReasonLeft2.value = "";
	document.career1.txt_EmployeeName2.value = "";
	
	document.career1.action = vURL + ".asp?action=cancel";
	document.career1.submit();
}

// cancel employer
function _cancelExperiencec(vURL)
{
	document.career1.txt_EmployerName3.value = "";
	document.career1.txt_EmployerAddress3a.value = "";
	document.career1.txt_EmployerAddress3b.value = "";
	document.career1.txt_EmployerCity3.value = "";
	document.career1.slt_EmployerState3.value = "";
	document.career1.txt_EmployerZipCode3.value = "";
	document.career1.txt_EmployerPhone3a.value = "";
	document.career1.txt_EmployerPhone3b.value = "";
	document.career1.txt_EmployerPhone3c.value = "";
	document.career1.txt_SupervisorName3.value = "";
	document.career1.txt_SupervisorTitle3.value = "";
	document.career1.txt_EmployedFrom3a.value = "";
	document.career1.txt_EmployedFrom3b.value = "";
	document.career1.txt_EmployedFrom3c.value = "";
	document.career1.txt_EmployedTo3a.value = "";
	document.career1.txt_EmployedTo3b.value = "";
	document.career1.txt_EmployedTo3c.value = "";
	document.career1.txt_SalaryStart3.value = "";
	document.career1.slt_SalaryStart3.value = "";
	document.career1.txt_SalaryEnd3.value = "";
	document.career1.slt_SalaryEnd3.value = "";
	document.career1.txt_Hours3.value = "";
	document.career1.txt_LastPosition3.value = "";
	document.career1.txt_Duties3.value = "";
	document.career1.txt_ReasonLeft3.value = "";
	document.career1.txt_EmployeeName3.value = "";
	
	document.career1.action = vURL + ".asp?action=cancel";
	document.career1.submit();
}

// next employer
function _nextExperience(vURL)
{
	document.career1.action = "application4" + vURL + ".asp?action=next";
	document.career1.submit();
}

// finishes and verifies step 5 is correct in the application
// checks to see if the user has filled out everything on page one correctly
function _nextStepVerify5()
{
	var vResponse = "Please correct the following fields before continuing: <ul class=\"errorMessage\">";
	var invalidFields = 0;
	
	if (document.career1.txt_SchoolName1.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide the school name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_SchoolLocation1.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide the school location.</li>";
		invalidFields++;
	}
	
	if (!document.career1.rad_Attending1[0].checked&&!document.career1.rad_Attending1[1].checked)
	{
		vResponse = vResponse + "<li>Please indicate if you are currently attending the college.</li>";
		invalidFields++;
	}
	
	if (document.career1.slt_Degree1.value=="")
	{
		vResponse = vResponse + "<li>Please select the degree you are pursuing/received.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Major1.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide the major you are pursuing/received.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_GPA1.value.length==0||!IsNumeric(document.career1.txt_GPA1.value))
	{
		vResponse = vResponse + "<li>Please provide the GPA.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_GPA2.value.length>0&&!IsNumeric(document.career1.txt_GPA2.value))
	{
		vResponse = vResponse + "<li>Please provide the GPA for the second school.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_GPA3.value.length>0&&!IsNumeric(document.career1.txt_GPA3.value))
	{
		vResponse = vResponse + "<li>Please provide the GPA for the second school.</li>";
		invalidFields++;
	}
	
	if (invalidFields>0)
	{
		vResponse = vResponse + "</ul>";
		document.getElementById("errMsg").innerHTML = vResponse;
		vResponse = "";
		window.self.scrollTo(0,0);
	}
	else
	{
		document.career1.action = "application6.asp?action=next";
		document.career1.submit();
	}
}

// finishes and verifies step 6 is correct in the application
// checks to see if the user has filled out everything on page one correctly
function _nextStepVerify6()
{
	var vResponse = "Please correct the following fields before continuing: <ul class=\"errorMessage\">";
	var invalidFields = 0;
	
	if (document.career1.txt_ReferenceName1.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide the first reference's name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Relationship1.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide the relationship to the first reference.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_ReferencePhone1a.value.length<3||document.career1.txt_ReferencePhone1b.value.length<3||document.career1.txt_ReferencePhone1c.value.length<4)||(!IsNumeric(document.career1.txt_ReferencePhone1a.value)||!IsNumeric(document.career1.txt_ReferencePhone1b.value)||!IsNumeric(document.career1.txt_ReferencePhone1c.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid phone number for the first reference.</li>";
		invalidFields++;
	}
	
	if (document.career1.slt_YearsKnown1.value=="0")
	{
		vResponse = vResponse + "<li>Please provide how long you've know the first reference.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_ReferenceName2.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide the second reference's name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Relationship2.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide the relationship to the second reference.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_ReferencePhone2a.value.length<3||document.career1.txt_ReferencePhone2b.value.length<3||document.career1.txt_ReferencePhone2c.value.length<4)||(!IsNumeric(document.career1.txt_ReferencePhone2a.value)||!IsNumeric(document.career1.txt_ReferencePhone2b.value)||!IsNumeric(document.career1.txt_ReferencePhone2c.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid phone number for the second reference.</li>";
		invalidFields++;
	}
	
	if (document.career1.slt_YearsKnown2.value=="0")
	{
		vResponse = vResponse + "<li>Please provide how long you've know the second reference.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_ReferenceName3.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide the third reference's name.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Relationship3.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide the relationship to the third reference.</li>";
		invalidFields++;
	}
	
	if ((document.career1.txt_ReferencePhone3a.value.length<3||document.career1.txt_ReferencePhone3b.value.length<3||document.career1.txt_ReferencePhone3c.value.length<4)||(!IsNumeric(document.career1.txt_ReferencePhone3a.value)||!IsNumeric(document.career1.txt_ReferencePhone3b.value)||!IsNumeric(document.career1.txt_ReferencePhone3c.value)))
	{
		vResponse = vResponse + "<li>Please provide a valid phone number for the third reference.</li>";
		invalidFields++;
	}
	
	if (document.career1.slt_YearsKnown3.value=="0")
	{
		vResponse = vResponse + "<li>Please provide how long you've know the third reference.</li>";
		invalidFields++;
	}
	
	if (invalidFields>0)
	{
		vResponse = vResponse + "</ul>";
		document.getElementById("errMsg").innerHTML = vResponse;
		vResponse = "";
		window.self.scrollTo(0,0);
	}
	else
	{
		document.career1.action = "application7.asp?action=next";
		document.career1.submit();
	}
}

// finishes and verifies step 7 is correct in the application
// checks to see if the user has filled out everything on page one correctly.
function _nextStepVerify7()
{
	var vResponse = "Please correct the following fields before continuing: <ul class=\"errorMessage\">";
	var invalidFields = 0;

	if (document.career1.txt_WhyWork.value.length==0)
	{
		vResponse = vResponse + "<li>Please provide why you would like to work at Mutual Federal Savings Bank.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_Initials.value.length==0||document.career1.txt_Initials.value.length<2)
	{
		vResponse = vResponse + "<li>Please provide your initials.</li>";
		invalidFields++;
	}
	
	if (invalidFields>0)
	{
		vResponse = vResponse + "</ul>";
		document.getElementById("errMsg").innerHTML = vResponse;
		vResponse = "";
		window.self.scrollTo(0,0);
	}
	else
	{
		document.career1.action = "application8.asp?action=next";
		document.career1.submit();
	}
}


// declines to identify or change information
function _declineIdentify()
{
	if (document.career1.chk_Decline.checked)
	{
		document.career1.rad_Gender[0].checked = false;
		document.career1.rad_Gender[1].checked = false;
		
		document.career1.rad_Race[0].checked = false;				
		document.career1.rad_Race[1].checked = false;
		document.career1.rad_Race[2].checked = false;
		document.career1.rad_Race[3].checked = false;
		document.career1.rad_Race[4].checked = false;
		document.career1.rad_Race[5].checked = false;
		document.career1.rad_Race[6].checked = false;	
		
		document.career1.rad_VeteranStatus[0].checked = false;	
		document.career1.rad_VeteranStatus[1].checked = false;	
		document.career1.rad_VeteranStatus[2].checked = false;		
		
		document.career1.rad_Gender[0].disabled = true;
		document.career1.rad_Gender[1].disabled = true;
		
		document.career1.rad_Race[0].disabled = true;				
		document.career1.rad_Race[1].disabled = true;
		document.career1.rad_Race[2].disabled = true;
		document.career1.rad_Race[3].disabled = true;
		document.career1.rad_Race[4].disabled = true;
		document.career1.rad_Race[5].disabled = true;
		document.career1.rad_Race[6].disabled = true;	
		
		document.career1.rad_VeteranStatus[0].disabled = true;	
		document.career1.rad_VeteranStatus[1].disabled = true;	
		document.career1.rad_VeteranStatus[2].disabled = true;								
	}
	else
	{
		document.career1.rad_Gender[0].disabled = false;
		document.career1.rad_Gender[1].disabled = false;
		
		document.career1.rad_Race[0].disabled = false;				
		document.career1.rad_Race[1].disabled = false;
		document.career1.rad_Race[2].disabled = false;
		document.career1.rad_Race[3].disabled = false;
		document.career1.rad_Race[4].disabled = false;
		document.career1.rad_Race[5].disabled = false;
		document.career1.rad_Race[6].disabled = false;	
		
		document.career1.rad_VeteranStatus[0].disabled = false;	
		document.career1.rad_VeteranStatus[1].disabled = false;	
		document.career1.rad_VeteranStatus[2].disabled = false;	
	}
}

// after the applicant reviews, they can submit...if there is a resume, make sure it is the right file type
function _submitApplication()
{
	var vResponse = "Please correct the following fields before continuing: <ul class=\"errorMessage\">";
	var invalidFields = 0;
	
	if (document.career1.txt_IdentifyInitials.value.length==0||document.career1.txt_IdentifyInitials.value.length<2)
	{
		vResponse = vResponse + "<li>Please provide your initials that you agree with the identifying information you submitted.</li>";
		invalidFields++;
	}
	
	if (document.career1.txt_IdentifyInitials.value!=document.career1.txt_Initials.value)
	{
		vResponse = vResponse + "<li>Please be sure your initials match with the initials you have provided previously.</li>";
		invalidFields++;
	}
	
	if (document.career1.fileResume.value!=""&&(document.career1.fileResume.value.indexOf(".pdf")<1&&document.career1.fileResume.value.indexOf(".PDF")<1&&document.career1.fileResume.value.indexOf(".doc")<1&&document.career1.fileResume.value.indexOf(".DOC")<1&&document.career1.fileResume.value.indexOf(".txt")<1&&document.career1.fileResume.value.indexOf(".TXT")<1&&document.career1.fileResume.value.indexOf(".htm")<1&&document.career1.fileResume.value.indexOf(".HTM")<1&&document.career1.fileResume.value.indexOf(".html")<1&&document.career1.fileResume.value.indexOf(".HTML")<1&&document.career1.fileResume.value.indexOf(".rtf")<1&&document.career1.fileResume.value.indexOf(".RTF")<1))
	{
		vResponse = vResponse + "<li>You may only upload a file with the following formats: .doc, .pdf, .txt, .htm, .html or .rtf. Please be sure the file you chose is one of these formats.</li>";
		invalidFields++;
		document.career1.fileResume.focus();
	}
	
	if (invalidFields>0)
	{
		vResponse = vResponse + "</ul>";
		document.getElementById("errMsg").innerHTML = vResponse;
		vResponse = "";
		window.self.scrollTo(0,0);
	}
	else
	{
		document.career1.encoding = "multipart/form-data";
		document.career1.action = "/careers/scripts/_srv_Applicant.asp";
		document.career1.submit();
	}
}

// function to count the characters in a text area
function _CountTextArea( vId )
{
	//var old = parseInt(document.getElementById("span" + vId + "Counter").value);
	var limit = 255;
	var hidCounter = 0;
	hidCounter = parseInt(document.getElementById(vId).value.length);
	//document.getElementById("span" + vId + "Counter").innerHTML = limit - hidCounter;
	if ((limit-hidCounter)<0) 
	{
		document.getElementById(vId).value = document.getElementById(vId).value.substr(0, limit);
		hidCounter = limit;
		//document.getElementById("span" + vId + "Counter").innerHTML = limit - hidCounter;
  	}
}

function _EmployPresent1()
{
	var currentTime = new Date();
	
	document.career1.txt_EmployedTo1a.value = currentTime.getMonth() + 1;
	document.career1.txt_EmployedTo1b.value = currentTime.getDate();
	document.career1.txt_EmployedTo1c.value = currentTime.getFullYear();
}

function _EmployPresent2()
{
	var currentTime = new Date();
	
	document.career1.txt_EmployedTo2a.value = currentTime.getMonth() + 1;
	document.career1.txt_EmployedTo2b.value = currentTime.getDate();
	document.career1.txt_EmployedTo2c.value = currentTime.getFullYear();
}

function _EmployPresent3()
{
	var currentTime = new Date();
	
	document.career1.txt_EmployedTo3a.value = currentTime.getMonth() + 1;
	document.career1.txt_EmployedTo3b.value = currentTime.getDate();
	document.career1.txt_EmployedTo3c.value = currentTime.getFullYear();
}