

function checkvalid_reg()
{
	
	    document.getElementById("Submit").disabled = true;
		document.frmMaster.name.focus();

		if(!check_validation("textfield", "name", "Please Enter First Name.") ||
			!check_validation("letter", "name", "Please Enter First Name In Valid Format.") ||
			!check_validation("textfield", "lname", "Please Enter Last Name.") ||
			!check_validation("letter", "lname", "Please Enter Last Name In Valid Format.") ||
			!check_validation("textfield", "email", "Please Enter Email.") ||
			!check_validation( "email", "email", "Please enter the email in valid format.") ||
			!check_validation("textfield", "vAddress", "Please Enter Address.") ||
			!check_validation("textfield", "vCity", "Please Enter the City.") ||
			!check_validation("letter", "vCity", "Please Enter City In Valid Format.") ||
			!check_validation("combobox", "iStateId", "State. For non-US inquiries please select the Non-US option.") ||
			!check_validation("combobox", "iCountryId", "Country.") ||
			!check_validation("textfield", "internationalNumber", "Please Enter Your Telephone.") ||
			!check_validation("phoneformate", "internationalNumber", "Please Enter Telephone in Valid Format.") ||
			!check_validation("combobox", "iReferredID", "Reference")) {
				
				document.getElementById('Submit').disabled = false;
				return false;
		}		

		//VALIDATION ACORDING TO THE COUNTRY SELECTION
		if(document.getElementById("iCountryId").value == "us"){
			//ZIP CODE
			if(!check_validation("textfield", "vZip", "Please Enter Zip Code.") ||				
				!check_validation("number", "vZip", "Please Enter Zip Code In Valid Format.") ||
				!check_validation("textfield", "internationalNumber", "Please Enter Your Telephone.") ||
				!check_validation("phoneformate", "internationalNumber", "Please Enter Telephone in Valid Format.") ||
				!check_validation("combobox", "iReferredID", "Reference")) {
				document.getElementById("Submit").disabled = false;
				return false;
			}
			if(document.getElementById("vZip").value.length != 5) {
				alert("The zip code is incomplete");
				document.getElementById("vZip").focus();
				document.getElementById("Submit").disabled = false;
				return false;
			}

		}	
	
	document.frmMaster.submit();
	
}//end checkvalid()

