/*
	Created by		: Wesley Wong
	Created on		: MAY 4 2006
	Purpose			: NEW Liftow WWW
*/



// validating CATALOGUE FORM

function validate_catalogue()
{
	if(catalogue_form.Your_Name.value == "")
	{
		alert("Please enter your name");
		catalogue_form.Your_Name.focus();
		return false;
	}
	
	if(catalogue_form.Company.value == "")
	{
		alert("Please enter your Company Name");
		catalogue_form.Company.focus();
		return false;
	}
	
	if(catalogue_form.Address.value == "")
	{
		alert("Please enter your Address");
		catalogue_form.Address.focus();
		return false;
	}
	
	if(catalogue_form.City.value == "")
	{
		alert("Please enter your City/Town");
		catalogue_form.City.focus();
		return false;
	}
	
	if(catalogue_form.State_Province.value == "")
	{
		alert("Please enter your State/Province");
		catalogue_form.State_Province.focus();
		return false;
	}
	
	if(catalogue_form.Zip_Postal.value == "")
	{
		alert("Please enter your Zip/Postal");
		catalogue_form.Zip_Postal.focus();
		return false;
	}
	
	if(catalogue_form.Country.value == "")
	{
		alert("Please enter your Country");
		catalogue_form.Country.focus();
		return false;
	}
	
	if(catalogue_form.Area_Code.value == "")
	{
		alert("Please enter the Area Code");
		catalogue_form.Area_Code.focus();
		return false;
	}
	
	if(!catalogue_form.Area_Code.value.match(/^\d+$/))
	{
		alert("Please enter a valid Area Code");
		catalogue_form.Area_Code.focus();
		return false;
	}
	
	if(catalogue_form.Phone03.value == "")
	{
		alert("Please enter the first 3 digits of the phone number");
		catalogue_form.Phone03.focus();
		return false;
	}
	
	if(!catalogue_form.Phone03.value.match(/^\d+$/))
	{
		alert("Please enter digits for the phone number");
		catalogue_form.Phone03.focus();
		return false;
	}
	
	if(catalogue_form.Phone04.value == "")
	{
		alert("Please enter the last digits of the phone number");
		catalogue_form.Phone04.focus();
		return false;
	}
	
	
	if(!catalogue_form.Phone04.value.match(/^\d+$/))
	{
		alert("Please enter digits for the phone number");
		catalogue_form.Phone04.focus();
		return false;
	}
	
	
	if(catalogue_form.Email.value == "")
	{
		alert("Please enter your E-mail Address");
		catalogue_form.Email.focus();
		return false;
	}
	
	var apos1 = catalogue_form.Email.value.indexOf("@");
	var dotpos1 = catalogue_form.Email.value.lastIndexOf(".")
	if (apos1<1 || dotpos1-apos1<2)
	{
		alert("Please enter a valid E-mail Address");
		catalogue_form.Email.focus();
		return false;
	}
	
	return (true);
}

// validating PARTS FORM

function validate_parts()
{
	if(parts_form.first_name.value == "")
	{ 
		alert("Please enter your FIRST Name");
		parts_form.first_name.focus();
		return false;
	}
	
	if(parts_form.last_name.value == "")
	{ 
		alert("Please enter your LAST Name");
		parts_form.last_name.focus();
		return false;
	}
	
	if(parts_form.company_name.value == "")
	{ 
		alert("Please enter your COMPANY Name");
		parts_form.company_name.focus();
		return false;
	}
	
	if(parts_form.make.value == "")
	{ 
		alert("Please enter the MAKE of your truck");
		parts_form.make.focus();
		return false;
	}
	
	if(parts_form.model.value == "")
	{ 
		alert("Please enter the MODEL of your truck");
		parts_form.model.focus();
		return false;
	}
	
	if(parts_form.partNo.value == "")
	{ 
		alert("Please enter the PART NO. you are requesting");
		parts_form.partNo.focus();
		return false;
	}
	
	if(!parts_form.partType[0].checked)
	{ 
		if(!parts_form.partType[1].checked)
		alert("Please let us know what PART TYPE you require");
		parts_form.partType.focus();
		return false;
	}
	
	if(parts_form.quantity.value == "")
	{ 
		alert("Please enter the QUANTITY of parts");
		parts_form.quantity.focus();
		return false;
	}
	
	
	if(!parts_form.quantity.value.match(/^\d+$/))
	{
		alert("Please enter a number in the QUANTITY field");
		parts_form.quantity.focus();
		return false;
	}
		
	if(parts_form.email.value == "")
	{ 
		alert("Please enter YOUR E-MAIL ADDRESS");
		parts_form.email.focus();
		return false;
	}
	
	var apos = parts_form.email.value.indexOf("@");
	var dotpos = parts_form.email.value.lastIndexOf(".")
	if (apos<1 || dotpos-apos<2)
	{
		alert("Please enter a valid E-mail Address");
		parts_form.email.focus();
		return false;
	}
	
	return (true);
}


