	

function reset1()
{
   document.frm_reservation.name.value = "";
   document.frm_reservation.phone_no1.value="";
   document.frm_reservation.phone_no2.value="";
   document.frm_reservation.phone_no3.value="";
   document.frm_reservation.mobile_no1.value="";
   document.frm_reservation.mobile_no2.value="";
   document.frm_reservation.email.value="";
   document.frm_reservation.comment.value="";
   document.frm_reservation.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_reservation.name.value=="")
		{
			alert("Please enter your Name")
			document.frm_reservation.name.focus()
			return false;
		}
		if(document.frm_reservation.name.value!="")
		{
			var mytext=document.frm_reservation.name.value;
			var number=IsNumeric(mytext);
			if (number=="false")
			{
				alert ("Name field accept characters only.");
				document.frm_reservation.name.value="";
				document.frm_reservation.name.focus();
				return false;
			}//first name validation		
		}
		
		// phon validation
		if(document.frm_reservation.phone_no1.value=="")
		{
			alert("Please enter your Phone no.")
			document.frm_reservation.phone_no1.focus()
			return false;
		}
		// Phone country code
		if(document.frm_reservation.phone_no1.value!="")
		{
			var str1=document.frm_reservation.phone_no1.value
			for(i=0; i<str1.length; i++)
			{
				var ch=str1.substring(i, i+1)
				if (ch < "0" ||"9" < ch)
				{
					alert("\nCountry code field accept numbers only.");
					document.frm_reservation.phone_no1.value="";
					document.frm_reservation.phone_no1.focus()
					return false;
				}
			}
		}

		// Phone area code
		if(document.frm_reservation.phone_no2.value=="")
		{
			alert("Please enter your Phone no.")
			document.frm_reservation.phone_no2.focus()
			return false;
		}
		if(document.frm_reservation.phone_no2.value!="")
		{
			var str2=document.frm_reservation.phone_no2.value
			for(i=0; i<str2.length; i++)
			{
				var ch=str2.substring(i, i+1)
				if (ch < "0" ||"9" < ch)
				{
					alert("\nArea code field accept numbers only.");
					document.frm_reservation.phone_no2.value="";
					document.frm_reservation.phone_no2.focus()
					return false;
				}
			}
		}

		// Phone number code
		if(document.frm_reservation.phone_no3.value=="")
		{
			alert("Please enter your Phone no. ")
			document.frm_reservation.phone_no3.focus()
			return false;
		}
		// tell	
		if(document.frm_reservation.phone_no3.value!="")
		{
			var str3=document.frm_reservation.phone_no3.value
			for(i=0; i<str3.length; i++)
			{
				var ch=str3.substring(i, i+1)
				if (ch < "0" ||"9" < ch)
				{
					alert("Phone number field accept numbers only.");
					document.frm_reservation.phone_no3.value="";
					document.frm_reservation.phone_no3.focus()
					return false;
				}
			}
		}
		if(document.frm_reservation.mobile_no1.value!="")
		{
			var str3=document.frm_reservation.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_reservation.mobile_no1.value="";
					document.frm_reservation.mobile_no1.focus()
					return false;
				}
			}
		}
		if(document.frm_reservation.mobile_no2.value!="")
		{
			var str3=document.frm_reservation.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_reservation.mobile_no2.value="";
					document.frm_reservation.mobile_no2.focus()
					return false;
				}
			}
		}
		
	
		//email
			
		if(document.frm_reservation.email.value=="")
		{
			alert("Please enter Email ID");
			document.frm_reservation.email.focus();
			return false;
		}
		if(document.frm_reservation.email.value!="")
		{
			var string1 =/[-a-zA-Z0-9_\.]+@[-a-zA-Z0-9]+\.[-a-zA-Z0-9\.]+/;
			var eflag = document.frm_reservation.email.value.match(string1);
			if(eflag!=document.frm_reservation.email.value)
			{
				alert("Please enter a valid Email ID");
				document.frm_reservation.email.value=""
				document.frm_reservation.email.focus();
				document.frm_reservation.email.select();
				return false;
			}
		}

	document.frm_reservation.action="Fsend.asp"

}//end validation function

