function verify() {

var themessage = "You are required to complete the following fields: \n";

if (document.email.First_Name.value=="") {

themessage = themessage + " - Your First Name \n";

}

if (document.email.Last_Name.value=="") {

themessage = themessage + " -  Your Last Name \n";

}

if (document.email.Email.value=="") {

themessage = themessage + " -  Your E-mail \n";

}

if (document.email.Day_Phone.value=="") {

themessage = themessage + " -  Your Phone Number \n";

}

if (document.email.Customer_Message.value=="") {

themessage = themessage + " -  Your Message \n";

}

//alert if fields are empty and cancel email submit

if (themessage == "You are required to complete the following fields: \n") {

document.email.submit();

}

else {

alert(themessage);

return false;

   }

}





// Begin Job Verification
function jobverify() {

var themessage = "You are required to complete the following fields: \n";

if (document.job.First_Name.value=="") {

themessage = themessage + " -  Your First Name \n";

}

if (document.job.Last_Name.value=="") {

themessage = themessage + " -  Your Last Name \n";

}

if (document.job.Email.value=="") {

themessage = themessage + " -  Your E-mail \n";

}

if (document.job.Day_Phone.value=="") {

themessage = themessage + " -  Your Phone Number \n";

}
if (document.job.JobPosition.value=="") {

themessage = themessage + " -  The Job you are applying for \n";

}
if (document.job.JobHistory.value=="") {

themessage = themessage + " -  Your Job History \n";

}



//alert if fields are empty and cancel email submit

if (themessage == "You are required to complete the following fields: \n") {

document.job.submit();

}

else {

alert(themessage);

return false;

   }

}



// Begin QuickQuote Verification
function quoteverify() {

var themessage = "QuickQuote Verification: \nYou are required to complete the following fields: \n";

if (document.quickQuote.Email.value=="") {

themessage = themessage + " -  Your E-mail \n";

}


if (document.quickQuote.FirstName.value=="") {

themessage = themessage + " -  Your First Name \n";
}

if (document.quickQuote.LastName.value=="") {

themessage = themessage + " -  Your Last Name \n";
}

//alert if fields are empty and cancel email submit

if (themessage == "QuickQuote Verification: \nYou are required to complete the following fields: \n") {

document.quickQuote.submit();

}

else {

alert(themessage);

return false;

   }

}



// Begin ContactUS Verification
function contactverify() {

var themessage = "Contact Us Verification: \nYou are required to complete the following fields: \n";

if (document.contact.FirstName.value=="") {

themessage = themessage + " -  Your First Name \n";
}

if (document.contact.LastName.value=="") {

themessage = themessage + " -  Your Last Name \n";
}

if (document.contact.Email.value=="") {

themessage = themessage + " -  Your E-mail \n";

}

if (document.contact.Phone1.value=="" || document.contact.Phone2.value=="" || document.contact.Phone3.value=="") {
	
	if (document.contact.EveningPhone1.value=="" || document.contact.EveningPhone2.value=="" || document.contact.EveningPhone3.value=="" )
	{
		themessage = themessage + " -  Your Daytime or Evening Phone Number \n";	
	}

	
}

if (document.contact.PreferredContact.value=="") {

themessage = themessage + " -  Your Preferred Contact Method \n";

}


if (document.contact.ContactSubject.value=="") {

themessage = themessage + " -  The Subject of This Email \n";

}

if (document.contact.ContactUrgency.value=="") {

themessage = themessage + " -  The Urgency Level of This Email \n";

}

if (document.contact.HeardAbout.value=="") {

themessage = themessage + " -  How You Heard About Our Site \n";

}

if (document.contact.Comments.value=="") {

themessage = themessage + " -  Your Comments or Questions \n";

}

//alert if fields are empty and cancel email submit

if (themessage == "Contact Us Verification: \nYou are required to complete the following fields: \n") {

document.contact.submit();

}

else {

alert(themessage);

return false;

   }

}