<!-- 
function validate_feedback()
{
	
	if (!radio_form.Hear_button[0].checked &&
	!radio_form.Hear_button[1].checked &&
	!radio_form.Hear_button[2].checked &&
	!radio_form.Hear_button[3].checked &&
	!radio_form.Hear_button[4].checked)
	{
		// no radio button is selected
		alert("Please tell us, How did you hear about Liftow.com?")
		return false;
	}
	
	if (!radio_form.Easy_button[0].checked &&
	!radio_form.Easy_button[1].checked &&
	!radio_form.Easy_button[2].checked)
	{
		// no radio button is selected
		alert("Please tell us, How easy was the site to use?")
		return false;
	}
	
	if (!radio_form.Section_button[0].checked &&
	!radio_form.Section_button[1].checked &&
	!radio_form.Section_button[2].checked &&
	!radio_form.Section_button[3].checked &&
	!radio_form.Section_button[4].checked &&
	!radio_form.Section_button[5].checked)
	{
		// no radio button is selected
		alert("Please tell us, Which section of the site did you visit today?")
		return false;
	}
	
	if (!radio_form.Look_button[0].checked &&
	!radio_form.Look_button[1].checked)

	{
		// no radio button is selected
		alert("Please tell us, Were you able to find what you were looking for?")
		return false;
	}
	
	

	
	if (radio_form.Comments.value=="")
	{
	alert("Please provide us with some comments")
	return (false);
	
	}

// If text_name is not null continue processing
return (true);
}


function validate_log()
{
	if(log_form.Your_Name.value == "")
	{
		alert("Please enter your name");
		log_form.Your_Name.focus();
		return false;
	}
	
	if(log_form.Company.value == "")
	{
		alert("Please enter your Company Name");
		log_form.Company.focus();
		return false;
	}
	
	
	if(log_form.Address.value == "")
	{
		alert("Please enter your Address");
		log_form.Address.focus();
		return false;
	}
	
	if(log_form.City.value == "")
	{
		alert("Please enter your City/Town");
		log_form.City.focus();
		return false;
	}
	
	if(log_form.State_Province.value == "")
	{
		alert("Please enter your State/Province");
		log_form.State_Province.focus();
		return false;
	}
	
	if(log_form.Zip_Postal.value == "")
	{
		alert("Please enter your Zip/Postal");
		log_form.Zip_Postal.focus();
		return false;
	}
	

	
	if(log_form.Area_Code.value == "")
	{
		alert("Please enter the Area Code");
		log_form.Area_Code.focus();
		return false;
	}
	
	if(!log_form.Area_Code.value.match(/^\d+$/))
	{
		alert("Please enter a valid Area Code");
		log_form.Area_Code.focus();
		return false;
	}
	
	if(log_form.Phone03.value == "")
	{
		alert("Please enter the first 3 digits of the phone number");
		log_form.Phone03.focus();
		return false;
	}
	
	if(!log_form.Phone03.value.match(/^\d+$/))
	{
		alert("Please enter digits for the phone number");
		log_form.Phone03.focus();
		return false;
	}
	
	if(log_form.Phone04.value == "")
	{
		alert("Please enter the last digits of the phone number");
		log_form.Phone04.focus();
		return false;
	}
	
	
	if(!log_form.Phone04.value.match(/^\d+$/))
	{
		alert("Please enter digits for the phone number");
		log_form.Phone04.focus();
		return false;
	}
	


	
	
	if(log_form.Email.value == "")
	{
		alert("Please enter your E-mail Address");
		log_form.Email.focus();
		return false;
	}
	
	var apos1 = log_form.Email.value.indexOf("@");
	var dotpos1 = log_form.Email.value.lastIndexOf(".");
	if (apos1<1 || dotpos1-apos1<2)
	{
		alert("Please enter a valid E-mail Address");
		log_form.Email.focus();
		return false;
	}
	
	if(log_form.lifttrucks.value == "" )
	{
		alert("Please tell us, how many lift trucks do you have?");
		log_form.lifttrucks.focus();
		return false;
	}
	
	if(log_form.lifttruckoperator.value == "" )
	{
		alert("Please tell us, how many lift truck operators are in your company?");
		log_form.lifttruckoperator.focus();
		return false;
	}
	
	if (!log_form.Type[0].checked &&
	!log_form.Type[1].checked &&
	!log_form.Type[2].checked &&
	!log_form.Type[3].checked)
	
	{
		// no radio button is selected
		alert("Please tell us, What type of Lift Truck Logs do you want?");
		return false;
	}
	
	if (!log_form.agree.checked)
	{
		alert("Please agree to the survey that you have to complete in 3 weeks evaluating the Lift Truck Log");
		return false;
	}
	
	return (true);
}


