// JavaScript Document

function checkfield(loginform)
{
	ok=true
	if(loginform.name.value=="")
	{
		alert("Please Enter Your Name.")
		loginform.name.focus()
		ok=false
	}
	else if(loginform.address.value=="")
	{
		alert("Please Enter Address.")
		loginform.address.focus()
		ok=false
	}
		else if(loginform.country.value=="")
	{
		alert("Please Enter Country Name.")
		loginform.country.focus()
		ok=false
	}
	else if(loginform.phone.value=="")
	{
		alert("Please Enter Phone Number.")
		loginform.phone.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.checkcode.value == "")
	{
		alert("Please enter a value for the checkcode.");
		loginform.checkcode.focus();
		  ok=false
	}
	else if (loginform.checkcode.value != randomnumber)
	{
		alert("Check code does not match.");
		loginform.checkcode.value='';
		loginform.checkcode.focus();
		ok=false
	}
	 */
	
	else if(loginform.validation_code.value=="")
	{
		alert("Please Enter Validation Code.")
		loginform.validation_code.focus()
		ok=false
	}arrival_date
	else if(loginform.arrival_date.value=="")
	{
		alert("Please Enter Arrival Date.")
		loginform.arrival_date.focus()
		ok=false
	}
	else if(loginform.departure_date.value=="")
	{
		alert("Please Enter Departure Date.")
		loginform.departure_date.focus()
		ok=false
	}
	else if(loginform.no_of_rooms.value=="")
	{
		alert("Please Mention Number of Rooms.")
		loginform.no_of_rooms.focus()
		ok=false
	}
	else if (loginform.details_of_services.value == "")
	{
		alert("Please specify your requirements.");
		loginform.details_of_services.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;
}

