function validate_form(theForm)
   {
    
    if (theForm.type.options[theForm.type.selectedIndex].value == "" )
		{
			alert( "Please select the Type of Move" );
			theForm.type.focus();
			return false;
		}

    
	mvdate = theForm.month.value + "/" + theForm.day.value + "/" + theForm.year.value
	
	
	if(ValidateThisDate(mvdate) == false)
	 	{
	   		
	   		alert("Please enter proper date");
	   		theForm.month.focus();
	   		return false;
	 	} 
		else  //if date is valid check if it falls within the good move window
		{
 		var gyear = theForm.year.value;
	 	var gmonth = theForm.month.value;
 		var gday = theForm.day.value;
	 	if (gday.substring(0,1) == "0") { gday = gday.substring(1);}
		if (gmonth.substring(0,1) == "0") { gmonth = gmonth.substring(1);}		
		
		var dateNow = new Date();
			var year=dateNow.getYear()
			if (year <1000)
			year+=1900
			var day=dateNow.getDay()
			var month=dateNow.getMonth()
			var daym=dateNow.getDate()
			month=month+1
			if (month<10)
			month="0"+month
			daym=daym+2
			if (daym<10)
			daym="0"+daym

			var tShow = daym+"/"+month+"/"+year
			var MoveDate = new Date(gyear,gmonth-1,gday);
			var dateDiffDays = parseInt((MoveDate - dateNow) / (1000 * 60 * 60 * 24));

			if (dateDiffDays < 1)
			{
				vStr = "The Move Date has to be on or after "+tShow+".";
				alert(vStr);
				theForm.month.focus();
				return false;
			}
			if (dateDiffDays > 120)
			{
				vStr = "In order to provide a good quality service, we require the move date to be within next 120 days.";
				alert(vStr);
				theForm.month.focus();
				return false;
			}
		
		}  // else part of validatedate ends here
 	
 	 theForm.fld_movedate.value = mvdate;
 	 
	if ( theForm.weight.options[theForm.weight.selectedIndex].value == "" )
	{
		alert("Please select appropriate weight of your move");
		theForm.weight.focus();			
   		return false;
	} 

	var chosen_country_from=theForm.countryFrom.options[theForm.countryFrom.selectedIndex].value;
	var chosen_country_to=theForm.countryTo.options[theForm.countryTo.selectedIndex].value;
	
	if ( theForm.stateFrom.options[theForm.stateFrom.selectedIndex].value == "" && chosen_country_from == "USA")
	{
		alert("Please select the From State");
		theForm.stateFrom.focus();			
   		return false;
	} 

	if ( theForm.stateTo.options[theForm.stateTo.selectedIndex].value == "" && chosen_country_to == "USA")
	{
		alert("Please select the To State");
		theForm.stateTo.focus();			
   		return false;
	}

    if (theForm.cityFrom.value == "") 
      {
		alert("Please enter appropriate From City");
		theForm.cityFrom.select();
   		return false;
	  }

	if (theForm.cityTo.value == "") 
      {
		alert("Please enter appropriate To City");
		theForm.cityTo.select();
   		return false;
	  }

    if (theForm.zipFrom.value == "" || isNaN(theForm.zipFrom.value) || (theForm.zipFrom.value).length != 5) 
          {
			alert("Please enter appropriate From ZIP code value");
			theForm.zipFrom.select();
    		return false;
		  } 
		  
    if (theForm.zipTo.value == "" || isNaN(theForm.zipTo.value) || (theForm.zipTo.value).length != 5) 
          {
			alert("Please enter appropriate To ZIP code value");
			theForm.zipTo.select();
    		return false;
		  }

    if (theForm.name.value == "") 
          {
			alert("Please enter your name");
			theForm.name.select();
    		return false;
		  } 
		  
    if (theForm.email.value == "") 
          {
			alert("Please enter your email address");
			theForm.email.select();
    		return false;
		  } 

if (theForm.phone.value == "") 
          {
			alert("Please enter your phone number");
			theForm.phone.select();
    		return false;
		  } 
		  

return true;
   }