function checkform(theform)
{
   if(theform.selCountry.value!=1)
   {
		theform.selState.value='';
		theControl="txtFirstName,txtLastName,txtEmail,txtCompanyInfo,txtAddress1,txtAddress2,selCountry,txtCity,txtState,txtPin,txtPhone,txtFax,txtUsername,txtPassword,txtRetypePassword";
		theMessage="First Name,Last Name,Email ID,Company Information,Address,Address,Country,City,State,Zip Code,Phone No,Fax,Username,Password,Retype Password";
		
		theNumeric=",,,,,,,,,,,,,,";
		theEmail=",,Y,,,,,,,,,,,,";
		theURL=",,,,,,,,,,,,,,";
		theConfirmPassword=",,,,,,,,,,,,,,Y";
		thebadstuff="7,7,,4,4,4,,4,4,1,1,1,6,1,";
		theinteger=",,,,,,,,,,,,,,";
		thepercent=",,,,,,,,,,,,,,";
		thesize=",,,,,,,,,,,,,,";
		thedecimal=",,,,,,,,,,,,,,";
		theimage=",,,,,,,,,,,,,,";
		theempty="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="txtFirstName,txtLastName,txtEmail,txtCompanyInfo,txtAddress1,txtAddress2,selCountry,txtCity,selState,txtPin,txtPhone,txtFax,txtUsername,txtPassword,txtRetypePassword";
		theMessage="First Name,Last Name,Email ID,Company Information,Address,Address,Country,City,State,Zip Code,Phone No,Fax,Username,Password,Retype Password";
		
		theNumeric=",,,,,,,,,,,,,,";
		theEmail=",,Y,,,,,,,,,,,,";
		theURL=",,,,,,,,,,,,,,";
		theConfirmPassword=",,,,,,,,,,,,,,Y";
		thebadstuff="7,7,,4,4,4,,4,4,1,1,1,6,1,";
		theinteger=",,,,,,,,,,,,,,";
		thepercent=",,,,,,,,,,,,,,";
		thesize=",,,,,,,,,,,,,,";
		thedecimal=",,,,,,,,,,,,,,";
		theimage=",,,,,,,,,,,,,,";
		theempty="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;
    }
}
