
			var serverDate = "";
			function createHiddenfield_flight(curr_date)
			{
				//alert(curr_date)
				var field0 = document.createElement("input");
				field0.setAttribute("type","hidden");
				field0.setAttribute("value","");
				field0.setAttribute("name","prefAirlineSelected");
				field0.setAttribute("id","prefAirlineSelected");
				document.getElementById("flightsPage").appendChild(field0);
				
				var field1 = document.createElement("input");
				field1.setAttribute("type","hidden");
				field1.setAttribute("value","");
				field1.setAttribute("name","checkin");
				field1.setAttribute("id","checkin");
				document.getElementById("flightsPage").appendChild(field1);
				
				var field2 = document.createElement("input");
				field2.setAttribute("type","hidden");
				field2.setAttribute("value","");
				field2.setAttribute("name","checkout");
				field2.setAttribute("id","checkout");
				document.getElementById("flightsPage").appendChild(field2);
				
				var field3 = document.createElement("input");
				field3.setAttribute("type","hidden");
				field3.setAttribute("value","false");
				field3.setAttribute("name","e_ticket");
				field3.setAttribute("id","e_ticket");
				document.getElementById("flightsPage").appendChild(field3);
				
				var field4 = document.createElement("input");
				field4.setAttribute("type","hidden");
				field4.setAttribute("value","1001");
				field4.setAttribute("name","partnerid");
				field4.setAttribute("id","partnerid");
				document.getElementById("flightsPage").appendChild(field4);
				
				var field5 = document.createElement("input");
				field5.setAttribute("type","hidden");
				field5.setAttribute("value","true");
				field5.setAttribute("name","residenceIndia");
				field5.setAttribute("id","residenceIndia");
				document.getElementById("flightsPage").appendChild(field5);
				
				
				
				var field7 = document.createElement("input");
				field7.setAttribute("type","hidden");
				field7.setAttribute("value","false");
				field7.setAttribute("name","e_ticket_intl");
				field7.setAttribute("id","e_ticket_intl");
				document.getElementById("flightsPage").appendChild(field7);
				
				var field6 = document.createElement("input");
				field6.setAttribute("type","hidden");
				field6.setAttribute("value",curr_date);
				field6.setAttribute("name","currentdate_flight");
				field6.setAttribute("id","currentdate_flight");
				document.getElementById("flightsPage").appendChild(field6);
				
				
			
			}
			
			function getUserHiddenParam_filght(userdelparam)
			{
				if(userdelparam != "")
				{
					var UserParamSplit = userdelparam.split("<comma>");
					//alert(UserParamSplit);
					var field8 = document.createElement("input");
					field8.setAttribute("type","hidden");
					field8.setAttribute("value",UserParamSplit[0]);
					field8.setAttribute("name","prtnr_user_id");
					field8.setAttribute("id","prtnr_user_id");
					document.getElementById("flightsPage").appendChild(field8);
					document.getElementById("prtnr_user_id").value = document.getElementById("prtnr_user_id").value;
					
					var field9 = document.createElement("input");
					field9.setAttribute("type","hidden");
					field9.setAttribute("value",UserParamSplit[1]);
					field9.setAttribute("name","fname");
					field9.setAttribute("id","fname");
					document.getElementById("flightsPage").appendChild(field9);
					document.getElementById("fname").value = document.getElementById("fname").value;
					
					var field10 = document.createElement("input");
					field10.setAttribute("type","hidden");
					field10.setAttribute("value",UserParamSplit[2]);
					field10.setAttribute("name","lname");
					field10.setAttribute("id","lname");
					document.getElementById("flightsPage").appendChild(field10);
					document.getElementById("lname").value = document.getElementById("lname").value;
					
					var field11 = document.createElement("input");
					field11.setAttribute("type","hidden");
					field11.setAttribute("value",UserParamSplit[3]);
					field11.setAttribute("name","email");
					field11.setAttribute("id","email");
					document.getElementById("flightsPage").appendChild(field11);
					document.getElementById("email").value = document.getElementById("email").value;
					
					var field12 = document.createElement("input");
					field12.setAttribute("type","hidden");
					field12.setAttribute("value",UserParamSplit[4]);
					field12.setAttribute("name","add");
					field12.setAttribute("id","add");
					document.getElementById("flightsPage").appendChild(field12);
					document.getElementById("add").value = document.getElementById("add").value;
					
					var field13 = document.createElement("input");
					field13.setAttribute("type","hidden");
					field13.setAttribute("value",UserParamSplit[5]);
					field13.setAttribute("name","pin");
					field13.setAttribute("id","pin");
					document.getElementById("flightsPage").appendChild(field13);
					document.getElementById("pin").value = document.getElementById("pin").value;
					
					var field14 = document.createElement("input");
					field14.setAttribute("type","hidden");
					field14.setAttribute("value",UserParamSplit[6]);
					field14.setAttribute("name","city");
					field14.setAttribute("id","city");
					document.getElementById("flightsPage").appendChild(field14);
					document.getElementById("city").value = document.getElementById("city").value;
					
					var field15 = document.createElement("input");
					field15.setAttribute("type","hidden");
					field15.setAttribute("value",UserParamSplit[7]);
					field15.setAttribute("name","state");
					field15.setAttribute("id","state");
					document.getElementById("flightsPage").appendChild(field15);
					document.getElementById("state").value = document.getElementById("state").value;
					
					var field16 = document.createElement("input");
					field16.setAttribute("type","hidden");
					field16.setAttribute("value",UserParamSplit[8]);
					field16.setAttribute("name","phone");
					field16.setAttribute("id","phone");
					document.getElementById("flightsPage").appendChild(field16);
					document.getElementById("phone").value = document.getElementById("phone").value;
					
					var field17 = document.createElement("input");
					field17.setAttribute("type","hidden");
					field17.setAttribute("value",UserParamSplit[9]);
					field17.setAttribute("name","mobile");
					field17.setAttribute("id","mobile");
					document.getElementById("flightsPage").appendChild(field17);
					document.getElementById("mobile").value = document.getElementById("mobile").value;
					
					var field18 = document.createElement("input");
					field18.setAttribute("type","hidden");
					field18.setAttribute("value",UserParamSplit[10]);
					field18.setAttribute("name","username");
					field18.setAttribute("id","username");
					document.getElementById("flightsPage").appendChild(field18);
					document.getElementById("username").value = document.getElementById("username").value;
				}
			}
			
			function Process()
			{
				var f=document.flightsPage;
				
				var frm = document.getElementById("flightsPage");
				var len = frm.length;
				for(x=0;x<len;x++)
				{
					if(frm[x].type=="hidden")
					{		
						if(frm[x].name == "e_ticket")
						{	
							
							alert("12name = "+frm[x].name+"\n value ="+frm[x].value)
						}
						if(frm[x].name == "currentdate")
						{	
							//frm[x].name.value = 
							serverDate= frm[x].value;//f.currentdate.value;
							//alert(serverDate)
							alert("name = "+frm[x].name+"\n value ="+frm[x].value)
						}
					}
				}
			}
			
			function tabchange(arg)
			{
				if(arg == "Dom_flt")
					{
					
					document.getElementById("InternationalFlight").style.display="none";
					document.getElementById("DomesticFlight").style.display="block";
					checkCookieInternationalFlight();
					hideReturn();
					}
				else{
					document.getElementById("DomesticFlight").style.display="none";
					document.getElementById("InternationalFlight").style.display="block";
					checkCookieDomesticFlight();
					hideReturn();
				}
			}
			
			
			
			function dateStatusHandler_Flight_dom(date, y, m, d) 
			{
			    var dt = new Date();
			    
				var time = date.getTime();
				var currtime = dt.getTime() - Date.DAY ;
				if (time >= currtime)
					return false;
				else
					return true;
			    // return true above if you want to disable other dates
			}
			
			function dateStatusHandler_Flight_Int(date, y, m, d) 
			{
		   	 	var dt = new Date();
		    	var dt1 = new Date(dt.getTime()+((1000*60*60*24)*361));
				var time = date.getTime();
				var currtime = dt.getTime()  ;
				var currtime1 = dt1.getTime() - Date.DAY ;
				//if (time >= currtime)
				if (time >= currtime && time <= currtime1)
					return false;
				else
					return true;
		    	// return true above if you want to disable other dates
			}
			
			function catcalcFlight_dom(cal) 
		   	{
				var date = cal.date;
				var time = date.getTime()
				// use the _other_ field
				var field = document.getElementById("return_date");
				if (field == cal.params.inputField) {
					field = document.getElementById("depart_date");
					//time += (Date.DAY + 1); // substract one day
				} else {
					time += Date.DAY; // add one week
				var date2 = new Date(time);
					field.value = date2.print("%d-%b-%Y");
				}										        
			}
		   	
		   	function catcalcFlight_intl(cal) 
		   	{
				var date = cal.date;
				var time = date.getTime()
				// use the _other_ field
				var field = document.getElementById("return_date_intl");
				if (field == cal.params.inputField) {
					field = document.getElementById("depart_date_intl");
					time += (Date.DAY + 1); // substract one day
				} else {
					time += Date.WEEK ; // add one Week 
				var date2 = new Date(time);
					field.value = date2.print("%d-%b-%Y");
				}
			}		
			
			function showReturn()
			{
			
				 /*var tb_return = document.getElementById("tb_return");
                                tb_return.style.visibility="";
                                tb_return.style.display="";*/

                                var dom_visible= document.getElementById("DomesticFlight").style.display;
                                var int_visible = document.getElementById("InternationalFlight").style.display;
                                if(dom_visible == "block")
                                {
                                        /*var tb_return = document.getElementById("tb_return");
                                        tb_return.style.visibility="";
                                        document.getElementById("two_way").checked=true;
                                        tb_return.style.display="";*/
                                        var tb_return = document.getElementById("tb_return");
                                        tb_return.style.visibility="";
                    if(document.getElementById("round_trip").checked)
                    {
                        //round_trip
                                                //alert("This facility is currently not available for Spice jet and Indigo");
                        document.getElementById("round_trip").checked=true;
                                        }
                    else
                    {
                        document.getElementById("two_way").checked=true;
                                        }
                    tb_return.style.display="";
                                }
                                else
                                {
                                        var tb_return_intl = document.getElementById("tb_return_intl");
                                        tb_return_intl.style.visibility="";
                                        document.getElementById("two_way_intl").checked=true;
                                        tb_return_intl.style.display="";
                                }

			}

			function hideReturn()
			{
				/*if(document.getElementById("one_way").checked)
				{
				    document.getElementById("two_way").checked=false;
					var tb_return = document.getElementById("tb_return");
					document.getElementById("tb_return").style.visibility="hidden";
					document.getElementById("tb_return").style.display="none";
				}
				*/
				var dom_visible= document.getElementById("DomesticFlight").style.display;
				var int_visible = document.getElementById("InternationalFlight").style.display;
				
				if(dom_visible == "block")
				{
					if(document.getElementById("one_way").checked)
					{
					    document.getElementById("two_way").checked=false;
						var tb_return = document.getElementById("tb_return");
						document.getElementById("tb_return").style.visibility="hidden";
						document.getElementById("tb_return").style.display="none";
					}
				}else
				{
					if(document.getElementById("one_way_intl").checked)
					{
						alert("For issuance of one way air ticket to any country, passenger should be in possession of, either a work permit \n or student visa or resident visa of that country.");
						document.getElementById("two_way_intl").checked=false;
						var tb_return = document.getElementById("tb_return_intl");
						document.getElementById("tb_return_intl").style.visibility="hidden";
						document.getElementById("tb_return_intl").style.display="none";
					}
				}
				
			}
			
			function hideReturnLoad()
			{
				/*if(document.getElementById("one_way").checked)
				{
				    document.getElementById("two_way").checked=false;
					var tb_return = document.getElementById("tb_return");
					document.getElementById("tb_return").style.visibility="hidden";
					document.getElementById("tb_return").style.display="none";
				}
				*/
				var dom_visible= document.getElementById("DomesticFlight").style.display;
				var int_visible = document.getElementById("InternationalFlight").style.display;
				
				if(dom_visible == "block")
				{
					if(document.getElementById("one_way").checked)
					{
					    document.getElementById("two_way").checked=false;
						var tb_return = document.getElementById("tb_return");
						document.getElementById("tb_return").style.visibility="hidden";
						document.getElementById("tb_return").style.display="none";
					}
				}else
				{
					if(document.getElementById("one_way_intl").checked)
					{
						document.getElementById("two_way_intl").checked=false;
						var tb_return = document.getElementById("tb_return_intl");
						document.getElementById("tb_return_intl").style.visibility="hidden";
						document.getElementById("tb_return_intl").style.display="none";
					}
				}
				
			}
			
			
			function flightsource(currDate,nextDate,w_retDate,w_retintdate)
			{
				// Domestic Flight				
				
				var domsrc = "<div id='DomesticFlight' style='display:block;'>";				
				domsrc = domsrc + "<table width='340px' border='0' cellspacing='0' cellpadding='3' class='formText_common'>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td colspan='2' align='left' ><strong>Domestic Flights</strong></td>";
				domsrc = domsrc + "<td colspan='2' align='right' ><a href='#' onclick=javascript:tabchange('intl_flt') class='selectText_option'>International Flights</a></td>";
				domsrc = domsrc + "</tr>";
				
				
				//domsrc = domsrc + "<tr>";
				//domsrc = domsrc + "<td align='left'>Search by</td>";
				//domsrc = domsrc + "<td align='left'>:<input type='radio' align='top' name='one_way' onClick=hideReturn() value='true' tabindex='0' Id='one_way'/>One Way</td>";
				//domsrc = domsrc + "<td colspan='2' align='left'><input type='radio' align='top' name='one_way' onClick=showReturn() value='false' Id='two_way' checked/>Round Trip</td>";
				//domsrc = domsrc + "</tr>";
				
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td colspan='4'>";
				domsrc = domsrc + "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td width='25%' nowrap height='25' align='left' class='ft_031'><input type='radio' align='top' name='one_way' onClick=hideReturn() value='true' tabindex='0' Id='one_way'/>One Way</td>";
				domsrc = domsrc + "<td width='25%' nowrap height='25' align='left' class='ft_031'><input type='radio' align='top' name='one_way' onClick=showReturn() value='false' Id='two_way' checked/>Round Trip</td>";
            	domsrc = domsrc + "<td width='50%' nowrap height='25' align='left' class='ft_031'><input type='radio' align='top' name='one_way' onClick=showReturn() value='false' Id='round_trip'/>Round Trip Special Fare </td>";
				domsrc = domsrc + "</tr></table></td></tr>";
			
			
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td colspan='2' align='left' style='border-bottom:1px solid #c9dbf3;'><strong>Journey Details</strong></td>";
				domsrc = domsrc + "<td colspan='2' align='left' style='border-bottom:1px solid #c9dbf3;'><strong>Passenger Details</strong></td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td align='left' style='width:80px;'>From</td>";
				domsrc = domsrc + "<td align='left' style='width:125px;'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='1' style='width:116px;' name='from_location' id='from_location'>";
				domsrc = domsrc + "<option value='BOM'>MUMBAI</option><option value='DEL'>DELHI</option><option value='BLR'>BANGALORE</option><option value='MAA'>CHENNAI</option><option value='HYD'>HYDERABAD</option><option value='CCU'>KOLKATA</option><option value='line'>---------------</option><option value='IXA'>AGARTALA</option><option value='AGX'>AGATTI</option><option value='AGR'>AGRA</option><option value='AMD'>AHMEDABAD</option><option value='AJL'>AIJWAL</option><option value='AKD'>AKOLA</option><option value='IXD'>ALLAHABAD</option><option value='IXV'>ALONG</option><option value='ATQ'>AMRITSAR</option><option value='IXU'>AURANGABAD</option><option value='IXB'>BAGDOGRA</option><option value='RGH'>BALURGHAT</option><option value='BLR'>BANGALORE</option><option value='IXG'>BELGAUM</option><option value='BEP'>BELLARY</option><option value='BUP'>BHATINDA</option><option value='BHU'>BHAVNAGAR</option><option value='BHO'>BHOPAL</option><option value='BBI'>BHUBANESHWAR</option><option value='BHJ'>BHUJ</option><option value='BKB'>BIKANER</option><option value='PAB'>BILASPUR</option><option value='CCJ'>CALICUT</option><option value='CBD'>CAR NICOBAR</option><option value='IXC'>CHANDIGARH</option><option value='MAA'>CHENNAI</option><option value='COK'>COCHIN</option><option value='CJB'>COIMBATORE</option><option value='COH'>COOCH BEHAR</option><option value='CDP'>CUDDAPAH</option><option value='NMB'>DAMAN</option><option value='DAE'>DAPARIZO</option><option value='DAI'>DARJEELING</option><option value='DED'>DEHRA DUN</option><option value='DEL'>DELHI</option><option value='DEP'>DEPARIZO</option><option value='DBD'>DHANBAD</option><option value='DHM'>DHARAMSALA</option><option value='DIB'>DIBRUGARH</option><option value='DMU'>DIMAPUR</option><option value='DIU'>DIU</option><option value='GAY'>GAYA</option><option value='GOI'>GOA</option><option value='GOP'>GORAKHPUR</option><option value='GUX'>GUNA</option><option value='GAU'>GUWAHATI</option><option value='GWL'>GWALIOR</option><option value='HSS'>HISSAR</option><option value='HBX'>HUBLI</option><option value='HYD'>HYDERABAD</option><option value='IMF'>IMPHAL</option><option value='IDR'>INDORE</option><option value='JLR'>JABALPUR</option><option value='JGB'>JAGDALPUR</option><option value='JAI'>JAIPUR</option><option value='JSA'>JAISALMER</option><option value='IXJ'>JAMMU</option><option value='JGA'>JAMNAGAR</option><option value='IXW'>JAMSHEDPUR</option><option value='PYB'>JEYPORE</option><option value='JDH'>JODHPUR</option><option value='JRH'>JORHAT</option><option value='IXH'>KAILASHAHAR</option><option value='IXQ'>KAMALPUR</option><option value='IXY'>KANDLA</option><option value='KNU'>KANPUR</option><option value='IXK'>KESHOD</option><option value='HJR'>KHAJURAHO</option><option value='IXN'>KHOWAI</option><option value='KLH'>KOLHAPUR</option><option value='CCU'>KOLKATA</option><option value='KTU'>KOTA</option><option value='KUU'>KULU</option><option value='LTU'>LATUR</option><option value='IXL'>LEH</option><option value='IXI'>LILABARI</option><option value='LKO'>LUCKNOW</option><option value='LUH'>LUDHIANA</option><option value='IXM'>MADURAI</option><option value='LDA'>MALDA</option><option value='IXE'>MANGALORE</option><option value='MOH'>MOHANBARI</option><option value='BOM'>MUMBAI</option><option value='MZA'>MUZAFFARNAGAR</option><option value='MZU'>MUZAFFARPUR</option><option value='MYQ'>MYSORE</option><option value='NAG'>NAGPUR</option><option value='NDC'>NANDED</option><option value='ISK'>NASIK</option><option value='NVY'>NEYVELI</option><option value='OMN'>OSMANABAD</option><option value='PGH'>PANTNAGAR</option><option value='IXT'>PASIGHAT</option><option value='IXP'>PATHANKOT</option><option value='PAT'>PATNA</option><option value='PNY'>PONDICHERRY</option><option value='PBD'>PORBANDAR</option><option value='IXZ'>PORTBLAIR</option><option value='PNQ'>PUNE</option><option value='PUT'>PUTTAPARTHI</option><!-- <option value='BEK'>PUTTAPARTHY</option> --><option value='RPR'>RAIPUR</option><option value='RJA'>RAJAHMUNDRY</option><option value='RAJ'>RAJKOT</option><option value='RJI'>RAJOURI</option><option value='RMD'>RAMAGUNDAM</option><option value='IXR'>RANCHI</option><option value='RTC'>RATNAGIRI</option><option value='REW'>REWA</option><option value='RRK'>ROURKELA</option><option value='RUP'>RUPSI</option><option value='SXV'>SALEM</option><option value='TNI'>SATNA</option><option value='SHL'>SHILLONG</option><option value='SSE'>SHOLAPUR</option><option value='IXS'>SILCHAR</option><option value='SLV'>SIMLA</option><option value='SXR'>SRINAGAR</option><option value='STV'>SURAT</option><option value='TEZ'>TEZPUR</option><option value='TEI'>TEZU</option><option value='TJV'>THANJAVUR</option><option value='TRV'>TRIVANDRUM</option><option value='TRZ'>TIRUCHIRAPALLI</option><option value='ICH'>TRICHI</option><option value='TIR'>TIRUPATI</option><option value='TCR'>TUTICORIN</option><option value='UDR'>UDAIPUR</option><option value='BDQ'>VADODRA</option><option value='VNS'>VARANASI</option><option value='VGA'>VIJAYAWADA</option><option value='VTZ'>VIZAG</option><option value='WGC'>WARANGAL</option>";
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "<td align='left' style='border-left:1px solid #c9dbf3;width:60px;'>Adult(s)</td>";
				domsrc = domsrc + "<td align='left' style='width:60px;'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='3' name='no_adult' id='no_adult' class='L11'>";
				domsrc = domsrc + "<option value='1'>01</option><option value='2'>02</option><option value='3'>03</option><option value='4'>04</option><option value='5'>05</option><option value='6'>06</option><option value='7'>07</option><option value='8'>08</option><option value='9'>09</option>";
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td align='left' style='width:80px;'>To</td>";
				domsrc = domsrc + "<td align='left' style='width:125px;'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='2' style='width:116px;' name='to_location' id='to_location'>";
				domsrc = domsrc + "<option value='DEL'>DELHI</option><option value='BOM'>MUMBAI</option><option value='BLR'>BANGALORE</option><option value='MAA'>CHENNAI</option><option value='HYD'>HYDERABAD</option><option value='CCU'>KOLKATA</option><option value='line1'>---------------</option><option value='IXA'>AGARTALA</option><option value='AGX'>AGATTI</option><option value='AGR'>AGRA</option><option value='AMD'>AHMEDABAD</option><option value='AJL'>AIJWAL</option><option value='AKD'>AKOLA</option><option value='IXD'>ALLAHABAD</option><option value='IXV'>ALONG</option><option value='ATQ'>AMRITSAR</option><option value='IXU'>AURANGABAD</option><option value='IXB'>BAGDOGRA</option><option value='RGH'>BALURGHAT</option><option value='BLR'>BANGALORE</option><option value='IXG'>BELGAUM</option><option value='BEP'>BELLARY</option><option value='BUP'>BHATINDA</option><option value='BHU'>BHAVNAGAR</option><option value='BHO'>BHOPAL</option><option value='BBI'>BHUBANESHWAR</option><option value='BHJ'>BHUJ</option><option value='BKB'>BIKANER</option><option value='PAB'>BILASPUR</option><option value='CCJ'>CALICUT</option><option value='CBD'>CAR NICOBAR</option><option value='IXC'>CHANDIGARH</option><option value='MAA'>CHENNAI</option><option value='COK'>COCHIN</option><option value='CJB'>COIMBATORE</option><option value='COH'>COOCH BEHAR</option><option value='CDP'>CUDDAPAH</option><option value='NMB'>DAMAN</option><option value='DAE'>DAPARIZO</option><option value='DAI'>DARJEELING</option><option value='DED'>DEHRA DUN</option><option value='DEL'>DELHI</option><option value='DEP'>DEPARIZO</option><option value='DBD'>DHANBAD</option><option value='DHM'>DHARAMSALA</option><option value='DIB'>DIBRUGARH</option><option value='DMU'>DIMAPUR</option><option value='DIU'>DIU</option><option value='GAY'>GAYA</option><option value='GOI'>GOA</option><option value='GOP'>GORAKHPUR</option><option value='GUX'>GUNA</option><option value='GAU'>GUWAHATI</option><option value='GWL'>GWALIOR</option><option value='HSS'>HISSAR</option><option value='HBX'>HUBLI</option><option value='HYD'>HYDERABAD</option><option value='IMF'>IMPHAL</option><option value='IDR'>INDORE</option><option value='JLR'>JABALPUR</option><option value='JGB'>JAGDALPUR</option><option value='JAI'>JAIPUR</option><option value='JSA'>JAISALMER</option><option value='IXJ'>JAMMU</option><option value='JGA'>JAMNAGAR</option><option value='IXW'>JAMSHEDPUR</option><option value='PYB'>JEYPORE</option><option value='JDH'>JODHPUR</option><option value='JRH'>JORHAT</option><option value='IXH'>KAILASHAHAR</option><option value='IXQ'>KAMALPUR</option><option value='IXY'>KANDLA</option><option value='KNU'>KANPUR</option><option value='IXK'>KESHOD</option><option value='HJR'>KHAJURAHO</option><option value='IXN'>KHOWAI</option><option value='KLH'>KOLHAPUR</option><option value='CCU'>KOLKATA</option><option value='KTU'>KOTA</option><option value='KUU'>KULU</option><option value='LTU'>LATUR</option><option value='IXL'>LEH</option><option value='IXI'>LILABARI</option><option value='LKO'>LUCKNOW</option><option value='LUH'>LUDHIANA</option><option value='IXM'>MADURAI</option><option value='LDA'>MALDA</option><option value='IXE'>MANGALORE</option><option value='MOH'>MOHANBARI</option><option value='BOM'>MUMBAI</option><option value='MZA'>MUZAFFARNAGAR</option><option value='MZU'>MUZAFFARPUR</option><option value='MYQ'>MYSORE</option><option value='NAG'>NAGPUR</option><option value='NDC'>NANDED</option><option value='ISK'>NASIK</option><option value='NVY'>NEYVELI</option><option value='OMN'>OSMANABAD</option><option value='PGH'>PANTNAGAR</option><option value='IXT'>PASIGHAT</option><option value='IXP'>PATHANKOT</option><option value='PAT'>PATNA</option><option value='PNY'>PONDICHERRY</option><option value='PBD'>PORBANDAR</option><option value='IXZ'>PORTBLAIR</option><option value='PNQ'>PUNE</option><option value='PUT'>PUTTAPARTHI</option><!-- <option value='BEK'>PUTTAPARTHY</option> --><option value='RPR'>RAIPUR</option><option value='RJA'>RAJAHMUNDRY</option><option value='RAJ'>RAJKOT</option><option value='RJI'>RAJOURI</option><option value='RMD'>RAMAGUNDAM</option><option value='IXR'>RANCHI</option><option value='RTC'>RATNAGIRI</option><option value='REW'>REWA</option><option value='RRK'>ROURKELA</option><option value='RUP'>RUPSI</option><option value='SXV'>SALEM</option><option value='TNI'>SATNA</option><option value='SHL'>SHILLONG</option><option value='SSE'>SHOLAPUR</option><option value='IXS'>SILCHAR</option><option value='SLV'>SIMLA</option><option value='SXR'>SRINAGAR</option><option value='STV'>SURAT</option><option value='TEZ'>TEZPUR</option><option value='TEI'>TEZU</option><option value='TJV'>THANJAVUR</option><option value='TRV'>TRIVANDRUM</option><option value='TRZ'>TIRUCHIRAPALLI</option><option value='ICH'>TRICHI</option><option value='TIR'>TIRUPATI</option><option value='TCR'>TUTICORIN</option><option value='UDR'>UDAIPUR</option><option value='BDQ'>VADODRA</option><option value='VNS'>VARANASI</option><option value='VGA'>VIJAYAWADA</option><option value='VTZ'>VIZAG</option><option value='WGC'>WARANGAL</option>";
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "<td align='left' style='border-left:1px solid #c9dbf3;width:60px;'>Children</td>";
				domsrc = domsrc + "<td align='left' style='width:60px;'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='4' name='no_child' id='no_child' class='L11'>";
				domsrc = domsrc + "<option value='0'>00</option><option value='1'>01</option><option value='2'>02</option><option value='3'>03</option><option value='4'>04</option><option value='5'>05</option><option value='6'>06</option><option value='7'>07</option><option value='8'>08</option><option value='9'>09</option>";
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td align='left' style='width:80px;'>Departure</td>";
				domsrc = domsrc + "<td align='left' style='width:125px;'>:";
				domsrc = domsrc + "<input type='text' style='height:12px;width:110px;' class='L11' onFocus=this.blur() name='depart_date' id='depart_date' value='"+currDate+"'/>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "<td align='left' style='border-left:1px solid #c9dbf3;width:60px;'>Infant(s)</td>";
				domsrc = domsrc + "<td align='left' style='width:60px;'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='5' name='no_infant' id='no_infant' class='L11'>";
				domsrc = domsrc + "<option value='0'>00</option><option value='1'>01</option><option value='2'>02</option><option value='3'>03</option><option value='4'>04</option><option value='5'>05</option><option value='6'>06</option><option value='7'>07</option><option value='8'>08</option><option value='9'>09</option>";
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr id='tb_return'>";
				domsrc = domsrc + "<td align='left' style='width:80px;'>Return</td>";
				domsrc = domsrc + "<td align='left' style='width:125px;'>:";
				domsrc = domsrc + "<input type='text' style='height:12px;width:110px;' class='L11' name='return_date' id='return_date' onFocus='this.blur()' value='"+nextDate+"'/>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "<td style='border-left:1px solid #c9dbf3;width:60px;'>&nbsp;</td>";
				domsrc = domsrc + "<td align='left' style='width:60px;'>&nbsp;</td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td align='left' id='cabindom' style='font-size:11px;'>Cabin</td>";
				domsrc = domsrc + "<td colspan='3' align='left'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='6' name='cabin_type' id='cabin_type'>";
				domsrc = domsrc + "<option selected value='E' >Economy Lowest Fare</option><option value='ER' >Economy Refundable Fare</option><option value='B'>Bus. / First Class </option>";				
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr id='dom_button_height'>";
				domsrc = domsrc + "<td colspan='4' align='center'><a href=javascript:submit_search('dom_flt')><img src='images/search-button.gif' width='89' height='22' border='0' /></a></td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr >";
				domsrc = domsrc + "<td colspan='4' align='right'><a href='gbookingHistory.do' class='L44'><strong>Print/Cancel your ticket</strong></a></td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "</table>";
				
				
				domsrc = domsrc + "</div>";
				
				// International Flight
				
				
				
				domsrc = domsrc +"<div id='InternationalFlight' style='display: none'>";				
				domsrc = domsrc + "<table width='340px' border='0' cellspacing='0' cellpadding='3' class='formText_common'>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td colspan='2' align='left'><strong>International Flights</strong></td>";
				domsrc = domsrc + "<td colspan='2' align='right'><a href='#' onclick=javascript:tabchange('Dom_flt') class='selectText_option'>Domestic Flights</a></td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td align='left'>Search by</td>";
				domsrc = domsrc + "<td align='left'>:<input type='radio' align='top' tabindex='0' name='one_way_intl' value='ONE' onClick=hideReturn() Id='one_way_intl'/>One Way</td>";
				domsrc = domsrc + "<td colspan='2' align='left'><input type='radio' align='top' name='one_way_intl'  checked value='ROUND' onClick=showReturn() Id='two_way_intl'/>Round Trip</td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td colspan='2' align='left' style='border-bottom:1px solid #c9dbf3;'><strong>Journey Details</strong></td>";
				domsrc = domsrc + "<td colspan='2' align='left' style='border-bottom:1px solid #c9dbf3;'><strong>Passenger Details</strong></td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td align='left' style='width:80px;'>From</td>";
				domsrc = domsrc + "<td align='left' style='width:125px;'>:";
				//domsrc = domsrc + "<input type='text' class='L11'  style='width:110px;' name='fromcity' value='' title='Type the first 3 letters of airport or city name' autocomplete='off'/>";
				domsrc = domsrc + "<input type='text' tabindex='1' style='width:110px;' class='L11' id='textdepart' name='fromcity'/>";
				domsrc = domsrc + "<div id='textdepart'></div>";			
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "<td align='left' style='border-left:1px solid #c9dbf3;width:60px;'>Adult(s)</td>";
				domsrc = domsrc + "<td align='left' style='width:60px;'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='3' name='no_adult_intl' id='no_adult_intl' class='L11'>";
				domsrc = domsrc + "<option value='1'>01</option><option value='2'>02</option><option value='3'>03</option><option value='4'>04</option><option value='5'>05</option>";
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td align='left' style='width:80px;'>To</td>";
				domsrc = domsrc + "<td align='left' style='width:125px;'>:";
				domsrc = domsrc + "<input type='text' tabindex='2' class='L11' id='textreturn' style='width:110px;' name='tocity' value='' title='Type the first 3 letters of airport or city name' autocomplete='off'/>";				
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "<td align='left' style='border-left:1px solid #c9dbf3;width:60px;'>Children</td>";
				domsrc = domsrc + "<td align='left' style='width:60px;'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='4' name='no_child_intl'  id='no_child_intl' class='L11'>";
				domsrc = domsrc + "<option value='0'>00</option><option value='1'>01</option><option value='2'>02</option><option value='3'>03</option><option value='4'>04</option><option value='5'>05</option>";
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td align='left' style='width:80px;'>Departure</td>";
				domsrc = domsrc + "<td align='left' style='width:125px;'>:";
				domsrc = domsrc + "<input type='text' style='height:12px;width:110px;' onFocus=this.blur()  class='L11'  name='depart_date_intl' id='depart_date_intl' value='"+w_retDate+"'/>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "<td align='left' style='border-left:1px solid #c9dbf3;width:60px;'>Infant(s)</td>";
				domsrc = domsrc + "<td align='left' style='width:60px;'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='5' name='no_infant_intl'  id='no_infant_intl' class='L11'>";
				domsrc = domsrc + "<option value='0'>00</option><option value='1'>01</option><option value='2'>02</option><option value='3'>03</option>";
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr id='tb_return_intl'>";
				domsrc = domsrc + "<td align='left' style='width:80px;'>Return</td>";
				domsrc = domsrc + "<td align='left' style='width:125px;'>:";
				domsrc = domsrc + "<input type='text' style='height:12px;width:110px;' class='L11' onFocus='this.blur()' name='return_date_intl' id='return_date_intl' value='"+w_retintdate+"'/>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "<td style='border-left:1px solid #c9dbf3;width:60px;'>&nbsp;</td>";
				domsrc = domsrc + "<td align='left' style='width:60px;'>&nbsp;</td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td align='left' id='cabinintl' style='font-size:11px;'>Cabin</td>";
				domsrc = domsrc + "<td colspan='3' align='left' id='cabinoptintl'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='6' name='cabin_type_intl' id='cabin_type_intl'>";
				domsrc = domsrc + "<option value='E' >Economy Class</option><option value='B' >Business Class</option><option value='F'>First Class </option>";
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "</tr>";						
				domsrc = domsrc + "<tr>";
				domsrc = domsrc + "<td align='left'>Preferred<br/>Airlines</td>";
				domsrc = domsrc + "<td colspan='3' align='left' id='cabinoptintl'>:";
				domsrc = domsrc + "<select class='selectText_common' tabindex='7' name='airline_intl' id='airline_intl'>";
				domsrc = domsrc + "<option value=''>All</option><option value='SU'>AEROFLOT AIRLINE</option><option value='AK'>AIR ASIA</option><option value='KC'>AIR ASTANA</option><option value='AC'>AIR CANADA</option><option value='CA'>AIR CHINA</option><option value='AF'>AIR FRANCE</option><option value='AI'>AIR INDIA</option><option value='IX'>AIR INDIA EXPRESS</option><option value='MK'>AIR MAURITIUS</option><option value='AZ'>ALITALIA</option><option value='AA'>AMERICAN AIRLINES</option><option value='OZ'>ASIANA AIRLINES</option><option value='OS'>AUSTRIAN AIRWAYS</option>";
				domsrc = domsrc + "<option value='BG'>BIMAN BANGLADESH</option><option value='BA'>BRITISH AIRWAYS</option><option value='BD'>BRITISH MIDLAND</option><option value='SN'>BRUSSELS AIRLINES</option><option value='CX'>CATHAY PACIFIC</option><option value='CI'>CHINA AIRLINES</option><option value='MU'>CHINA EASTERN AIRLINES</option><option value='CZ'>CHINA SOUTHERN</option><option value='CO'>CONTINENTAL AIRWAYS</option><option value='CY'>CYPRUS AIRWAYS</option><option value='DL'>DELTA AIRLINES</option><option value='KB'>DRUK AIR</option><option value='MS'>EGYPT AIR</option><option value='LY'>ELAL ISRAEL AIRWAYS</option><option value='EK'>EMIRATES AIRLINES</option><option value='ET'>ETHIOPIAN AIRLINES </option><option value='EY'>ETIHAD AIRWAYS</option><option value='BR'>EVA AIR</option>";
				domsrc = domsrc + "<option value='AY'>FINNAIR</option><option value='GA'>GARUDA AIRLINES</option><option value='Z5'>GMG Airlines</option><option value='GF'>GULF AIR</option><option value='IC'>INDIAN AIRLINES</option><option value='IR'>IRAN AIR</option><option value='9W'>JET AIRWAYS</option><option value='JL'>JAPAN AIRLINES</option><option value='J9'>JAZEERA AIRWAYS</option><option value='S2'>JETLITE</option><option value='KQ'>KENYA AIRWAYS</option><option value='IT'>KINGFISHER AIRLINES</option><option value='KL'>KLM NORTHWEST</option><option value='KE'>KOREAN AIR</option><option value='KU'>KUWAIT AIRWAYS</option><option value='LH'>LUFTHANASA</option><option value='W5'>MAHAN AIR</option><option value='MH'>MALAYSIAN AIRLINE</option><option value='CE'>NATIONWIDE</option>";
				domsrc = domsrc + "<option value='NW'>NORTHWEST AIRLINE</option><option value='WY'>OMAN AIR</option><option value='PK'>PAKISTAN AIRLINES</option><option value='QF'>QANTAS AIRWAYS</option><option value='QR'>QATAR AIRWAYS</option><option value='RJ'>ROYAL JORDANIAN</option><option value='RA'>ROYAL NEPAL</option><option value='S2'>SAHARA AIRLINE</option><option value='SV'>SAUDI ARABIAN</option><option value='MI'>SILK AIR</option><option value='SQ'>SINGAPORE AIRLINES</option><option value='SA'>SOUTH AFRICAN</option><option value='UL'>SRILANKAN AIRLINES</option><option value='LX'>SWISS AIR</option><option value='RB'>SYRIAN AIR</option><option value='TG'>THAI AIRWAYS</option><option value='TK'>TURKISH AIRLINES</option><option value='UA'>UNITED AIRLINES</option><option value='US'>US AIRWAYS</option><option value='HY'>UZBEKISTAN AIRWAYS</option><option value='VN'>VIETNAM AIRWAYS</option><option value='VS'>VIRGIN ATLANTIC</option><option value='IY'>YEMENA AIRWAYS</option>";
				domsrc = domsrc + "</select>";
				domsrc = domsrc + "</td>";
				domsrc = domsrc + "</tr>";				
				domsrc = domsrc + "<tr id='intl_button_height'>";
				domsrc = domsrc + "<td colspan='4' align='center'><a href=javascript:submit_search('intl_flt')><img src='images/search-button.gif' width='89' height='22' border='0' /></a></td>";
				domsrc = domsrc + "</tr>";
				domsrc = domsrc + "</table>";
				
				domsrc = domsrc + "</div>";
				
				document.getElementById("flightsrc").innerHTML = domsrc;
				
				
				//Flight Domestic Calender setup
				
				Zapatec.Calendar.setup({
						inputField     :    "depart_date",
						ifFormat       :    "%d-%b-%Y",
						showsTime      :    false,
						timeFormat     :    "24",
						onUpdate       :    catcalcFlight_dom,
						dateStatusFunc :    dateStatusHandler_Flight_dom,
						showsTime      :  false,
						weekNumbers    :  false,
						monthsInRow    : 1,
						numberMonths   :    2
				});		
				Zapatec.Calendar.setup({
						inputField     :    "return_date",
						ifFormat       :    "%d-%b-%Y",
						showsTime      :    false,
						timeFormat     :    "24",
						onUpdate       :    catcalcFlight_dom,
						dateStatusFunc :    dateStatusHandler_Flight_dom,
						showsTime      :  false,
      					weekNumbers    :  false,
      					monthsInRow    : 1,
      					numberMonths   :    2
				});
					
				//Flight Internation Calender setup
				
				Zapatec.Calendar.setup({
						inputField     :    "depart_date_intl",
						ifFormat       :    "%d-%b-%Y",
						showsTime      :    false,
						timeFormat     :    "24",
						onUpdate       :    catcalcFlight_intl,
						dateStatusFunc :    dateStatusHandler_Flight_Int,
						showsTime      :  false,
						weekNumbers    :  false,
						monthsInRow    : 1,
						numberMonths   :    2
				});
				Zapatec.Calendar.setup({
						inputField     :    "return_date_intl",
						ifFormat       :    "%d-%b-%Y",
						showsTime      :    false,
						timeFormat     :    "24",
						onUpdate       :    catcalcFlight_intl,
						dateStatusFunc :    dateStatusHandler_Flight_Int,
						showsTime      :  false,
						weekNumbers    :  false,
						monthsInRow    : 1,
						numberMonths   :    2
				});
				
			}
			
			/*function submit_search()
			{
				if ( validate()!=false)
				{
					window.document.flightsPage.action="http://online.arzoo.com/searchprogress.do";
					window.document.flightsPage.submit();
				}
			}*/
			
			function validate()
			{
			
				var f=document.flightsPage;
				var serverDate= document.getElementById("currentdate_flight").value;//f.currentdate.value;
				//alert(serverDate)
				var serdat;

				var to=f.to_location.value;				
			    var from=f.from_location.value;
				var d=f.depart_date.value;
				 var r=f.return_date.value;
				document.getElementById("e_ticket").value = "false";
				
				var diffr;
				var tmpDate;
				var tmpDate1;
				var arrdepart;
				var now = new Date();
				var checkdate = new Date();
				var arrreturn;
				var no_adult = f.no_adult.options[f.no_adult.selectedIndex].value ;
				var no_child = f.no_child.options[f.no_child.selectedIndex].value ;
				var no_infant = f.no_infant.options[f.no_infant.selectedIndex].value ;
				
				if(!(parseInt(no_adult) + parseInt(no_child) <= 9 ) )
				{
					 alert("Maximum 9 Passengers are Allowed");
					 return false;
				}
				else if (!(parseInt(no_infant) <= parseInt(no_adult)))
				{
					alert("Number of Infants cannot exceed the number of adults");
					return false;
				}
				if(to==from)
			    {
				 alert("Origin And Destination can't be same");
				 return false;
				}
				if(from=="line")
				{
					alert("Select valid From location");
					return false;
				}
				if(to=="line1")
				{
					alert("Select valid To location");
					return false;
				}
				
				serdat=serverDate.split("-");
				var mm2=serdat[1];
				var dd2=serdat[2];
				var yy2=serdat[0];
				var h=serdat[3];
				var m=serdat[4];
				var s=serdat[5];
					
				if (yy2 < 1000)
				{
					yy2 = (1900+parseInt(yy2));
				}	
				servdate = new Date(yy2,mm2-1,dd2,h,m,s);
				
				var arr= new Array(12); 
				arr[0]="Jan";
				arr[1]="Feb";
				arr[2]="Mar";
				arr[3]="Apr";
				arr[4]="May";
				arr[5]="Jun";
				arr[6]="Jul";
				arr[7]="Aug";
				arr[8]="Sep";
				arr[9]="Oct";
				arr[10]="Nov";
				arr[11]="Dec";

					 arrdepart=d.split("-");
					 mm=arrdepart[1];
						
					 //dd=arrdepart[0];
					 
					 dd = arrdepart[0];
					
					 yy=arrdepart[2];
						
					if (mm == "Jan")
					{
						mm = 0;
					}		
					else if (mm == "Feb")
					{
						mm = 1;
					}
					else if (mm == "Mar")
					{
						mm = 2;
					}
					else if (mm == "Apr")
					{
						mm = 3;
					}
					else if (mm == "May")
					{
						mm = 4;
					}
					else if (mm == "Jun")
					{
						mm = 5;
					}
					else if (mm == "Jul")
					{
						mm = 6;
					}
					else if (mm == "Aug")
					{
						mm = 7;
					}
					else if (mm == "Sep")
					{
						mm = 8;
					}
					else if (mm == "Oct")
					{
						mm = 0;
					}
					else if (mm == "Nov")
					{
						mm = 10;
					}
					else if (mm == "Dec")
					{
						mm = 11;
					}
					tmpDate = new Date(yy,mm,dd,h,m,s);
					if(f.two_way.value == true)
					{
						 arrreturn=r.split("-");
						 mm1=arrreturn[1];
				 		
				
						 dd1= arrreturn[0];
						
						 yy1=arrreturn[2];
						if (mm1 == "Jan")
						{
							mm1 = 1;
						}		
						else if (mm1 == "Feb")
						{
							mm1 = 2;
						}
						else if (mm1 == "Mar")
						{
							mm1 = 3;
						}
						else if (mm1 == "Apr")
						{
							mm1 = 4;
						}
						else if (mm1 == "May")
						{
							mm1 = 5;
						}
						else if (mm1 == "Jun")
						{
							mm1 = 6;
						}
						else if (mm1 == "Jul")
						{
							mm1 = 7;
						}
						else if (mm1 == "Aug")
						{
							mm1 = 8;
						}
						else if (mm1 == "Sep")
						{
							mm1 = 9;
						}
						else if (mm1 == "Oct")
						{
							mm1 = 10;
						}
						else if (mm1 == "Nov")
						{
							mm1 = 11;
						}
						else if (mm1 == "Dec")
						{
							mm1 = 12;
						}
						tmpDate1 = new Date(yy1,mm1-1,dd1,h,m,s);
						dd = parseFloat(dd);
					
						dd1= parseFloat(dd1);
						
						for (var iCharCounter1=0;iCharCounter1<12;iCharCounter1++)
						{
							var charVal = arr[iCharCounter1];
							
							
							if (charVal==mm)
							{
							    mm=iCharCounter1+1;
								
							}
							if (charVal==mm1)
							{
							    mm1=iCharCounter1+1;
									 
							}
						}     
						if (dd == dd2 && mm == mm2 && yy==yy2)
						{
							if ((parseInt(h) + 8) >= 24) 
							{
								alert("Same Day Flights cannot be booked at this time. \n Please select another date");
								return false;
							}
							else
							{
							
							}
						}
					
						if(tmpDate < servdate)
						{
							alert("Please select valid date");
							return false;
						}
					}
					///E-ticket 
					var checkdate1 = new Date(servdate.getTime()+((1000*60*60*24)*3));
					if ((checkdate1.getTime() - tmpDate.getTime()) >= 0 )
					{
						document.getElementById("e_ticket").value = "true";
					}
					if(f.two_way.value == true)
					{
						diffr=tmpDate1.getTime()-tmpDate.getTime();
						
						if(diffr<0)
						{
							alert("Return Date cannot be before Depart Date");
							return false;
						}
						else
							return true;
					}
			}
			
			
			function validate_intl()
			{
				var f=document.forms[formindex];
				var serverDate = document.getElementById("currentdate_flight").value;//f.currentdate.value;
				var serdat;

				var to=f.tocity.value;
			    var from=f.fromcity.value;
			    //alert(to+"--"+from);
				var d=f.depart_date_intl.value;
  			    var r=f.return_date_intl.value;
				document.getElementById("e_ticket_intl").value = "false";
				var diffr;
				var tmpDate;
				var tmpDate1;
				var arrdepart;
				var now = new Date();
				var checkdate = new Date();
				var arrreturn;
				var no_adult_intl = f.no_adult_intl.options[f.no_adult_intl.selectedIndex].value ;
				var no_child_intl = f.no_child_intl.options[f.no_child_intl.selectedIndex].value ;
				var no_infant_intl = f.no_infant_intl.options[f.no_infant_intl.selectedIndex].value ;
				
				
				if((parseInt(no_adult_intl) + parseInt(no_child_intl) + parseInt(no_child_intl)) > 6  )
				{
					 alert("Maximum 6 Passengers are Allowed");
					 return false;
				}
				else if (!(parseInt(no_infant_intl) <= parseInt(no_adult_intl)))
				{
					alert("Number of Infants cannot exceed the number of adults");
					return false;
				}
				
				if(to==from)
			    {
					 alert("Origin And Destination can't be same");
					 return false;
				}
				serdat=serverDate.split("-");
				var mm2=serdat[1];
				var dd2=serdat[2];
				var yy2=serdat[0];
				var h=serdat[3];
				var m=serdat[4];
				var s=serdat[5];
					
				if (yy2 < 1000)
				{
					yy2 = (1900+parseInt(yy2));
				}	
				servdate = new Date(yy2,mm2-1,dd2,h,m,s);
				
				var arr= new Array(12); 
				arr[0]="Jan";
				arr[1]="Feb";
				arr[2]="Mar";
				arr[3]="Apr";
				arr[4]="May";
				arr[5]="Jun";
				arr[6]="Jul";
				arr[7]="Aug";
				arr[8]="Sep";
				arr[9]="Oct";
				arr[10]="Nov";
				arr[11]="Dec";

					 arrdepart=d.split("-");
					 mm=arrdepart[1];
						
					 //dd=arrdepart[0];
					 
					 dd = arrdepart[0];
					
					 yy=arrdepart[2];
						
					if (mm == "Jan")
					{
						mm = 0;
					}		
					else if (mm == "Feb")
					{
						mm = 1;
					}
					else if (mm == "Mar")
					{
						mm = 2;
					}
					else if (mm == "Apr")
					{
						mm = 3;
					}
					else if (mm == "May")
					{
						mm = 4;
					}
					else if (mm == "Jun")
					{
						mm = 5;
					}
					else if (mm == "Jul")
					{
						mm = 6;
					}
					else if (mm == "Aug")
					{
						mm = 7;
					}
					else if (mm == "Sep")
					{
						mm = 8;
					}
					else if (mm == "Oct")
					{
						mm = 9;
					}
					else if (mm == "Nov")
					{
						mm = 10;
					}
					else if (mm == "Dec")
					{
						mm = 11;
					}
					tmpDate = new Date(yy,mm,dd,h,m,s);
					
					if(f.two_way_intl.checked)
					{
						 arrreturn=r.split("-");
						 mm1=arrreturn[1];
						 dd1= arrreturn[0];
						 yy1=arrreturn[2];
				
						if (mm1 == "Jan")
						{
							mm1 = 1;
						}		
						else if (mm1 == "Feb")
						{
							mm1 = 2;
						}
						else if (mm1 == "Mar")
						{
							mm1 = 3;
						}
						else if (mm1 == "Apr")
						{
							mm1 = 4;
						}
						else if (mm1 == "May")
						{
							mm1 = 5;
						}
						else if (mm1 == "Jun")
						{
							mm1 = 6;
						}
						else if (mm1 == "Jul")
						{
							mm1 = 7;
						}
						else if (mm1 == "Aug")
						{
							mm1 = 8;
						}
						else if (mm1 == "Sep")
						{
							mm1 = 9;
						}
						else if (mm1 == "Oct")
						{
							mm1 = 10;
						}
						else if (mm1 == "Nov")
						{
							mm1 = 11;
						}
						else if (mm1 == "Dec")
						{
							mm1 = 12;
						}
						tmpDate1 = new Date(yy1,mm1-1,dd1,h,m,s);
						dd = parseFloat(dd);
						dd1= parseFloat(dd1);
						
						for (var iCharCounter1=0;iCharCounter1<12;iCharCounter1++)
						{
							var charVal = arr[iCharCounter1];
							
							if (charVal==mm)
							{
							    mm=iCharCounter1+1;
								
							}
							if (charVal==mm1)
							{
							    mm1=iCharCounter1+1;
									 
							}
						}     
						
						if (dd == dd2 && mm == mm2 && yy==yy2)
						{
							if ((parseInt(h) + 8) >= 24) 
							{
								alert("Same Day Flights cannot be booked at this time. \n Please select another date");
								return false;
							}
							else
							{
							
							}
						}
					
						if(tmpDate < servdate)
						{
							alert("Please select valid date");
							return false;
						}
					}
				
					var checkdate1 = new Date(servdate.getTime()+((1000*60*60*24)*3));
					if ((checkdate1.getTime() - tmpDate.getTime()) >= 0 )
					{
						document.getElementById("e_ticket_intl").value = "true";
					}
					if(f.two_way_intl.checked)
					{
						diffr=tmpDate1.getTime()-tmpDate.getTime();
						
						if(diffr<0)
						{
							alert("Return Date cannot be before Depart Date");
							return false;
						}
						else
							return true;
					}
			}
			
			
			function submit_search(args)
			{
				//alert("hi")
				//Process();
				if(args == "dom_flt")
				{	
					var f=document.flightsPage;
					var roundflag = f.round_trip.checked;
				
					if ( validate()!=false)
					{
					
						if(!roundflag)
						{																
							window.document.flightsPage.sahara.value = "false";
							window.document.flightsPage.residenceIndia.value = "true";
							window.document.flightsPage.action="http://arzoo.com/air/searchprogress.do";
							window.document.flightsPage.submit();
						}
						else
						{
							if (document.getElementById("one_way").checked)
								window.document.flightsPage.one_way_intl.value ="ONE";
							else
                                window.document.flightsPage.one_way_intl.value ="ROUND";

                            window.document.flightsPage.fromcity.value = f.from_location.value;
                            window.document.flightsPage.tocity.value = f.to_location.value;

                            window.document.flightsPage.depart_date_intl.value = f.depart_date.value;
                            window.document.flightsPage.return_date_intl.value = f.return_date.value;

                            window.document.flightsPage.no_adult_intl.value = f.no_adult.value;
                            window.document.flightsPage.no_child_intl.value = f.no_child.value;
                            window.document.flightsPage.no_infant_intl.value = f.no_infant.value;
                            window.document.flightsPage.cabin_type_intl.value = f.cabin_type.value;
                            window.document.flightsPage.airline_intl.value = "All";

                            window.document.flightsPage.e_ticket_intl.value="true";
                            window.document.flightsPage.roundtripfare.value="specialFare";
                            window.document.flightsPage.action= "http://arzoo.com/air_international/checkcity.do";
                            //window.document.flightsPage.action= "http://arzoo.com/air_multi/checkcity.do";
                            window.document.flightsPage.submit();
						}
						//setcookiedomesticflight();
						////window.document.flightsPage.action="http://online.arzoo.com/searchprogress.do";
						//window.document.flightsPage.action="http://172.16.100.22:8080/whitelabel_production_nov_remove_akbarpnr/searchprogress.do";
						//window.document.flightsPage.submit();
					}
				}
				else
				{
					if ( validate_intl()!=false)
					{
						//setcookiesInternationalFlight();
						//window.document.flightsPage.action= "http://172.16.100.54:8080/ArzooInternationalFlight_v3/checkcity.do";
						window.document.flightsPage.action= "http://arzoo.com/air_international/checkcity.do";
						//window.document.flightsPage.action= "http://arzoo.com/air_multi/checkcity.do";
						window.document.flightsPage.submit();
					}
				}	
			}
			
			
			function dateStatusHandler(date, y, m, d) 
			{
			    var dt = new Date();
			    
				var time = date.getTime();
				var currtime = dt.getTime() - Date.DAY ;
				if (time >= currtime)
					return false;
				else
					return true;
			}

			
			
			
			
						
	var expiredays=365;
		function getCookieDomestic(c_name)
			{
				if (document.cookie.length>0)
		 			{
		  				c_start=document.cookie.indexOf(c_name + "=");
		 				if (c_start!=-1)
		    				{
		    					c_start=c_start + c_name.length+1;
		    					c_end=document.cookie.indexOf(";",c_start);
		    					if (c_end==-1) c_end=document.cookie.length;
		    					return unescape(document.cookie.substring(c_start,c_end));
		    				}
		  			}
			    return "";
		   	}
		
		function setCookieDomestic(c_name,value)
			{
				var exdate=new Date();
				exdate.setDate(exdate.getDate()+expiredays);
				document.cookie=c_name+ "=" +escape(value)+
				((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
			}
		function checkCookieDomesticFlight()
			{
				from_location=getCookieDomestic('from_location');
					if (from_location!=null && from_location!="")
				  	  {
				  	 		document.getElementById("from_location").value = from_location
				  	  }
				to_location=getCookieDomestic('to_location');
					if (to_location!=null && to_location!="")
					  {
					  	 document.getElementById("to_location").value = to_location
					  }
				  
				depart_date=getCookieDomestic('depart_date');
					if (depart_date!=null && depart_date!="")
					  {
					  	 document.getElementById("depart_date").value = depart_date
					  }
				  
				 return_date=getCookieDomestic('return_date');
					if (return_date!=null && return_date!="")
					  {
					  	 document.getElementById("return_date").value = return_date
					  }
				  
				 cabin_type=getCookieDomestic('cabin_type');
					if (cabin_type!=null && cabin_type!="")
					  {
					  	 document.getElementById("cabin_type").value = cabin_type
					  } 
				no_adult=getCookieDomestic('no_adult');
					if (no_adult!=null && no_adult!="")
					  {
					  	 document.getElementById("no_adult").value = no_adult
					  } 
				no_child=getCookieDomestic('no_child');
					if (no_child!=null && no_child!="")
					  {
					  	 document.getElementById("no_child").value = no_child
					  } 
				no_infant=getCookieDomestic('no_infant');
					if (no_infant!=null && no_infant!="")
					  {
					  	 document.getElementById("no_infant").value = no_infant
					  }  
				one_wy=getCookieDomestic('one_wy');
				if (one_wy!=null && one_wy!="")
				  {
				  	if(one_wy == 9)
				  		{
				  			document.getElementById("one_way").checked=true;
				  	 	}
				  	 else if(one_wy == 8)
				  	 	{
				  			document.getElementById("two_way").checked=true;
				  	 	}
				  }  
		}

	function setcookiedomesticflight()
		{
			if(document.getElementById("one_way").checked)
				{
					var one_wy="9";
				}
				else if(document.getElementById("two_way").checked)
				{
					var one_wy="8";
				}
			var from_location=document.getElementById("from_location").value;
			setCookieDomestic('from_location',from_location);
			var to_location=document.getElementById("to_location").value;
			setCookieDomestic('to_location',to_location);
			var depart_date=document.getElementById("depart_date").value;
			setCookieDomestic('depart_date',depart_date);
			var return_date=document.getElementById("return_date").value;
			setCookieDomestic('return_date',return_date);
			var cabin_type=document.getElementById("cabin_type").value;
			setCookieDomestic('cabin_type',cabin_type);
			var no_adult=document.getElementById("no_adult").value;
			setCookieDomestic('no_adult',no_adult);
			var no_child=document.getElementById("no_child").value;
			setCookieDomestic('no_child',no_child);
			var no_infant=document.getElementById("no_infant").value;
			setCookieDomestic('no_infant',no_infant);
			setCookieDomestic('one_wy',one_wy);
		}
					
	function getCooke(c_name)
		{
			if (document.cookie.length>0)
	  			{
	  				c_start=document.cookie.indexOf(c_name + "=");
	  				if (c_start!=-1)
	    				{
						    c_start=c_start + c_name.length+1;
						    c_end=document.cookie.indexOf(";",c_start);
						    if (c_end==-1) c_end=document.cookie.length;
						    return unescape(document.cookie.substring(c_start,c_end));
						}
	  			}
			return 365;
		}
	function setCooke(c_name,value)
		{
			var exdate=new Date();
			exdate.setDate(exdate.getDate()+expiredays);
			document.cookie=c_name+ "=" +escape(value)+
			((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
		}
	
	function checkCookieInternationalFlight()
		{
			fromcity=getCooke('fromcity');
				if (fromcity!=null && fromcity!=365)
				  {
				  	 document.getElementById("fromcity").value = fromcity
				  }
			tocity=getCooke('tocity');
				if (tocity!=null && tocity!=365)
				  {
				  	 document.getElementById("tocity").value = tocity
				  }
			depart_date_intl=getCooke('depart_date_intl');
				if (depart_date_intl!=null && depart_date_intl!=365)
				  {
				  	 document.getElementById("depart_date_intl").value = depart_date_intl
				  }
			return_date_intl=getCooke('return_date_intl');
				if (return_date_intl!=null && return_date_intl!=365)
				  {
				  	 document.getElementById("return_date_intl").value = return_date_intl
				  }
			cabin_type_intl=getCooke('cabin_type_intl');
				if (cabin_type_intl!=null && cabin_type_intl!=365)
				  {
				  	 document.getElementById("cabin_type_intl").value = cabin_type_intl
				  }
			airline_intl=getCooke('airline_intl');
				if (airline_intl!=null && airline_intl!=365)
				  {
				  	 document.getElementById("airline_intl").value = airline_intl
				  }
			no_adult_intl=getCooke('no_adult_intl');
				if (no_adult_intl!=null && no_adult_intl!=365)
				  {
				  	 document.getElementById("no_adult_intl").value = no_adult_intl
				  }
			no_child_intl=getCooke('no_child_intl');
				if (no_child_intl!=null && no_child_intl!=365)
				  {
				  	 document.getElementById("no_child_intl").value = no_child_intl
				  }
			no_infant_intl=getCooke('no_infant_intl');
				if (no_infant_intl!=null && no_infant_intl!=365)
				  {
				  	 document.getElementById("no_infant_intl").value = no_infant_intl
				  }
			  
  			intl_one_wy=getCooke('intl_one_wy');
				if (intl_one_wy!=null && intl_one_wy!=365)
		  		  {
		  			if(intl_one_wy ==4)
		  				{
		  					document.getElementById("one_way_intl").checked=true;
		  		 		}
		  	 		else if(intl_one_wy ==5)
		  	 			{
		  	 				document.getElementById("two_way_intl").checked=true;
		  	 			}
		  		   }  
		  
			one_wy=getCookieDomestic('one_wy');
		
				if (one_wy!=null && one_wy!=365)
				  {
				  	if(one_wy == 9)
					  	{
					  		document.getElementById("one_way").checked=true;
					  	}
				  	else if(one_wy == 8)
					  	{
					  		document.getElementById("two_way").checked=true;
					  	}
				  } 
		}
	function setcookiesInternationalFlight()
     	{
			if(document.getElementById("one_way").checked)
					{
						var one_wy="9";
					}
					else if(document.getElementById("two_way").checked)
					{
						var one_wy="8";
					}
			if(document.getElementById("one_way_intl").checked)
						{
							var intl_one_wy="4";
						}
			else if(document.getElementById("two_way_intl").checked)
						{
							var intl_one_wy="5";
						}
			var fromcity=document.getElementById("textdepart").value;
			
			setCooke('fromcity',fromcity);
			var tocity=document.getElementById("textreturn").value;
			//alert(fromcity+"--"+tocity);
			setCooke('tocity',tocity);
			var depart_date_intl=document.getElementById("depart_date_intl").value;
			setCooke('depart_date_intl',depart_date_intl);
			var return_date_intl=document.getElementById("return_date_intl").value;
			setCooke('return_date_intl',return_date_intl);
			var cabin_type_intl=document.getElementById("cabin_type_intl").value;
			setCooke('cabin_type_intl',cabin_type_intl);
			var airline_intl=document.getElementById("airline_intl").value;
			setCooke('airline_intl',airline_intl);
			var no_adult_intl=document.getElementById("no_adult_intl").value;
			setCooke('no_adult_intl',no_adult_intl);
			var no_child_intl=document.getElementById("no_child_intl").value;
			setCooke('no_child_intl',no_child_intl);
			var no_infant_intl=document.getElementById("no_infant_intl").value;
			setCooke('no_infant_intl',no_infant_intl);
			setCookieDomestic('one_wy',one_wy); //for one way Domestic
			setCookieDomestic('intl_one_wy',intl_one_wy); //for one way International
	
	}

	function airFareCalender()
{
	var xhr;
	var mode = "";
	var airFareFrom = document.getElementById("airFareFrom")!=null?document.getElementById("airFareFrom").value:"";
	var airFareTo = document.getElementById("airFareTo")!=null?document.getElementById("airFareTo").value:"";
	
	var airFareMonth = document.getElementById("airFareMonth")!=null?document.getElementById("airFareMonth").value:"";
	var airFareCal = document.getElementById("div1Img");
	//alert(airFareCal.innerHTML);
	if(window.XMLHttpRequest){
		xhr = new XMLHttpRequest();
	}
	else if(window.ActiveXObject){
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xhr.open("POST","servlet/AirFareCalender",true);
	//xhr.open("POST","airFareCalAction.do",true);
	xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xhr.onreadystatechange = callback;
	xhr.send("airFareFrom="+airFareFrom+"&airFareTo="+airFareTo+"&airFareMonth="+airFareMonth);
	
	function callback() 
	{	
		if( xhr.readyState==4 )
		{
			if( xhr.status==200 )
			{
				airFareCal.innerHTML = xhr.responseText;
				//var airFareCal1 = document.getElementById("div1Img");
				//alert(airFareCal1.innerHTML);
			}else{
				alert("error");
			}
		}
	}
}



function validateOriginDestination()
{
	var airFareFrom = document.getElementById("airFareFrom")!=null?document.getElementById("airFareFrom").value:"";
	var airFareTo = document.getElementById("airFareTo")!=null?document.getElementById("airFareTo").value:"";
	
	if(airFareFrom != airFareTo)
		airFareCalender();
	else
	{
		alert("Origin and Destination cannot be same.");
		document.getElementById("airFareFrom").focus();
	}	
}

