/* ClearForm: this function has 1 argument: form.
   It clears the input and answer fields on the form. 
   It needs to know the names of the INPUT elements in order
   to do this. */
function ClearForm(form)
{
form.ServiceType.value = "selected";
form.EquipmentType.value = "selected";
form.PickUpCity.value = "";
form.PickUpState.value = "";
form.PickUpZipCode.value = "";
form.PickUpLocationType.value = "selected";
form.DeliveryCity.value = "";
form.DeliveryState.value = "";
form.DeliveryZipCode.value = "";
form.DeliveryLocationType.value = "selected";
form.ProductDescription.value = "";
form.Weight.value = "";
form.HowManyPieces.value = "";
form.PackageType.value = "";
form.Company.value = "";
form.Contact.value = "";
form.Phone.value = "";
form.Fax.value = "";
form.Email.value = "";
form.recaptcha_response_field.value = "";
}

/*The checkform funtion is to used to make sure that the fields on the 
form are filled out before being printed off and sent in.*/
function checkform(thisform) {

var completed = true;
	// This is a radio button group
	if (thisform.ServiceType.selectedIndex==0)
	{
	alert ("Please select a Service Type");
	thisform.ServiceType.focus();
	//thisform.ServiceType.select();
	completed = false;
	}
	// This is a radio button group
	if (thisform.EquipmentType.selectedIndex==0)
	{
	alert ("Please select an Equipment Type");
	thisform.EquipmentType.focus();
	//thisform.EquipmentType.select();
	completed = false;
	}
	// 
	if (thisform.PickUpCity.value == null || thisform.PickUpCity.value == "")
	{
	alert ("Please enter the City you want your load picked up from");
	thisform.PickUpCity.focus();
	thisform.PickUpCity.select();
	completed = false;
	}
	//break
	// 
	if (thisform.PickUpState.value == null || thisform.PickUpState.value == "")
	{
	alert ("Please enter the State/Province your load should be picked up from");
	thisform.PickUpState.focus();
	thisform.PickUpState.select();
	completed = false;
	}
	// 
	if (thisform.PickUpZipCode.value == null || thisform.PickUpZipCode.value == "")
	{
	alert ("Please enter the Zip/Postal Code your load should be picked up from");
	thisform.PickUpZipCode.focus();
	thisform.PickUpZipCode.select();
	completed = false;
	}
	// 
	if (thisform.PickUpLocationType.selectedIndex==0)
	{
	alert ("Please select an the Pick up Location Type");
	thisform.PickUpLocationType.focus();
	//thisform.PickUpLocationType.select();
	completed = false;
	}
	// 
	if (thisform.DeliveryCity.value == null || thisform.DeliveryCity.value == "")
	{
	alert ("Please enter the City your load should be delivered to");
	thisform.DeliveryCity.focus();
	thisform.DeliveryCity.select();
	completed = false;
	}
	// 
	if (thisform.DeliveryState.value == null || thisform.DeliveryState.value == "")
	{
	alert ("Please enter the Delivery State or Province your load should be delivered to");
	thisform.DeliveryState.focus();
	thisform.DeliveryState.select();
	completed = false;
	}
	if (thisform.DeliveryZipCode.value == null || thisform.DeliveryZipCode.value == "")
	{
	alert ("Please enter the Zip/Postal Code your load should be delivered to");
	thisform.DeliveryZipCode.focus();
	thisform.DeliveryZipCode.select();
	completed = false;
	}
	if (thisform.DeliveryLocationType.value.selectedIndex==0)
	{
	alert ("Please select a Delivery Location Type");
	thisform.DeliveryLocationType.focus();
	//thisform.DeliveryLocationType.select();
	completed = false;
	}
	// 
	if (thisform.ProductDescription.value == null || thisform.ProductDescription.value == "")
	{
	alert ("Please enter a description of the Product you want shipped");
	thisform.ProductDescription.focus();
	thisform.ProductDescription.select();
	completed = false;
	}
	//
	if (thisform.Weight.value == null || thisform.Weight.value == "")
	{
	alert ("Please enter how much your load Weighs in pounds");
	thisform.Weight.focus();
	thisform.Weight.select();
	completed = false;
	}
	//
	if (thisform.HowManyPieces.value == null || thisform.HowManyPieces.value == "")
	{
	alert ("Please enter How Many Pieces you want shipped");
	thisform.HowManyPieces.focus();
	thisform.HowManyPieces.select();
	completed = false;
	}
	//
	if (thisform.PackageType.value == null || thisform.PackageType.value == "")
	{
	alert ("Please enter a Package Type");
	thisform.PackageType.focus();
	thisform.PackageType.select();
	completed = false;
	}
	//
	if (thisform.Company.value == null || thisform.Company.value == "")
	{
	alert ("Please enter your Company Name");
	thisform.Company.focus();
	thisform.Company.select();
	completed = false;
	}
	//
	if (thisform.Contact.value == null || thisform.Contact.value == "")
	{
	alert ("Please enter a Contact Name");
	thisform.Contact.focus();
	thisform.Contact.select();
	completed = false;
	}
	//
	if (thisform.Phone.value == null || thisform.Phone.value == "")
	{
	alert ("Please enter your Phone Number");
	thisform.Phone.focus();
	thisform.Phone.select();
	completed = false;
	}
	//
	if (thisform.Email.value == null || thisform.Email.value == "")
	{
	alert ("Please enter your Email Address");
	thisform.Email.focus();
	thisform.Email.select();
	completed = false;
	}
	if (completed == false){
	return false;
	}
	//
		//
	/*if (thisform.recaptcha.value == "")
	{
	alert ("Please enter the two words");
	thisform.recaptcha.focus();
	thisform.recaptcha.select();
	completed = false;
	}
	//
	if (thisform.recaptcha_response_field.value == null || thisform.recaptcha_response_field.value == "")
	{
	alert ("Please enter the two words");
	thisform.recaptcha_response_field.focus();
	thisform.recaptcha_response_field.select();
	completed = false;
	}
	if (completed == false){
	return false;
	}*/
}

/*The print_form funtion is to print the checkout page to mail in.*/
function print_form(thisform) {
	window.print();
	return false;
}	
