// JavaScript Document by Javed for Jaideep Travel House



function checkfield(loginform)

{

	ok=true

	if(loginform.clintname.value=="")

	{

		alert("Please Enter Your Name.")

		loginform.clintname.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.mobile_no.value=="")

	{

		alert("Please Enter Phone Number.")

		loginform.mobile_no.focus()

		ok=false

	}

	

	

	else if(loginform.checkinDate.value=="")

	{

		alert("Please Enter Check in Date.")

		loginform.checkinDate.focus()

		ok=false

	}

	

	else if(loginform.checkoutDate.value=="")

	{

		alert("Please Enter Check out Date.")

		loginform.checkoutDate.focus()

		ok=false

	}

	

	

	else if(loginform.no_of_room.value=="")

	{

		alert("Please Select Number of Room.")

		loginform.no_of_room.focus()

		ok=false

	}

	

	

	return ok

}

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;

}

		function ValidateNum(input,event){

		var keyCode = event.which ? event.which : event.keyCode;

			if(parseInt(keyCode)>=48 && parseInt(keyCode)<=57){

				return true;

			}

			return false;

}


