﻿/*document.onload = go();*/

jQuery(document).ready(function(){
		
       /* jQuery('#slideshow').cycle({
			fx:    'fade',           //Choose your transition, many options at http://jquery.malsup.com/cycle/
			speed:   400,            // Transition speed, in milliseconds.
			timeout: 4000          // How much time each slide gets, in milliseconds.
		});*/
		
		loadIframe();
    });
    
function loadIframe()
	{ 	
		if (location.search.length > 0){ 
			url = unescape(location.search.substring(1)) 
			window.frames["myiframe"].location=url 
		} 
	} 
	
function go(){
	anylinkmenu.init("menuanchorclass");
}


function validation(passForm)
	{
		if (passForm.Primary_Name.value == "")
		{
			alert("You must enter a value for Name")
			passForm.Primary_Name.focus()
			return false
		}

		if (passForm.Email.value == "")
		{
			alert("You must enter a value for Email")
			passForm.Email.focus()
			return false
		}
		
		var answer = document.getElementById('CaptchaAnswer').value;
		if (answer == "")
		{
			alert("You must enter a value for the Captcha.")
			return false
		}


		return true
	}

function validation_service(passForm)
	{
		if (passForm.Primary_Name.value == "")
		{
			alert("You must enter a value for Name")
			passForm.Primary_Name.focus()
			return false
		}

		if (passForm.Arrival_Date.value == "")
		{
			alert("You must enter a value for Arrival Date")
			passForm.Arrival_Date.focus()
			return false
		}
		
		if (passForm.Departure_Date.value == "")
		{
			alert("You must enter a value for Departure Date")
			passForm.Departure_Date.focus()
			return false
		}
		
		if (passForm.Time_of_Day.value == "")
		{
			alert("You must enter a value for Time of Day")
			passForm.Time_of_Day.focus()
			return false
		}

		if (passForm.Primary_Phone.value == "")
		{
			alert("You must enter a value for Primary Phone")
			passForm.Primary_Phone.focus()
			return false
		}
		
		if (passForm.Secondary_Phone.value == "")
		{
			alert("You must enter a value for Secondary Phone")
			passForm.Secondary_Phone.focus()
			return false
		}

		if (passForm.Email.value == "")
		{
			alert("You must enter a value for Email")
			passForm.Email.focus()
			return false
		}
		
		var answer = document.getElementById('CaptchaAnswer').value;
		if (answer == "")
		{
			alert("You must enter a value for the Captcha.")
			return false
		}


		return true
	}
	
function validation_quote(passForm)
	{
		if (passForm.Primary_Name.value == "")
		{
			alert("You must enter a value for Name")
			passForm.Primary_Name.focus()
			return false
		}

		if (passForm.Phone.value == "")
		{
			alert("You must enter a value for Phone")
			passForm.Phone.focus()
			return false
		}
		
		var answer = document.getElementById('CaptchaAnswer').value;
		if (answer == "")
		{
			alert("You must enter a value for the Captcha.")
			return false
		}


		return true
	}


function validation_parts(passForm)
	{
		if (passForm.Primary_Name.value == "")
		{
			alert("You must enter a value for Name")
			passForm.Primary_Name.focus()
			return false
		}
		
		if (passForm.Email.value == "")
		{
			alert("You must enter a value for Email")
			passForm.Email.focus()
			return false
		}

		if (passForm.Phone.value == "")
		{
			alert("You must enter a value for Phone")
			passForm.Phone.focus()
			return false
		}
		
		if (passForm.Part_No.value == "")
		{
			alert("You must enter a value for Part Number")
			passForm.Part_No.focus()
			return false
		}

		if (passForm.Description.value == "")
		{
			alert("You must enter a value for Description")
			passForm.Description.focus()
			return false
		}
		
		if (passForm.Make.value == "")
		{
			alert("You must enter a value for Make")
			passForm.Make.focus()
			return false
		}

		if (passForm.Model.value == "")
		{
			alert("You must enter a value for Model")
			passForm.Model.focus()
			return false
		}
		
		if (passForm.Serial_No.value == "")
		{
			alert("You must enter a value for Serial Number")
			passForm.Serial_No.focus()
			return false
		}

		if (passForm.Year.value == "")
		{
			alert("You must enter a value for Year")
			passForm.Year.focus()
			return false
		}
		
		if (passForm.Engine_Model.value == "")
		{
			alert("You must enter a value for Engine Model")
			passForm.Engine_Model.focus()
			return false
		}

		if (passForm.Quantity.value == "")
		{
			alert("You must enter a value for Quantity")
			passForm.Quantity.focus()
			return false
		}
		
		var answer = document.getElementById('CaptchaAnswer').value;
		if (answer == "")
		{
			alert("You must enter a value for the Captcha.")
			return false
		}


		return true
	}


