// JavaScript Document
function checkfield(loginform)
{
	ok=true
	if(loginform.name.value=="")
	{
		alert("Please Enter Your Name.")
		loginform.name.focus()
		ok=false
	}
	else if(loginform.country.value=="")
	{
		alert("Please Enter Country Name.")
		loginform.country.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.month_of_travel.value == "")
	{
		alert("Please specify Preferred Month of Travel.");
		loginform.month_of_travel.focus();
		ok=false
	}
	else if (loginform.year_of_travel.value == "")
	{
		alert("Please specify Preferred Year of Travel.");
		loginform.year_of_travel.focus();
		ok=false
	}
	else if (loginform.duration_of_tour.value == "")
	{
		alert("Please specify Proposed Duration of Tour.");
		loginform.duration_of_tour.focus();
		ok=false
	}
	else if (loginform.persons_travelling.value == "")
	{
		alert("Please specify Number of Person Travelling.");
		loginform.persons_travelling.focus();
		ok=false
	}
	else if (loginform.budget_per_person_per_day.value == "")
	{
		alert("Please specify Budget per Person per Day.");
		loginform.budget_per_person_per_day.focus();
		ok=false
	}
	else if (loginform.tour_interest.value == "")
	{
		alert("Please specify Tours you are Interested in.");
		loginform.tour_interest.focus();
		ok=false
	}
	else if (loginform.details.value == "")
	{
		alert("Please specify your requirements.");
		loginform.details.focus();
		ok=false
	}
	else if (loginform.security_code.value == "")
	{
		alert("Please enter verification code.");
		loginform.security_code.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;
}
