			var divclose = "";
			var divcloslist = "";
			var Selectedlist = "";
			var check = "";	
			var formindex = "0";		
			function getPrefferdAirline(pref_airline_array,evt)
			{	
				check = "";
				divclose = "";
				Selectedlist = "";
				check = "click";
				var break_line = 0;							
				var divObj = document.getElementById("prefferedAirlineDIV");		
				var x = evt.clientX;
				var y = evt.clientY+document.body.scrollTop-100;				
				divObj.style.display = "block";
				divObj.style.position = "absolute";								
				var prefferedAir = "<form><table border='0' cellpadding='0' cellspacing='0' width='320'><tr><td align='left' valign='top' background='image/left_line.gif' width='45' style='background-repeat:repeat-y'><img src='image/marker_1.gif' vspace='0' hspace='0' border='0' style='margin-top:45px;'></td><td align='left' valign='top'><table cellpadding='0' cellspacing='0' border='0' align='center' width='320' bgcolor='#FFFFFF'><tr><td align='left' valign='top' height='1' bgcolor='#0062af'></td></tr><tr><td align='left' valign='middle' height='22' bgcolor='#0062af'>&nbsp;&nbsp;<span class='ft2'><strong>Preffered Airline</strong></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
					prefferedAir += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' onclick=javascript:closeDiv()><img src='image/close_image.gif'/></a></td></tr><tr><td align='left' valign='top' height='5'></td></tr><tr><td align='left' valign='top'><table cellpadding='0' cellspacing='0' border='0' align='center' width='100%'>";				
				var break_line = 0;
				var prefAirsplit = pref_airline_array.split("<br>");
				for(i = 0; i < prefAirsplit.length-1; i++)
				{
					var prefAir = prefAirsplit[i].split(",");
					var id = prefAir[0];
					var name = prefAir[1];
					if (break_line == 0)
					{
						prefferedAir +="<tr>"; 
					}
						prefferedAir +="<td nowrap width='5'><input type='checkbox' class='ft_03' name='prefairline' id='prefairline' value="+id+" ></td><td align='left' class='ft_03' width='80'>"+name+"</td>";
						Selectedlist += id +",";
					if(break_line == 2)
					{
						break_line = -1;
						prefferedAir +="</tr>";
					}
					break_line++;	
					
					//defaultAirList += id +",";   						
				}
				divObj.style.left = x;
				divObj.style.top = y;
				
				prefferedAir += "</table></td></tr><tr><td align='left' valign='top' height='1' bgcolor='#0062af'><img src='image/spacer.gif' vspace='0' hspace='0' border='0' width='1' height='1'></td></tr></table></td><td align='left' valign='top' width='1' bgcolor='#0062af'><img src='image/spacer.gif' vspace='0' space='0' border='0' width='1' height='0'></td></tr></table></form>";
				//</table></td></tr><tr><td align='left' valign='top' height='1' bgcolor='#0062af'><img src='image/spacer.gif' vspace='0' hspace='0' border='0' width='1' height='1'></td></tr></table></td><td align='left' valign='top' width='1' bgcolor='#0062af'><img src='image/spacer.gif' vspace='0' space='0' border='0' width='1' height='0'></td></tr></table>				
				divObj.innerHTML  = prefferedAir;	
			}
			
			function closeDiv()
			{		
				//formindex = "0";	
				divclose = "close";
				divcloslist = "";
				var l1 = document.forms[0].prefairline;
				for(k = 0; k < l1.length; k++)
				{
					if(l1[k].checked)
					{
						divcloslist = divcloslist + l1[k].value+",";
					}
				}
				//if(divcloslist == "")
				//{	
				//	divclose = "";
				//	alert("Atleast one preffered Airline should be select");						
				//	return false;
				//}
				//alert(divcloslist);
				document.getElementById("prefferedAirlineDIV").innerHTML = "";
			}
			
			function submitRequest()
			{
				var email = document.frmsubsc.emailadd.value;
				var error = "false";
				var mobile = document.frmsubsc.mobile.value;
                if ((email.indexOf('@') == -1 || email.indexOf('.') == -1) && email!= "")
                {
					alert("Invalid E-mail address.Please enter again" );
					document.frmsubsc.emailadd.focus();
					error = "true";
                }
                if(email=="" && mobile=="")
                {
					alert( "E-mail or Mobile cannot be blank" );
					document.frmsubsc.emailadd.focus();
					error = "true";
                }
                
                if (mobile!="")
                {
                	if(!(parseInt(mobile)))
					{
						alert("Mobile number should be numberic" );						
						document.frmsubsc.mobile.focus();
						error = "true";
					}
				}
				if (error == "false")
				{
					alert("Thank you for subscribing. We will update you with special offers and promotions");
					window.document.frmsubsc.action="submitSubscribtion.do";
					window.document.frmsubsc.submit();
				}
				
			}
			
			function getPhoneTerms()
			{
				MyWindow=window.open('general/phoneterms.jsp','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=550,height=500'); 
				return false;
			}
			function submitRequest()
			{
				var email = document.frmsubsc.emailadd.value;
				var error = "false";
				var mobile = document.frmsubsc.mobile.value;
                if ((email.indexOf('@') == -1 || email.indexOf('.') == -1) && email!= "")
                {
					alert("Invalid E-mail address.Please enter again" );
					document.frmsubsc.emailadd.focus();
					error = "true";
                }
                if(email=="" && mobile=="")
                {
					alert( "E-mail or Mobile cannot be blank" );
					document.frmsubsc.emailadd.focus();
					error = "true";
                }
                if (mobile!="")
                {
                	if(!(parseInt(mobile)))
					{
						alert("Mobile number should be numberic" );						
						document.frmsubsc.mobile.focus();
						error = "true";
					}
				}
				if (error == "false")
				{
					alert("Thank you for subscribing. We will update you with special offers and promotions");
					window.document.frmsubsc.action="submitSubscribtion.do";
					window.document.frmsubsc.submit();
				}
			}
			
			
			function msieversion()
		   	{
		      	var ua = window.navigator.userAgent
		      	var msie = ua.indexOf ( "MSIE " )
		      	
		      	//alert(msie);
		      	if ( msie > 0 )      // If Internet Explorer, return version number
		         	return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
		      	else                 // If another browser, return 0
		         	return 0
		   	}
		   	
		   	
			function onBodyLoad()
			{
			//alert(document.getElementById("args").value);
				var args = document.getElementById("args").value;
				var currDate = document.getElementById("currdate").value;
				var nextDate = document.getElementById("next_date").value;
				var w_retDate = document.getElementById("w_ret_date").value;
				var w_retintdate = document.getElementById("w_ret_int_date").value;
				var w_url = document.getElementById("w_url_Hotel").value;
				var w_date2 = document.getElementById("w_date2").value;
				var w_date3 = document.getElementById("w_date3").value;
				var w_date4 = document.getElementById("w_date4").value;
				var servdat = document.getElementById("servdat").value;
				var ss = document.getElementById("ss").value;
				var ssout = document.getElementById("ssout").value;
				var lsCity = document.getElementById("lsCity").value;
				var sskin = document.getElementById("sskin").value;
				var sskout = document.getElementById("sskout").value;
				var userdelparam = document.getElementById("UserDel").value;
				
				
				//Create Hidden field for Flight,Hotel,Car
				getUserHiddenParam_filght(userdelparam);
				getUserHiddenParam_Hotel(userdelparam);
				getUserHiddenParam_Car(userdelparam);
				
				createHiddenfield_flight(currDate);
				createHiddenfield_Hotel(w_date2,w_date3,w_date4);
				createHiddenfield_Car(servdat,ss,ssout,lsCity,sskin,sskout);
				//---------------------------------------------------------
				flightsource(currDate,nextDate,w_retDate,w_retintdate);
				hotelsource();
				carsource()
				
				//checkCookieDomesticFlight();
				hideReturnLoad();
				//checkCookieInternationalFlight();
			
				var dom_visible= document.getElementById("DomesticFlight").style.display;
				var int_visible = document.getElementById("InternationalFlight").style.display;
				airFareCalender();
				//alert(args);
					
					
				new actb('textdepart',"");
				new actb('textreturn',"");
				
				changeRows();
				showRoomsChildren();
				showRoomsChildren1();
				showRoomsChildren2();
				showRoomsChildren3();
				showRoomsChildren4();
				
				var browser=navigator.appName;			
				if(browser == "Microsoft Internet Explorer")
				{
					
					//document.getElementById('top_banners1_flight').className='top_banners_ie';
					document.getElementById('cabinintl').className='cabinie';
					document.getElementById('cabindom').className='cabindomie';
					document.getElementById('intl_button_height').className='intl_button_hgt_ie';
					document.getElementById('dom_button_height').className='dom_button_hgt_ie';
					document.getElementById('cabinoptintl').className='cabinoptie';
					//document.getElementById('fromintl').className='fromintlie';
					//document.getElementById('fromtextintl').className='fromtextintlie';
					//document.getElementById('fromtableintl').className='fromtableintlie';
					//document.getElementById('fromtable1intl').className='fromtable1intlie';
					//document.getElementById('top_header_right1').className='top_header_right_ie';
					//document.getElementById('L2_new13').className='L2_new_ie';
					
	
				}
				else
				{
					//document.getElementById('top_banners1_flight').setAttribute("class", "top_banners");//.class='top_banners';
					document.getElementById('cabinintl').setAttribute("class", "cabin");//.class='top_banners';
					document.getElementById('cabindom').setAttribute("class", "cabindom");//.class='top_banners';
					document.getElementById('intl_button_height').setAttribute("class", "intl_button_hgt");//.class='top_banners';
					document.getElementById('dom_button_height').setAttribute("class", "dom_button_hgt");//.class='top_banners';
					document.getElementById('cabinoptintl').setAttribute("class", "cabinopt");//.class='top_banners';
					//document.getElementById('fromintl').setAttribute("class", "fromintl");//.class='top_banners';
					//document.getElementById('fromtextintl').setAttribute("class", "fromtextintl");//.class='top_banners';
					//document.getElementById('fromtableintl').setAttribute("class", "fromtableintl");//.class='top_banners';
					//document.getElementById('fromtable1intl').setAttribute("class", "fromtable1intl");//.class='top_banners';
					//document.getElementById('top_header_right1').setAttribute("class", "top_header_right");//.class='top_banners';
					
					//document.getElementById('L2_new13').setAttribute("class", "L2_new");//.class='top_banners';
				
	
				}
				
				if (args == "flight")
					tabchangeHeader("Flight");
				else if (args == "hotel")
				{
					tabchangeHeader("Hotel");
					
				}
				else if (args == "car")
					tabchangeHeader("Car");
			}

			function submit_search()
			{
				if ( validate()!=false)
				{
					window.document.flightsPage.action="http://arzoo.com/air/searchprogress.do";
					window.document.flightsPage.submit();
				}
			}
			
	
