// JavaScript Document
	var gSelect // the number to define that which object should be checked empty //

	function validate()
	{ 
		// This function's use for define that which object should be validated //
		
		// Step 1: check that required fields are filled in, alert and exit without submitting if not
		// check that the lastname field is valued

	
		// check that the email field is valued //'Please fill in '.
		if (document.mForm.EmailAddress.value=='')
		{
			alert("Please fill in "+document.mForm.EmailAddress.name);
			document.mForm.EmailAddress.setFocus;
			return false;
		}
		
		if (document.mForm.ContactPhone.value=='')
		{
			alert("Please fill in "+document.mForm.ContactPhone.name);
			document.mForm.ContactPhone.setFocus;
			return false;
		}
		
		if (document.mForm.RentalName.value=='')
		{
			alert("Please fill in "+document.mForm.RentalName.name);
			document.mForm.RentalName.setFocus;
			return false;
		}
		
		
		if (document.mForm.RentalAge.value=='')
		{
			alert("Please fill in "+document.mForm.RentalAge.name);
			document.mForm.RentalAge.setFocus;
			return false;
		}
		
		
		if (document.mForm.NumberDays.value=='')
		{
			alert("Please fill in "+document.mForm.NumberDays.name);
			document.mForm.NumberDays.setFocus;
			return false;
		}
		
		if (document.mForm.PickupLocation.value=='')
		{
			alert("Please fill in "+document.mForm.PickupLocation.name);
			document.mForm.PickupLocation.setFocus;
			return false;
		}
		
		if (document.mForm.PickupTime.value=='')
		{
			alert("Please fill in "+document.mForm.PickupTime.name);
			document.mForm.PickupTime.setFocus;
			return false;
		}
		
		if (document.mForm.DropoffLocation.value=='')
		{
			alert("Please fill in "+document.mForm.DropoffLocation.name);
			document.mForm.DropoffLocation.setFocus;
			return false;
		}
		
		if (document.mForm.DropoffTime.value=='')
		{
			alert("Please fill in "+document.mForm.DropoffTime.name);
			document.mForm.DropoffTime.setFocus;
			return false;
		}
		
		if (document.mForm.PickupTime.value=='')
		{
			alert("Please fill in "+document.mForm.PickupTime.name);
			document.mForm.PickupTime.setFocus;
			return false;
		}
		
		
		// check that the capnum field is valued
		if (document.mForm.capnum.value=='')
		{
			alert("Please fill in "+document.mForm.capnum.name);
			document.mForm.capnum.setFocus;
			return false;
		}
		
		document.mForm.submit();
		return true;

	}
	
	// provides year <option> for years in the next 18 months (2 or 3), big box needs this - small box doesn't
function getYear(){
 var today = new Date();
 var month = today.getMonth() + 1;
 var year = today.getFullYear();
 var yearOld = "";
 for(var i=0; i<=17; i++) {
   month = month + 1;
   if(month>=13) {
     month = 1;
     if(i==0) document.write('<option value="'+year+'">'+year+'</option>');
     year = year + 1;
   }
   if(yearOld!=year) {
     document.write('<option value="'+year+'">'+year+'</option>');
     yearOld = year;
   }
 }    
}

