// JavaScript Document
function checkfield(loginform)
{
	ok=true
	 if(loginform.SName.value=="")
	{
		alert("Please Enter The Name.")
		loginform.SName.focus()
		ok=false
	}
    else if (loginform.Email.value == "")
	{
		alert("Please enter a value for the Email field.");
		loginform.Email.focus();
		ok=false
	}
	else if (!isEmailAddr(loginform.Email.value))
	{
		alert("Please enter a complete Email address in the form: yourname@yourdomain.com");
		loginform.Email.focus();
		ok=false
	}
	 else if(loginform.Phone.value=="")
	{
		alert("Please Enter The Phone.")
		loginform.Phone.focus()
		ok=false
	}

	   else if(loginform.DateofTravel.value=="")
	{
		alert("Please Select Date .")
		loginform.DateofTravel.focus()
		ok=false
	}
	  else if(loginform.MonthofTravel.value=="")
	{
		alert("Please Select Month .")
		loginform.MonthofTravel.focus()
		ok=false
	}  else if(loginform.YearofTravel.value=="")
	{
		alert("Please Select Year .")
		loginform.YearofTravel.focus()
		ok=false
	}
	   else if(loginform.NumberofAdult.value=="")
	{
		alert("Please Enter No of Adults .")
		loginform.NumberofAdult.focus()
		ok=false
	}
	  else if(loginform.NumberofChildren.value=="")
	{
		alert("Please Enter  No. of Children.")
		loginform.NumberofChildren.focus()
		ok=false
	}
	  else if(loginform.Town.value=="")
	{
		alert("Please Enter The Town.")
		loginform.Town.focus()
		ok=false
	}
	  
		else if (loginform.Description.value == "")
	{
		alert("Please specify your Requirement.");
		loginform.Description.focus();
		ok=false
	}
	return ok
}

function ValidateNum(input,event){
			var keyCode = event.which ? event.which : event.keyCode;
			if(parseInt(keyCode)>=48 && parseInt(keyCode)<=57){
				return true;
			}
			return false;
		}
function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
	var pindex = theStr.indexOf(".",index);
	if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}