function checkfield(applicationform)
{
	ok=true
	var test=document.getElementById("hiddenvalue").value;
	//var moblilenumber=document.getElementById("phone_no").value;
	if(applicationform.name.value=="")
	{
		alert("Please Enter Your Name .")
		applicationform.name.focus();
		ok=false
	}
	else if(applicationform.country.value=="")
	{
		alert("Please Enter Country ")
		applicationform.country.focus();
		ok=false
	}
	else if (applicationform.email.value == "")
	{
		alert("Please enter valid email .")
		applicationform.email.focus();
		ok=false
	}
	
	else if (!isEmailAddr(applicationform.email.value))
	{
		alert("Please enter a complete email address in the form: yourname@yourdomain.com")
		applicationform.email.focus();
		ok=false
	}
	else if(applicationform.mobile.value=="")
	{
		alert("Please Enter Valid Mobile No.")
		applicationform.mobile.focus();
		ok=false
	}
	
		else if(applicationform.city.value=="")
	{
		alert("Please Enter City . ")
		applicationform.city.focus();
		ok=false
	}
		
	else if (applicationform.date.value =="")
	{
		alert("Please Enter Date.  ")
		applicationform.date.focus();
		ok=false
	}
	
	else if(applicationform.pickup.value=="")
		{
		alert("Please Select Your Location ")
		applicationform.pickup.focus();
		ok=false
		}
		
		else if (applicationform.carpre.value == "")
	{
		alert("Please Select Car Preference.")
		applicationform.carpre.focus();
		ok=false
	}
	else if (applicationform.returnto.value == "")
	{
		alert("Please Select Return To.")
		applicationform.returnto.focus();
		ok=false
	}
	else if (applicationform.passenger.value == "")
	{
		alert("Please Enter No. of Passenger.")
		applicationform.passenger.focus();
		ok=false
	}
	else if (applicationform.description.value == "")
	{
		alert("You must have to Specify Description.")
		applicationform.description.focus();
		ok=false
	}
		else if (applicationform.validation.value=="")
	{
		alert("Please Enter The validation code.")
		applicationform.validation.focus();
		ok=false
	}
	else if (applicationform.validation.value!=test)
	{
		alert("Please Enter The validation code.")
		applicationform.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 ValidateNum(input,event){
			var keyCode = event.which ? event.which : event.keyCode;
			if(parseInt(keyCode)>=48 && parseInt(keyCode)<=57){
				return true;
			}
			return false;
		}


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]+'.png /><img  src=image/'+zz[1]+'.png /><img  src=image/'+zz[2]+'.png /><img  src=image/'+zz[3]+'.png /><img  src=image/'+zz[4]+'.png />');
			
}


