
function checkfield(loginform)
{
	var test=document.getElementById("hiddenvalue").value;
	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
	}
	else if(loginform.validation.value=="")
	{
		alert("Please Enter The Validation Code.");
		loginform.validation.focus();
		ok=false;
	}
	else if(loginform.validation.value!=test)
	{
		alert("Please Enter The Correct Code.");
		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 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=hiddenvalue id=hiddenvalue value='+xx+' />');
			document.write('<img  src=image/'+zz[0]+'.gif /><img  src=image/'+zz[1]+'.gif /><img  src=image/'+zz[2]+'.gif /><img  src=image/'+zz[3]+'.gif /><img  src=image/'+zz[4]+'.gif />');
			
}
