function checkform(theform)
{
   if(theform.selCountry.value!=1)
   {
		theform.selState.value='';
		theControl="txtCompanyName,txtCompanyURL,txtContactName,txtContactEmail,txtCompanyEmail,txtAddress1,txtAddress2,txtCity,selCountry,txtState,txtZipCode,txtPhone,txtFax,txtUsername,txtPassword,txtRetypePassword";
		theMessage="Company Name,Company URL,Contact Name,Contact Email,Company Email,Address,Address,City,Country,State,Zip Code,Phone No,Fax,Username,Password,Retype Password";
		
		theNumeric=",,,,,,,,,,,,,,,";
		theEmail=",,,Y,Y,,,,,,,,,,,";
		theURL=",Y,,,,,,,,,,,,,,";
		theConfirmPassword=",,,,,,,,,,,,,,,Y";
		thebadstuff="9,,7,,,4,4,4,,,,4,4,6,1,1";
		theinteger=",,,,,,,,,,,,,,,";
		thepercent=",,,,,,,,,,,,,,,";
		thesize=",,,,,,,,,,,,,,,";
		thedecimal=",,,,,,,,,,,,,,,";
		theimage=",,,,,,,,,,,,,,,";
		theempty="Y,,Y,Y,Y,Y,,Y,Y,Y,Y,Y,,Y,Y,Y";

		themin=",,,,,,,,,,,,,,,";
		themax=",,,,,,,,,,,,,,,";
		thecheckboxlength=",,,,,,,,,,,,,,,";
		thephoneno=",,,,,,,,,,,Y,,,,";

		if(!theValidator(theform,theControl,theMessage,theNumeric,theEmail,theURL,theConfirmPassword,thebadstuff,theinteger,thepercent,thesize,thedecimal,theimage,theempty,themin,themax,thecheckboxlength,thephoneno))
		  return false;
    }
    else
    {
		theform.txtState.value='';
		theControl="txtCompanyName,txtCompanyURL,txtContactName,txtContactEmail,txtCompanyEmail,txtAddress1,txtAddress2,txtCity,selCountry,selState,txtZipCode,txtPhone,txtFax,txtUsername,txtPassword,txtRetypePassword";
		theMessage="Company Name,Company URL,Contact Name,Contact Email,Company Email,Address,Address,City,Country,State,Zip Code,Phone No,Fax,Username,Password,Retype Password";
		
		theNumeric=",,,,,,,,,,,,,,,";
		theEmail=",,,Y,Y,,,,,,,,,,,";
		theURL=",Y,,,,,,,,,,,,,,";
		theConfirmPassword=",,,,,,,,,,,,,,,Y";
		thebadstuff="9,,7,,,4,4,4,,,,4,4,6,1,1";
		theinteger=",,,,,,,,,,,,,,,";
		thepercent=",,,,,,,,,,,,,,,";
		thesize=",,,,,,,,,,,,,,,";
		thedecimal=",,,,,,,,,,,,,,,";
		theimage=",,,,,,,,,,,,,,,";
		theempty="Y,,Y,Y,Y,Y,,Y,Y,Y,Y,Y,,Y,Y,Y";

		themin=",,,,,,,,,,,,,,,";
		themax=",,,,,,,,,,,,,,,";
		thecheckboxlength=",,,,,,,,,,,,,,,";
		thephoneno=",,,,,,,,,,,Y,,,,";

		if(!theValidator(theform,theControl,theMessage,theNumeric,theEmail,theURL,theConfirmPassword,thebadstuff,theinteger,thepercent,thesize,thedecimal,theimage,theempty,themin,themax,thecheckboxlength,thephoneno))
		  return false;
    }
}