function Form1_Validator(theForm)
{
	// check to see if the field is blank
	if (theForm.txtname.value == "")
	{
	alert("Please Enter your Name.");
	theForm.txtname.focus();
	return (false);
	}
	if (theForm.txtfirmname1.value == "")
	{
	alert("Please Enter your Firm Name.");
	theForm.txtfirmname1.focus();
	return (false);
	}
	if (theForm.txtaddr1.value == "")
	{
	alert("Please Enter valid Address.");
	theForm.txtaddr1.focus();
	return (false);
	}
	if (theForm.txtcity.value == "")
	{
	alert("Please Enter valid City or Town.");
	theForm.txtcity.focus();
	return (false);
	}
	if (theForm.txtzip.value == "")
	{
	alert("Please Enter valid Postcode.");
	theForm.txtzip.focus();
	return (false);
	}
	var zip = theForm.txtzip.value;
	if(zip != null)
	{
			var zipPat = /^(\d{1,5})$/;
            var matchArray = zip.match(zipPat); // is the format ok?
            if (matchArray == null) {
            alert("Please Enter valid Postcode.");
			theForm.txtzip.focus();
			return (false);
			}
    }
	if (theForm.txtstate.value == "")
	{
	alert("Please Enter valid State.");
	theForm.txtstate.focus();
	return (false);
	}
	//alert("heForm.ord1.value =="+theForm.ord1.value);
	if(theForm.ord1.value == "" && theForm.ord2.value == "" && theForm.ord3.value == "" && theForm.ord4.value == "" && theForm.ord5.value == "" && theForm.ord6.value == "" && theForm.ord7.value == "" && theForm.ord8.value == "" && theForm.ord9.value == "" && theForm.ord10.value == "" && theForm.ord11.value == "" && theForm.ord12.value == "" && theForm.ord13.value == "" && theForm.ord14.value == "" && theForm.ord15.value == "" && theForm.ord16.value == "" && theForm.ord17.value == "" && theForm.ord18.value == "")	
	{
		alert("Please select a Literature for the Order");
		return false;
	}
	else
	{
		return;
	}
}
