if(typeof (IXIGO)=="undefined"){IXIGO={}}IXIGO.FlightFilter=function(){var A=null;this.flightResult=null;
this.receivedAirlineType=[];this.airline=[];this.priceSlider=new IXIGO.Slider();this.sliders=[];this.minPrice=0;
this.maxPrice=24;this.distanceMap=["any",500,1000,2000,4000,8000];this.distanceFilter=[];this.priceRange=new Range(this.minPrice,this.maxPrice);
this.init=function(B){A=this;$("#resetFilter").click(function(){A.reset()});this.flightResult=B;$("#airlineTypeFilter").click(function(C){A.airlineTypeChange(C)
});$("#tripDistance").change(function(){A.distanceFilterChange()});this.priceSlider.init(A);this.priceSlider.create({track:"slider_track1",steps:100,min:this.minPrice,max:this.maxPrice,onSlide:this.priceSlide,onChange:this.priceChange})
};this.reset=function(){for(a in this.receivedAirlineType){$("#airlineType_"+a.replace(/[^a-zA-Z0-9]/g,"_")).attr("checked",true);
this.airline[a]=true}$("#tripDistance").val("any");this.distanceFilter.distance=$("#tripDistance").val();
this.priceSlider.reset({track:"slider_track1",steps:100,onChange:this.priceChange,range:[this.minPrice,this.maxPrice],params:[0,120,7.5,120]});
$(this).trigger("change")};this.show=function(){$("#filterResponse").show()};this.hide=function(){$("#filterResponse").hide()
};this.searchResults=function(B){$(this).trigger("change")};this.priceSlide=function(B){$("#sliderStatus1").html("Rs. "+(B[0]).toFixed(0)+" to "+"Rs."+(B[1]).toFixed(0))
};this.priceChange=function(B){$("#updateIndicator").show();this.priceRange.start=B[0];this.priceRange.end=B[1];
if(B[0]>this.minPrice||B[1]<this.maxPrice){}this.priceSlide(B)};this.getFilteredResponses=function(B){var C=[];
var E;for(var D=0;B[D];D++){E=B[D];if(this.isDisplayed(E)){C[C.length]=E}}return C};this.isDisplayed=function(C){var B=true;
if(C.providers){B=B&&(this.airline[C.providers[0].toLowerCase()]!==false)}B=B&&(this.priceRange.contains(C.adultTotal));
B=B&&(this.isWithinRange(C));return B};this.isWithinRange=function(F){if(this.distanceFilter.distance==="any"){return true
}else{var D=parseFloat(this.flightResult.originLat);var H=parseFloat(this.flightResult.originLong);var E=6371;
var C=parseFloat(F.latitude?F.latitude:0);var G=parseFloat(F.longitude?F.longitude:0);var J=(C-D)*Math.PI/180;
var B=(G-H)*Math.PI/180;var L=Math.sin(J*0.5)*Math.sin(J*0.5)+Math.cos(D*Math.PI/180)*Math.cos(C*Math.PI/180)*Math.sin(B/2)*Math.sin(B/2);
var K=2*Math.atan2(Math.sqrt(L),Math.sqrt(1-L));var I=E*K;return(I<=parseFloat(this.distanceFilter.distance))
}};this.airlineTypeChange=function(D){var C=D.target;var B,E;if(C.id&&C.id.indexOf("airlineType_")===0){E=C.id.substring(C.id.indexOf("airlineType_")+12);
if(E==="selectAll"||E==="selectNone"){B=(E==="selectAll");for(a in this.receivedAirlineType){$("#airlineType_"+a.replace(/[^a-zA-Z0-9]/g,"_")).attr("checked",B);
this.airline[a]=B}}else{for(a in this.receivedAirlineType){this.airline[a]=$("#airlineType_"+a.replace(/[^a-zA-Z0-9]/g,"_")).attr("checked")
}}$(this).trigger("change")}else{if(C.id&&C.id.indexOf("airlineTypeLabel_")===0){E=C.id.substring(C.id.indexOf("airlineTypeLabel_")+17);
for(a in this.receivedAirlineType){B=a===E?true:false;$("#airlineType_"+a.replace(/[^a-zA-Z0-9]/g,"_")).attr("checked",B);
this.airline[a]=B}$(this).trigger("change")}}};this.updateAirlineType=function(D){var G="";var F="airlines";
G='<div><div style="margin-top: 4px;"><label for="airline" id="airlineTypeShowLabel">'+F+"</label></div></div>";
var E=0;G+='<div id="airlineTypeOptions" style="display:block;">'+'<div style="margin:5px 5px 5px 0px;">'+"select&#160;"+'<span class="link" id="airlineType_selectAll">all,</span>&#160;'+'<span class="link" id="airlineType_selectNone">none</span>'+"</div></div>";
G+='<div id="airlineTypeCheckBox" style="overflow-x: hidden;overflow: hidden;">';var C=[];for(a in D){C.push(a)
}C.sort();for(var B=0;B<C.length;B++){a=C[B];G+='<div style="margin:5px 5px 0px 0px;">';G+='<div style="float: left; width: 20px;"><input type="checkbox" class="filterAirlineBox" id="airlineType_'+a.replace(/[^a-zA-Z0-9]/g,"_")+'"';
if(this.airline[a]===false){G+=" />"}else{G+=' checked="checked" />';this.airline[a]=true}G+='</div><div class="link" id="airlineTypeLabel_'+a+'" style="float: left; width: 110px;">'+a.toLowerCase()+'</div><div class="clear"></div></div>';
E++}G+="</div>";if(E!==0){$("#airlineType").html(G);$("#airlineTypeFilter").show()}};this.updatePriceFilter=function(){var B=100;
this.minPrice=this.minPrice-(this.minPrice%B);this.maxPrice=this.maxPrice+B-(this.maxPrice%B);this.priceRange.start=this.minPrice;
this.priceRange.end=this.maxPrice;this.priceSlider.create({track:"slider_track1",steps:100,min:this.minPrice,max:this.maxPrice,onSlide:this.priceSlide,onChange:this.priceChange})
};this.distanceFilterChange=function(){var B=$("#tripDistance").val();this.distanceFilter.distance=B;
$(this).trigger("change")};this.updateTripLandmark=function(){var C=$("#tripDistance").html()!=""?$("#tripDistance").val():"";
var D=$("#tripDistance").html("")[0];for(var B=0;this.distanceMap[B];B++){D.options[B]=new Option(this.distanceMap[B],this.distanceMap[B])
}if(C==""){D.options[0].selected=true}else{$("#tripDistance").val(C)}this.distanceFilter.distance="any"
}};IXIGO.FlightMain=function(){var B=null;this.monthAbr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
this.date=new Date();this.mapView=null;this.flightSort=new IXIGO.FlightSort();this.filter=new IXIGO.FlightFilter();
this.results=[];this.selectedResults=[];this.receivedAirlineType=[];this.sortedResponses=[];this.filteredResponses=[];
this.receivedLandmarkMap=[];this.map;this.currentTab="contentMap";this.originLat=0;this.originLong=0;
this.origin="DEL";this.duration="";this.retDuration="";this.tripType="oneway";this.showOnly=25;this.product="mapper";
this.continent="Anywhere";this.countryCode={"NorthAmerica":["AG","AI","AW","BB","BM","BS","BZ","CA","CR","CU","DM","DO","GD","GL","GP","GT","HN","HT","JM","KN","KY","LC","MQ","MS","MX","NI","PA","PM","PR","SV","TC","TT","UM","US","VC","VG","VI","WI"],"SouthAmerica":["AR","BO","BR","CL","CO","EC","FK","GF","GY","PE","PY","SR","UY","VE"],"Europe":["AD","AL","AN","AT","BA","BE","BG","BY","CH","CZ","DE","DK","EE","ES","FI","FO","FR","GB","GE","GI","GR","GS","HR","HU","IE","IS","IT","LI","LT","LU","LV","MC","MD","MK","MT","NL","NO","PL","PT","RE","RO","SE","SI","SJ","SK","SM","TF","UA","VA","WX","WY","XB","YU"],"Africa":["AO","BF","BJ","BV","BW","CF","CG","CI","CM","CV","DJ","DZ","EG","EH","ER","ET","GA","GH","GM","GN","GW","KE","KM","LR","LS","LY","MA","MG","ML","MR","MU","MW","MZ","NA","NE","NG","RW","SC","SD","SH","SL","SN","SO","ST","SZ","TD","TG","TN","TZ","UG","XA","YT","ZA","ZM","ZR","ZW"],"Asia":["AE","AF","AM","AZ","BD","BH","BI","BN","BT","BU","CN","CY","GQ","HK","ID","IL","IN","IO","IQ","IR","JO","JP","KG","KH","KP","KR","KW","KZ","LA","LB","LK","MM","MN","MO","MV","MY","NP","OM","PH","PK","QA","RU","SA","SG","SY","TH","TJ","TM","TP","TR","TW","UZ","VN","XI","YE"],"Australia":["AS","AU","CC","CK","CX","FJ","FM","GU","HM","KI","MH","MP","NC","NF","NR","NU","NZ","PF","PG","PN","PW","SB","TK","TO","TV","VU","WF","WS"]};
this.init=function(){B=this;this.loadLeavingCombo();var G=window.location.href;var F=G.split("/");B.product=F[3];
if(F.length>4){if(F[4].length>0){B.origin=F[4];$("#fareMapperForm\\:origin").val(B.origin)}if(F[5].length>0){B.duration=F[5];
$("#fareMapperForm\\:leaveTimeBox").val(B.duration)}if(F[6].length>0){B.retDuration=F[6];$($("input[@name='returnFlight']")[0]).attr("checked","checked");
$("#returnTime").show();$("#fareMapperForm\\:returnTimeBox").val(B.retDuration);B.tripType="return"}if(F[7].length>0){B.showOnly=F[7];
if(F[7]==="100"){$($("input[@name='showNumResults']")[1]).attr("checked","checked")}}if(F[8].length>0){B.continent=F[8];
$("#fareMapperForm\\:destBox").val(B.continent)}}this.flightSort.init(B);$(this.flightSort).change(function(){$("#updateIndicator").show();
B.updateSort()});this.filter.init(B);$(this.filter).change(function(){$("#updateIndicator").show();B.updateFilter()
});$("input[@name='showNumResults']").click(function(){B.showOnly=$("input[@name='showNumResults']:checked").val()
});$("div#contentBox").corner("bottom").corner("tr");$("#FaresButton").mouseover(function(H){IXIGO.buttonHover("#FaresButton","b-","-bg-3")
}).mouseout(function(H){IXIGO.buttonHover("#FaresButton","b-","-bg-3")});$("#FaresButton").click(function(){var H=$($("input[@name='returnFlight']")[0]).attr("checked");
if(H){window.location.href="/"+B.product+"/"+$("#fareMapperForm\\:origin").val()+"/"+$("#fareMapperForm\\:leaveTimeBox").val()+"/"+$("#fareMapperForm\\:returnTimeBox").val()+"/"+B.showOnly+"/"+$("#fareMapperForm\\:destBox").val()
}else{window.location.href="/"+B.product+"/"+$("#fareMapperForm\\:origin").val()+"/"+$("#fareMapperForm\\:leaveTimeBox").val()+"//"+B.showOnly+"/"+$("#fareMapperForm\\:destBox").val()
}});$("#loadingIndicator").show();B.loadGMapScript();$("#contentTabContainer").click(function(H){B.oncontentTabClick(this,H)
});$("#contentMapTabLink").corner("top");$("#shareFareMap").click(function(){var I="iXiGO Fare Mapper";
var H="/html/info/tell-a-friend.ixi?provider=email&channel=email&id=200811273773&link="+window.location+"&title="+document.title+"&custom={'tool':'"+I+"'}";
window.open(H,"iXiGO","scrollbars=no,menubar=no,width=490,height=520,resizable=no,toolbar=no,location=no,status=no,screenX=200,screenY=100,left=200,top=100");
return false});$("input[@name='returnFlight']").click(function(){B.toggleReturn()})};this.toggleReturn=function(){if($($("input[@name='returnFlight']")[0]).attr("checked")){$("#returnTime").fadeIn()
}else{$("#returnTime").fadeOut()}};this.loadGMapScript=function(){if(location.hostname.indexOf("ixigo")!==-1){var F=document.createElement("script");
F.type="text/javascript";F.src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAaFkhHqRKxmIC55Cw5dS1cRSVVb5P-P-81vc8SJK_4LEGVkGjEhSfxXw_tms7NnWvDcBG8yfIUb1Mxw&async=2&callback=window.searchResult.initializeMap";
$("body")[0].appendChild(F)}};this.initializeMap=function(){if(B.mapView===null||!B.mapView){var F=document.createElement("script");
F.type="text/javascript";F.src="/static/js/ixigo/label_marker.js";$("body")[0].appendChild(F)}$.ajax({type:"GET",url:"/action/content/faremap?searchFor=faremap&origin="+B.origin+"&duration="+B.duration+"&retDuration="+B.retDuration,dataType:"html",success:function(I){if($("#loadingIndicator").css("display")!="block"){$("#updateIndicator").show()
}B.results=Ajax.evalJSON(I);var G=0;if(GBrowserIsCompatible()&&B.results[0]){B.results.sort(B.flightSort.comparator);
B.sortedResponses=B.results;for(var H=0;H<B.sortedResponses.length;H++){if(B.sortedResponses[H].originCode===B.sortedResponses[H].destinationCode){B.originLat=B.sortedResponses[H].latitude;
B.originLong=B.sortedResponses[H].longitude}if(B.sortedResponses[H].destinationCode!=$("#fareMapperForm\\:origin").val()&&B.sortedResponses[H].providers!=null&&G<parseInt(B.showOnly)&&E(B.sortedResponses[H].destCountryCode)){B.selectedResults[G]=B.sortedResponses[H];
G++}}B.addFilterData(B.selectedResults);B.filter.receivedAirlineType=B.receivedAirlineType;B.filter.updateAirlineType(B.receivedAirlineType);
B.filter.updatePriceFilter();B.filter.updateTripLandmark();if(B.originLat!=0&&B.originLong!=0){$(B.flightSort).trigger("change")
}else{B.map=new GMap2(document.getElementById("map"),{size:new GSize(583,400)});$("#updateIndicator, #loadingIndicator, #resultList, #filterOpts").hide();
$("#allResults").html("");$("#updateTextError").html("Not enough searches on this route");$("#updateError").show()
}}else{B.map=new GMap2(document.getElementById("map"),{size:new GSize(583,400)});$("#updateIndicator, #loadingIndicator, #resultList, #filterOpts").hide();
$("#allResults").html("");$("#contentBox").css("height","400px");$("#updateTextError").html("Not enough searches on this route");
$("#updateError").show()}},error:function(G){$("#updateTextError").html("Not enough searches on this route");
B.map=new GMap2(document.getElementById("map"),{size:new GSize(583,400)});$("#updateIndicator, #loadingIndicator, #resultList, #filterOpts").hide();
$("#contentBox").css("height","400px");$("#allResults").html("");$("#updateError").show();setTimeout('$("#updateError").hide();',3000)
},beforeSend:function(G){G.setRequestHeader("Accept","text/javascript")}})};this.addFilterData=function(F){var I=0;
var J=100;var H=parseInt(B.showOnly)>F.length?F.length:parseInt(B.showOnly);for(var G=0;G<H;G++){if(F[G].providers){var K=F[G].providers[0].toLowerCase();
if(!this.receivedAirlineType[K]){this.receivedAirlineType[K]=K}}if(parseFloat(F[G].adultTotal)>J){J=parseFloat(F[G].adultTotal)
}else{if(parseFloat(F[G].adultTotal)<I){I=parseFloat(F[G].adultTotal)}}}this.filter.minPrice=this.filter.minPrice!==0?Math.min(I,this.filter.minPrice):I;
this.filter.maxPrice=Math.max(J,this.filter.maxPrice)};this.updateSort=function(){$("#updateIndicator").show();
this.filteredResponses=this.filter.getFilteredResponses(this.sortedResponses);if(this.filteredResponses.length>0){this.filteredResponses.sort(B.flightSort.comparator);
B.showResults(this.filteredResponses)}else{$("#updateError").show();if(window.location.href.indexOf("planner")>0){$("#contentBox").css("height","400px")
}}};this.updateFilter=function(){$("#updateIndicator").show();this.filteredResponses=this.filter.getFilteredResponses(this.sortedResponses);
this.filteredResponses.sort(B.flightSort.comparator);this.showResults(this.filteredResponses)};this.updateLandmarkMap=function(F){if(F.landmarks.length!==0){this.filter.receivedLandmarkMap=F.landmarks;
this.receivedLandmarkMap=F.landmarks}};this.createPolyline=function(L,K,J,I,H){var F={geodesic:true};
var G=new GPolyline([new GLatLng(L,K),new GLatLng(J,I)],"#0686fe",3,0.3,F);H.addOverlay(G)};this.createMarker=function(L,F,G,K,J,N){var H=new GLatLng(L,F);
var M=new GIcon();M.image="/img/x.gif";M.iconSize=new GSize(0,0);M.iconAnchor=new GPoint(1,12);M.infoWindowAnchor=new GPoint(0,16);
opts={"icon":M,"clickable":true,"title":N,"labelText":K,"labelClass":"label","labelOffset":new GSize(-489,-231)};
var I=new LabeledMarker(H,opts);G.addOverlay(I);GEvent.addListener(I,"click",function(){I.openInfoWindowHtml(J,{maxWidth:"200"})
})};this.loadLeavingCombo=function(){var I=B.date.getMonth();var J="<option class='optionOne' value=''>anytime</option>";
for(var G=0,F=0;G<6;G++,F++){if(I+F>12){I=1;F=0}B.date.setMonth(I+F);var H=""+(B.date.getMonth()+1);if(H.length==1){H="0"+H
}J+='<option value="'+(H+B.date.getFullYear())+'">'+(B.monthAbr[B.date.getMonth()]+" "+B.date.getFullYear())+"</option>"
}$("#option1").hide();$("#fareMapperForm\\:leaveTimeBox, #fareMapperForm\\:returnTimeBox ").append(J);
$("#fareMapperForm\\:returnTimeBox option.optionOne").val("any")};this.fillMapData=function(J){B.map=new GMap2(document.getElementById("map"),{size:new GSize(583,400)});
$("#contentBox").css("height","400px");B.map.addControl(new GSmallZoomControl());B.map.setCenter(new GLatLng(B.originLat,B.originLong),this.zoomLevel(J));
var H='<div id="ixiTipWrapper" style="width: 100px; top: 204px; left: 449px; display: block;">'+'<div class="ixiTip" style="top: 18px; left: 33px;">'+'<div style="margin: 0pt 0px; overflow: hidden; height: 1px; background-color: #ffaa00; width: 14px; float: none;"></div>'+'<div style="margin: 0pt 1px; overflow: hidden; height: 1px; background-color: #ffaa00; width: 12px; float: none;"></div>'+'<div style="margin: 0pt 2px; overflow: hidden; height: 1px; background-color: #ffaa00; width: 10px; float: none;"></div>'+'<div style="margin: 0pt 3px; overflow: hidden; height: 1px; background-color: #ffaa00; width: 8px; float: none;"></div>'+'<div style="margin: 0pt 4px; overflow: hidden; height: 1px; background-color: #ffaa00; width: 6px; float: none;"></div>'+'<div style="margin: 0pt 5px; overflow: hidden; height: 1px; background-color: #ffaa00; width: 4px; float: none;"></div>'+'<div style="margin: 0pt 6px; overflow: hidden; height: 1px; background-color: #ffaa00; width: 2px; float: none;"></div>'+'<div class="clear"></div>'+"</div>"+'<div class="ixiTipBody">'+'<div class="cnMap left"></div>'+'<div class="ixiTipBodyContent semi" style="background: #ffaa00;color: #444;">';
var G="</div>"+'<div class="cnMap right"></div>'+'<div class="clear"></div>'+"</div>"+"</div>";var F=0;
for(var I=0;I<J.length;I++){if(J[I].destinationCode!=$("#fareMapperForm\\:origin").val()&&J[I].providers!=null&&F<parseInt(B.showOnly)&&E(J[I].destCountryCode)){var K='<div style="line-height:18px;font-family:verdana;color#444;">'+'<div style="font-weight:bold;">'+J[I].origin+" - "+J[I].destination+"</div>"+'<div style="font-weight:bold;">'+J[I].providers[0]+"</div>"+'<div style="float:left;width:125px;">'+"<div>"+Date.fromFlatDate(J[I].startDate).toDateString()+"</div>";
if(J[I].endDate!="01011970"){K+="<div>"+Date.fromFlatDate(J[I].endDate).toDateString()+"</div>"}K+="</div>"+'<div style="float:right;">'+'<span style="color:#666;font-size:9pt;">Rs. </span>'+'<span style="font-weight:bold;font-size:11pt;color:#444;">'+parseInt(J[I].adultTotal,10).toFixed(0)+"</span>"+"</div>"+'<div class="clear"></div>'+'<div style="text-align:right;">';
if(J[I].endDate!="01011970"){K+='<a target="_blank" href="/search/result/flight/'+$("#fareMapperForm\\:origin").val()+"/"+J[I].destinationCode+"/"+J[I].startDate+"/"+J[I].endDate+'/1/0/0/e">search flight</a>'
}else{K+='<a target="_blank" href="/search/result/flight/'+$("#fareMapperForm\\:origin").val()+"/"+J[I].destinationCode+"/"+J[I].startDate+'//1/0/0/e">search flight</a>'
}K+="</div>"+"</div>";B.createMarker(J[I].latitude,J[I].longitude,B.map,H+'<span style="color:#666;font-size:10px;">Rs.</span><b>'+parseInt(J[I].adultTotal).toFixed(0)+"</b>"+G,K,"flight to "+J[I].destination);
B.createPolyline(B.originLat,B.originLong,J[I].latitude,J[I].longitude,B.map);F=F+1}}};this.showResults=function(H){var I="&#160;";
var F=0;if(window.location.href.indexOf("planner")==-1&&H.length>0){if(B.tripType!="oneway"){$("#sortReturn").show();
$("#sortDestination, #sortDepart").css("width","90px");for(var G=0;G<H.length;G++){if(H[G].destinationCode!=$("#fareMapperForm\\:origin").val()&&F<parseInt(B.showOnly)&&H[G].startDate!=null&&H[G].endDate!=null&&E(H[G].destCountryCode)){I+='<div id="result_'+H[G].destinationCode+'" class="resultsDisplay" style="background:#fff;"><a target="_blank" id="result_'+H[G].destinationCode+'Link" style="text-decoration:none;color:#666;background:#fff;" href="/search/result/flight/'+$("#fareMapperForm\\:origin").val()+"/"+H[G].destinationCode+"/"+H[G].startDate+"/"+H[G].endDate+'/1/0/0/e"><div id="result_'+H[G].destinationCode+'Div" class="round_all" style="cursor:pointer;font-family:verdana;background:#eee;color:#444;">'+'<div style="float:left;width:90px;font-weight:bold;margin-top:2px;padding:10px 0px 10px 10px;">'+H[G].destination+"</div>"+'<div style="float:left;width:90px;margin-top:2px;padding:10px 0px;" title="'+Date.fromFlatDate(H[G].startDate).toDateString()+'">'+Date.fromFlatDate(H[G].startDate).toDateString().substring(4,10)+'<span class="ixiGray"> ('+Date.fromFlatDate(H[G].startDate).toDateString().substring(0,3)+")</span></div>"+'<div style="float:left;width:90px;margin-top:2px;padding:10px 0px;" title="'+Date.fromFlatDate(H[G].endDate).toDateString()+'">'+Date.fromFlatDate(H[G].endDate).toDateString().substring(4,10)+'<span class="ixiGray"> ('+Date.fromFlatDate(H[G].endDate).toDateString().substring(0,3)+")</span></div>"+'<div style="float:left;margin-top:2px;padding:10px 0px;">found '+C(H[G].searchedOn)+' on <span style="color:#ff7800;">'+H[G].providers[0]+'</span></div><div style="text-align:right;padding:10px 10px 10px 0px;"><span class="currency">Rs. </span><span class="adultTotal" style="color:#000;">'+parseInt(H[G].adultTotal,10).toFixed(0)+'</span></div><div class="clear"/></div></a></div><br/>';
F=F+1}}}else{for(var G=0;G<H.length;G++){if(H[G].destinationCode!=$("#fareMapperForm\\:origin").val()&&F<parseInt(B.showOnly)&&H[G].startDate!=null&&E(H[G].destCountryCode)){I+='<div id="result_'+H[G].destinationCode+'" class="resultsDisplay" style="background:#fff;"><a target="_blank" id="result_'+H[G].destinationCode+'Link" style="text-decoration:none;color:#666;background:#fff;" href="/search/result/flight/'+$("#fareMapperForm\\:origin").val()+"/"+H[G].destinationCode+"/"+H[G].startDate+'//1/0/0/e"><div id="result_'+H[G].destinationCode+'Div" class="round_all" style="cursor:pointer;font-family:verdana;background:#eee;color:#444;">'+'<div style="float:left;width:120px;font-weight:bold;margin-top:2px;padding:10px 0px 10px 10px;">'+H[G].destination+"</div>"+'<div style="float:left;width:120px;margin-top:2px;padding:10px 0px;" title="'+Date.fromFlatDate(H[G].startDate).toDateString()+'">'+Date.fromFlatDate(H[G].startDate).toDateString().substring(4,10)+'<span class="ixiGray"> ('+Date.fromFlatDate(H[G].startDate).toDateString().substring(0,3)+")</span></div>"+'<div style="float:left;margin-top:2px;padding:10px 0px;">found '+C(H[G].searchedOn)+' on <span style="color:#ff7800;">'+H[G].providers[0]+'</span></div><div style="text-align:right;padding:10px 10px 10px 0px;"><span class="currency">Rs. </span><span class="adultTotal" style="color:#000;">'+parseInt(H[G].adultTotal,10).toFixed(0)+'</span></div><div class="clear"/></div></a></div><br/>';
F=F+1}}}$("#resultList, #filterOpts").show();if(H.length===1){$("#allResults").html("<div style='background: #eee;border-top: 1px solid #999999; border-bottom: 1px solid #999999; padding: 25px; height: 60px; font-weight: bold; font-size: 10pt;'>No results available for the applied filters.<br/> Please <span id='resetResult' class='link'>reset</span> filters.</div>").show();
$("#resetResult").click(function(){B.filter.reset()})}else{$("#allResults").html(I).show()}$("div.resultsDisplay").hover(function(){$("#"+$(this).attr("id")+"Div").css("background","#dedede")
},function(){$("#"+$(this).attr("id")+"Div").css("background","#eee")});$("#allResults div.round_all").corner()
}else{$("#uploadIndicator").hide();$("#updateTextError").html("Not enough searches on this route")}if(!this.flightSort.updateMap){B.fillMapData(H)
}$("#updateIndicator, #loadingIndicator").hide();setTimeout('$("#copyright").css("font-size", "9px");',2000)
};function E(F){if(B.continent==="Anywhere"||$.richArray.has(B.countryCode[B.continent],F)){return true
}else{return false}}function D(F){return F.getDate()+" "+F.getSmallMonthName()}function A(F){newDate=F.replace("-","");
newDate=newDate.replace("-","");return newDate}function C(G){var I=0;var F=Date.today();var H;I=(F-G)/(1000*60*60*24);
if(parseInt(I)>0){H=parseInt(I)+(parseInt(I)>1?" days ago":" day ago")}else{if(parseInt(I*24)>0){H=parseInt(I*24)+(parseInt(I*24)>1?" hrs ago":" hr ago")
}else{H=parseInt(I*1440)+(parseInt(I*1440)>1?" mins ago":" min ago")}}return H}this.oncontentTabClick=function(I,H){var F="";
var G=H.target;while(G&&G!==I&&!G.getAttribute("action")){G=G.parentNode}if(G&&G.getAttribute("action")){F=G.getAttribute("action");
F=F.lastIndexOf("/")!==-1?F.substring(F.lastIndexOf("/")+1):F;this.selectTab(F)}if(G.getAttribute("action")==="contentGraph"){$("#radioShowResults").hide();
$("#destCity").fadeIn();$("option.optionOne").html("next 30 days");$("#contentBox").css("height","400px")
}else{$("#destCity").hide();$("option.optionOne").html("anytime");$("#radioShowResults").fadeIn();$("#contentBox").css("height","400px")
}};this.selectTab=function(F){if(this.currentTab===F){return }this.hideTab(this.currentTab);this.showTab(F);
this.currentTab=F};this.hideTab=function(F){F="#"+F;$(F).hide();$(F+"TabLink").attr("class","tripDetailTabTitle")
};this.showTab=function(F){F="#"+F;$(F).show();$(F+"TabLink").attr("class","tripDetailTabTitleSelected");
$(F+"TabLink").corner("top")};this.updateOutlookGraph=function(){var G=$("#fareMapperForm\\:origin").val();
var F=$("#fareMapperForm\\:destination").val();var H=$("#fareMapperForm\\:leaveTimeBox").val().substring(0,2)+$("#fareMapperForm\\:leaveTimeBox").val().substring(2,6);
if(G!=F){$("#contentGraph").html('<br/><div style="float:left;color:#666;margin-left:40px;margin-bottom:10px;">30 day fare outlook for <b>'+G+" - "+F+'</b> flights</div><br/><iframe scrolling="no" height="320" frameborder="0" width="580" src="/html/search/result/flights/flightplanner.ixi?orig='+G+"&amp;des="+F+"&amp;month="+H+'&amp;page=tripPlanner" id="iframe_outlookBig"/>')
}else{if(F==="DEL"){$("#contentGraph").html('<br/><div style="float:left;color:#666;margin-left:40px;margin-bottom:10px;">30 day fare outlook for <b>'+G+' - BOM</b> flights</div><br/><iframe scrolling="no" height="320" frameborder="0" width="580" src="/html/search/result/flights/flightplanner.ixi?orig='+G+"&amp;des=BOM&amp;month="+H+'&amp;page=tripPlanner" id="iframe_outlookBig"/>');
$("#fareMapperForm\\:destination").val("BOM")}else{if(F==="BOM"){$("#contentGraph").html('<br/><div style="float:left;color:#666;margin-left:40px;margin-bottom:10px;">30 day fare outlook for <b>'+G+' - DEL</b> flights</div><br/><iframe scrolling="no" height="320" frameborder="0" width="580" src="/html/search/result/flights/flightplanner.ixi?orig='+G+"&amp;des=DEL&amp;month="+H+'&amp;page=tripPlanner" id="iframe_outlookBig"/>');
$("#fareMapperForm\\:destination").val("DEL")}else{$("#contentGraph").html("");$("#updateTextError").html("Please select a destination");
$("#updateError").show()}}}};this.zoomLevel=function(U){var O=0;var G=0;var H=U.length;for(var L=0;L<H;
L++){var J=parseFloat(B.originLat);var N=parseFloat(B.originLong);var K=6371;var I=parseFloat(U[L]?U[L].latitude:0);
var M=parseFloat(U[L]?U[L].longitude:0);var Q=(I-J)*Math.PI/180;var F=(M-N)*Math.PI/180;var T=Math.sin(Q*0.5)*Math.sin(Q*0.5)+Math.cos(J*Math.PI/180)*Math.cos(I*Math.PI/180)*Math.sin(F/2)*Math.sin(F/2);
var S=2*Math.atan2(Math.sqrt(T),Math.sqrt(1-T));var P=K*S;if(U[L]&&E(U[L].destCountryCode)&&(G<parseInt(B.showOnly))){O=O>P?O:P;
G=G+1}}O=O<500?6:O<1000?5:(O<4000?4:(O<8000?3:(O<11000?2:1)));return O}};IXIGO.FlightSort=function(){var B=this;
this.flightResult=null;this.comparator=null;this.priceSortDesc=true;this.sortDesc=true;this.arrow="&#8595;";
var A=false;this.init=function(C){B=this;this.flightResult=C;$("#sortDestination").html("<span>destination</span>");
$("#sortDepart").html("<span>depart</span>");$("sortReturn").html("<span>return</span>");$("#sortAirline").html("<span>airline</span>");
$("#sortPrice").html("<span>price per adult*</span>");this.sort(B.priceComparator,$("#sortPrice"),"first");
$("#sortDepart").click(function(){B.sort(B.departComparator,$("#sortDepart"))});$("#sortReturn").click(function(){B.sort(B.returnComparator,$("#sortReturn"))
});$("#sortDestination").click(function(){B.sort(B.arrivalComparator,$("#sortDestination"))});$("#sortPrice").click(function(){B.sort(B.priceComparator,$("#sortPrice"))
});$("#sortAirline").click(function(){B.sort(B.airlineComparator,$("#sortAirline"))})};this.departComparator=function(D,C){var E=Date.fromFlatDate(D.startDate)-Date.fromFlatDate(C.startDate);
if(E===0){return B.priceComparator(D,C)}E=B.sortDesc?E:-E;return E};this.returnComparator=function(D,C){var E=Date.fromFlatDate(D.endDate)-Date.fromFlatDate(C.endDate);
if(E===0){return B.priceComparator(D,C)}E=B.sortDesc?E:-E;return E};this.arrivalComparator=function(D,C){var E=String.compareIgnoreCase(D.destination,C.destination);
if(E===0){return B.priceComparator(D,C)}E=B.sortDesc?E:-E;return E};this.airlineComparator=function(D,C){var E=C.searchedOn-D.searchedOn;
if(E===0){return B.priceComparator(D,C)}E=B.sortDesc?E:-E;return E};this.priceComparator=function(D,C){var E=D.adultTotal-C.adultTotal;
E=B.priceSortDesc?E:-E;if(E===0){return(D.startDate-C.startDate)}return E};this.sort=function(F,E,D){if(D!="first"){$("#updateIndicator").show()
}this.priceSortDesc=true;if(this.comparator!=F){this.comparator=F;this.sortDesc=true}else{this.sortDesc=!this.sortDesc
}if(this.comparator===this.priceComparator){this.priceSortDesc=this.sortDesc}this.arrow=this.sortDesc?"<span style='color:#000;'>&#8595;</span>":"<span style='color:#000;'>&#8593;</span>";
$("#sortDestination").html("<span>destination</span>");$("#sortDepart").html("<span>depart</span>");$("#sortReturn").html("<span>return</span>");
$("#sortAirline").html("<span>found on</span>");$("#sortPrice").html("<span>price per adult*</span>");
if(E){var C=E.html().lastIndexOf(">");var G=E.html().substring(E.html().indexOf("<"),C+1);E.html(B.arrow+G+B.arrow);
A=true}$(this).trigger("change")}};$(document).ready(function(){window.searchResult=new IXIGO.FlightMain();
window.searchResult.init()});