	
	
function reset1()
{
   document.frm_booking.name.value = "";
   document.frm_booking.city.value="";
   document.frm_booking.country.value="";
   document.frm_booking.mobile_no1.value="";
   document.frm_booking.mobile_no2.value="";
   document.frm_booking.email.value="";
   document.frm_booking.pname.value="";
   document.frm_booking.comment.value="";
   document.frm_booking.name.focus()
   return false;
     
}
	
function IsNumeric(sText)
{
	var ValidChars = "0123456789.#@*_-\/|$%:;`^<>[]{}=?)(";
	var IsNumber=true;
	var Char;
	
	for (i = 0; i < sText.length && IsNumber == true; i++) 
		{ 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) != -1) 
		{
		IsNumber = "false";
		//alert ("Please enter characters only.");						
		}
	}
	return IsNumber;   
}//character validation
	
function IsChar(sText)
{
	var ValidChars = "0123456789";
	var IsNumber=true;
	var Char;
	
	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
		{
			IsNumber = "false";
			//alert ("Please enter numeric only.");						
		}
	}
	return IsNumber;   
}//number validation
	
function validate()
{
	if(document.frm_booking.name.value=="")
		{
			alert("Please enter your Name")
			document.frm_booking.name.focus()
			return false;
		}
		if(document.frm_booking.name.value!="")
		{
			var mytext=document.frm_booking.name.value;
			var number=IsNumeric(mytext);
			if (number=="false")
			{
				alert ("Name field accept characters only.");
				document.frm_booking.name.value="";
				document.frm_booking.name.focus();
				return false;
			}//first name validation		
		}
		
		if(document.frm_booking.city.value=="")
		{
			alert("Please enter your City")
			document.frm_booking.city.focus()
			return false;
		}
		if(document.frm_booking.city.value!="")
		{
			var mytext=document.frm_booking.city.value;
			var number=IsNumeric(mytext);
			if (number=="false")
			{
				alert ("Name field accept characters only.");
				document.frm_booking.city.value="";
				document.frm_booking.city.focus();
				return false;
			}//first name validation		
		}
		
		if(document.frm_booking.mobile_no1.value=="")
		{
			alert("Please enter your Mobile number")
			document.frm_booking.mobile_no1.focus()
			return false;
		}
		if(document.frm_booking.mobile_no1.value!="")
		{
			var str3=document.frm_booking.mobile_no1.value
			for(i=0; i<str3.length; i++)
			{
				var ch=str3.substring(i, i+1)
				if (ch < "0" ||"9" < ch)
				{
					alert("Mobile number field accept numbers only.");
					document.frm_booking.mobile_no1.value="";
					document.frm_booking.mobile_no1.focus()
					return false;
				}
			}
		}
		
		if(document.frm_booking.mobile_no2.value=="")
		{
			alert("Please enter your Mobile number")
			document.frm_booking.mobile_no2.focus()
			return false;
		}
		if(document.frm_booking.mobile_no2.value!="")
		{
			var str3=document.frm_booking.mobile_no2.value
			for(i=0; i<str3.length; i++)
			{
				var ch=str3.substring(i, i+1)
				if (ch < "0" ||"9" < ch)
				{
					alert("Mobile number field accept numbers only.");
					document.frm_booking.mobile_no2.value="";
					document.frm_booking.mobile_no2.focus()
					return false;
				}
			}
		}
		
	
		//email
		if(document.frm_booking.email.value=="")
		{
			alert("Please enter Email ID");
			document.frm_booking.email.focus();
			return false;
		}
		if(document.frm_booking.email.value!="")
		{
			var string1 =/[-a-zA-Z0-9_\.]+@[-a-zA-Z0-9]+\.[-a-zA-Z0-9\.]+/;
			var eflag = document.frm_booking.email.value.match(string1);
			if(eflag!=document.frm_booking.email.value)
			{
				alert("Please enter a valid Email ID");
				document.frm_booking.email.value=""
				document.frm_booking.email.focus();
				document.frm_booking.email.select();
				return false;
			}
		}
		
       if(document.frm_booking.pname.value=="")
		{
			alert("Please enter Propety or Company Name")
			document.frm_booking.pname.focus()
			return false;
		}
		if(document.frm_booking.pname.value!="")
		{
			var mytext=document.frm_booking.pname.value;
			var number=IsNumeric(mytext);
			if (number=="false")
			{
				alert ("Name field accept characters only.");
				document.frm_booking.pname.value="";
				document.frm_booking.pname.focus();
				return false;
			}//first name validation		
		}		
		
document.frm_booking.action="Fsend.asp";		
}//end validation function

