				
				function formValidation()
				{					
					if(validateCity()) {
						if(validDate()) {							
							if(validatePassenger()) {								
								document.searchForm.action.value="flightsearch.htm";
							//	document.searchForm.submit();								
								return true;
							}
							else {
								return false;
							}
							return true;
						}
						else {
							return false;
						}
						return true;
					}
					else{
						return false;
					}
				}
				
				
				function ccformValidation()
				{					
					if(validateCity()){
						if(validDate()) {
							if(validatePassenger() ) {
								return true;
							}
							else {
								return false;
							}
							return true;
						}
						else {
							return false;
						}
						return true;
					}
					else{
						return false;
					}
				}



				function removeValues()
				{ 

				  document.getElementById("departDate").value="dd/mm/yyyy";
				  document.getElementById("returnDate").value="dd/mm/yyyy";
				  document.getElementById("departDate").focus();
				 }
				
				
				
				function disable()
				{		
					document.getElementById("returnDate").disabled=true;				
					//document.getElementById("returnDate").value="dd/mm/yyyy";
       				//For setting background colour of text Box to Light gray when disable
				//	document.getElementById("returnDate").style.backgroundColor="#D4D4D4";
					document.getElementById("returnDate").className = "eng_content_dis";
				}

				
				
				function enable()
				{		
					document.getElementById("returnDate").disabled=false;	
       				//document.getElementById("returnDate").value="dd/mm/yyyy";			
       				//For setting background colour of text Box to White again
				//	document.getElementById("returnDate").style.backgroundColor="white";
					document.getElementById("returnDate").className = "eng_content";
				}

				function validateCity()
				{ 
					if(document.all) {
						var src = document.getElementById("srcCity").value;
						var dest = document.getElementById("destCity").value;
					}
					else {
						var src = document.getElementById("srcCity").value;
						var dest = document.getElementById("destCity").value;
					}

					if(src == "from" || src == "" || src == null) {
						alert("Please select Source city");
						document.getElementById("srcCity").focus();
						return false;
					}
					
					if(dest == "to" || dest == "" || dest == null) {
						alert("Please select Destination city");
						document.getElementById("destCity").focus();
						return false;
					}
					
					if(src == dest) {
						alert("Source and Destination City should not be same");
						return false;
					}
					return true;
				}


				function validatePassenger() {
					var adults = document.getElementById("adults").value;
					var children = document.getElementById("children").value;
					var infants = document.getElementById("infants").value;
					var total = parseInt(adults)+parseInt(children)+parseInt(infants);
					
					if(adults < infants) {
						alert(" Number of Infants should not exceed Adults. ");
						return false;
					}
					if(total > 8) {
						alert("Number of Passengers should not exceed 8.");
						return false;
					}
					if(total == 0) {
						alert("Please select number of passengers travelling.");
						return false;
					}
					return true;
				}



			
			
			
			function validDate()
			{				
				
				var date = document.getElementById("departDate").value;
				if ( (date==null)||(date.length!=10) ||date=="dd/mm/yyyy") 
				{
					alert ("Please select valid Departure Date");
					document.getElementById("departDate").select();
					return false;
				}
				
				if (document.getElementById("departDate").value.indexOf("/")!=2)
				{
					alert ("Invalid Date Format (must be dd/mm/yyyy)");
					document.getElementById("departDate").select();
					return false;
				}
				else
				{
				  var date1 = document.getElementById("departDate").value;	
				  var subdate=date1.substr(3,6);
				  if (subdate.indexOf("/")!=2)
				   {
					alert ("Please enter Date with valid Date Format.");
					document.getElementById("departDate").select();
					return false;
					}
					else
					{
					 if (fromcheck())
					 {
				  return true;
					  }
				  else
					  {
					   return false;
				  }
					 }
				  }
				 
				
			}



			function fromcheck()
			{
			  var today = new Date();
			  today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
			  var tday= today.getDate();
			  var tmon=today.getMonth()+1;
			  var tyear=today.getFullYear();
			  var edate = document.getElementById("departDate").value;
			  var eday=edate.substring(0,2);
			  var emon=edate.substring(3,5);
			  var eyear=edate.substring(6,11);
			  if (eyear<tyear)
			  {
				  alert (" Departure Date should not be before current date ") ;
				  return false;
			  }  
			  else
			  if ( (eyear==tyear) && (emon<tmon) )
			  {
				 alert (" Departure Date should not be before current date ") ;
				  return false;
			  }  
			  else
			  if  ( (eyear==tyear)&&((emon==tmon) && (eday<tday)))
			  {
				  alert (" Departure Date should not be before current date ") ;
				  return false;
			  }  
			  else 
			  {
				  if(!document.getElementById("oneway").checked){
					if(toValidDate()){
					   return true;}
					   else{
					   return false;}
			   }
			   return true;
				 }
				  
			 }
			 
			 
			 
			function toValidDate() 
			{
				var date = document.getElementById("returnDate").value;
				
				if ( (date==null)||(date.length!=10)|| date=="dd/mm/yyyy") 
				{
					alert ("Please select valid Return Date ");
					document.getElementById("returnDate").select();
					return false;
				}
				
				if (document.searchForm.returnDate.value.indexOf("/")!=2)
				{
					alert ("Invalid Date Format (must be dd/mm/yyyy)");
					document.getElementById("returnDate").select();
					return false;
				}
				else
				{
				  var date1 = document.getElementById("returnDate").value;
				  var subdate=date1.substr(3,6);
				  if (subdate.indexOf("/")!=2)
				  {
					alert ("Please enter Date with valid Date Format.");
					document.getElementById("returnDate").select();
					return false;
				  }
					else
					{
						
					 if (tocheck())
					 {
					  return true;
					  }
					  else
					  {
					   return false;
					  }
						
					 }
				  }
				 
			}
			
			
			
			
			
			function tocheck()
			{
			  
			  var todaydate = new Date();
			  todaydate = new Date(todaydate.getFullYear(), todaydate.getMonth(), todaydate.getDate());
			  var todayday= todaydate.getDate();
			  var todaymon=todaydate.getMonth()+1;
			  var todayyear=todaydate.getFullYear();
			  var fromdate=	document.getElementById("departDate").value;
			  var fromday=fromdate.substring(0,2);
			  var frommon=fromdate.substring(3,5);
			  var fromyear=fromdate.substring(6,11);
			   var todate = document.getElementById("returnDate").value;
			  var today=todate.substring(0,2);
			  var tomon=todate.substring(3,5);
			  var toyear=todate.substring(6,11);
			  
			  var flen=fromdate.length;
			  var tlen=todate.length;  
			 if(flen>tlen)
			  {
			   alert("Can't Enter only one of From Date And To Date Fields ")
			   return false;
			  }
			  
			  else 
			  if (toyear<todayyear)
			  {
				  alert (" Return Date should not be before current date ") ;
				  return false;
			  }  
			  else
				  if ( (toyear==todayyear) && (tomon<todaymon) )
				{
				  alert (" Return Date should not be before current date ") ;
				  return false;
				  }  
			  else
			  if  ( (toyear==todayyear)&&((tomon==todaymon) && (today<todayday)))
				{
				 alert (" Return Date should not be before current date ") ;
				  return false;
				  }  
			   else 
			 
				if (fromyear>toyear)
			  {
				 alert ("Return Date should not be before Depature Date");
				  return false;
			  }  
			  else
				  if ( (fromyear==toyear) && (frommon>tomon) )
				{
				 alert ("Return Date should not be before Depature Date");
				  return false;
				  }  
			  else
			  
			   if  ( (fromyear==toyear)&&((frommon==tomon) && (fromday>today)))
				{
				  alert ("Return Date should not be before Depature Date");
				  return false;
				}  
				else
				{
				   return true;		
				}
			}
	

