// JavaScript Document
function checkfield(loginform)
{
	ok=true
	var xx=document.getElementById("validatecode").value;
	 if(loginform.pickup.value=="")
	{
		alert("Select the Pick Up Location.")
		loginform.pickup.focus()
		ok=false
	}
		else if(loginform.carpre.value=="")
	{
		alert("Select the preference Car/Coach.")
		loginform.carpre.focus()
		ok=false
	}
		else if(loginform.start_date.value=="")
	{
		alert("Please Enter Start Date of Tour.")
		loginform.start_date.focus()
		ok=false
	}
		else if(loginform.returnto.value=="")
	{
		alert("Select The return Location.")
		loginform.returnto.focus()
		ok=false
	}
		 else if(loginform.adults.value=="")
	{
		alert("Please Enter The No of Adults.")
		loginform.adults.focus()
		ok=false
	}
	   else if(loginform.name.value=="")
	{
		alert("Please Enter The Name.")
		loginform.name.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.value=="")
	{
		alert("Please Enter The Mobile.")
		loginform.mobile.focus()
		ok=false
	}
	else if(loginform.end_date.value=="")
	{
		alert("Please Enter The End Date of Tour.")
		loginform.end_date.focus()
		ok=false
	}
    else if(loginform.city.value=="")
	{
		alert("Please Enter CITY .")
		loginform.city.focus()
		ok=false
	}
	else if(loginform.childs.value=="")
	{
		alert("Please Enter Childs .")
		loginform.childs.focus()
		ok=false
	}
	  else if(loginform.country.value=="")
	{
		alert("Please Enter Country.")
		loginform.country.focus()
		ok=false
	} 
	else if (loginform.Urneed.value == "")
	{
		alert("Please specify your Need.");
		loginform.Urneed.focus();
		ok=false
	}
		else if(loginform.validation.value=="")
	{
		alert("Please Enter The Validation code.")
		loginform.validation.focus()
		ok=false
	}
	else if(loginform.validation.value!=xx)
	{
		alert("Please Enter The Validation code as shown in the Left.")
		loginform.validation.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 check(loginform)
{
	ok=true
	var xx=document.getElementById("validatecode").value;
	  if(loginform.name.value=="")
	{
		alert("Please Enter The Name.")
		loginform.name.focus()
		ok=false
	}
	
		else if(loginform.carpre.value=="")
	{
		alert("Select the preference Car/Coach.")
		loginform.carpre.focus()
		ok=false
	}
		else if(loginform.start_date.value=="")
	{
		alert("Please Enter Start Date of Tour.")
		loginform.start_date.focus()
		ok=false
	}
		else if(loginform.returnto.value=="")
	{
		alert("Select The return Location.")
		loginform.returnto.focus()
		ok=false
	}
		 else if(loginform.adults.value=="")
	{
		alert("Please Enter The No of Adults.")
		loginform.adults.focus()
		ok=false
	}
	 else if(loginform.country.value=="")
	{
		alert("Please Enter Country.")
		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.mobile.value=="")
	{
		alert("Please Enter The Mobile.")
		loginform.mobile.focus()
		ok=false
	}
	else if(loginform.end_date.value=="")
	{
		alert("Please Enter The End Date of Tour.")
		loginform.end_date.focus()
		ok=false
	}
    else if(loginform.city.value=="")
	{
		alert("Please Enter CITY .")
		loginform.city.focus()
		ok=false
	}
	else if(loginform.childs.value=="")
	{
		alert("Please Enter Childs .")
		loginform.childs.focus()
		ok=false
	}
	else if(loginform.tour_package.value=="")
	{
		alert("Please Enter Tour Package .")
		loginform.tour_package.focus()
		ok=false
	}  
	else if (loginform.Urneed.value == "")
	{
		alert("Please specify your Need.");
		loginform.Urneed.focus();
		ok=false
	}
		else if(loginform.validation.value=="")
	{
		alert("Please Enter The Validation code.")
		loginform.validation.focus()
		ok=false
	}
	else if(loginform.validation.value!=xx)
	{
		alert("Please Enter The Validation code as shown in the Left.")
		loginform.validation.focus()
		ok=false
	}
	return ok
}
function get_random()
{

    var xx=null;
	var yy='xzc';
	
	xx=Math.floor(Math.random()*9);
	return xx;
	
}


function lockcode()
{
	var zz=new Array();
			
			 zz[0]=get_random();
			 zz[1]=get_random();
			 zz[2]=get_random();
			 zz[3]=get_random();
			  zz[4]=get_random();
			var xx=""+zz[0]+zz[1]+zz[2]+zz[3]+zz[4];
			document.write('<input type=hidden  name=validatecode id=validatecode value='+xx+' />');
			document.write('<img  width="20" height="20" src=images/'+zz[0]+'.png /><img   width="20" height="20" src=images/'+zz[1]+'.png /><img   width="20" height="20"  src=images/'+zz[2]+'.png /><img  width="20" height="20" src=images/'+zz[3]+'.png /><img  width="20" height="20"  src=images/'+zz[4]+'.png />');
			}