function validate_usedtruck()
{
	if(edit_truck.tyear.value == "")
	{
		alert("Please enter a value for the Year");
		edit_truck.tyear.focus();
		return false;
	}
	
	if(edit_truck.tmodel.value == "")
	{
		alert("Please enter a value for the Model");
		edit_truck.tmodel.focus();
		return false;
	}
	
	if(edit_truck.tsn.value == "")
	{
		alert("Please enter a value for the Serial Number");
		edit_truck.tsn.focus();
		return false;
	}
	
	if(edit_truck.tfuel_type.value == "")
	{
		alert("Please enter a value for the Model");
		edit_truck.tfuel_type.focus();
		return false;
	}
	
	if(edit_truck.tmast.value == "")
	{
		alert("Please enter a value for the Mast");
		edit_truck.tmast.focus();
		return false;
	}
	
	if(edit_truck.tcapacity.value == "")
	{
		alert("Please enter a value for the Capacity");
		edit_truck.tcapacity.focus();
		return false;
	}
	
	//if(edit_truck.tss.value == "")
	//{
		//alert("Please enter a value for the Side-Shift Attachment");
		//edit_truck.tss.focus();
		//return false;
	//}
	
	if(edit_truck.ttires.value == "")
	{
		alert("Please enter a value for the Tires");
		edit_truck.ttires.focus();
		return false;
	}
	
	if(edit_truck.tprice.value == "")
	{
		alert("Please enter a value for the Price");
		edit_truck.tprice.focus();
		return false;
	}
	
	if(!edit_truck.tprice.value.match(/^\d+$/))
	{
		alert("Please enter a numerical value for the Price e.g. for $25,000 enter= 25000");
		edit_truck.tprice.focus();
		return false;
	}
	
	
	return (true);
}



function validate_usedtruck2()
{
	if(add_truck.tlocation.value == "")
	{
		alert("Please enter a value for the Location");
		add_truck.tlocation.focus();
		return false;
	}
	
	if(add_truck.tmodel.value == "")
	{
		alert("Please enter a value for the Model");
		add_truck.tmodel.focus();
		return false;
	}
	
	if(add_truck.tsn.value == "")
	{
		alert("Please enter a value for the Serial Number");
		add_truck.tsn.focus();
		return false;
	}
	
	if(add_truck.tyear.value == "")
	{
		alert("Please enter a value for the Year");
		add_truck.tyear.focus();
		return false;
	}
	
	
	if(add_truck.tmast.value == "")
	{
		alert("Please enter a value for the Mast");
		add_truck.tmast.focus();
		return false;
	}
	
	if(add_truck.tcapacity.value == "")
	{
		alert("Please enter a value for the Capacity");
		add_truck.tcapacity.focus();
		return false;
	}
	
	//if(add_truck.tss.value == "")
	//{
		//alert("Please enter a value for the Side-Shift Attachment");
		//add_truck.tss.focus();
		//return false;
	//}
	
	if(add_truck.tprice.value == "")
	{
		alert("Please enter a value for the Price");
		add_truck.tprice.focus();
		return false;
	}
	
	if(!add_truck.tprice.value.match(/^\d+$/))
	{
		alert("Please enter a numerical value for the Price e.g. for $25,000 enter= 25000");
		add_truck.tprice.focus();
		return false;
	}
	
	
	return (true);
}