function wrt_opts(){
var city = "Bombay (Mumbai),Calcuta,Chennai,New Delhi,Agartala,Agatti-eyja,Agra,Ahmedabad,Aizawl,Akola,Allahabad,Amritsar,Aurangabad,Bagdogra,Bangalore,Baroda,Bavnagar,Belgaum,Bellary,Bhopal,Bhubaneswar,Bhuj,Bilaspur,Calicut,Car Nicobar,Chandigarh,Coimbatore,Cooch Behar,Daman,Dehra Dun,Dharamsala,Dibrugarh,Dimapur,Diu,Gauhati,Goa,Gorakhpur,Gwalior,Hyderabad,Imphal,Indore,Jabalpur,Jagdalpur,Jaipur,Jaisalmer,Jammu,Jamnagar,Jamshedpur,Jodhpur,Jorhat,Kailashahar,Kandla,Kanpoor,Keshod,Khajuraho,Kochin,Kolhapur,Kota,Kulu,Leh,Lilabari,Lucknow,Ludhiana,Madurai,Malda,Mangalore,Nagpur,Nanded,Nasik,Neyveli,Pantnagar,Patna,Poona,Porbandar,Port Blair,Raipur,Rajahmundry,Rajkot,Rajouri,Ranchi,Rewa,Rourkela,Satna,Shimla,Silchar,Sirinagar,Surat,Tezpur,Tezu,Thiruvananthapuram,Tiruchirapally,Tirupati,Udaipur,Varanasi,Vijayawada,Vizag"
var city_spl = city.split(",")
var i=0
for (i;i<=(city_spl.length-1);i++){
document.write("<option value='" + city_spl[i] + "'>" + city_spl[i])
}
}

