function isNumberKey(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57))
	return false;
			
	return true;
}
function isEntryy(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode >= 0 && charCode <= 127 )
	{
	 	alert("Manual Entry not allowed Please use Calendar ");
        return false;
	}	
         return true;
}
function echeck(str)
{
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	var errorMsg = "";
	if (str.indexOf(at)==-1){
		return false;
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		return false;
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		return false;
	}
	if (str.indexOf(at,(lat+1))!=-1){
		return false;
	}
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		return false;
	}
	if (str.indexOf(dot,(lat+2))==-1){
		return false;
	}
	if (str.indexOf(" ")!=-1){
		return false;
	}
	return true;
}
function QueryformCheck()
{ 
	var errorMsg = "";
	if (document.Queryform.txtQueryType.value == "")
	{
		errorMsg += "\n\tQuery For \t- Enter Query";
	}
	if (document.Queryform.txtCANumber.value == "")
	{
		errorMsg += "\n\tCA Number \t- Enter CA Number";
	}
	if (document.Queryform.txtName.value == "")
	{
		errorMsg += "\n\tName \t\t- Enter Name";
	}
	if (document.Queryform.txtAddress.value == "")
	{
		errorMsg += "\n\tAddress \t\t- Enter Address";
	}
	if (document.Queryform.txtCity.value == "")
	{
		errorMsg += "\n\tCity \t- Enter City";
	}
	if (document.Queryform.txtPinCode.value == "")
	{
		errorMsg += "\n\tPin Code \t\t- Enter Pin Code";
	}
	if (document.Queryform.txtContactNo.value == "")
	{
		errorMsg += "\n\tContact No \t- Enter Contact No";
	}
	if (document.Queryform.txtMobileNo.value == "")
	{
		errorMsg += "\n\tMobile No \t- Enter Mobile No";
	}
	if (document.Queryform.txtEmail.value == "")
	{
		errorMsg += "\n\tEmail \t\t- Enter Email";
	}
	if (echeck(document.Queryform.txtEmail.value)==false){
		errorMsg += "\n\tEmail ID \t- Enter Valid E-mail ID";
	}
	if (document.Queryform.txtquery.value == "")
	{
		errorMsg += "\n\tQuery \t\t- Enter Query";
	}
	if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function BookNowForm()
{ 
	var errorMsg = "";
	if (document.booking_form.txtCity.value == "")
	{
		errorMsg += "\n\tCity \t\t\t- Select City";
	}
	if (document.booking_form.txtname.value == "")
	{
		errorMsg += "\n\tName \t\t\t- Enter Name";
	}
	if (document.booking_form.txtaddress.value == "")
	{
		errorMsg += "\n\tAddress \t\t\t- Enter Address";
	}
	if (document.booking_form.txtPincode.value == "")
	{
		errorMsg += "\n\tPin Code \t\t\t- Enter Pin Code";
	}
	if (document.booking_form.txtContact.value == "" && document.booking_form.txtMobile.value == "")
	{
		errorMsg += "\n\tContact \t\t\t- Enter Either LandlineNo. \t\t\t\t\t  or Moblieno.";
	}
	if (document.booking_form.txtEmail.value == "")
	{
		if (document.booking_form.txtEmail.value == "")
		{
			errorMsg += "\n\tEmail \t\t\t- Enter E-mail ID";
		}
	}
	if (document.booking_form.txtEmail.value != "")
	{
		if (echeck(document.booking_form.txtEmail.value)==false)
		errorMsg += "\n\tEmail ID \t\t\t- Enter Valid E-mail ID";
	}
	
	
	if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function Cityform()
{ 
	var errorMsg = "";
	if (document.newcty_form.txtName.value == "")
	{
		errorMsg += "\n\tName \t\t\t- Enter Name";
	}
	if (document.newcty_form.txtCity.value == "")
	{
		errorMsg += "\n\tCity \t\t\t\t- Enter City";
	}
	if (document.newcty_form.txtState.value == "")
	{
		errorMsg += "\n\tState \t\t\t- Enter State";
	}
	if (document.newcty_form.txtPincode.value == "")
	{
		errorMsg += "\n\tPin Code \t\t\t- Enter Pin Code";
	}
	if (document.newcty_form.txtContact.value == "")
	{
		errorMsg += "\n\tContact \t\t\t- Enter Contact no.";
	}
	if (document.newcty_form.txtAddress.value == "")
	{
		errorMsg += "\n\tAddress \t\t\t- Enter Address";
	}
	if (document.newcty_form.txtEmail.value != "")
	{
		if (echeck(document.newcty_form.txtEmail.value)==false)
		errorMsg += "\n\tEmail ID \t\t\t- Enter Valid E-mail ID";
	}
	
	
	if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}