function validation_application(passForm)
	{
		if (passForm.Primary_First_Name.value == "")
		{
			alert("You must enter a value for First Name.")
			passForm.Primary_First_Name.focus()
			return false
		}

		if (passForm.Last_Name.value == "")
		{
			alert("You must enter a value for Last Name.")
			passForm.Last_Name.focus()
			return false
		}
		
		if (passForm.Address.value == "")
		{
			alert("You must enter a value for Address.")
			passForm.Address.focus()
			return false
		}
		
		if (passForm.City.value == "")
		{
			alert("You must enter a value for City.")
			passForm.City.focus()
			return false
		}
		
		if (passForm.State.value == "")
		{
			alert("You must enter a value for State.")
			passForm.State.focus()
			return false
		}
		
		if (passForm.Zip.value == "")
		{
			alert("You must enter a value for Zip.")
			passForm.Zip.focus()
			return false
		}
		
		if (passForm.Phone.value == "")
		{
			alert("You must enter a value for Phone.")
			passForm.Phone.focus()
			return false
		}

		if (passForm.Email.value == "")
		{
			alert("You must enter a value for Email.")
			passForm.Email.focus()
			return false
		}
		
		if (passForm.Positions.value == "")
		{
			alert("You must enter a value for Positions(s) Applied For.")
			passForm.Positions.focus()
			return false
		}

		if (passForm.Referral_Source.value == "")
		{
			alert("You must enter a value for Referral Source.")
			passForm.Referral_Source.focus()
			return false
		}
		
		if (passForm.Referral_Source.value == "Other" && passForm.If_Other_Referral.value == "")
		{
			alert("You must enter how you were referred to us.")
			passForm.If_Other_Referral.focus()
			return false
		}

		if (passForm.Employer1.value == "")
		{
			alert("You must enter a value for Employer.")
			passForm.Employer1.focus()
			return false
		}
		
		if (passForm.Employer1Location.value == "")
		{
			alert("You must enter a value for Address / City.")
			passForm.Employer1Location.focus()
			return false
		}
		
		if (passForm.Employer1From.value == "")
		{
			alert("You must enter a value for From (MM/DDDD).")
			passForm.Employer1From.focus()
			return false
		}
		
		if (passForm.Employer1To.value == "")
		{
			alert("You must enter a value for To (MM/DDDD).")
			passForm.Employer1To.focus()
			return false
		}
		
		if (passForm.Employer1Supervisor.value == "")
		{
			alert("You must enter a value for Supervisor.")
			passForm.Employer1Supervisor.focus()
			return false
		}
		
		if (passForm.Employer1Phone.value == "")
		{
			alert("You must enter a value for Phone.")
			passForm.Employer1Phone.focus()
			return false
		}
		
		if (passForm.Employer1Salary.value == "")
		{
			alert("You must enter a value for Salary.")
			passForm.Employer1Salary.focus()
			return false
		}
		
		if (passForm.Employer1ReasonForLeaving.value == "")
		{
			alert("You must enter a value for Reason for Leaving.")
			passForm.Employer1ReasonForLeaving.focus()
			return false
		}
			
		if (passForm.Employer2.value == "")
		{
			alert("You must enter a value for Employer.")
			passForm.Employer2.focus()
			return false
		}
		
		if (passForm.Employer2Location.value == "")
		{
			alert("You must enter a value for Address / City.")
			passForm.Employer2Location.focus()
			return false
		}
		
		if (passForm.Employer2From.value == "")
		{
			alert("You must enter a value for From (MM/DDDD).")
			passForm.Employer2From.focus()
			return false
		}
		
		if (passForm.Employer2To.value == "")
		{
			alert("You must enter a value for To (MM/DDDD).")
			passForm.Employer2To.focus()
			return false
		}
		
		if (passForm.Employer2Supervisor.value == "")
		{
			alert("You must enter a value for Supervisor.")
			passForm.Employer2Supervisor.focus()
			return false
		}
		
		if (passForm.Employer2Phone.value == "")
		{
			alert("You must enter a value for Phone.")
			passForm.Employer2Phone.focus()
			return false
		}
		
		if (passForm.Employer2Salary.value == "")
		{
			alert("You must enter a value for Salary.")
			passForm.Employer2Salary.focus()
			return false
		}

		if (passForm.Employer2ReasonForLeaving.value == "")
		{
			alert("You must enter a value for Reason for Leaving.")
			passForm.Employer2ReasonForLeaving.focus()
			return false
		}
		
		if (passForm.Employer2.value == "")
		{
			alert("You must enter a value for Employer.")
			passForm.Employer2.focus()
			return false
		}
		
		if (passForm.Employer2Location.value == "")
		{
			alert("You must enter a value for Address / City.")
			passForm.Employer2Location.focus()
			return false
		}
		
		if (passForm.Employer2From.value == "")
		{
			alert("You must enter a value for From (MM/DDDD).")
			passForm.Employer2From.focus()
			return false
		}
		
		if (passForm.Employer2To.value == "")
		{
			alert("You must enter a value for To (MM/DDDD).")
			passForm.Employer2To.focus()
			return false
		}
		
		if (passForm.Employer2Supervisor.value == "")
		{
			alert("You must enter a value for Supervisor.")
			passForm.Employer2Supervisor.focus()
			return false
		}

		if (passForm.Employer2ReasonForLeaving.value == "")
		{
			alert("You must enter a value for Reason for Leaving.")
			passForm.Employer2ReasonForLeaving.focus()
			return false
		}

		if (passForm.Employer3.value == "")
		{
			alert("You must enter a value for Employer.")
			passForm.Employer3.focus()
			return false
		}
		
		if (passForm.Employer3Location.value == "")
		{
			alert("You must enter a value for Address / City.")
			passForm.Employer3Location.focus()
			return false
		}
		
		if (passForm.Employer3From.value == "")
		{
			alert("You must enter a value for From (MM/DDDD).")
			passForm.Employer3From.focus()
			return false
		}
		
		if (passForm.Employer3To.value == "")
		{
			alert("You must enter a value for To (MM/DDDD).")
			passForm.Employer3To.focus()
			return false
		}
		
		if (passForm.Employer3Supervisor.value == "")
		{
			alert("You must enter a value for Supervisor.")
			passForm.Employer3Supervisor.focus()
			return false
		}
		
		if (passForm.Employer3Phone.value == "")
		{
			alert("You must enter a value for Phone.")
			passForm.Employer3Phone.focus()
			return false
		}

		if (passForm.Employer3Salary.value == "")
		{
			alert("You must enter a value for Salary.")
			passForm.Employer3Salary.focus()
			return false
		}

		if (passForm.Employer3ReasonForLeaving.value == "")
		{
			alert("You must enter a value for Reason for Leaving.")
			passForm.Employer3ReasonForLeaving.focus()
			return false
		}

		if (passForm.Time_to_Call_At_Home.value == "")
		{
			alert("You must select the best time to call you at home.")
			passForm.Time_to_Call_At_Home.focus()
			return false
		}
		
		function checkRadioBtn(buttonClass){
			var test = document.getElementsByClassName(buttonClass);
			var value = "";
			for (var i = 0; i < test.length; i++){
				if (test[i].checked){
					value += test[i].value
				}
			}
			return value
		}
		
		var AM_or_PM_At_Home = checkRadioBtn("AM_or_PM_At_Home");
		if (AM_or_PM_At_Home == ""){
			alert("You must select AM or PM.")
			return false
		}

		var Contact_At_Work = checkRadioBtn("Contact_At_Work");

		if (Contact_At_Work == ""){
			alert("You must select whether we may contact you at work.")
			return false
		}
		
		if (Contact_At_Work == "Yes" && passForm.Work_Number.value == "")
		{
			alert("You must enter a work number.")
			passForm.Work_Number.focus()
			return false
		}
		
		if (Contact_At_Work == "Yes" && passForm.Time_to_Call_At_Work.value == "")
		{
			alert("You must select the best time to call you at work.")
			passForm.Time_to_Call_At_Work.focus()
			return false
		}
		
		var AM_or_PM_At_Work = checkRadioBtn("AM_or_PM_At_Work");
		if (Contact_At_Work == "Yes" && AM_or_PM_At_Work == ""){
			alert("You must select AM or PM.")
			return false
		}
			
		var WorkPermit = checkRadioBtn("WorkPermit");
		if (WorkPermit  == ""){
			alert("You must select if you can furnish a work permit if required.")
			return false
		}
	
		if (WorkPermit == "No" && passForm.No_WorkPermit_Reason.value == "")
		{
			alert("You must describe why you cannot furnish a work permit.")
			passForm.No_WorkPermit_Reason.focus()
			return false
		}
		
		var PreviousApplicationSubmission = checkRadioBtn("PreviousApplicationSubmission");
		if (PreviousApplicationSubmission == ""){
			alert("You must select if you have submitted an application here before.")
			return false
		}
	
		if (PreviousApplicationSubmission == "Yes" && passForm.PreviousApplicationSubmission_Info.value == "")
		{
			alert("You must provide date(s) and position(s) of your previous application.")
			passForm.PreviousApplicationSubmission_Info.focus()
			return false
		}
		
		var EmployedHereBefore = checkRadioBtn("EmployedHereBefore");
		if (EmployedHereBefore == ""){
			alert("You must select whether you have been employed here previously.")
			return false
		}
		
		if (EmployedHereBefore  == "Yes" && passForm.EmployedHereBefore_Info.value == "")
		{
			alert("You must provide date(s) and position(s) of your former employment with us.")
			passForm.EmployedHereBefore_Info.focus()
			return false
		}
		
		var USAuthorizedWorker = checkRadioBtn("USAuthorizedWorker");
		if (USAuthorizedWorker == ""){
			alert("You must select whether you are legally authorized to work in the U.S.")
			return false
		}

		if (passForm.AvailableStartDate.value == "")
		{
			alert("You must enter when you would be available to start working.")
			passForm.AvailableStartDate.focus()
			return false
		}

		if (passForm.DesiredPay.value == "")
		{
			alert("You must enter your desired salary range or hourly rate of pay.")
			passForm.DesiredPay.focus()
			return false
		}

		if (passForm.EmploymentTypeDesired.value == "")
		{
			alert("You must enter the type of employment desired.")
			passForm.EmploymentTypeDesired.focus()
			return false
		}
		
		var Relocate = checkRadioBtn("Relocate");
		if (Relocate == ""){
			alert("You must select whether you would be willing to relocate.")
			return false
		}
		
		var Travel = checkRadioBtn("Travel");
		if (Travel == ""){
			alert("You must select whether you would be willing to travel.")
			return false
		}

		var AttendanceRequirements = checkRadioBtn("AttendanceRequirements");
		if (AttendanceRequirements == ""){
			alert("You must select whether you can meet the attendance requirements of this position.")
			return false
		}

		var Overtime = checkRadioBtn("Overtime");
		if (Overtime == ""){
			alert("You must select whether you would be willing to work overtime.")
			return false
		}

		if (Overtime == "No" && passForm.NoOvertime_Reason.value == "")
		{
			alert("You must enter the reason you cannot work overtime.")
			passForm.NoOvertime_Reason.focus()
			return false
		}
		
		var Bonded = checkRadioBtn("Bonded");
		if (Bonded == ""){
			alert("You must select whether you have ever been bonded.")
			return false
		}
		
		var Felony = checkRadioBtn("Felony");
		if (Felony == ""){
			alert("You must select whether you have ever been convicted of a felony.")
			return false
		}

		if (Felony == "Yes" && passForm.YesFelony_Info.value == "")
		{
			alert("You must provide date(s) and details of your conviction.")
			passForm.YesFelony_Info.focus()
			return false
		}
		
		var BeenFired = checkRadioBtn("BeenFired");
		if (BeenFired == ""){
			alert("You must select whether you have ever been fired or asked to resign from a job.")
			return false
		}

		if (BeenFired == "Yes" && passForm.BeenFired_Reason.value == "")
		{
			alert("You must provide date(s) and details of incident(s).")
			passForm.BeenFired_Reason.focus()
			return false
		}
		
		var ContactPresentEmployer = checkRadioBtn("ContactPresentEmployer");
		if (ContactPresentEmployer == ""){
			alert("You must select whether we can contact your present employer.")
			return false
		}
		
		if (passForm.School1_Info.value == "")
		{
			alert("You must enter a School Name and Location.")
			passForm.School1_Info.focus()
			return false
		}

		if (passForm.School1_YearsCompleted.value == "")
		{
			alert("You must enter what years were completed at this school.")
			passForm.School1_YearsCompleted.focus()
			return false
		}
		
		if (passForm.School1_MajorCourse.value == "")
		{
			alert("You must enter what your major course of study was at this school.")
			passForm.School1_MajorCourse.focus()
			return false
		}
	
		if (passForm.School1_Degree.value == "")
		{
			alert("You must enter what, if any, your diploma / degree was from this school.")
			passForm.School1_Degree.focus()
			return false
		}

		if (passForm.School1_GPA_Rank.value == "")
		{
			alert("You must enter your GPA or Class Rank from this school.")
			passForm.School1_GPA_Rank.focus()
			return false
		}
		
		if (passForm.Reference1.value == "")
		{
			alert("You must enter the name of a reference.")
			passForm.Reference1.focus()
			return false
		}
		
		if (passForm.Reference1_Occupation.value == "")
		{
			alert("You must enter the occupation of this reference.")
			passForm.Reference1_Occupation.focus()
			return false
		}
		
		if (passForm.Reference1_Address.value == "")
		{
			alert("You must enter the address of this reference.")
			passForm.Reference1_Address.focus()
			return false
		}
		
		if (passForm.Reference1_CityStateZip.value == "")
		{
			alert("You must enter the city, state and zip of this reference.")
			passForm.Reference1_CityStateZip.focus()
			return false
		}
		
		if (passForm.Reference1_Phone.value == "")
		{
			alert("You must enter a phone number for this reference.")
			passForm.Reference1_Phone.focus()
			return false
		}
		
		if (passForm.Reference1_Relationship.value == "")
		{
			alert("You must enter your relationship to this reference.")
			passForm.Reference1_Relationship.focus()
			return false
		}
		
		if (passForm.Reference1_TimeKnown.value == "")
		{
			alert("You must enter how long you have known this reference.")
			passForm.Reference1_TimeKnown.focus()
			return false
		}
		
		if (passForm.Reference2.value == "")
		{
			alert("You must enter the name of a reference.")
			passForm.Reference2.focus()
			return false
		}
		
		if (passForm.Reference2_Occupation.value == "")
		{
			alert("You must enter the occupation of this reference.")
			passForm.Reference2_Occupation.focus()
			return false
		}
		
		if (passForm.Reference2_Address.value == "")
		{
			alert("You must enter the address of this reference.")
			passForm.Reference2_Address.focus()
			return false
		}
		
		if (passForm.Reference2_CityStateZip.value == "")
		{
			alert("You must enter the city, state and zip of this reference.")
			passForm.Reference2_CityStateZip.focus()
			return false
		}
		
		if (passForm.Reference2_Phone.value == "")
		{
			alert("You must enter a phone number for this reference.")
			passForm.Reference2_Phone.focus()
			return false
		}
		
		if (passForm.Reference2_Relationship.value == "")
		{
			alert("You must enter your relationship to this reference.")
			passForm.Reference2_Relationship.focus()
			return false
		}

		if (passForm.Reference2_TimeKnown.value == "")
		{
			alert("You must enter how long you have known this reference.")
			passForm.Reference2_TimeKnown.focus()
			return false
		}
		
		if (!passForm.AcceptStatement.checked)
		{
			alert("You must accept the above statement in order to submit your application.")
			return false
		}
		
		var answer = document.getElementById('CaptchaAnswer').value;
		if (answer == "")
		{
			alert("You must enter a value for the Captcha.")
			return false
		}


		return true
	}

