function validateform(theform)
{

if(theform.name.value=="" || theform.name.value==" ")
{
	alert("Please enter your name.");
	theform.name.select();
	theform.name.focus();
	return false;
}
else
{
	for(var i=0;i<theform.name.value.length;i++)
	{
		 if(theform.name.value.charAt(i)<'A' ||  theform.name.value.charAt(i)>'Z')
		{
			 if(theform.name.value.charAt(i)<'a' ||  theform.name.value.charAt(i)>'z')
			{
				 if(!((theform.name.value.charAt(i)=='.') || (theform.name.value.charAt(i)==' ')))
				 {
					  alert("Only alphabets, a space and a . are allowed in the name field.");
					  theform.name.select();
					  theform.name.focus();
					  return false;
				 }
			}
		}
	}
}

if(theform.address.value=="")
{
 alert("Please enter your address.");
 theform.address.select();
 theform.address.focus();
 return false;
}

if(theform.phone.value == "" && theform.email.value=="")
{
 alert("Either the phone number or the email-id is compulsory.");
 theform.phone.select();
 theform.phone.focus();
 return false;
}

if (theform.phone.value!="")
{
 a = theform.phone.value;
 var i=0;
 for(i=0;i<a.length;i++)
 {
  if(a.charAt(i) < '0' || a.charAt(i) > '9') 
  {
  if(!(a.charAt(i) == ' ' || a.charAt(i) == '(' || a.charAt(i)==')' || a.charAt(i)==',' || a.charAt(i)=='/' || a.charAt(i)=='-' || a.charAt(i)=='+' || a.charAt(i)=='[' || a.charAt(i)==']')) 
    {
     alert("Characters and Special symbols are not allowed in the Phone field.");
     theform.phone.select();
     theform.phone.focus();
     return false;
  }
   }
 }
}

if (theform.email.value!="")
{
 if (theform.email.value.indexOf(".")==-1 || theform.email.value.indexOf("@")==-1)
  {
  alert("Please enter a valid email address.");
  theform.email.focus();
  theform.email.select();
  return false;
  }
}
if (theform.hotel.value=="")
{
alert("Please choose hotel name.");
theform.hotel.focus();
return false;
}

if (theform.comments.value=="")
{
alert("Please enter your comments/suggestions.");
theform.comments.select();
theform.comments.focus();
return false;
}
return true;
}