function validate_order()
{
	if(shipping.contact_person.value == "")
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a Contact Name");
			shipping.contact_person.focus();
			return false;
		}
	}
	
	if(shipping.shipping_address.value == "")
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a Shipping Address");
			shipping.shipping_address.focus();
			return false;
		}
	}
	
	if(shipping.shipping_city.value == "")
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a City for the Shipping Address");
			shipping.shipping_city.focus();
			return false;
		}
	}
	
	if(shipping.shipping_province.value == "")
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please select a Province for the Shipping Address");
			shipping.shipping_province.focus();
			return false;
		}
	}
	
	
	if(shipping.shipping_postalcode.value == "")
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a Postal Code for the Shipping Address");
			shipping.shipping_postalcode.focus();
			return false;
		}
	}
	
	if(shipping.shipping_telephone01.value == "")
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter an Area Code for method of contact");
			shipping.shipping_telephone01.focus();
			return false;
		}
	}
	
	if(!shipping.shipping_telephone01.value.match(/^\d+$/))
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a numerical value for the Area Code for method of contact");
			shipping.shipping_telephone01.focus();
			return false;
		}
	}
	
	if(shipping.shipping_telephone01.value.length < 2)
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a proper value for the Area Code for method of contact");
			shipping.shipping_telephone01.focus();
			return false;
		}
	}
	
	if(shipping.shipping_telephone02.value == "")
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a value for the Telephone Number under method of contact");
			shipping.shipping_telephone02.focus();
			return false;
		}
	}
	
	if(!shipping.shipping_telephone02.value.match(/^\d+$/))
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a numerical value for the Telephone Number for method of contact");
			shipping.shipping_telephone02.focus();
			return false;
		}
	}
	
	if(shipping.shipping_telephone02.value.length < 2)
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a proper value for the Telephone Number under method of contact");
			shipping.shipping_telephone02.focus();
			return false;
		}
	}
	
	if(shipping.shipping_telephone03.value == "")
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a value for the Telephone Number under method of contact");
			shipping.shipping_telephone03.focus();
			return false;
		}
	}
	
	if(!shipping.shipping_telephone03.value.match(/^\d+$/))
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a numerical value for the Telephone Number udner method of contact");
			shipping.shipping_telephone03.focus();
			return false;
		}
	}
	
	if(shipping.shipping_telephone03.value.length < 3)
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter a proper value for the Telephone Number under method of contact");
			shipping.shipping_telephone03.focus();
			return false;
		}
	}
		
	if(shipping.shipping_email.value == "")
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please enter an E-mail Address for method of contact");
			shipping.shipping_email.focus();
			return false;
		}
	}
	
	
	var apos1 = shipping.shipping_email.value.indexOf("@");
	var dotpos1 = shipping.shipping_email.value.lastIndexOf(".")
	if (apos1<1 || dotpos1-apos1<2)
	{
		if (!shipping.dealer_check.checked)
		{
			alert("Please re-enter a valid E-mail Address for method of contact");
			shipping.shipping_email.focus();
			return false;
		}
	}
	
		if (shipping.dealer_check.checked)
		{
				
			if(shipping.dealer_account.value == "")
			{
				alert("Please enter your Dealer Account No# under Dealer Information");
				shipping.dealer_account.focus();
				return false;
			}
			
			if(shipping.dealer_account.value.length < 4)
			{
				alert("Please re-enter your Dealer Account No#, 4-6 digit number on previous invoices");
				shipping.dealer_account.focus();
				return false;
			}
			
			if(!shipping.dealer_account.value.match(/^\d+$/))
			{
				alert("Please re-enter your Dealer Account No#, a 4-6 digit number value");
				shipping.dealer_account.focus();
				return false;
			}
			
			if(shipping.dealer_contact.value == "")
			{
				alert("Please enter a Contact Name under Dealer Information");
				shipping.dealer_contact.focus();
				return false;
			}
			
			
			
				if(shipping.dealer_telephone01.value == "")
				{
					alert("Please enter an Area Code under Dealer Information");
					shipping.dealer_telephone01.focus();
					return false;
				}
				
				if(!shipping.dealer_telephone01.value.match(/^\d+$/))
				{
					alert("Please enter a numerical value for the Area Code under Dealer Information");
					shipping.dealer_telephone01.focus();
					return false;
				}
				
				if(shipping.dealer_telephone01.value.length < 2)
				{
					alert("Please enter a proper value for the Area Code under Dealer Information");
					shipping.dealer_telephone01.focus();
					return false;
				}
				
				if(shipping.dealer_telephone02.value == "")
				{
					alert("Please enter a Telephone Number under Dealer Information");
					shipping.dealer_telephone02.focus();
					return false;
				}
				
				if(!shipping.dealer_telephone02.value.match(/^\d+$/))
				{
					alert("Please enter a numerical value for the Telephone Number under Dealer Information");
					shipping.dealer_telephone02.focus();
					return false;
				}
				
				if(shipping.dealer_telephone02.value.length < 2)
				{
					alert("Please enter a proper value for the Telephone Number under Dealer Information");
					shipping.dealer_telephone02.focus();
					return false;
				}
				
				if(shipping.dealer_telephone03.value == "")
				{
					alert("Please enter a Telephone Number under Dealer Information");
					shipping.dealer_telephone03.focus();
					return false;
				}
				
				if(!shipping.dealer_telephone03.value.match(/^\d+$/))
				{
					alert("Please enter a numerical value for the Telephone Number under Dealer Information");
					shipping.dealer_telephone03.focus();
					return false;
				}
				
				if(shipping.dealer_telephone03.value.length < 3)
				{
					alert("Please enter a proper value for the Telephone Number under Dealer Information");
					shipping.dealer_telephone03.focus();
					return false;
				}
	
					
		
			if(shipping.dealer_email.value == "")
			{
				alert("Please enter an E-mail Address under Dealer Information");
				shipping.dealer_email.focus();
				return false;
			}
			var apos1 = shipping.dealer_email.value.indexOf("@");
			var dotpos1 = shipping.dealer_email.value.lastIndexOf(".")
			if (apos1<1 || dotpos1-apos1<2)
			{
				alert("Please re-enter a valid E-mail Address under Dealer Information");
				shipping.dealer_email.focus();
				return false;
			}
			
		}
	
	
	if (shipping.payment_type[1].checked)
	{
		if(shipping.account_po_number.value == "")
		{
			alert("Please enter an Account/P.O. Number under Payment Information");
			shipping.account_po_number.focus();
			return false;
		}
	}
	
	return (true);
}