function tabchangeHeader(arg)
{	
	var browser=navigator.appName;			
	if(browser == "Microsoft Internet Explorer")
	{
		//document.getElementById('top_banners1_flight').className='top_banners_ie';
		document.getElementById('cabinintl').className='cabinie';
		document.getElementById('cabindom').className='cabindomie';
		document.getElementById('intl_button_height').className='intl_button_hgt_ie';
		document.getElementById('dom_button_height').className='dom_button_hgt_ie';

	}
	else
	{
	
	
		//document.getElementById('top_banners1_flight').setAttribute("class", "top_banners");//.class='top_banners';
		document.getElementById('cabinintl').setAttribute("class", "cabin");//.class='top_banners';
		document.getElementById('cabindom').setAttribute("class", "cabindom");//.class='top_banners';
		document.getElementById('intl_button_height').setAttribute("class", "intl_button_hgt");//.class='top_banners';
		document.getElementById('dom_button_height').setAttribute("class", "dom_button_hgt");//.class='top_banners';
		
	}
	if(arg == "Flight")
	{	
		btnStatus ('flight','hotel','car','flight_s','hotel','car');
		swapDiv ('div1Img','div2Img','div3Img','searchFlight','searchHotel','searchCar')
	}	
	else if(arg == "Hotel")
	{	
		btnStatus ('hotel','flight','car','hotel_s','flight','car');
		swapDiv ('div2Img','div1Img','div3Img','searchHotel','searchFlight','searchCar')
	}
	else if(arg == "Car")
	{
		btnStatus ('car','hotel','flight','car_s','hotel','flight');
		swapDiv ('div3Img','div2Img','div1Img','searchCar','searchHotel','searchFlight')
			
	}


	function btnStatus (btn1,btn2,btn3,showC,hide1C,hide2C)
			{
				document.getElementById(btn1).className = showC;
				document.getElementById(btn2).className = hide1C;
				document.getElementById(btn3).className = hide2C;
			}
				
			function swapDiv (IdivId,I1DivId,I2DivId,SdivId,S1DivId,S2DivId)
			{
				document.getElementById(IdivId).className = 'dispBlock';
				document.getElementById(I1DivId).className = 'dispNone';
				document.getElementById(I2DivId).className = 'dispNone';
				
				document.getElementById(SdivId).className = 'dispBlock';
				document.getElementById(S1DivId).className = 'dispNone';
				document.getElementById(S2DivId).className = 'dispNone';
			}

}
function getLowestFare(dateForLowestFare, thisRef) {
	
	document.getElementById("lowestFareDateDisplay").innerHTML = "Searching for the lowest Air Fare on " + dateForLowestFare;
	//centering with css
	centerPopup();
	//load popup
	loadPopup();
	
	var origin = document.getElementById("airFareFrom").value;
	var destination = document.getElementById("airFareTo").value;
	
	var xmlhttp;
	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp = new XMLHttpRequest();
	}
	else {// code for IE6, IE5
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			var responses = xmlhttp.responseText.split(":");
			
			if (responses[0] == null || responses[0] == "null" || responses[0] == "error") {
				document.getElementById("lowestFareHeaderDisplay").innerHTML = "Search Result: ";
				document.getElementById("lowestFareDateDisplay").innerHTML = responses[1];
			}
			else {
				document.getElementById("lowestFareHeaderDisplay").innerHTML = "Search Result: ";
				document.getElementById("lowestFareDateDisplay").innerHTML = "Lowest Air Fare on " + dateForLowestFare + " is : " + responses[1] + " INR";
				thisRef.onclick = function () { submitSearch( dateForLowestFare,origin,destination ); };
				thisRef.style.color = "#af0000";
				thisRef.innerHTML = responses[1];
			}
			//document.getElementById("lowestFareHeaderDisplay").innerHTML = "Search Result: ";
			//document.getElementById("lowestFareDateDisplay").innerHTML = "xmlhttp.responseText: " + xmlhttp.responseText;
			disablePopup();
	    }
	}
	xmlhttp.open("GET", "GetLowestAirFare.do?origin=" + origin + "&destination=" + destination + "&date=" + dateForLowestFare, true);
	xmlhttp.send();
	
}

