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 Service Verification
function svcverify() {

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

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

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

}

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

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

}

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

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

}

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

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

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

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

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

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

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

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

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

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

if (document.service.Service_Date.value=="") {

themessage = themessage + " -  Your Requested Service Date \n";
}

if (document.service.Service_Time.value=="") {

themessage = themessage + " -  Your Requested Service Time \n";
}

if (document.service.Service_Needed.value=="") {

themessage = themessage + " -  Your Requested Service \n";
}


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

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

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

themessage = themessage + " -  The location you want your vehicle serviced \n";
}

//alert if fields are empty and cancel email submit

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

document.service.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					
	}


//  Email Verification
function ValidateEmail(){
	var emailID=document.forms[0].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;
			}
			
		}








// Begin Rental 1 Verification
function rental_1_verify() {

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

if (document.rental.Pickup_Date.value=="") {

themessage = themessage + " -  Your Pick-up Date \n";

}

if (document.rental.Pickup_Time.value=="") {

themessage = themessage + " -  Your Pick-up Time \n";

}

if (document.rental.Dropoff_Date.value=="") {

themessage = themessage + " -  Your Drop-off Date \n";

}

if (document.rental.Dropoff_Time.value=="") {

themessage = themessage + " -  Your Drop-off Time \n";

}


//alert if fields are empty and cancel email submit

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

document.rental.submit();

}

else {

alert(themessage);

return false;

   }

}


// Begin Rental 2 Verification
function rental_2_verify() {

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

if (document.rental.Vehicle.value=="") {

themessage = themessage + " -  Your Vehicle Selection \n";

}


//alert if fields are empty and cancel email submit

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

document.rental.submit();

}

else {

alert(themessage);

return false;

   }

}


// Begin Rental 3 Verification
function rental_3_verify() {

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

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

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

}
if (document.rental.Last_Name.value=="") {

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

}
if (document.rental.Email.value=="") {

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

}
if (document.rental.Phone.value=="") {

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

}

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

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

}
if (document.rental.City.value=="") {

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

}


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

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

}

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

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

}

if (document.rental.Payment.value=="") {

themessage = themessage + " -  Your Payment Method \n";

}

if (document.rental.Age.value=="") {

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

}


//alert if fields are empty and cancel email submit

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

document.rental.submit();

}

else {

alert(themessage);

return false;

   }

}