// Begin Test Drive Verification
function driveverify() {

var themessage = "Test Drive Verification: \nYou are required to complete the following fields: \n";

if (document.testDrive.FirstName.value=="") {

themessage = themessage + " -  Your First Name \n";			

}

if (document.testDrive.LastName.value=="") {

themessage = themessage + " -  Your Last Name \n";			

}

if (document.testDrive.Email.value=="") {

themessage = themessage + " -  Your E-mail \n";			

}

if (document.testDrive.Phone1.value=="" || document.testDrive.Phone2.value=="" || document.testDrive.Phone3.value=="") {

themessage = themessage + " -  Your Phone Number \n";			

}

if (document.testDrive.DriveDate.value=="") {

themessage = themessage + " -  Desired Test Drive Date \n";
}

if (document.testDrive.DriveTime.value=="") {

themessage = themessage + " -  Desired Test Drive Time \n";
}


//alert if fields are empty and cancel email submit

if (themessage == "Test Drive Verification: \nYou are required to complete the following fields: \n") {

document.testDrive.submit();

}

else {

alert(themessage);
return false;

   }

}



// Begin Trade-In Verification
function tradeverify() {

var themessage = "Trade-In Verification: \nYou are required to complete the following fields: \n";
if (document.trade.First_Name.value=="") {

themessage = themessage + " -  Your First Name \n";

}

if (document.trade.Last_Name.value=="") {

themessage = themessage + " -  Your Last Name \n";

}

if (document.trade.Email.value=="") {

themessage = themessage + " -  Your E-mail \n";

}

if (document.trade.Day_Phone.value=="") {

themessage = themessage + " -  Your Day Phone Number \n";

}


if (document.trade.Evening_Phone.value=="") {

themessage = themessage + " -  Your Evening Phone Number \n";

}

if (document.trade.Zip.value=="") {

themessage = themessage + " -  Your Zip Code \n";

}

if (document.trade.Buying.value=="") {

themessage = themessage + " -  Buying Timeframe \n";
}


if (document.trade.Heard_About_Web_Site.value=="") {

themessage = themessage + " -  How you heard about our website \n";

}
if (document.trade.Trade_Date.value=="") {

themessage = themessage + " -  Desired Appraisal Date \n";
}

if (document.trade.Trade_Time.value=="") {

themessage = themessage + " -  Desired Appraisal Time \n";
}

if (document.trade.Year.value=="") {

themessage = themessage + " -  Trade-In Year \n";
}

if (document.trade.Make.value=="") {

themessage = themessage + " -  Trade-In Make \n";
}

if (document.trade.Model.value=="") {

themessage = themessage + " -  Trade-In Model \n";
}

if (document.trade.Miles.value=="") {

themessage = themessage + " -  Trade-In Mileage \n";
}

if (document.trade.Color.value=="") {

themessage = themessage + " -  Trade-In Color \n";
}

if (document.trade.Engine.value=="") {

themessage = themessage + " -  Trade-In Engine \n";
}

if (document.trade.Body_Style.value=="") {

themessage = themessage + " -  Trade-In Body Style \n";
}

if (document.trade.Transmission.value=="") {

themessage = themessage + " -  Trade-In Transmission \n";
}

if (document.trade.Drive_Train.value=="") {

themessage = themessage + " -  Trade-In Drive Train \n";
}

if (document.trade.Condition.value=="") {

themessage = themessage + " -  Trade-In Condition \n";
}

if (document.trade.Nearest_Location.value=="") {

themessage = themessage + " -  Your nearest location \n";
}

if (document.trade.Terms.value=="") {

themessage = themessage + " -  Your must agree to the terms \n";
}

//alert if fields are empty and cancel email submit

if (themessage == "Trade-In Verification: \nYou are required to complete the following fields: \n") {

document.trade.submit();

}

else {

alert(themessage);

return false;

   }

}