// validating USED REQUEST

function validate_toyotarequest()

{
	if(document.toyotaRequest.firstName.value == "")
	{ 
		alert("S'il vous plaît entrer votre Prénom");
		document.toyotaRequest.firstName.focus();
		return false;
	}
	
	if(document.toyotaRequest.lastName.value == "")
	{ 
		alert("S'il vous plaît entrer votre Nom de Famille");
		document.toyotaRequest.lastName.focus();
		return false;
	}
	
	if(document.toyotaRequest.companyName.value == "")
	{ 
		alert("S'il vous plaît entrer votre Compagnie");
		document.toyotaRequest.companyName.focus();
		return false;
	}
	
	if(document.toyotaRequest.companyAddress.value == "")
	{ 
		alert("S'il vous plaît entrer votre Adresse");
		document.toyotaRequest.companyAddress.focus();
		return false;
	}
	
	if(document.toyotaRequest.companyCity.value == "")
	{ 
		alert("S'il vous plaît entrer votre Ville");
		document.toyotaRequest.companyCity.focus();
		return false;
	}
	
	if(document.toyotaRequest.companyProv.value == "")
	{ 
		alert("S'il vous plaît entrer votre Province");
		document.toyotaRequest.companyProv.focus();
		return false;
	}
	
	if(document.toyotaRequest.postalCode.value == "")
	{ 
		alert("S'il vous plaît entrer votre Code Postal");
		document.toyotaRequest.postalCode.focus();
		return false;
	}
	
	if(document.toyotaRequest.telephone.value == "")
	{ 
		alert("S'il vous plaît entrer votre Téléphone");
		document.toyotaRequest.telephone.focus();
		return false;
	}
	
	if(document.toyotaRequest.email.value == "")
	{ 
		alert("S'il vous plaît entrer votre Courriel");
		document.toyotaRequest.email.focus();
		return false;
	}
	
	if(document.toyotaRequest.subject.value == "")
	{ 
		alert("S'il vous plaît entrer votre Objet");
		document.toyotaRequest.subject.focus();
		return false;
	}
	
	if(document.toyotaRequest.comments.value == "")
	{ 
		alert("S'il vous plaît entrer votre Message");
		document.toyotaRequest.comments.focus();
		return false;
	}
	
	
	
	return (true);
}




-->


