<!--


function validate()
{
var check1,check2,flag;
var url;
url=window.location.href;
document.query.url.value=url;

var cName = document.query.txtName.value;
var cCountry = document.query.S_country.value;
var cCity = document.query.required_car_city.value;
var cCarType = "";
var cCar ="";

var arDate=parseInt(document.query.arrival_date_day.value);
var arMonth=parseInt(document.query.arrival_date_month.value);
var arYear=parseInt(document.query.arrival_date_year.value);

var deDate=parseInt(document.query.departure_date_day.value);
var deMonth=parseInt(document.query.departure_date_month.value);
var deYear=parseInt(document.query.departure_date_year.value);

var cRequirements = document.query.txtQuery.value;



flag=true;


var mail=document.query.txtMail.value;

var invalidChar = " *|,\":<>/[]{}`\';()&$#%";


//getting values of car types radio buttons
for (i=0; i<document.query.type_of_Car.length; i++){
	if (document.query.type_of_Car[i].checked==true){
	cCarType = document.query.type_of_Car[i].value;
	document.query.hdcarType.value = cCarType;
	break;
	}
};


//getting values of car radio buttons
for (j=0; i<document.query.Car.length; j++){
	if (document.query.Car[j].checked==true){
	cCar = document.query.Car[j].value;
	document.query.hdwhichCar.value=cCar;
	break;
	}
};

//validation country field
if(cCountry=="")
{
	alert("Please enter your Country");
	flag=false;
	document.query.S_country.focus()
	return false;
}


//validation Car required field
if(cCity=="")
{
	alert("Please enter City where the Car required?");
	flag=false;
	document.query.required_car_city.focus()
	return false;
}
		
//date validation
	todayDate=new Date();
	thisday=todayDate.getDay();
		
	thismonth=todayDate.getMonth()+1;
	thisdate=todayDate.getDate();
	thisyear=todayDate.getFullYear();
	
	if(arYear<thisyear || deYear<arYear)
	{
		
		alert("Please enter Valid Year");
		flag=false;
		document.query.arrival_date_year.focus();
		return false;
									
	}
	else
	{
		if(arYear==thisyear)
		{
					
			if(arMonth<thismonth || deMonth<arMonth)
			{
				alert("Month Error");
				flag=false;
				document.query.arrival_date_month.focus();
				return false;
									
			}
			else
			{
			
				if(arMonth==thismonth || deMonth==arMonth)
				{
					if(arDate<=thisdate)
					{
						if(deDate<=arDate)
						{
							alert("Date error");
							flag=false;
							document.query.arrival_date_day.focus();
							return false;
						}
					}
								
		
				}
				else
				{
					flag=true;
				}
	
				flag=true;
			}	
		
			flag=true;
	}

}
		
		
// date validation ends



// mail validation
if(mail!="")
	{
		check1=mail.indexOf("@");
		check2=mail.indexOf(".");
		if(check1==-1 || check2==-1)
			{
				flag=false;
			}
		if((check1-check2)==1 || (check1-check2)==-1)
			{
				flag=false;
			}
		
	}

if(mail=="")
{
	flag=false;
}

if(flag==true)
	{
	
	document.query.submit();
	}
else
	{
	alert("Invalid Mail ID");
  	document.query.txtMail.select();
  	document.query.txtMail.focus();

	}
}




// end the hiding comment -->