// Begin AutoLocator Verification
function locverify() {

var themessage = "You are required to complete the following fields: \n";

if (document.locator.First_Name.value=="") {

themessage = themessage + " -  Your First Name \n";

}

if (document.locator.Last_Name.value=="") {

themessage = themessage + " -  Your Last Name \n";

}

if (document.locator.Email.value=="") {

themessage = themessage + " -  Your E-mail \n";

}

if (document.locator.Day_Phone.value=="") {

themessage = themessage + " -  Your Phone Number \n";

}
if (document.locator.Year.value=="") {

themessage = themessage + " -  Vehicle Year \n";
}

if (document.locator.Make.value=="") {

themessage = themessage + " -  Vehicle Make \n";
}

if (document.locator.Model.value=="") {

themessage = themessage + " -  Vehicle Model \n";
}

if (document.locator.Color.value=="") {

themessage = themessage + " -  Vehicle Color \n";
}

if (document.locator.Transmission.value=="") {

themessage = themessage + " -  Vehicle Transmission \n";
}

if (document.locator.Mileage.value=="") {

themessage = themessage + " -  Vehicle Mileage \n";
}

if (document.locator.Buying.value=="") {

themessage = themessage + " -  Buying Timeframe \n";
}


if (document.locator.Heard_About_Web_Site.value=="") {

themessage = themessage + " -  How you hear about our website \n";

}

if (document.locator.Nearest_Location.value=="") {

themessage = themessage + " -  Your nearest location \n";
}

//alert if fields are empty and cancel email submit

if (themessage == "You are required to complete the following fields: \n") {

document.locator.submit();

}

else {

alert(themessage);

return false;

   }

}


// Begin Coupon Verification
function cpnverify() {

var themessage = "You are required to complete the following fields: \n";

if (document.coupon.First_Name.value=="") {

themessage = themessage + " -  Your First Name \n";

}

if (document.coupon.Last_Name.value=="") {

themessage = themessage + " -  Your Last Name \n";

}

if (document.coupon.Email.value=="") {

themessage = themessage + " -  Your E-mail \n";

}

if (document.coupon.Day_Phone.value=="") {

themessage = themessage + " -  Your Phone Number \n";

}

if (document.coupon.Street.value=="") {

themessage = themessage + " -  Your Street Address \n";

}

if (document.coupon.City.value=="") {

themessage = themessage + " -  Your City \n";

}

if (document.coupon.State.value=="") {

themessage = themessage + " -  Your State\n";

}

if (document.coupon.Zip.value=="") {

themessage = themessage + " -  Your Zip Code \n";

}

if (document.coupon.Year.value=="") {

themessage = themessage + " -  Vehicle Year \n";
}

if (document.coupon.Make.value=="") {

themessage = themessage + " -  Vehicle Make \n";
}

if (document.coupon.Model.value=="") {

themessage = themessage + " -  Vehicle Model \n";
}


if (document.coupon.Buying.value=="") {

themessage = themessage + " -  Buying Timeframe \n";
}


if (document.coupon.Heard_About_Web_Site.value=="") {

themessage = themessage + " -  How you hear about our website \n";
}

if (document.coupon.Nearest_Location.value=="") {

themessage = themessage + " -  Your nearest location \n";
}

//alert if fields are empty and cancel email submit

if (themessage == "You are required to complete the following fields: \n") {

document.coupon.submit();

}
else {

alert(themessage);

return false;

   }

}

// Validate Email Address

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

 		 return true					
	}


// Quick Quote Email Verification
function ValidateQuickQuoteEmail(){
	var emailID=document.quickQuote.Email
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
 
 // Test Drive Email Verification
function ValidateTestDriveEmail(){
	var emailID=document.testDrive.Email
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
 
  // Contact Us Email Verification
function ValidateContactUSEmail(){
	var emailID=document.contact.Email
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }



function CheckSearch() {


			
			if(document.searchform.SelectedMake.value=="")
			{
				window.alert('You are required to enter a vehicle make to search.');
				document.searchform.SelectedMake.focus();
				return false;
			}
			
		if(document.searchform.SelectedMake.value=="?")
			{
				window.alert('You are required to enter a vehicle make to search.');
				document.searchform.SelectedMake.focus();
				return false;
			}

		if(document.searchform.search_MakeType.value=="")
			{
				window.alert('You are required to enter a vehicle make to search.');
				document.searchform.SelectedMake.focus();
				return false;
			}
			if(document.searchform.search_Zip.value=="")
			{
				window.alert('You are required to enter your zip code to search.');
				document.searchform.search_Zip.focus();
				return false;
			}
			
		}

