// JavaScript Document

function validate()
{

	
	if(document.reservation.fname.value == "")
    {
 		alert("Enter your Name");
 		document.reservation.fname.focus();
 		return false;
    }
	
	 if(document.reservation.tel.value == "")
	{
		alert("Enter the Telephone Number");
		document.reservation.tel.focus();
		return false;
    }
	
	if(isNaN(document.reservation.tel.value))
	{
		alert("Enter a valid Telephone Number");
		document.reservation.tel.focus();
		return false;
    }
	
    
	
	if(document.reservation.email.value == "")
	{
		alert("Enter the Email Address");
		document.reservation.email.focus();
		return false;
    }
	
	if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.reservation.email.value))
	{
		alert("Invalid E-mail Address! Please re-enter.");
	    document.reservation.email.value="";
		document.reservation.email.focus();
		return (false);
	}
	
	if(document.reservation.dom.value == "")
	{
		alert("Enter the date of moving");
		document.reservation.dom.focus();
		return false;
    }
	
	if(isNaN(document.reservation.dom.value))
	{
		alert("Enter a valid date of moving");
		document.reservation.dom.focus();
		return false;
    }
	
	if (document.reservation.month.selectedIndex == 0)
    		{
        	alert ("Please select the month.");
			document.reservation.month.focus();
			return false;
        	/*valid = true;*/
    		}
			
	
	
	if(document.reservation.tostate.value == "")
    {
		alert("Enter the State Moving to");
 		document.reservation.tostate.focus();
 		return false;
	}
	if(document.reservation.tocity.value == "")
    {
		alert("Enter the City Moving to");
 		document.reservation.tocity.focus();
 		return false;
	}
	
	if(document.reservation.fromstate.value == "")
    {
		alert("Enter the State Moving From");
 		document.reservation.fromstate.focus();
 		return false;
	}
	if(document.reservation.fromcity.value == "")
    {
		alert("Enter the City Moving From");
 		document.reservation.fromcity.focus();
 		return false;
	}

   
   if(document.reservation.model.value == "")
    {
		alert("Enter the Car Model & Make");
 		document.reservation.model.focus();
 		return false;
	}
	
	
/*	else
	{
    window.open('RegSuccess.htm','','height=266,width=519 ')
	}*/
    }