function submitSearch(date,origin,destination) {
		
		 arrreturn=date.split("-");
		 mm1=arrreturn[1];
		 dd1= arrreturn[2];
		 yy1=arrreturn[0];

		if (mm1 == "1" || mm1 == "01")
		{
			mm1 = "Jan";
		}		
		else if (mm1 == "2" || mm1== "02")
		{
			mm1 = "Feb";
		}
		else if (mm1 == "3" || mm1 == "03")
		{
			mm1 = "Mar";
		}
		else if (mm1 == "4" || mm1 == "04")
		{
			mm1 = "Apr";
		}
		else if (mm1 == "5" || mm1 == "05")
		{
			mm1 = "May";
		}
		else if (mm1 == "6" || mm1 == "06")
		{
			mm1 = "Jun";
		}
		else if (mm1 == "7" || mm1 == "07")
		{
			mm1 = "Jul";
		}
		else if (mm1 == "8" || mm1 == "08")
		{
			mm1 = "Aug";
		}
		else if (mm1 == "9" || mm1 =="09")
		{
			mm1 = "Sep";
		}
		else if (mm1 == "10")
		{
			mm1 = "Oct";
		}
		else if (mm1 == "11")
		{
			mm1 = "Nov";
		}
		else if (mm1 == "12")
		{
			mm1 = "Dec";
		}
		
		date = dd1 + "-" + mm1+"-"+yy1;
		
		var travelmode="oneway";
		var partnerid = "1001";
		var fromcity = origin;
		var tocity = destination;
		var fromdate = date;
		var todate = date;
		
		var e_ticket="false";						
         var no_adult = "1" ;
         var no_child = "0";
         var no_infant ="0";
         var cabin_type ="E";                       
         var residenceIndia = "true";
		
		MyWindow=window.open('http://arzoo.com/air/searchprogress.do?partnerid=1001&fromlocation='+origin+'&tolocation='+destination+'&fromdate='+date+'&todate='+date+'&travelmode=oneway&e_ticket=false&no_adult=1&no_child=0&no_infant=0&cabin_type=E&residenceIndia=true','_parent','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=1024,height=1024');

}


/***************************/
//@Author: Adrian "yEnS" Mato Gondelle
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/

//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupStatus = 0;

//loading popup with jQuery magic!
function loadPopup(){
	//loads popup only if it is disabled
	if(popupStatus==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupContact").fadeIn("slow");
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup(){
	//disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupContact").fadeOut("slow");
		popupStatus = 0;
	}
	var t = setTimeout("replaceLowestFareHeaderDisplay()", 500);
}
function replaceLowestFareHeaderDisplay() {
	document.getElementById("lowestFareHeaderDisplay").innerHTML = "<div id='lowestFareHeaderDisplay'>Please wait... <img style='border:none' src='images/Loading_bar_blue.gif' alt='Loading...'>";
}

//centering popup
function centerPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact").height();
	var popupWidth = $("#popupContact").width();
	//centering
	$("#popupContact").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}

/*
//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
			
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose").click(function(){
		disablePopup();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopup();
	});
	//Press Escape event!
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup();
		}
	});

});*/

