function checkfield(loginform)
{
	var date1obj = document.getElementById('doa');
	var date2obj = document.getElementById('dod');
	var fromDate = date1obj.value;
	var toDate = date2obj.value;
	var validate=document.loginform.validation.value;
	var test=validate.toUpperCase();
	ok=true
   	var chek=document.getElementById("validatecode").value;
	if(loginform.fname.value=="")
	{
		alert("Please Enter Your First Name.")
		loginform.fname.focus()
		ok=false
	}
		else if(loginform.city.value=="")
	{
		alert("Please Enter Your City.")
		loginform.city.focus()
		ok=false
	}
	else if(loginform.country.value=="")
	{
		alert("Please Select Country Name.")
		loginform.country.focus()
		ok=false
	}
		
	else if(loginform.mobile.value=="")
	{
		alert("Please Enter Your Mobile No.")
		loginform.mobile.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.doa.value=="")
	{
		alert("Please Select Your Arrival Date.")
		loginform.doa.focus()
		ok=false
	}
	else if(loginform.dod.value=="")
	{
		alert("Please Select Your Departure Date.")
		loginform.dod.focus()
		ok=false
	}
	 else if (Date.parse(fromDate) > Date.parse(toDate)  || Date.parse(fromDate)== Date.parse(toDate))
    {
		alert("Invalid Date Range!")
		date2obj.value = "";
		date2obj.focus();
		return false; 
		}
    else if(loginform.adults.value=="")
	{
		alert("Please Enter No. of Adults.")
		loginform.adults.focus()
		ok=false
	}
	else if(loginform.child.value=="")
	{
		alert("Please Enter No. of Children.")
		loginform.child.focus()
		ok=false
	}
	else if(loginform.description.value=="")
	{
		alert("Please Specify the description.")
		loginform.description.focus()
		ok=false
	}
	else if(loginform.validation.value=="")
	{
		alert("Please Enter The Validation code.")
		loginform.validation.focus()
		ok=false
	}
	
	else if(test!=chek)
	{
		alert("Please Enter The Validation code for the proper mail functioning.")
		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='xyz';
	xx=Math.floor(Math.random()*9);
	return xx;
}



function lockcode()
{
var number=new Array();
number[0]='WORK';
number[1]='4HM8';
number[2]='56H8';
number[3]='EAPN';
number[4]='JUMP';
number[5]='NFAS';
number[6]='PJBT';
number[7]='SH8E';
number[8]='ULKT';	

            var xx=get_random();
			document.write('<input type=hidden id=validatecode name=validatecode value='+number[xx]+'>');
			document.write('<img border=0 src=images/'+number[xx]+'.gif />');
			}



/////////////////////////////////////////////////////////////////////////

function openNewWin()
{
window.open('distance.html','Rajasthan_Cities_Distance_Charts','width=650,height=425,scrollbars=no');
}
