function CheckContactUsForm(theform)
{
	if (theform.fname.value.length <=0 && theform.lname.value.length <=0 && theform.company.value.length <=0)
	{
		alert("Please enter your name or your company name.");
		theform.fname.focus();
		return false;
	}
	
	if (theform.fname.value.length >0 && theform.lname.value.length <=0 && theform.company.value.length <=0)
	{
		alert("Please enter your last name.");
		theform.lname.focus();
		return false;
	}
	
	if (theform.fname.value.length <= 0 && theform.lname.value.length >0 && theform.company.value.length <=0)
	{
		alert("Please enter your first name.");
		theform.lname.focus();
		return false;
	}

	if (theform.address.value.length <=2)
	{
		alert("Please enter your address.");
		theform.address.focus();
		return false;
	}

	if (theform.city.value.length <=0)
	{
		alert("Please enter your city.");
		theform.city.focus();
		return false;
	}

	if (theform.zip_postal.value.length <=0)
	{
		alert("Please enter your zip/postal code.");
		theform.zip_postal.focus();
		return false;
	}
	
	if (theform.email.value.length <=0)
	{
		alert("Please enter your email address.");
		theform.email.focus();
		return false;
	}
	
	if (theform.phone.value.length <=0)
	{
		alert("Please enter your phone number.");
		theform.phone.focus();
		return false;
	}

	if (theform.ContactMethod[theform.ContactMethod.selectedIndex].value == "Fax")
	{
		if (theform.fax.value.length <=0)
		{
			alert("Please enter your fax number.");
			theform.fax.focus();
			return false;
		}
	}
	
	if (theform.comments.value == "")
	{
		alert("Please enter some comments.");
		theform.comments.focus();
		return false;
	}
	
	theform.submit();
}

function CheckCustomProductForm(theform)
{
	if (theform.Company_Name.value.length <=0)
	{
		alert("Please enter your Company Name.");
		theform.Company_Name.focus();
		return false;
	}

	if (theform.Contact_Name.value.length <=0)
	{
		alert("Please enter your contact name.");
		theform.Contact_Name.focus();
		return false;
	}

	if (theform.Email.value.length <=0)
	{
		alert("Please enter your email address.");
		theform.Email.focus();
		return false;
	}
	
	if (theform.Phone.value.length <=0)
	{
		alert("Please enter your phone number.");
		theform.Phone.focus();
		return false;
	}

}


function CheckIt(theform)
{
	if (theform.subtype.value != "cancel")
	{
		if (theform.company.value.length <= 0)
		{
			alert("Please enter your company name.");
			theform.company.focus();
			return false;
		}

		if (theform.firstname.value.length <= 0)
		{
			alert("Please enter your firstname.");
			theform.firstname.focus();
			return false;
		}
		
		if (theform.lastname.value.length <= 0)
		{
			alert("Please enter your lastname.");
			theform.lastname.focus();
			return false;
		}
		
		if (theform.address1.value.length <= 0)
		{
			alert("Please enter your address.");
			theform.address1.focus();
			return false;
		}
		
		if (theform.city.value.length <= 0)
		{
			alert("Please enter your city.");
			theform.city.focus();
			return false;
		}
		
		if (theform.postal.value.length <= 0)
		{
			alert("Please enter your postal code.");
			theform.postal.focus();
			return false;
		}
		
		if (theform.phone.value.length <= 9)
		{
			alert("Please enter your phone number including area code.");
			theform.phone.focus();
			return false;
		}
	
		if (theform.email.value.length <= 0)
		{
			alert("Please enter your email address.");
			theform.email.focus();
			return false;
		}
		
		if (theform.sales_rep[theform.sales_rep.selectedIndex].value == "")
		{
			alert("Please select a sales rep.");
			theform.sales_rep[0].focus();
			return false;
		}
		
	}
return true;
}

function CheckKeywordSearchForm(theform)
{
	if (theform.keyword.value.length <=0)
	{
		alert("Please enter a keyword.");
		theform.keyword.focus();
		return false;
	}

	theform.submit();
	//return true;
}

function CheckMailingListEmail(theform)
{
	if (theform.email.value.length <=0)
	{
		alert("Please enter your email address.");
		theform.email.focus();
		return false;
	}

	if (theform.email.value.indexOf("@") == -1)
	{
		alert("Please enter a valid email.")
		theform.email.focus();
		return false;
	}

	theform.submit();
	//return true;
}
	
function CheckPriceListSignupForm(theform)
{
	if (theform.company.value.length <=0)
	{
		alert("Please enter your company name.");
		theform.company.focus();
		return false;
	}

	if (theform.fname.value.length <=0)
	{
		alert("Please enter your first name.");
		theform.fname.focus();
		return false;
	}

	if (theform.lname.value.length <=0)
	{
		alert("Please enter your last name.");
		theform.lname.focus();
		return false;
	}

	if (theform.Email.value.length <=0)
	{
		alert("Please enter your email address.");
		theform.Email.focus();
		return false;
	}
	
	if (theform.phone.value.length <=5)
	{
		alert("Please enter your phone number.");
		theform.phone.focus();
		return false;
	}
	
	if (theform.postal.value.length <=4)
	{
		alert("Please enter your postal/zip code.");
		theform.postal.focus();
		return false;
	}
	
	theform.submit();
}

function CheckProductDetailsForm(theform)
{
	if (theform.qty.value.length <=0)
	{
		alert("Please enter a quantity.");
		theform.qty.focus();
		return false;
	}
	
	if (theform.qty.value == 0)
	{
		alert("Please enter a quantity greater than 0.");
		theform.qty.focus();
		return false;
	}
	
	if (!IsNumber(parseInt(theform.qty.value)))
	{
		alert("Please enter a numeric value for the quantity.");
		theform.qty.focus();
		return false;
	}
	
	theform.submit();
	//true;
}


function CheckVieCartForm(theform)
{
	if (CheckIt(theform))
		theform.submit();
}
