var FocusId="";function openwindow11(){var a=Ext.getCmp("air_rt_form").getForm();openwindow(a)}function openwindow(u){var o;var f=new Array();var t=queryString("sid");var b=queryString("cfrrefid");var g=queryString("trip_type");var a=Ext.getCmp("air_ow_form").getForm();if(queryString("sid")!="false"){var c=getWinsToOpen(t,b);for(var n=0;n<openwindowpercent.length;n++){var r=Math.floor(Math.random()*101);var s=parseInt(openwindowpercent[n]);if(s==100){f[n]=c[n]}else{if(s==0){continue}else{if(r<=s){f[n]=c[n]}}}}if(f.length>0){var e;if(g!=null&&g!=undefined&&g=="OneWay"){e="&to="+a.findField("hd_ow_to").value+"&from="+a.findField("hd_ow_from").value+"&dep_date="+a.findField("ow_Depart").value+"&ret_date="+a.findField("ow_Depart").value+"&class="+a.findField("ow_air_class").value+"&pax="+a.findField("ow_pax_count").value+"&trip_type="+g}else{e="&to="+u.findField("hd_rt_to").value+"&from="+u.findField("hd_rt_from").value+"&ret_date="+u.findField("rt_Return").value+"&dep_date="+u.findField("rt_Depart").value+"&class="+u.findField("rt_air_class").value+"&pax="+u.findField("rt_pax_count").value+"&trip_type="+g}var l=800;var h=screen.height;if(window.ActiveXObject){h=screen.height-70}var d=0;if(f.length==2){l=(screen.width/2)-10}else{if(f.length==3){l=(screen.width/3)-10}else{if(f.length==4){l=(screen.width/4)-10}}}if(f.length>1){d=(screen.width)/f.length}var k=0;var j=0;for(var o=0;o<f.length;o++){if(null==f[o]||f[o]==""||f[o]=="undefined"){continue}else{if(f[o]=="Hotwire"&&depCountryVal!="US"){continue}}var p=f[o]+"Win";var q="/externalsearch.cfr?extl_source="+f[o]+e;bookWindow=window.open(q,p,"'menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes,width="+l+",height="+h+",top="+k+",left="+j+"'");if(bookWindow){bookWindow.blur();window.focus()}j=j+d}}}}function reArrangeComparisionBoxes(){if(Ext.getCmp("rt_from").getValue().length>3){if(null!=Ext.getCmp("rt_from").getValue()&&Ext.getCmp("rt_from").getValue()!="undefined"&&Ext.getCmp("rt_from").getValue().indexOf("United States")!=-1){if(Ext.getCmp("rt_to").getValue().length>3){if(null!=Ext.getCmp("rt_to").getValue()&&Ext.getCmp("rt_to").getValue()!="undefined"&&Ext.getCmp("rt_to").getValue().indexOf("United States")!=-1){var a=new Array({AdName:"Hotwire",Cpc:0.6},{AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4});showDynamicCompareBoxes(a)}else{var a=new Array({AdName:"Kayak",Cpc:0.6},{AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4});showDynamicCompareBoxes(a)}}else{showDefaultCompareBoxes()}}else{var a=new Array({AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4},{AdName:"Kayak",Cpc:0.6});showDynamicCompareBoxes(a)}}else{if(Ext.getCmp("rt_from").getValue().length==0){showDefaultCompareBoxes()}else{if(Ext.getCmp("rt_from").getValue().length==3){if(null!=Ext.getCmp("hd_depart_country").getValue()&&Ext.getCmp("hd_depart_country").getValue()!="undefined"&&Ext.getCmp("hd_depart_country").getValue()=="US"){if(Ext.getCmp("rt_to").getValue().length>3){if(null!=Ext.getCmp("rt_to").getValue()&&Ext.getCmp("rt_to").getValue()!="undefined"&&Ext.getCmp("rt_to").getValue().indexOf("United States")!=-1){var a=new Array({AdName:"Hotwire",Cpc:0.6},{AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4});showDynamicCompareBoxes(a)}else{var a=new Array({AdName:"Kayak",Cpc:0.6},{AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4});showDynamicCompareBoxes(a)}}else{showDefaultCompareBoxes()}}else{var a=new Array({AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4},{AdName:"Kayak",Cpc:0.6});showDynamicCompareBoxes(a)}}else{showDefaultCompareBoxes()}}}}function openhotelwindow(i){var h="CfaresHotels";var g=i.findField("rt_to").value;g=getCity(g);var f=new Date(i.findField("rt_Depart").value);var k=new Date(i.findField("rt_Return").value);var j=i.findField("rt_pax_count").value;var a=(screen.width/2)-10;var l=screen.height;var d=0;var c=(screen.width/4)-10;var l=screen.height;var b=f.getMonth()+"/"+f.getDate()+"/"+f.getFullYear();var e=k.getMonth()+"/"+k.getDate()+"/"+k.getFullYear();var m="http://hotels.cfares.com/index.jsp?cid=197618&pageName=hotSearch&Validatedates=true&validateCity=true&submitted=true&";m=m+"arrivalMonth="+f.getMonth()+"&departureMonth="+k.getMonth()+"&arrivalDay="+f.getDate()+"&departureDay="+k.getDate()+"&mode=2&avail=true&passThrough=true&propertyType=A&locale=en_US&city="+g+"&cidateField="+b+"&codateField="+e+"&numberOfNights=&numberOfRooms=1&room-0-adult-total="+j+"&room-0-child-total=0&submit2.x=29&submit2.y=13";bookWindow=window.open(m,h,"'menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes,width="+a+",height="+l+",top="+d+",left="+c+"'");if(bookWindow){bookWindow.blur();window.focus()}}var arrDefaultAdNames=new Array({AdName:"Hotwire",Cpc:0.6},{AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4});function reOrderByCpc(b,a){var d=b.Cpc;var c=a.Cpc;return((d>c)?-1:((d<c)?1:0))}function getAllCompareBoxes(){var d=new Array();var c=new Ext.form.Checkbox({xtype:"checkbox",boxLabel:"Hotwire",name:"rt_hotwire",id:"rt_hotwire",tabIndex:12,width:"100px",style:"padding-left:0px;margin-left:0px;font-size:11px;line-height:15px",checked:"checked"});d.Hotwire=c;var b=new Ext.form.Checkbox({xtype:"checkbox",boxLabel:"Fly.com",name:"rt_fly",id:"rt_fly",tabIndex:13,width:"70px",style:"padding-left:0px;margin-left:0px;font-size:11px;line-height:15px",checked:"checked"});d.Fly=b;var f=new Ext.form.Checkbox({xtype:"checkbox",boxLabel:"TravelTicker",name:"rt_travelTicker",id:"rt_travelTicker",tabIndex:14,width:"100px",style:"padding-left:0px;margin-left:0px;font-size:11px;line-height:15px"});d.TravelTicker=f;var a=new Ext.form.Checkbox({xtype:"checkbox",boxLabel:"BookingBuddy",name:"rt_bookingbuddy",id:"rt_bookingbuddy",tabIndex:15,width:"120px",style:"padding-left:0px;margin-left:0px;font-size:11px;line-height:15px",checked:"checked"});d.BookingBuddy=a;var e=new Ext.form.Checkbox({xtype:"checkbox",boxLabel:"Kayak",name:"rt_kayak",id:"rt_kayak",tabIndex:16,width:"105px",style:"padding-left:0px;margin-left:0px;font-size:11px;line-height:15px",checked:"checked"});d.Kayak=e;return d}function getCompBoxContainer(){return new Ext.form.FieldSet({xtype:"fieldset",title:"",name:"compareboxes",id:"compareboxes",labelSeparator:" ",height:"200",layout:"table",layoutConfig:{columns:2,rows:3}})}function reorderCompBoxes(d,a){var c=0;var b=new Array();for(c=0;c<a.length;c++){b[c]=d[a[c].AdName]}return b}var compare_boxes_container=getCompBoxContainer();function showDefaultCompareBoxes(){arrDefaultAdNames.sort(reOrderByCpc);Ext.getCmp("compareboxes").destroy();var b=getCompBoxContainer();var d=getAllCompareBoxes();var a=reorderCompBoxes(d,arrDefaultAdNames);if(a.length>0){var c=0;for(c=0;c<a.length;c++){b.add(a[c])}}Ext.getCmp("air_rt_form").add(b);Ext.getCmp("air_rt_form").doLayout()}function showDynamicCompareBoxes(a){a.sort(reOrderByCpc);Ext.getCmp("compareboxes").destroy();var b=getCompBoxContainer();var e=getAllCompareBoxes();var c=reorderCompBoxes(e,a);if(c.length>0){var d=0;for(d=0;d<c.length;d++){b.add(c[d])}}Ext.getCmp("air_rt_form").add(b);Ext.getCmp("air_rt_form").doLayout()}Ext.ns("Cfares");Ext.onReady(function(){Ext.QuickTips.init();Ext.form.Field.prototype.msgTarget="side";Ext.reg("selectbox",Ext.ux.SelectBox);var httpProxy=new Ext.data.HttpProxy(new Ext.data.Connection({url:"/dyna/autocomplete?action=complete",method:"post"}));var xmlReader=new Ext.data.XmlReader({record:"ai",id:"c"},[{name:"airportcode",mapping:"c"},{name:"airportname",mapping:"dn"},{name:"country",mapping:"z"}]);var dsRtFrom=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsRtFrom.on("load",function(ds,records,o){if(FocusId!="rt_from"&&ds.getAt(0)){Ext.getCmp("rt_from").setValue(ds.getAt(0).data.airportname)}if(Ext.getCmp("rt_from").getValue().length>2){if(ds.getAt(0)&&ds.getAt(0).data.airportname=="Enter city name or choose from the airport code link"){showDefaultCompareBoxes()}else{var isUsOrNonUS=ds.getAt(0).data.country;if(null!=isUsOrNonUS&&isUsOrNonUS!="undefined"&&isUsOrNonUS.length>0&&isUsOrNonUS=="US"){if(Ext.getCmp("rt_to").getValue().length>3){if(null!=Ext.getCmp("rt_to").getValue()&&Ext.getCmp("rt_to").getValue()!="undefined"&&Ext.getCmp("rt_to").getValue().indexOf("United States")!=-1){var arrDynamicAdNames=new Array({AdName:"Hotwire",Cpc:0.6},{AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4});showDynamicCompareBoxes(arrDynamicAdNames)}else{var arrDynamicAdNames=new Array({AdName:"Kayak",Cpc:0.6},{AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4});showDynamicCompareBoxes(arrDynamicAdNames)}}else{showDefaultCompareBoxes()}}else{var arrDynamicAdNames=new Array({AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4},{AdName:"Kayak",Cpc:0.6});showDynamicCompareBoxes(arrDynamicAdNames)}}}else{if(Ext.getCmp("rt_from").getValue().length==0){showDefaultCompareBoxes()}}});var resultTpl=new Ext.XTemplate('<tpl for="."><div class="search-item">',"<bold>{airportname}</bold>","</div></tpl>");var dsRtTo=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsRtTo.on("load",function(ds,records,o){if(FocusId!="rt_to"&&ds.getAt(0)){Ext.getCmp("rt_to").setValue(ds.getAt(0).data.airportname)}if(Ext.getCmp("rt_to").getValue().length>2){if(ds.getAt(0)&&ds.getAt(0).data.airportname=="Enter city name or choose from the airport code link"){showDefaultCompareBoxes()}else{var isUsOrNonUS=ds.getAt(0).data.country;if(null!=isUsOrNonUS&&isUsOrNonUS!="undefined"&&isUsOrNonUS.length>0&&isUsOrNonUS!="US"){if(Ext.getCmp("rt_from").getValue().length>3){if(null!=Ext.getCmp("rt_from").getValue()&&Ext.getCmp("rt_from").getValue()!="undefined"&&Ext.getCmp("rt_from").getValue().indexOf("United States")!=-1){var arrDynamicAdNames=new Array({AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4},{AdName:"Kayak",Cpc:0.6});showDynamicCompareBoxes(arrDynamicAdNames)}else{var arrDynamicAdNames=new Array({AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4},{AdName:"Kayak",Cpc:0.6});showDynamicCompareBoxes(arrDynamicAdNames)}}else{showDefaultCompareBoxes()}}else{if(Ext.getCmp("rt_from").getValue().length>3){if(null!=Ext.getCmp("rt_from").getValue()&&Ext.getCmp("rt_from").getValue()!="undefined"&&Ext.getCmp("rt_from").getValue().indexOf("United States")!=-1){var arrDynamicAdNames=new Array({AdName:"Hotwire",Cpc:0.6},{AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4});showDynamicCompareBoxes(arrDynamicAdNames)}else{var arrDynamicAdNames=new Array({AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4},{AdName:"Kayak",Cpc:0.6});showDynamicCompareBoxes(arrDynamicAdNames)}}else{showDefaultCompareBoxes()}}}}else{showDefaultCompareBoxes()}});var dsOWFrom=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsOWFrom.on("load",function(ds,records,o){if(FocusId!="ow_from"&&ds.getAt(0)){Ext.getCmp("ow_from").setValue(ds.getAt(0).data.airportname)}});var dsOWTo=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsOWTo.on("load",function(ds,records,o){if(FocusId!="ow_to"&&ds.getAt(0)){Ext.getCmp("ow_to").setValue(ds.getAt(0).data.airportname)}});var dsMC11From=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsMC11From.on("load",function(ds,records,o){if(FocusId!="mc_l1_from"&&ds.getAt(0)){Ext.getCmp("mc_l1_from").setValue(ds.getAt(0).data.airportname)}});var dsMC11To=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsMC11To.on("load",function(ds,records,o){if(FocusId!="mc_l1_to"&&ds.getAt(0)){Ext.getCmp("mc_l1_to").setValue(ds.getAt(0).data.airportname)}});var dsMC12From=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsMC12From.on("load",function(ds,records,o){if(FocusId!="mc_l2_from"&&ds.getAt(0)){Ext.getCmp("mc_l2_from").setValue(ds.getAt(0).data.airportname)}});var dsMC12To=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsMC12To.on("load",function(ds,records,o){if(FocusId!="mc_l2_to"&&ds.getAt(0)){Ext.getCmp("mc_l2_to").setValue(ds.getAt(0).data.airportname)}});var dsMC13From=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsMC13From.on("load",function(ds,records,o){if(FocusId!="mc_l3_from"&&ds.getAt(0)){Ext.getCmp("mc_l3_from").setValue(ds.getAt(0).data.airportname)}});var dsMC13To=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsMC13To.on("load",function(ds,records,o){if(FocusId!="mc_l3_to"&&ds.getAt(0)){Ext.getCmp("mc_l3_to").setValue(ds.getAt(0).data.airportname)}});var dsMC14From=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsMC14From.on("load",function(ds,records,o){if(FocusId!="mc_l4_from"&&ds.getAt(0)){Ext.getCmp("mc_l4_from").setValue(ds.getAt(0).data.airportname)}});var dsMC14To=new Ext.data.Store({proxy:httpProxy,reader:xmlReader});dsMC14To.on("load",function(ds,records,o){if(FocusId!="mc_l4_to"&&ds.getAt(0)){Ext.getCmp("mc_l4_to").setValue(ds.getAt(0).data.airportname)}});var times=new Ext.data.SimpleStore({fields:["value","display"],data:[["Any","Any Time"],["Morning","Morning"],["Noon","Noon"],["Afternoon","Afternoon"],["Evening","Evening"],["Night","Night"]]});Cfares.FlightCombo=Ext.extend(Ext.form.ComboBox,{});Ext.reg("flightcombo",Cfares.FlightCombo);var map=new Ext.KeyMap(document,[{key:[10,13],fn:function(){var browser1=navigator.appVersion;var tab=Ext.getCmp("flights").getActiveTab();if(isOverlayDisplayed==false){if(Ext.MessageBox.isVisible()){Ext.MessageBox.hide()}else{if(tab){if(document.URL.indexOf("advancedsearch.cfr")==-1){if(document.URL.indexOf("showresults.cfr")==-1){if(tab.title=="Round Trip"){tabs.setRTHiddenFields();if(browser1.indexOf("Safari")==-1){air_rt_form.getForm().el.dom.action=air_rt_form.getForm().url}curForm=air_rt_form;if(tabs.checkAndSubmit(curForm.getForm())){if(browser1.indexOf("Safari")!=-1){air_rt_form.getForm().el.dom.action=air_rt_form.getForm().url}curForm.getForm().submit()}}if(tab.title=="One Way"){tabs.setOWHiddenFields();curForm=air_ow_form;if(tabs.checkAndSubmitOW(curForm.getForm())){air_ow_form.getForm().el.dom.action=air_ow_form.getForm().url;curForm.getForm().submit()}}if(tab.title=="Multi-City"){tabs.setMCHiddenFields();curForm=air_mc_form;if(tabs.checkAndSubmitMC(curForm.getForm())){air_mc_form.getForm().el.dom.action=air_mc_form.getForm().url;curForm.getForm().submit()}}}}else{if(tab.title=="Round Trip"){document.getElementById("rt_roundtrip").focus();return false}if(tab.title=="One Way"){document.getElementById("ow_oneway").focus();return false}if(tab.title=="Multi-City"){document.getElementById("mc_multicity").focus();return false}}}}}else{if(isNonTextFieldFocussed==false){if(document.getElementById("loginform")){var user=document.getElementById("loginform").email.value;var password=document.getElementById("loginform").passwd.value;if(user.trim().length>0&&password.trim().length>0){eval(signIn(document.getElementById("loginform")))}else{if(document.getElementById("regiform")){var userNameVal=document.getElementById("regiform").email.value;if(userNameVal.trim().length>0){var submitVal=document.getElementById("regSubmitImg").attributes.onclick.value;eval(submitVal)}else{eval(signIn(document.getElementById("loginform")))}}else{eval(signIn(document.getElementById("loginform")))}}}else{if(document.getElementById("confirmpage")){if(document.getElementById("isCCAvailable")&&document.getElementById("isCCAvailable").value=="YES"){eval(confirmme(document.getElementById("confirmpage")))}else{eval(gotoGoldCCPage(document.getElementById("confirmpage")))}}}}}}}]);var formHeight=parseInt(document.getElementById("test").value);var count=0;var air_rt_form=new Ext.FormPanel({id:"air_rt_form",height:formHeight,labelAlign:"top",frame:true,hideMode:"display",standardSubmit:true,url:"/advancedsearch.cfr",name:"multitype",trackResetOnLoad:true,defaults:{msgTarget:"side"},layoutConfig:{labelSeparator:""},items:[{columnWidth:1,layout:"form",items:[{xtype:"fieldset",autoHeight:true,height:"auto",items:[{layout:"column",items:[{columnWidth:0.36,items:[{xtype:"radio",boxLabel:"Round Trip",name:"rt_rt_radiobutton",value:"roundtrip",tabIndex:16,id:"rt_roundtrip",checked:"checked",listeners:{check:function(){Ext.getCmp("trip_type").setValue(Ext.getCmp("rt_roundtrip").value);FocusId="other"}}}]},{columnWidth:0.32,items:[{xtype:"radio",boxLabel:"One Way",value:"oneway",id:"rt_oneway",tabIndex:17,listeners:{check:function(){if(this.value=="oneway"&&this.checked){Ext.getCmp("flights").setActiveTab(1);Ext.getCmp("trip_type").setValue(Ext.getCmp("rt_oneway").value);FocusId="other"}}},name:"rt_rt_radiobutton"}]},{columnWidth:0.32,items:[{xtype:"radio",boxLabel:"Multi City",value:"multicity",id:"rt_multicity",tabIndex:18,listeners:{check:function(){if(this.value=="multicity"&&this.checked){Ext.getCmp("flights").setActiveTab(2)}Ext.getCmp("trip_type").setValue(Ext.getCmp("rt_multicity").value);FocusId="other"}},name:"rt_rt_radiobutton"}]}]}]},{xtype:"fieldset",style:"background:url(/scripts/ext2/ext-2.1/resources/images/cfares/dot.gif) repeat-x 0px 0px;padding: 0px 0px 10px 0px",width:230},{xtype:"combo",fieldLabel:'From (city or <a href="javascript:lookupDepart(\'round\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"rt_from",id:"rt_from",store:dsRtFrom,queryParam:"id",displayField:"airportname",typeAhead:false,enableKeyEvents:true,loadingText:"Searching...",maxHeight:400,minHeight:350,minListWidth:350,minChars:3,listWidth:350,forceSelection:false,hideTrigger:true,triggerAction:"all",tpl:resultTpl,itemSelector:"div.search-item",tabIndex:1,queryDelay:50,width:230,selectOnFocus:true,listeners:{keydown:function(e){var str=Ext.getCmp("rt_from").getValue();if(str.length<=1){Ext.getCmp("rt_from").store.loadData("");this.minChars=3;return true}Ext.getCmp("trip_type").setValue("roundtrip")},blur:function(){Ext.getCmp("mc_l1_from").setValue(Ext.getCmp("rt_from").getValue());Ext.getCmp("ow_from").setValue(Ext.getCmp("rt_from").getValue());FocusId="";var str=Ext.getCmp("rt_from").getValue();if(str.indexOf("-")==-1&&dsRtFrom.getAt(0)){Ext.getCmp("rt_from").setValue(dsRtFrom.getAt(0).data.airportname)}return true},focus:function(){FocusId="rt_from";return true},select:function(){FocusId="rt_from";reArrangeComparisionBoxes();return true}}},{xtype:"combo",fieldLabel:'To (city or <a href="javascript:lookupReturn(\'round\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"rt_to",id:"rt_to",store:dsRtTo,queryParam:"id",displayField:"airportname",typeAhead:false,loadingText:"Searching...",forceSelection:false,maxHeight:900,minHeight:900,minListWidth:350,minChars:3,listWidth:350,hideTrigger:true,triggerAction:"all",tpl:resultTpl,itemSelector:"div.search-item",tabIndex:2,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("rt_to").getValue();if(str.length<=1){Ext.getCmp("rt_to").store.loadData("");this.minChars=3;return true}},blur:function(){Ext.getCmp("mc_l1_to").setValue(Ext.getCmp("rt_to").getValue());Ext.getCmp("ow_to").setValue(Ext.getCmp("rt_to").getValue());FocusId="";var str=Ext.getCmp("rt_to").getValue();if(str.indexOf("-")==-1&&dsRtTo.getAt(0)){Ext.getCmp("rt_to").setValue(dsRtTo.getAt(0).data.airportname)}return true},focus:function(){FocusId="rt_to";return true},select:function(){FocusId="rt_to";if(Ext.getCmp("rt_to").getValue().length>3){if(null!=Ext.getCmp("rt_to").getValue()&&Ext.getCmp("rt_to").getValue()!="undefined"&&Ext.getCmp("rt_to").getValue().indexOf("United States")==-1){if(Ext.getCmp("rt_from").getValue().length>3){if(null!=Ext.getCmp("rt_from").getValue()&&Ext.getCmp("rt_from").getValue()!="undefined"&&Ext.getCmp("rt_from").getValue().indexOf("United States")!=-1){var arrDynamicAdNames=new Array({AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4},{AdName:"Kayak",Cpc:0.6});showDynamicCompareBoxes(arrDynamicAdNames)}else{var arrDynamicAdNames=new Array({AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4},{AdName:"Kayak",Cpc:0.6});showDynamicCompareBoxes(arrDynamicAdNames)}}else{showDefaultCompareBoxes()}}else{if(Ext.getCmp("rt_from").getValue().length>3){if(null!=Ext.getCmp("rt_from").getValue()&&Ext.getCmp("rt_from").getValue()!="undefined"&&Ext.getCmp("rt_from").getValue().indexOf("United States")!=-1){var arrDynamicAdNames=new Array({AdName:"Hotwire",Cpc:0.6},{AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4});showDynamicCompareBoxes(arrDynamicAdNames)}else{var arrDynamicAdNames=new Array({AdName:"Fly",Cpc:0.5},{AdName:"TravelTicker",Cpc:0.23},{AdName:"BookingBuddy",Cpc:0.4},{AdName:"Kayak",Cpc:0.6});showDynamicCompareBoxes(arrDynamicAdNames)}}else{showDefaultCompareBoxes()}}}else{if(Ext.getCmp("rt_to").getValue().length==0){showDefaultCompareBoxes()}}return true}}}]},{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{xtype:"datefieldplus",usePickerPlus:true,noOfMonth:2,markWeekends:false,showWeekNumber:false,submitFormat:"m/d/Y",submitFormatAddon:"-format",fieldLabel:"Leave",name:"rt_Depart",id:"rt_Depart",width:80,blankText:"Please enter a valid departure date.",maxText:"Flights are available for up to 330 days in advance. The date you entered exceeds this number of days.",minText:"The departure date is prior to today's date. Please enter a valid departure date.",tabIndex:3,allowBlank:false,listeners:{blur:function(){var d=new Date();var dateTemp=new Date();var curDate=parseInt(d.getDate()-1,10);var todayDateVal=new Date();todayDateVal.setDate(todayDateVal.getDate()-1);todayDateVal.setHours(23);todayDateVal.setMinutes(59);todayDateVal.setSeconds(59);dateTemp.setDate(curDate+15);if(Ext.getCmp("rt_Depart").getValue()==null||Ext.getCmp("rt_Depart").getValue()==""){Ext.getCmp("rt_Depart").setValue(dateTemp)}Ext.getCmp("mc_l1_Depart").setValue(Ext.getCmp("rt_Depart").getValue());Ext.getCmp("ow_Depart").setValue(Ext.getCmp("rt_Depart").getValue());var newDateForReturn=new Date(Ext.getCmp("rt_Depart").getValue());var formDate=Ext.getCmp("rt_Depart").getValue();var newDate=parseInt(formDate.getDate()-1,10);newDateForReturn.setDate(newDate+8);Ext.getCmp("rt_Return").setValue(newDateForReturn);return true},focus:function(){FocusId="other";return true}},vtype:"daterange",endDateField:"enddt"}]},{columnWidth:0.5,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Time",name:"rt_departSchedule",id:"rt_departScheduleId",hiddenName:"rt_departSchedule",store:times,valueField:"value",listWidth:106,value:"Any",displayField:"display",editable:false,mode:"local",width:90,tabIndex:4,triggerAction:"all",listeners:{blur:function(){Ext.getCmp("mc_l1_departScheduleId").setValue(Ext.getCmp("rt_departScheduleId").getValue());Ext.getCmp("ow_departScheduleId").setValue(Ext.getCmp("rt_departScheduleId").getValue());return true},focus:function(){FocusId="other";return true}}}]}]},{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{xtype:"datefieldplus",usePickerPlus:true,noOfMonth:2,markWeekends:false,showWeekNumber:false,submitFormat:"m/d/Y",submitFormatAddon:"-format",fieldLabel:"Return",name:"rt_Return",id:"rt_Return",width:80,blankText:"Please enter a valid arrival date.",maxText:"Flights are available for up to 330 days in advance. The date you entered exceeds this number of days.",minText:"The arrival date is prior to departure date. Please enter a valid arrival date.",tabIndex:5,allowBlank:false,listeners:{blur:function(){var d=new Date();var dateTemp=new Date();var curDate=parseInt(d.getDate()-1,10);var todayDateVal=new Date();todayDateVal.setDate(todayDateVal.getDate()-1);todayDateVal.setHours(23);todayDateVal.setMinutes(59);todayDateVal.setSeconds(59);dateTemp.setDate(curDate+22);if(Ext.getCmp("rt_Return").getValue()==null||Ext.getCmp("rt_Return").getValue()==""){Ext.getCmp("rt_Return").setValue(dateTemp)}Ext.getCmp("mc_l2_Depart").setValue(Ext.getCmp("rt_Return").getValue());return true},focus:function(){FocusId="other";return true}},vtype:"daterange",startDateField:"startdt"}]},{columnWidth:0.5,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Time",name:"rt_returnSchedule",id:"rt_returnScheduleId",store:times,valueField:"value",displayField:"display",hiddenName:"rt_returnSchedule",listWidth:106,editable:false,mode:"local",tabIndex:6,triggerAction:"all",listeners:{blur:function(){Ext.getCmp("mc_l2_departScheduleId").setValue(Ext.getCmp("rt_returnScheduleId").getValue());return true},focus:function(){FocusId="other";return true}},value:"Any",width:90}]}]},{layout:"column",items:[{columnWidth:0.35,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Passengers",name:"rt_pax_count",id:"rt_pax_countId",store:new Ext.data.SimpleStore({fields:["value","display"],data:[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]}),valueField:"value",displayField:"display",hiddenName:"rt_pax_count",editable:false,mode:"local",tabIndex:7,triggerAction:"all",listeners:{blur:function(){Ext.getCmp("mc_pax_countId").setValue(Ext.getCmp("rt_pax_countId").getValue());Ext.getCmp("ow_pax_countId").setValue(Ext.getCmp("rt_pax_countId").getValue());return true},focus:function(){FocusId="other";return true}},value:"1",listWidth:41,width:25}]},{columnWidth:0.65,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Class",name:"rt_air_class",id:"rt_air_classId",store:new Ext.data.SimpleStore({fields:["value","display"],data:[["economy","Economy"],["business","Business"],["first","First"]]}),valueField:"value",displayField:"display",hiddenName:"rt_air_class",editable:false,mode:"local",tabIndex:8,triggerAction:"all",listeners:{blur:function(){Ext.getCmp("ow_air_classId").setValue(Ext.getCmp("rt_air_classId").getValue());Ext.getCmp("mc_air_classId").setValue(Ext.getCmp("rt_air_classId").getValue());return true},focus:function(){FocusId="other";return true}},value:"economy",listWidth:106,width:90}]}]},{xtype:"checkbox",hideLabel:true,boxLabel:"Search nearby airports",name:"rt_regionalsearch",id:"rt_regionalsearch",style:"padding-left:0px;margin-left:0px;",stateful:true,listeners:{blur:function(){setRegionalCheckBoxValue("rt_regionalsearch");Ext.getCmp("ow_regionalsearch").setValue(Ext.getCmp("rt_regionalsearch").getValue());Ext.getCmp("mc_regionalsearch").setValue(Ext.getCmp("rt_regionalsearch").getValue());Ext.getCmp("regionalsearch").setValue(Ext.getCmp("rt_regionalsearch").getValue());return true},focus:function(){FocusId="other";return true}},tabIndex:9,width:200,height:10,left:40},{xtype:"checkbox",hideLabel:true,boxLabel:"I prefer non-stop flights",name:"rt_nonstop_search",id:"rt_nonstop_search",style:"padding-left:0px;margin-left:0px;",stateful:true,listeners:{blur:function(){setNonStopCheckBoxValue("rt_nonstop_search");Ext.getCmp("ow_nonstop_search").setValue(Ext.getCmp("rt_nonstop_search").getValue());Ext.getCmp("mc_nonstop_search").setValue(Ext.getCmp("rt_nonstop_search").getValue());Ext.getCmp("nonstopsearch").setValue(Ext.getCmp("rt_nonstop_search").getValue());return true},focus:function(){FocusId="other";return true}},tabIndex:10,width:200,height:20,left:40},{xtype:"hidden",name:"changetype",id:"changetype",value:"round"},{xtype:"hidden",name:"tripType",id:"tripType",value:"roundtrip"},{xtype:"hidden",name:"trip_type",id:"trip_type",value:"roundtrip"},{xtype:"hidden",name:"action_id",id:"action_id",value:"1"},{xtype:"hidden",name:"regionalsearch",id:"regionalsearch",value:"false"},{xtype:"hidden",name:"nonstopsearch",id:"nonstopsearch",value:"false"},{xtype:"hidden",name:"hd_rt_to",id:"hd_rt_to",value:"false"},{xtype:"hidden",name:"hd_rt_from",id:"hd_rt_from",value:"false"},{xtype:"hidden",name:"hd_depart_country",id:"hd_depart_country",value:"US"},{xtype:"hidden",name:"rt_depart_input",id:"rt_depart_input",value:"false"},{xtype:"hidden",name:"rt_return_input",id:"rt_return_input",value:"false"},{layout:"column",items:[{columnWidth:0.45,items:[{xtype:"checkbox",boxLabel:"Find hotels too",tabIndex:14,name:"rt_hotel",style:"padding-left:0px;margin-left:0px;padding-top:2px;",id:"rt_hotel"}]},{columnWidth:0.55,style:"padding-left:0px;margin-left:0px;padding-top:4px;",items:[{xtype:"label",style:"color:#999999;font-size:9px",text:"(opens new window)"}]}]},{xtype:"fieldset",style:"background:url(/scripts/ext2/ext-2.1/resources/images/cfares/dot.gif) repeat-x 0px 0px;padding: 0px 0px 10px 0px",width:230},{items:[{layout:"column",items:[{columnWidth:0.55,items:[{xtype:"label",style:"padding-top:10px;",text:"Compare Your Results"}]},{columnWidth:0.45,items:[{xtype:"label",style:"color:#999999;font-size:9px",text:"(opens new window)"}]}]}]},compare_boxes_container,{xtype:"fieldset",title:"",autoHeight:false,height:"100",border:false,items:[{layout:"column",items:[{columnWidth:1,items:[{xtype:"button",text:"Submit",minWidth:100,tabIndex:17,tooltip:"Search for cheap tickets.",style:{padding:"0px 0px 0px 40px",margin:"0px 10px 30px 120px"},handler:function(){tabs.setRTHiddenFields();air_rt_form.getForm().el.dom.action=air_rt_form.getForm().url;curForm=air_rt_form;if(tabs.checkAndSubmit(curForm.getForm())){curForm.getForm().submit()}}}]}]}]}]});var air_ow_form=new Ext.FormPanel({labelAlign:"top",id:"air_ow_form",height:360,frame:true,url:"/advancedsearch.cfr",standardSubmit:true,trackResetOnLoad:true,defaults:{msgTarget:"side"},layoutConfig:{labelSeparator:""},items:[{xtype:"fieldset",autoHeight:true,height:"auto",items:[{layout:"column",items:[{columnWidth:0.36,items:[{xtype:"radio",boxLabel:"Round Trip",name:"rt_rt_radiobutton",value:"roundtrip",id:"ow_roundtrip",listeners:{check:function(){if(this.value=="roundtrip"&&this.checked){Ext.getCmp("flights").setActiveTab(0)}Ext.getCmp("trip_type").setValue(Ext.getCmp("ow_roundtrip").value);FocusId="other"}},tabIndex:1}]},{columnWidth:0.32,items:[{xtype:"radio",boxLabel:"One Way",value:"oneway",id:"ow_oneway",tabIndex:2,name:"rt_rt_radiobutton",checked:"checked"}]},{columnWidth:0.32,items:[{xtype:"radio",boxLabel:"Multi City",value:"multicity",id:"ow_multicity",tabIndex:3,listeners:{check:function(){if(this.value=="multicity"&&this.checked){Ext.getCmp("flights").setActiveTab(2)}Ext.getCmp("trip_type").setValue(Ext.getCmp("ow_multicity").value);FocusId="other"}},name:"rt_rt_radiobutton"}]}]}]},{xtype:"fieldset",style:"background:url(/scripts/ext2/ext-2.1/resources/images/cfares/dot.gif) repeat-x 0px 0px;padding: 5px 0px 5px 0px",width:230},{columnWidth:1,layout:"form",items:[{xtype:"combo",fieldLabel:'From (city or <a href="javascript:lookupDepart(\'one\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"ow_from",id:"ow_from",store:dsOWFrom,queryParam:"id",displayField:"airportname",typeAhead:false,loadingText:"Searching...",forceSelection:false,maxHeight:900,minHeight:500,minListWidth:350,listWidth:350,minChars:3,hideTrigger:true,tpl:resultTpl,itemSelector:"div.search-item",tabIndex:4,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("ow_from").getValue();if(str.length<=1){Ext.getCmp("ow_from").store.loadData("");this.minChars=3;return true}},blur:function(){Ext.getCmp("mc_l1_from").setValue(Ext.getCmp("ow_from").getValue());Ext.getCmp("rt_from").setValue(Ext.getCmp("ow_from").getValue());FocusId="";var str=Ext.getCmp("ow_from").getValue();if(str.indexOf("-")==-1&&dsOWFrom.getAt(0)){Ext.getCmp("ow_from").setValue(dsOWFrom.getAt(0).data.airportname)}return true},focus:function(){FocusId="ow_from";return true}}},{xtype:"combo",fieldLabel:'To (city or <a href="javascript:lookupReturn(\'one\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"ow_to",id:"ow_to",store:dsOWTo,queryParam:"id",displayField:"airportname",forceSelection:false,typeAhead:false,loadingText:"Searching...",maxHeight:900,minHeight:500,minListWidth:350,listWidth:350,minChars:3,hideTrigger:true,tpl:resultTpl,itemSelector:"div.search-item",tabIndex:5,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("ow_to").getValue();if(str.length<=1){Ext.getCmp("ow_to").store.loadData("");this.minChars=3;return true}},blur:function(){Ext.getCmp("mc_l1_to").setValue(Ext.getCmp("ow_to").getValue());Ext.getCmp("rt_to").setValue(Ext.getCmp("ow_to").getValue());FocusId="";var str=Ext.getCmp("ow_to").getValue();if(str.indexOf("-")==-1&&dsOWTo.getAt(0)){Ext.getCmp("ow_to").setValue(dsOWTo.getAt(0).data.airportname)}return true},focus:function(){FocusId="ow_to";return true}}}]},{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{xtype:"datefieldplus",usePickerPlus:true,noOfMonth:2,markWeekends:false,showWeekNumber:false,submitFormat:"m/d/Y",submitFormatAddon:"-format",fieldLabel:"Leave",name:"ow_Depart",id:"ow_Depart",width:80,blankText:"Please enter a valid departure date.",maxText:"Flights are available for up to 330 days in advance. The date you entered exceeds this number of days.",minText:"The departure date is prior to today's date. Please enter a valid departure date.",tabIndex:6,allowBlank:false,listeners:{blur:function(){var d=new Date();var dateTemp=new Date();var curDate=parseInt(d.getDate()-1,10);var todayDateVal=new Date();todayDateVal.setDate(todayDateVal.getDate()-1);todayDateVal.setHours(23);todayDateVal.setMinutes(59);todayDateVal.setSeconds(59);dateTemp.setDate(curDate+15);if(Ext.getCmp("ow_Depart").getValue()==null||Ext.getCmp("ow_Depart").getValue()==""){Ext.getCmp("ow_Depart").setValue(dateTemp)}Ext.getCmp("mc_l1_Depart").setValue(Ext.getCmp("ow_Depart").getValue());Ext.getCmp("rt_Depart").setValue(Ext.getCmp("ow_Depart").getValue());return true},focus:function(){FocusId="other";return true}},vtype:"daterange",endDateFieldOW:"enddtOW"}]},{columnWidth:0.5,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Time",name:"ow_departSchedule",id:"ow_departScheduleId",hiddenName:"ow_departSchedule",store:times,valueField:"value",displayField:"display",editable:false,mode:"local",tabIndex:8,triggerAction:"all",listeners:{blur:function(){Ext.getCmp("mc_l1_departScheduleId").setValue(Ext.getCmp("ow_departScheduleId").getValue());Ext.getCmp("rt_departScheduleId").setValue(Ext.getCmp("ow_departScheduleId").getValue());return true},focus:function(){FocusId="other";return true}},value:"Any",listWidth:106,width:90}]}]},{layout:"column",items:[{columnWidth:0.35,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Passengers",name:"ow_pax_count",id:"ow_pax_countId",hiddenName:"ow_pax_count",store:new Ext.data.SimpleStore({fields:["value","display"],data:[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]}),valueField:"value",displayField:"display",editable:false,mode:"local",tabIndex:13,triggerAction:"all",listeners:{blur:function(){Ext.getCmp("mc_pax_countId").setValue(Ext.getCmp("ow_pax_countId").getValue());Ext.getCmp("rt_pax_countId").setValue(Ext.getCmp("ow_pax_countId").getValue());return true},focus:function(){FocusId="other";return true}},value:"1",listWidth:41,width:25}]},{columnWidth:0.65,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Class",name:"ow_air_class",id:"ow_air_classId",hiddenName:"ow_air_class",store:new Ext.data.SimpleStore({fields:["value","display"],data:[["economy","Economy"],["business","Business"],["first","First"]]}),valueField:"value",displayField:"display",editable:false,mode:"local",tabIndex:14,triggerAction:"all",listeners:{blur:function(){Ext.getCmp("rt_air_classId").setValue(Ext.getCmp("ow_air_classId").getValue());Ext.getCmp("mc_air_classId").setValue(Ext.getCmp("ow_air_classId").getValue());return true},focus:function(){FocusId="other";return true}},value:"economy",listWidth:106,width:90}]}]},{xtype:"checkbox",hideLabel:true,boxLabel:"Search nearby airports",name:"ow_regionalsearch",id:"ow_regionalsearch",tabIndex:15,stateful:true,style:"padding-left:0px;margin-left:0px;",listeners:{blur:function(){setRegionalCheckBoxValue("ow_regionalsearch");Ext.getCmp("rt_regionalsearch").setValue(Ext.getCmp("ow_regionalsearch").getValue());Ext.getCmp("mc_regionalsearch").setValue(Ext.getCmp("ow_regionalsearch").getValue());Ext.getCmp("regionalsearch").setValue(Ext.getCmp("ow_regionalsearch").getValue());return true},focus:function(){FocusId="other";return true}},width:200,height:10,left:40},{xtype:"checkbox",hideLabel:true,boxLabel:"I prefer non-stop flights",name:"ow_nonstop_search",id:"ow_nonstop_search",tabIndex:16,stateful:true,style:"padding-left:0px;margin-left:0px;",listeners:{blur:function(){setNonStopCheckBoxValue("ow_nonstop_search");Ext.getCmp("rt_nonstop_search").setValue(Ext.getCmp("ow_nonstop_search").getValue());Ext.getCmp("mc_nonstop_search").setValue(Ext.getCmp("ow_nonstop_search").getValue());Ext.getCmp("nonstopsearch").setValue(Ext.getCmp("ow_nonstop_search").getValue());return true},focus:function(){FocusId="other";return true}},width:200,height:20,left:40},{xtype:"hidden",name:"hd_ow_to",id:"hd_ow_to",value:"false"},{xtype:"hidden",name:"hd_ow_from",id:"hd_ow_from",value:"false"},{xtype:"hidden",name:"changetype",id:"changetype",value:"one"},{xtype:"hidden",name:"trip_type",id:"trip_type",value:"oneway"},{xtype:"hidden",name:"action_id",id:"action_id",value:"2"},{xtype:"hidden",name:"regionalsearch",id:"regionalsearch",value:"false"},{xtype:"hidden",name:"nonstopsearch",id:"nonstopsearch",value:"false"},{layout:"column",items:[{columnWidth:0.45,items:[{xtype:"checkbox",boxLabel:"Find hotels too",tabIndex:14,name:"ow_hotel",style:"padding-left:0px;margin-left:0px;padding-top:2px;",id:"ow_hotel"}]},{columnWidth:0.55,style:"padding-left:0px;margin-left:0px;padding-top:4px;",items:[{xtype:"label",style:"color:#999999;font-size:9px",text:"(opens new window)"}]}]},{xtype:"fieldset",style:"background:url(/scripts/ext2/ext-2.1/resources/images/cfares/dot.gif) repeat-x 0px 0px;padding: 0px 0px 10px 0px",width:230},{xtype:"fieldset",title:"",autoHeight:false,height:"200",cls:"x-fieldset-noborder",tabIndex:17,items:[{layout:"column",items:[{columnWidth:1,items:[{xtype:"button",text:"Submit",tooltip:"Search for cheap tickets.",minWidth:100,style:{padding:"0px 0px 0px 40px",margin:"0px 10px 30px 120px"},handler:function(){tabs.setOWHiddenFields();air_ow_form.getForm().el.dom.action=air_ow_form.getForm().url;curForm=air_ow_form;if(tabs.checkAndSubmitOW(curForm.getForm())){curForm.getForm().submit()}}}]}]}]}]});var air_mc_form=new Ext.FormPanel({id:"air_mc_form",height:898,labelAlign:"top",frame:true,standardSubmit:true,url:"/advancedsearch.cfr",trackResetOnLoad:true,defaults:{msgTarget:"side"},layoutConfig:{labelSeparator:""},items:[{xtype:"fieldset",autoHeight:true,height:"auto",items:[{layout:"column",items:[{columnWidth:0.36,items:[{xtype:"radio",boxLabel:"Round Trip",name:"rt_rt_radiobutton",value:"roundtrip",id:"mc_roundtrip",tabIndex:21,listeners:{check:function(){if(this.value=="roundtrip"&&this.checked){Ext.getCmp("flights").setActiveTab(0)}Ext.getCmp("trip_type").setValue(Ext.getCmp("mc_roundtrip").value);FocusId="other"}}}]},{columnWidth:0.32,items:[{xtype:"radio",boxLabel:"One Way",value:"oneway",tabIndex:22,id:"mc_oneway",listeners:{check:function(){if(this.value=="oneway"&&this.checked){Ext.getCmp("flights").setActiveTab(1)}Ext.getCmp("trip_type").setValue(Ext.getCmp("mc_oneway").value);FocusId="other"}},name:"rt_rt_radiobutton"}]},{columnWidth:0.32,items:[{xtype:"radio",boxLabel:"Multi City",value:"multicity",tabIndex:23,name:"rt_rt_radiobutton",id:"mc_multicity",checked:"checked"}]}]}]},{xtype:"fieldset",style:"background:url(/scripts/ext2/ext-2.1/resources/images/cfares/dot.gif) repeat-x 0px 0px;padding: 0px 0px 10px 0px",width:230},{columnWidth:1,layout:"form",title:"Flight 1",items:[{xtype:"combo",fieldLabel:'From (city or <a href="javascript:lookupDepart(\'multi1\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"mc_l1_from",id:"mc_l1_from",store:dsMC11From,queryParam:"id",displayField:"airportname",typeAhead:false,loadingText:"Searching...",forceSelection:false,maxHeight:900,minHeight:500,minListWidth:350,listWidth:350,minChars:3,hideTrigger:true,tpl:resultTpl,itemSelector:"div.search-item",tabIndex:1,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("mc_l1_from").getValue();if(str.length<=1){Ext.getCmp("mc_l1_from").store.loadData("");this.minChars=3;return true}},blur:function(){Ext.getCmp("rt_from").setValue(Ext.getCmp("mc_l1_from").getValue());Ext.getCmp("ow_from").setValue(Ext.getCmp("mc_l1_from").getValue());var str=Ext.getCmp("mc_l1_from").getValue();if(str.indexOf("-")==-1&&dsMC11From.getAt(0)){Ext.getCmp("mc_l1_from").setValue(dsMC11From.getAt(0).data.airportname)}FocusId="";return true},focus:function(){FocusId="mc_l1_from";return true}}},{xtype:"combo",fieldLabel:'To (city or <a href="javascript:lookupReturn(\'multi1\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"mc_l1_to",id:"mc_l1_to",store:dsMC11To,queryParam:"id",displayField:"airportname",typeAhead:false,loadingText:"Searching...",forceSelection:false,maxHeight:900,minHeight:500,minListWidth:350,listWidth:350,minChars:3,hideTrigger:true,tpl:resultTpl,itemSelector:"div.search-item",tabIndex:2,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("mc_l1_to").getValue();if(str.length<=1){Ext.getCmp("mc_l1_to").store.loadData("");this.minChars=3;return true}},blur:function(){Ext.getCmp("rt_to").setValue(Ext.getCmp("mc_l1_to").getValue());Ext.getCmp("ow_to").setValue(Ext.getCmp("mc_l1_to").getValue());var str=Ext.getCmp("mc_l1_to").getValue();if(str.indexOf("-")==-1&&dsMC11To.getAt(0)){Ext.getCmp("mc_l1_to").setValue(dsMC11To.getAt(0).data.airportname)}FocusId="";return true},focus:function(){FocusId="mc_l1_to";return true}}}]},{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{xtype:"datefieldplus",usePickerPlus:true,noOfMonth:2,markWeekends:false,showWeekNumber:false,submitFormat:"m/d/Y",submitFormatAddon:"-format",fieldLabel:"Leave",name:"mc_l1_Depart",id:"mc_l1_Depart",width:80,tabIndex:3,blankText:"Please enter a valid departure date for flight 1.",maxText:"Flights are available for up to 330 days in advance. The date you entered exceeds this number of days.",minText:"The departure date is prior to today's date. Please enter a valid departure date for flight 1.",listeners:{blur:function(){var d=new Date();var dateTemp=new Date();var curDate=parseInt(d.getDate()-1,10);var todayDateVal=new Date();todayDateVal.setDate(todayDateVal.getDate()-1);todayDateVal.setHours(23);todayDateVal.setMinutes(59);todayDateVal.setSeconds(59);dateTemp.setDate(curDate+15);if(Ext.getCmp("mc_l1_Depart").getValue()==null||Ext.getCmp("mc_l1_Depart").getValue()==""){Ext.getCmp("mc_l1_Depart").setValue(dateTemp)}Ext.getCmp("ow_Depart").setValue(Ext.getCmp("mc_l1_Depart").getValue());Ext.getCmp("rt_Depart").setValue(Ext.getCmp("mc_l1_Depart").getValue());var newDateForReturn=new Date(Ext.getCmp("mc_l1_Depart").getValue());var formDate=Ext.getCmp("mc_l1_Depart").getValue();var newDate=parseInt(formDate.getDate()-1,10);var todayDate=parseInt(formDate.getDate()-1,10);newDateForReturn.setDate(newDate+8);var lastAllowedDate=new Date();lastAllowedDate.setDate(curDate+330);if(newDateForReturn>lastAllowedDate){newDateForReturn=lastAllowedDate}Ext.getCmp("mc_l2_Depart").setValue(newDateForReturn);Ext.getCmp("mc_l3_Depart").setValue(newDateForReturn);Ext.getCmp("mc_l4_Depart").setValue(newDateForReturn);return true},focus:function(){FocusId="other";return true}},allowBlank:false,vtype:"daterange",endDateFieldMC11:"enddtMC11"}]},{columnWidth:0.5,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Time",name:"mc_l1_departSchedule",id:"mc_l1_departScheduleId",hiddenName:"mc_l1_departSchedule",store:times,valueField:"value",displayField:"display",editable:false,mode:"local",tabIndex:4,triggerAction:"all",listeners:{blur:function(){Ext.getCmp("ow_departScheduleId").setValue(Ext.getCmp("mc_l1_departScheduleId").getValue());Ext.getCmp("rt_departScheduleId").setValue(Ext.getCmp("mc_l1_departScheduleId").getValue());return true},focus:function(){FocusId="other";return true}},value:"Any",listWidth:106,width:90}]}]},{columnWidth:1,layout:"form",title:"Flight 2",items:[{xtype:"combo",fieldLabel:'From (city or <a href="javascript:lookupDepart(\'multi2\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"mc_l2_from",id:"mc_l2_from",store:dsMC12From,queryParam:"id",displayField:"airportname",typeAhead:false,loadingText:"Searching...",forceSelection:false,maxHeight:900,minHeight:500,minListWidth:350,listWidth:350,minChars:3,hideTrigger:true,tpl:resultTpl,itemSelector:"div.search-item",tabIndex:5,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("mc_l2_from").getValue();if(str.length<=1){Ext.getCmp("mc_l2_from").store.loadData("");this.minChars=3;return true}},focus:function(){FocusId="mc_l2_from";return true},blur:function(){FocusId="";var str=Ext.getCmp("mc_l2_from").getValue();if(str!=null){if(str.indexOf("-")==-1&&dsMC12From.getAt(0)){Ext.getCmp("mc_l2_from").setValue(dsMC12From.getAt(0).data.airportname)}Ext.getCmp("hd_mc_l2_from").setValue(Ext.getCmp("mc_l2_from").getValue())}return true}}},{xtype:"combo",fieldLabel:'To (city or <a href="javascript:lookupReturn(\'multi2\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"mc_l2_to",id:"mc_l2_to",store:dsMC12To,queryParam:"id",displayField:"airportname",typeAhead:false,loadingText:"Searching...",forceSelection:false,minListWidth:350,listWidth:350,maxHeight:900,minHeight:500,minChars:3,hideTrigger:true,tpl:resultTpl,itemSelector:"div.search-item",tabIndex:6,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("mc_l2_to").getValue();if(str.length<=1){Ext.getCmp("mc_l2_to").store.loadData("");this.minChars=3;return true}},focus:function(){FocusId="mc_l2_to";return true},blur:function(){FocusId="";var str=Ext.getCmp("mc_l2_to").getValue();if(str!=null){if(str.indexOf("-")==-1&&dsMC12To.getAt(0)){Ext.getCmp("mc_l2_to").setValue(dsMC12To.getAt(0).data.airportname)}Ext.getCmp("hd_mc_l2_to").setValue(Ext.getCmp("mc_l2_to").getValue())}return true}}}]},{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{xtype:"datefieldplus",usePickerPlus:true,noOfMonth:2,markWeekends:false,showWeekNumber:false,submitFormat:"m/d/Y",submitFormatAddon:"-format",fieldLabel:"Leave",name:"mc_l2_Depart",id:"mc_l2_Depart",width:80,tabIndex:7,allowBlank:false,listeners:{blur:function(){var d=new Date();var dateTemp=new Date();var curDate=parseInt(d.getDate()-1,10);var dateForValidation=new Date(Ext.getCmp("mc_l1_Depart").getValue());var dateFromFlight1=Ext.getCmp("mc_l1_Depart").getValue();var dateValue=parseInt(dateFromFlight1.getDate()-1,10);dateForValidation.setDate(dateValue+8);if(Ext.getCmp("mc_l2_Depart").getValue()==null||Ext.getCmp("mc_l2_Depart").getValue()==""){Ext.getCmp("mc_l2_Depart").setValue(dateForValidation)}var newDateForReturn=new Date(Ext.getCmp("mc_l2_Depart").getValue());var formDate=Ext.getCmp("mc_l2_Depart").getValue();var newDate=parseInt(formDate.getDate()-1,10);newDateForReturn.setDate(newDate+8);var lastAllowedDate=new Date();lastAllowedDate.setDate(curDate+330);if(new Date(Ext.getCmp("mc_l2_Depart").getValue())>lastAllowedDate){Ext.getCmp("mc_l2_Depart").setValue(lastAllowedDate)}if(newDateForReturn>lastAllowedDate){newDateForReturn=lastAllowedDate}Ext.getCmp("mc_l3_Depart").setValue(newDateForReturn);Ext.getCmp("mc_l4_Depart").setValue(newDateForReturn);return true},focus:function(){FocusId="other";return true}},blankText:"Please enter a valid departure date for flight 2.",maxText:"Flights are available for up to 330 days in advance. The date you entered exceeds this number of days.",minText:"The departure date is prior to flight 1 departure date. Please enter a valid departure date for flight 2.",vtype:"daterange",endDateFieldMC12:"enddtMC12"}]},{columnWidth:0.5,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Time",name:"mc_l2_departSchedule",id:"mc_l2_departScheduleId",hiddenName:"mc_l2_departSchedule",store:times,valueField:"value",displayField:"display",editable:false,mode:"local",tabIndex:8,triggerAction:"all",listeners:{blur:function(){return true},focus:function(){FocusId="other";return true}},value:"Any",listWidth:106,width:90}]}]},{columnWidth:1,layout:"form",title:"Flight 3",items:[{xtype:"combo",fieldLabel:'From (city or <a href="javascript:lookupDepart(\'multi3\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"mc_l3_from",id:"mc_l3_from",store:dsMC13From,queryParam:"id",displayField:"airportname",typeAhead:false,loadingText:"Searching...",forceSelection:false,maxHeight:900,minHeight:500,minListWidth:350,listWidth:350,minChars:3,hideTrigger:true,tpl:resultTpl,itemSelector:"div.search-item",tabIndex:9,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("mc_l3_from").getValue();if(str.length<=1){Ext.getCmp("mc_l3_from").store.loadData("");this.minChars=3;return true}},focus:function(){FocusId="mc_l3_from";return true},blur:function(){FocusId="";var str=Ext.getCmp("mc_l3_from").getValue();if(str!=null){if(str.indexOf("-")==-1&&dsMC13From.getAt(0)){Ext.getCmp("mc_l3_from").setValue(dsMC13From.getAt(0).data.airportname)}Ext.getCmp("hd_mc_l3_from").setValue(Ext.getCmp("mc_l3_from").getValue())}return true}}},{xtype:"combo",fieldLabel:'To (city or <a href="javascript:lookupReturn(\'multi3\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"mc_l3_to",id:"mc_l3_to",store:dsMC13To,queryParam:"id",displayField:"airportname",typeAhead:false,loadingText:"Searching...",forceSelection:false,minListWidth:350,listWidth:350,maxHeight:900,minHeight:500,minChars:3,hideTrigger:true,tpl:resultTpl,itemSelector:"div.search-item",tabIndex:10,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("mc_l3_to").getValue();if(str.length<=1){Ext.getCmp("mc_l3_to").store.loadData("");this.minChars=3;return true}},focus:function(){FocusId="mc_l3_to";return true},blur:function(){FocusId="";var str=Ext.getCmp("mc_l3_to").getValue();if(str!=null){if(str.indexOf("-")==-1&&dsMC13To.getAt(0)){Ext.getCmp("mc_l3_to").setValue(dsMC13To.getAt(0).data.airportname)}Ext.getCmp("hd_mc_l3_to").setValue(Ext.getCmp("mc_l3_to").getValue())}return true}}}]},{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{xtype:"datefieldplus",usePickerPlus:true,noOfMonth:2,markWeekends:false,showWeekNumber:false,submitFormat:"m/d/Y",submitFormatAddon:"-format",fieldLabel:"Leave",name:"mc_l3_Depart",id:"mc_l3_Depart",blankText:"Please enter a valid departure date for flight 3.",maxText:"Flights are available for up to 330 days in advance. The date you entered exceeds this number of days.",minText:"The departure date is prior to flight 2 departure date. Please enter a valid departure date for flight 3.",width:80,tabIndex:11,allowBlank:false,listeners:{blur:function(){var d=new Date();var dateTemp=new Date();var curDate=parseInt(d.getDate()-1,10);var dateForValidation=new Date(Ext.getCmp("mc_l2_Depart").getValue());var dateFromFlight2=Ext.getCmp("mc_l2_Depart").getValue();var currentFormDate=Ext.getCmp("mc_l3_Depart").getValue();var dateValue=parseInt(dateFromFlight2.getDate()-1,10);dateForValidation.setDate(dateValue+8);if(Ext.getCmp("mc_l3_Depart").getValue()==null||Ext.getCmp("mc_l3_Depart").getValue()==""){Ext.getCmp("mc_l3_Depart").setValue(dateForValidation)}var newDateForReturn=new Date(Ext.getCmp("mc_l3_Depart").getValue());var formDate=Ext.getCmp("mc_l3_Depart").getValue();var newDate=parseInt(formDate.getDate()-1,10);newDateForReturn.setDate(newDate+8);var lastAllowedDate=new Date();lastAllowedDate.setDate(curDate+330);if(newDateForReturn>lastAllowedDate){newDateForReturn=lastAllowedDate}if(new Date(Ext.getCmp("mc_l3_Depart").getValue())>lastAllowedDate){Ext.getCmp("mc_l3_Depart").setValue(lastAllowedDate);Ext.getCmp("mc_l4_Depart").setValue(lastAllowedDate)}Ext.getCmp("mc_l4_Depart").setValue(newDateForReturn);return true},focus:function(){FocusId="other";return true}},vtype:"daterange",endDateFieldMC13:"enddtMC13"}]},{columnWidth:0.5,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Time",name:"mc_l3_departSchedule",id:"mc_l3_departScheduleId",hiddenName:"mc_l3_departSchedule",store:times,valueField:"value",displayField:"display",editable:false,mode:"local",tabIndex:12,triggerAction:"all",value:"Any",listWidth:106,width:90}]}]},{columnWidth:1,layout:"form",title:"Flight 4",items:[{xtype:"combo",fieldLabel:'From (city or <a href="javascript:lookupDepart(\'multi4\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"mc_l4_from",id:"mc_l4_from",store:dsMC14From,queryParam:"id",displayField:"airportname",typeAhead:false,loadingText:"Searching...",forceSelection:false,minListWidth:350,listWidth:350,maxHeight:900,minHeight:500,minChars:3,hideTrigger:true,tpl:resultTpl,itemSelector:"div.search-item",tabIndex:13,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("mc_l4_from").getValue();if(str.length<=1){Ext.getCmp("mc_l4_from").store.loadData("");this.minChars=3;return true}},focus:function(){FocusId="mc_l4_from";return true},blur:function(){FocusId="";var str=Ext.getCmp("mc_l4_from").getValue();if(str!=null){if(str.indexOf("-")==-1&&dsMC14From.getAt(0)){Ext.getCmp("mc_l4_from").setValue(dsMC14From.getAt(0).data.airportname)}Ext.getCmp("hd_mc_l4_from").setValue(Ext.getCmp("mc_l4_from").getValue())}return true}}},{xtype:"combo",fieldLabel:'To (city or <a href="javascript:lookupReturn(\'multi4\',this)" style="font-weight:normal; text-decoration:underline" >airport code</a>)',name:"mc_l4_to",id:"mc_l4_to",store:dsMC14To,queryParam:"id",displayField:"airportname",typeAhead:false,loadingText:"Searching...",forceSelection:false,minListWidth:350,listWidth:350,maxHeight:900,minHeight:500,minChars:3,hideTrigger:true,tpl:resultTpl,itemSelector:"div.search-item",tabIndex:14,queryDelay:50,width:230,selectOnFocus:true,enableKeyEvents:true,listeners:{keydown:function(e){var str=Ext.getCmp("mc_l4_to").getValue();if(str.length<=1){Ext.getCmp("mc_l4_to").store.loadData("");this.minChars=3;return true}},focus:function(){FocusId="mc_l4_to";return true},blur:function(){FocusId="";var str=Ext.getCmp("mc_l4_to").getValue();if(str!=null){if(str.indexOf("-")==-1&&dsMC14To.getAt(0)){Ext.getCmp("mc_l4_to").setValue(dsMC14To.getAt(0).data.airportname)}Ext.getCmp("hd_mc_l4_to").setValue(Ext.getCmp("mc_l4_to").getValue())}return true}}}]},{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{xtype:"datefieldplus",usePickerPlus:true,noOfMonth:2,markWeekends:false,showWeekNumber:false,submitFormat:"m/d/Y",submitFormatAddon:"-format",fieldLabel:"Leave",name:"mc_l4_Depart",id:"mc_l4_Depart",width:80,tabIndex:15,blankText:"Please enter a valid departure date for flight 4.",maxText:"Flights are available for up to 330 days in advance. The date you entered exceeds this number of days.",minText:"The departure date is prior to flight 3 departure date. Please enter a valid departure date for flight 4.",allowBlank:false,listeners:{blur:function(){var d=new Date();var dateTemp=new Date();var curDate=parseInt(d.getDate()-1,10);var dateForValidation=new Date(Ext.getCmp("mc_l3_Depart").getValue());var dateFromFlight3=Ext.getCmp("mc_l3_Depart").getValue();var currentFormDate=Ext.getCmp("mc_l4_Depart").getValue();var dateValue=parseInt(dateFromFlight3.getDate()-1,10);dateForValidation.setDate(dateValue+8);var lastAllowedDate=new Date();lastAllowedDate.setDate(curDate+330);if(new Date(Ext.getCmp("mc_l4_Depart").getValue())>lastAllowedDate){Ext.getCmp("mc_l4_Depart").setValue(lastAllowedDate)}if(Ext.getCmp("mc_l4_Depart").getValue()==null||Ext.getCmp("mc_l4_Depart").getValue()==""){Ext.getCmp("mc_l4_Depart").setValue(dateForValidation)}},focus:function(){FocusId="other";return true}},vtype:"daterange",endDateFieldMC14:"enddtMC14"}]},{columnWidth:0.5,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Time",name:"mc_l4_departSchedule",id:"mc_l4_departScheduleId",hiddenName:"mc_l4_departSchedule",store:times,valueField:"value",displayField:"display",editable:false,mode:"local",tabIndex:16,triggerAction:"all",value:"Any",listWidth:106,width:90}]}]},{layout:"column",items:[{columnWidth:0.35,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Passengers",name:"mc_pax_count",id:"mc_pax_countId",hiddenName:"mc_pax_count",store:new Ext.data.SimpleStore({fields:["value","display"],data:[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]}),valueField:"value",displayField:"display",editable:false,mode:"local",tabIndex:17,triggerAction:"all",listeners:{blur:function(){Ext.getCmp("ow_pax_countId").setValue(Ext.getCmp("mc_pax_countId").getValue());Ext.getCmp("rt_pax_countId").setValue(Ext.getCmp("mc_pax_countId").getValue());return true},focus:function(){FocusId="other";return true}},value:"1",listWidth:41,width:25}]},{columnWidth:0.65,layout:"form",items:[{xtype:"selectbox",fieldLabel:"Class",name:"mc_air_class",id:"mc_air_classId",hiddenName:"mc_air_class",store:new Ext.data.SimpleStore({fields:["value","display"],data:[["economy","Economy"],["business","Business"],["first","First"]]}),valueField:"value",displayField:"display",editable:false,mode:"local",tabIndex:18,triggerAction:"all",listeners:{blur:function(){Ext.getCmp("rt_air_classId").setValue(Ext.getCmp("mc_air_classId").getValue());Ext.getCmp("ow_air_classId").setValue(Ext.getCmp("mc_air_classId").getValue());return true},focus:function(){FocusId="other";return true}},value:"economy",listWidth:106,width:90}]}]},{xtype:"checkbox",hideLabel:true,boxLabel:"Search nearby airports",name:"mc_regionalsearch",id:"mc_regionalsearch",style:"padding-left:0px;margin-left:0px;",stateful:true,listeners:{blur:function(){setRegionalCheckBoxValue("mc_regionalsearch");Ext.getCmp("rt_regionalsearch").setValue(Ext.getCmp("mc_regionalsearch").getValue());Ext.getCmp("ow_regionalsearch").setValue(Ext.getCmp("mc_regionalsearch").getValue());Ext.getCmp("regionalsearch").setValue(Ext.getCmp("mc_regionalsearch").getValue());return true},focus:function(){FocusId="other";return true}},tabIndex:19,width:200,height:10,left:40},{xtype:"checkbox",hideLabel:true,boxLabel:"I prefer non-stop flights",name:"mc_nonstop_search",id:"mc_nonstop_search",style:"padding-left:0px;margin-left:0px;",tabIndex:20,stateful:true,listeners:{blur:function(){setNonStopCheckBoxValue("mc_nonstop_search");Ext.getCmp("rt_nonstop_search").setValue(Ext.getCmp("mc_nonstop_search").getValue());Ext.getCmp("ow_nonstop_search").setValue(Ext.getCmp("mc_nonstop_search").getValue());Ext.getCmp("nonstopsearch").setValue(Ext.getCmp("mc_nonstop_search").getValue());return true},focus:function(){FocusId="other";return true}},width:200,height:20,left:40},{xtype:"hidden",name:"hd_mc_l1_to",id:"hd_mc_l1_to",value:"false"},{xtype:"hidden",name:"hd_mc_l1_from",id:"hd_mc_l1_from",value:"false"},{xtype:"hidden",name:"hd_mc_l2_to",id:"hd_mc_l2_to",value:"false"},{xtype:"hidden",name:"hd_mc_l2_from",id:"hd_mc_l2_from",value:"false"},{xtype:"hidden",name:"hd_mc_l3_to",id:"hd_mc_l3_to",value:"false"},{xtype:"hidden",name:"hd_mc_l3_from",id:"hd_mc_l3_from",value:"false"},{xtype:"hidden",name:"hd_mc_l4_to",id:"hd_mc_l4_to",value:"false"},{xtype:"hidden",name:"hd_mc_l4_from",id:"hd_mc_l4_from",value:"false"},{xtype:"hidden",name:"changetype",id:"changetype",value:"multi"},{xtype:"hidden",name:"trip_type",id:"trip_type",value:"multicity"},{xtype:"hidden",name:"action_id",id:"action_id",value:"2"},{xtype:"hidden",name:"regionalsearch",id:"regionalsearch",value:"false"},{xtype:"hidden",name:"nonstopsearch",id:"nonstopsearch",value:"false"},{layout:"column",items:[{columnWidth:0.45,items:[{xtype:"checkbox",boxLabel:"Find hotels too",tabIndex:14,name:"mc_hotel",style:"padding-left:0px;margin-left:0px;padding-top:2px;",id:"mc_hotel"}]},{columnWidth:0.55,style:"padding-left:0px;margin-left:0px;padding-top:4px;",items:[{xtype:"label",style:"color:#999999;font-size:9px",text:"(opens new window)"}]}]},{xtype:"fieldset",style:"background:url(/scripts/ext2/ext-2.1/resources/images/cfares/dot.gif) repeat-x 0px 0px;padding: 0px 0px 10px 0px",width:230},{xtype:"fieldset",title:"",autoHeight:false,height:"200",border:false,items:[{layout:"column",items:[{columnWidth:1,items:[{xtype:"button",text:"Submit",minWidth:100,tabIndex:21,tooltip:"Search for cheap tickets.",style:{padding:"0px 0px 0px 40px",margin:"0px 10px 30px 120px"},handler:function(){tabs.setMCHiddenFields();air_mc_form.getForm().el.dom.action=air_mc_form.getForm().url;curForm=air_mc_form;if(tabs.checkAndSubmitMC(curForm.getForm())){curForm.getForm().submit()}}}]}]}]}]});Cfares.FlightPanel=Ext.extend(Ext.TabPanel,{border:false,cls:"",selectedTab:0,__formulateDateStr:function(daysInAdvance){var d=new Date();var curDate=parseInt(d.getDate(),10);d.setDate(curDate+daysInAdvance);curDate=parseInt(d.getDate(),10);var curMonth=parseInt(d.getMonth(),10)+1;var fy=parseInt(d.getFullYear(),10);var ry=parseInt(d.getFullYear(),10);var curDateStr=curDate;if(curDate<10){curDateStr="0"+curDateStr}var currMonStr=curMonth;if(curMonth<10){currMonStr="0"+currMonStr}var depHdn=currMonStr+"/"+curDateStr+"/"+fy;return depHdn},__setAirportCode:function(airportField,hiddenField){var airStr=Ext.getCmp(airportField).getValue();if(airStr){Ext.getCmp(hiddenField).setValue(airStr.split("-")[0])}},showRT:function(){air_rt_form.findById("rt_roundtrip").setValue(true);air_rt_form.findById("rt_oneway").setValue(false);air_rt_form.findById("rt_multicity").setValue(false);air_ow_form.findById("ow_oneway").setValue(false);air_ow_form.findById("ow_roundtrip").setValue(false);air_ow_form.findById("ow_multicity").setValue(false);air_mc_form.findById("mc_multicity").setValue(false);air_mc_form.findById("mc_oneway").setValue(false);air_mc_form.findById("mc_roundtrip").setValue(false)},showOW:function(){air_rt_form.findById("rt_roundtrip").setValue(false);air_rt_form.findById("rt_oneway").setValue(false);air_rt_form.findById("rt_multicity").setValue(false);air_ow_form.findById("ow_oneway").setValue(true);air_ow_form.findById("ow_roundtrip").setValue(false);air_ow_form.findById("ow_multicity").setValue(false);air_mc_form.findById("mc_multicity").setValue(false);air_mc_form.findById("mc_oneway").setValue(false);air_mc_form.findById("mc_roundtrip").setValue(false)},showMC:function(){air_rt_form.findById("rt_roundtrip").setValue(false);air_rt_form.findById("rt_oneway").setValue(false);air_rt_form.findById("rt_multicity").setValue(false);air_ow_form.findById("ow_oneway").setValue(false);air_ow_form.findById("ow_roundtrip").setValue(false);air_ow_form.findById("ow_multicity").setValue(false);air_mc_form.findById("mc_multicity").setValue(true);air_mc_form.findById("mc_oneway").setValue(false);air_mc_form.findById("mc_roundtrip").setValue(false)},putFocus:function(){var depHdn=this.__formulateDateStr(14);var retHdn=this.__formulateDateStr(21);Ext.getCmp("rt_Depart").setValue(depHdn);Ext.getCmp("rt_Return").setValue(retHdn);Ext.getCmp("ow_Depart").setValue(depHdn);Ext.getCmp("mc_l1_Depart").setValue(depHdn);depHdn=this.__formulateDateStr(21);Ext.getCmp("mc_l2_Depart").setValue(depHdn);depHdn=this.__formulateDateStr(21);Ext.getCmp("mc_l3_Depart").setValue(depHdn);depHdn=this.__formulateDateStr(21);Ext.getCmp("mc_l4_Depart").setValue(depHdn)},setRTHiddenFields:function(){var to=Ext.getCmp("rt_to").getValue();if(to){Ext.getCmp("hd_rt_to").setValue(to.split("-")[0])}Ext.getCmp("trip_type").setValue("roundtrip");var from=Ext.getCmp("rt_from").getValue();if(from){Ext.getCmp("hd_rt_from").setValue(from.split("-")[0])}},setOWHiddenFields:function(){var to=Ext.getCmp("ow_to").getValue();if(to){Ext.getCmp("hd_ow_to").setValue(to.split("-")[0])}Ext.getCmp("trip_type").setValue("oneway");var from=Ext.getCmp("ow_from").getValue();if(from){Ext.getCmp("hd_ow_from").setValue(from.split("-")[0])}},setMCHiddenFields:function(){this.__setAirportCode("mc_l1_from","hd_mc_l1_from");this.__setAirportCode("mc_l1_to","hd_mc_l1_to");this.__setAirportCode("mc_l2_from","hd_mc_l2_from");this.__setAirportCode("mc_l2_to","hd_mc_l2_to");this.__setAirportCode("mc_l3_from","hd_mc_l3_from");this.__setAirportCode("mc_l3_to","hd_mc_l3_to");this.__setAirportCode("mc_l4_from","hd_mc_l4_from");this.__setAirportCode("mc_l4_to","hd_mc_l4_to");Ext.getCmp("trip_type").setValue("multicity");if(Ext.getCmp("hd_mc_l1_from").getValue()=="false"){Ext.getCmp("hd_mc_l1_from").setValue(null)}if(Ext.getCmp("hd_mc_l1_to").getValue()=="false"){Ext.getCmp("hd_mc_l1_to").setValue(null)}if(Ext.getCmp("hd_mc_l2_from").getValue()=="false"){Ext.getCmp("hd_mc_l2_from").setValue(null)}if(Ext.getCmp("hd_mc_l2_to").getValue()=="false"){Ext.getCmp("hd_mc_l2_to").setValue(null)}if(Ext.getCmp("hd_mc_l3_from").getValue()=="false"){Ext.getCmp("hd_mc_l3_from").setValue(null)}if(Ext.getCmp("hd_mc_l3_to").getValue()=="false"){Ext.getCmp("hd_mc_l3_to").setValue(null)}if(Ext.getCmp("hd_mc_l4_from").getValue()=="false"){Ext.getCmp("hd_mc_l4_from").setValue(null)}if(Ext.getCmp("hd_mc_l4_to").getValue()=="false"){Ext.getCmp("hd_mc_l4_to").setValue(null)}},forwardInputRT:function(){var to=Ext.getCmp("ow_to").getValue();var from=Ext.getCmp("ow_from").getValue();if(!from){from=Ext.getCmp("mc_l1_from").getValue()}if(!to){to=Ext.getCmp("mc_l1_to").getValue()}if(from){Ext.getCmp("rt_from").setValue(from)}if(to){Ext.getCmp("rt_to").setValue(to)}var nonstop=Ext.getCmp("ow_nonstop_search").getValue();if(!nonstop){nonstop=Ext.getCmp("mc_nonstop_search").getValue()}Ext.getCmp("rt_nonstop_search").setValue(nonstop);Ext.getCmp("nonstopsearch").setValue(nonstop);setRegionalCheckBoxValue("rt_regionalsearch");var regionalsearch=Ext.getCmp("ow_regionalsearch").getValue();if(!regionalsearch){regionalsearch=Ext.getCmp("mc_regionalsearch").getValue()}Ext.getCmp("rt_regionalsearch").setValue(regionalsearch);Ext.getCmp("regionalsearch").setValue(regionalsearch);setNonStopCheckBoxValue("rt_nonstop_search");var depart=Ext.getCmp("ow_Depart").getValue();var ret="";if(!depart){depart=Ext.getCmp("mc_l1_Depart").getValue();ret=Ext.getCmp("mc_l2_Depart").getValue()}Ext.getCmp("rt_Depart").setValue(depart);var departt=Ext.getCmp("ow_departScheduleId").getValue();var returnt="";if(departt=="Any"){departt=Ext.getCmp("mc_l1_departScheduleId").getValue()}if(returnt=="Any"||returnt==""){returnt=Ext.getCmp("mc_l2_departScheduleId").getValue()}if(departt!="Any"&&departt!=""){Ext.getCmp("rt_departScheduleId").setValue(departt)}if(returnt!=""&&returnt!="Any"){}var no_pax=Ext.getCmp("ow_pax_countId").getValue();var clas=Ext.getCmp("ow_air_classId").getValue();if(no_pax==1){no_pax=Ext.getCmp("mc_pax_countId").getValue()}if(clas=="economy"){clas=Ext.getCmp("mc_air_classId").getValue()}if(no_pax!="null"&&no_pax!=1){Ext.getCmp("rt_pax_countId").setValue(no_pax)}if(clas!="null"&&clas!="economy"){Ext.getCmp("rt_air_classId").setValue(clas)}reArrangeComparisionBoxes()},forwardInputOW:function(){var to=Ext.getCmp("rt_to").getValue();var from=Ext.getCmp("rt_from").getValue();if(!from){from=Ext.getCmp("mc_l1_from").getValue()}if(!to){to=Ext.getCmp("mc_l1_to").getValue()}if(from){Ext.getCmp("ow_from").setValue(from)}if(to){Ext.getCmp("ow_to").setValue(to)}var nonstop=Ext.getCmp("rt_nonstop_search").getValue();if(!nonstop){nonstop=Ext.getCmp("mc_nonstop_search").getValue()}Ext.getCmp("ow_nonstop_search").setValue(nonstop);Ext.getCmp("nonstopsearch").setValue(nonstop);var regionalsearch=Ext.getCmp("rt_regionalsearch").getValue();if(!regionalsearch){regionalsearch=Ext.getCmp("mc_regionalsearch").getValue()}Ext.getCmp("ow_regionalsearch").setValue(regionalsearch);Ext.getCmp("regionalsearch").setValue(regionalsearch);var depart=Ext.getCmp("rt_Depart").getValue();var ret=Ext.getCmp("rt_Return").getValue();if(!depart){depart=Ext.getCmp("mc_l1_Depart").getValue()}if(!ret){ret=Ext.getCmp("mc_l2_Depart").getValue()}Ext.getCmp("ow_Depart").setValue(depart);var departt=Ext.getCmp("rt_departScheduleId").getValue();if(departt=="Any"){departt=Ext.getCmp("mc_l1_departScheduleId").getValue()}if(departt!="Any"&&departt!=""){Ext.getCmp("ow_departScheduleId").setValue(departt)}var no_pax=Ext.getCmp("rt_pax_countId").getValue();var clas=Ext.getCmp("rt_air_classId").getValue();if(no_pax==1){no_pax=Ext.getCmp("mc_pax_countId").getValue()}if(clas=="economy"){clas=Ext.getCmp("mc_air_classId").getValue()}if(no_pax!="null"&&no_pax!=1){Ext.getCmp("ow_pax_countId").setValue(no_pax)}if(clas!="null"&&clas!="economy"){Ext.getCmp("ow_air_classId").setValue(clas)}},forwardInputMC:function(){var to=Ext.getCmp("rt_to").getValue();var from=Ext.getCmp("rt_from").getValue();if(!from){from=Ext.getCmp("ow_from").getValue()}if(!to){to=Ext.getCmp("ow_to").getValue()}if(from){Ext.getCmp("mc_l1_from").setValue(from)}if(to){Ext.getCmp("mc_l1_to").setValue(to)}var nonstop=Ext.getCmp("ow_nonstop_search").getValue();if(!nonstop){nonstop=Ext.getCmp("rt_nonstop_search").getValue()}Ext.getCmp("mc_nonstop_search").setValue(nonstop);Ext.getCmp("nonstopsearch").setValue(nonstop);var regionalsearch=Ext.getCmp("ow_regionalsearch").getValue();if(!regionalsearch){regionalsearch=Ext.getCmp("rt_regionalsearch").getValue()}Ext.getCmp("mc_regionalsearch").setValue(regionalsearch);Ext.getCmp("regionalsearch").setValue(regionalsearch);var depart=Ext.getCmp("rt_Depart").getValue();var ret=Ext.getCmp("rt_Return").getValue();if(!depart){depart=Ext.getCmp("ow_Depart").getValue()}Ext.getCmp("mc_l1_Depart").setValue(depart);if(ret!=""){Ext.getCmp("mc_l2_Depart").setValue(ret)}var departt=Ext.getCmp("rt_departScheduleId").getValue();var returnt=Ext.getCmp("rt_returnScheduleId").getValue();if(departt=="Any"){departt=Ext.getCmp("ow_departScheduleId").getValue()}if(departt!="Any"&&departt!=""){Ext.getCmp("mc_l1_departScheduleId").setValue(departt)}if(returnt!=""&&returnt!="Any"){Ext.getCmp("mc_l2_departScheduleId").setValue(returnt)}var no_pax=Ext.getCmp("rt_pax_countId").getValue();var clas=Ext.getCmp("rt_air_classId").getValue();if(no_pax==1){no_pax=Ext.getCmp("ow_pax_countId").getValue()}if(clas=="economy"){clas=Ext.getCmp("ow_air_classId").getValue()}if(no_pax!="null"&&no_pax!=1){Ext.getCmp("mc_pax_countId").setValue(no_pax)}if(clas!="null"&&clas!="economy"){Ext.getCmp("mc_air_classId").setValue(clas)}},newWindows:function(extSources,aform){var uri="&to=	"+strTrim(aform.findField("hd_rt_to").value)+"&from="+strTrim(aform.findField("hd_rt_from").value)+"&ret_date="+aform.findField("rt_Return").value+"&dep_date="+aform.findField("rt_Depart").value+"&class="+aform.findField("rt_air_class").value+"&pax="+aform.findField("rt_pax_count").value;if(Ext.getCmp("rt_roundtrip").getValue()==true){if(Ext.getCmp("rt_hotel").getValue()==true){openhotelwindow(aform)}}var width=800;var height=screen.height;if(window.ActiveXObject){height=screen.height-70}var offset=0;if(extSources.length==2){width=(screen.width/2)-10}else{if(extSources.length==3){width=(screen.width/3)-10}else{if(extSources.length==4){width=(screen.width/4)-10}else{if(extSources.length==5){width=(screen.width/5)-10}else{if(extSources.length==6){width=(screen.width/6)-10}}}}}if(extSources.length>1){offset=(screen.width)/extSources.length}var locx=0;var locy=0;for(var i=0;i<extSources.length;i++){var winName=extSources[i]+"Win";var urlval="/externalsearch.cfr?extl_source="+extSources[i]+uri;bookWindow=window.open(urlval,winName,"'menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes,width="+width+",height="+height+",top="+locx+",left="+locy+"'");if(bookWindow){bookWindow.blur();window.focus()}else{popUpsBlocked=true;break}locy=locy+offset}if(popUpsBlocked){var trip_type=air_rt_form.getComponent("trip_type").value;Ext.Updater.defaults.disableCaching=false;var rtRegSearch="false";var rtNonStopSearch="false";if(Ext.getCmp("rt_regionalsearch").getValue()){rtRegSearch="on"}if(Ext.getCmp("rt_nonstop_search").getValue()){rtNonStopSearch="on"}if(trip_type=="roundtrip"){var urlValue="/dyna/getformdata?trip_type="+trip_type+"&rt_from="+curForm.getForm().findField("rt_from").value+"&rt_to="+curForm.getForm().findField("rt_to").value+"&hd_rt_from="+strTrim(curForm.getForm().findField("rt_from").value.split("-")[0])+"&hd_rt_to="+strTrim(curForm.getForm().findField("rt_to").value.split("-")[0])+"&rt_Depart-format="+curForm.getForm().findField("rt_Depart").value+"&rt_Return-format="+curForm.getForm().findField("rt_Return").value+"&rt_departSchedule="+curForm.getForm().findField("rt_departSchedule").value+"&rt_returnSchedule="+curForm.getForm().findField("rt_returnSchedule").value+"&rt_pax_count="+curForm.getForm().findField("rt_pax_count").value+"&rt_air_class="+curForm.getForm().findField("rt_air_class").value+"&rt_regionalsearch="+rtRegSearch+"&rt_nonstop_search="+rtNonStopSearch;flights.setActiveTab("roundtrip");air_rt_form.getForm().load({url:urlValue})}showPopupInfoDialog(aform);return false}return true},newHotelWindowsOW:function(aform){if(Ext.getCmp("ow_hotel").getValue()==true){var winName="CfaresHotels";var cityVal=aform.findField("ow_to").value;cityVal=getCity(cityVal);var departdate=new Date(aform.findField("ow_Depart").value);var returndate=new Date(departdate);returndate.setDate(departdate.getDate()+2);var noOfPassenger=aform.findField("ow_pax_countId").value;var width=(screen.width/2)-10;var height=screen.height;var locx=0;var locy=(screen.width/4)-10;var checkInDateVal=departdate.getMonth()+"/"+departdate.getDate()+"/"+departdate.getFullYear();var checkOutDateVal=returndate.getMonth()+"/"+returndate.getDate()+"/"+returndate.getFullYear();var urlval="http://hotels.cfares.com/index.jsp?cid=197618&pageName=hotSearch&Validatedates=true&validateCity=true&submitted=true&";urlval=urlval+"arrivalMonth="+departdate.getMonth()+"&departureMonth="+returndate.getMonth()+"&arrivalDay="+departdate.getDate()+"&departureDay="+returndate.getDate()+"&mode=2&avail=true&passThrough=true&propertyType=A&locale=en_US&city="+cityVal+"&cidateField="+checkInDateVal+"&codateField="+checkOutDateVal+"&numberOfNights=&numberOfRooms=1&room-0-adult-total="+noOfPassenger+"&room-0-child-total=0&submit2.x=29&submit2.y=13";bookWindow=window.open(urlval,winName,"'menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes,width="+width+",height="+height+",top="+locx+",left="+locy+"'");if(bookWindow){bookWindow.blur();window.focus()}return true}else{return true}},newHotelWindowsMC:function(aform){if(Ext.getCmp("mc_hotel").getValue()==true){if(Ext.getCmp("mc_l2_to").getValue()==""||(Ext.getCmp("mc_l1_to").getValue()!=Ext.getCmp("mc_l2_from").getValue())){var winName="CfaresHotels";var cityVal=aform.findField("mc_l1_to").value;cityVal=getCity(cityVal);var departdate=new Date(aform.findField("mc_l1_Depart").value);var returndate=new Date(departdate);returndate.setDate(departdate.getDate()+2);var noOfPassenger=aform.findField("mc_pax_countId").value;var width=(screen.width/2)-10;var height=screen.height;var locx=0;var locy=(screen.width/4)-10;var checkInDateVal=departdate.getMonth()+"/"+departdate.getDate()+"/"+departdate.getFullYear();var checkOutDateVal=returndate.getMonth()+"/"+returndate.getDate()+"/"+returndate.getFullYear();var urlval="http://hotels.cfares.com/index.jsp?cid=197618&pageName=hotSearch&Validatedates=true&validateCity=true&submitted=true&";urlval=urlval+"arrivalMonth="+departdate.getMonth()+"&departureMonth="+returndate.getMonth()+"&arrivalDay="+departdate.getDate()+"&departureDay="+returndate.getDate()+"&mode=2&avail=true&passThrough=true&propertyType=A&locale=en_US&city="+cityVal+"&cidateField="+checkInDateVal+"&codateField="+checkOutDateVal+"&numberOfNights=&numberOfRooms=1&room-0-adult-total="+noOfPassenger+"&room-0-child-total=0&submit2.x=29&submit2.y=13";bookWindow=window.open(urlval,winName,"'menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes,width="+width+",height="+height+",top="+locx+",left="+locy+"'");if(bookWindow){bookWindow.blur();window.focus()}return true}else{if(Ext.getCmp("mc_l2_to").getValue()!=""){var winName="CfaresHotels";var cityVal=aform.findField("mc_l2_from").value;cityVal=getCity(cityVal);var departdate=new Date(aform.findField("mc_l1_Depart").value);var returndate=new Date(aform.findField("mc_l2_Depart").value);var noOfPassenger=aform.findField("mc_pax_countId").value;var width=(screen.width/2)-10;var height=screen.height;var locx=0;var locy=(screen.width/4)-10;var checkInDateVal=departdate.getMonth()+"/"+departdate.getDate()+"/"+departdate.getFullYear();var checkOutDateVal=returndate.getMonth()+"/"+returndate.getDate()+"/"+returndate.getFullYear();var urlval="http://hotels.cfares.com/index.jsp?cid=197618&pageName=hotSearch&Validatedates=true&validateCity=true&submitted=true&";urlval=urlval+"arrivalMonth="+departdate.getMonth()+"&departureMonth="+returndate.getMonth()+"&arrivalDay="+departdate.getDate()+"&departureDay="+returndate.getDate()+"&mode=2&avail=true&passThrough=true&propertyType=A&locale=en_US&city="+cityVal+"&cidateField="+checkInDateVal+"&codateField="+checkOutDateVal+"&numberOfNights=&numberOfRooms=1&room-0-adult-total="+noOfPassenger+"&room-0-child-total=0&submit2.x=29&submit2.y=13";bookWindow=window.open(urlval,winName,"'menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes,width="+width+",height="+height+",top="+locx+",left="+locy+"'");if(bookWindow){bookWindow.blur();window.focus()}return true}}}},validateAir:function(aform){var browser1=navigator.appVersion;if(Ext.getCmp("rt_from").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code.");Ext.getCmp("rt_from").setValue("");Ext.getCmp("rt_from").focus();return false}else{alert("Please enter a valid departure airport name/code.");document.getElementById("rt_roundtrip").focus();return false}}else{if(Ext.getCmp("rt_to").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code.");Ext.getCmp("rt_to").focus();return false}else{alert("Please enter a valid arrival airport name/code.");document.getElementById("rt_roundtrip").focus();return false}}else{if(aform.findField("hd_rt_from").value=="false"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code.");Ext.getCmp("rt_from").setValue("");Ext.getCmp("rt_from").focus();return false}else{alert("Please enter a valid departure airport name/code.");document.getElementById("rt_roundtrip").focus();return false}}else{if(aform.findField("hd_rt_to").value=="false"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code.");Ext.getCmp("rt_to").focus();return false}else{alert("Please enter a valid arrival airport name/code.");document.getElementById("rt_roundtrip").focus();return false}}else{if((Ext.getCmp("rt_from").getValue()==null)||(Ext.getCmp("rt_from").getValue()=="")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code.");Ext.getCmp("rt_from").setValue("");Ext.getCmp("rt_from").focus();return false}else{alert("Please enter a valid departure airport name/code.");document.getElementById("rt_roundtrip").focus();return false}}else{if((Ext.getCmp("rt_to").getValue()==null)||(Ext.getCmp("rt_to").getValue()=="")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival to airport name/code.");Ext.getCmp("rt_to").focus();return false}else{alert("Please enter a valid arrival to airport name/code.");document.getElementById("rt_roundtrip").focus();return false}}else{if(Ext.getCmp("rt_from").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code.");Ext.getCmp("rt_from").setValue("");Ext.getCmp("rt_from").focus();return false}else{alert("Please enter a valid departure airport name/code.");document.getElementById("rt_roundtrip").focus();return false}}else{if(Ext.getCmp("rt_to").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code.");Ext.getCmp("rt_to").focus();return false}else{alert("Please enter a valid arrival airport name/code.");document.getElementById("rt_roundtrip").focus();return false}}else{if(Ext.getCmp("rt_from").getValue()==Ext.getCmp("rt_to").getValue()){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure and arrival city names/codes are same. Please enter valid city names/codes.");Ext.getCmp("rt_from").setValue("");Ext.getCmp("rt_from").focus();return false}else{alert("The departure and arrival city names/codes are same. Please enter valid city names/codes.");document.getElementById("rt_roundtrip").focus();return false}}}}}}}}}}var date=new Date();var todayDateVal=new Date();todayDateVal.setDate(todayDateVal.getDate()-1);todayDateVal.setHours(23);todayDateVal.setMinutes(59);todayDateVal.setSeconds(59);if(Ext.getCmp("rt_Depart").getValue()==""||Ext.getCmp("rt_Depart").getValue().length<6||Ext.getCmp("rt_Depart").getValue()==null){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure date.");return false}else{alert("Please enter a valid departure date.");document.getElementById("rt_roundtrip").focus();return false}}else{if(Ext.getCmp("rt_Return").getValue()==""||Ext.getCmp("rt_Return").getValue().length<6||Ext.getCmp("rt_Return").getValue()==null){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid return date.");return false}else{alert("Please enter a valid return date.");document.getElementById("rt_roundtrip").focus();return false}}else{if(new Date(Ext.getCmp("rt_Depart").getValue())<todayDateVal){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure date is prior to today's date.<br>Please enter a valid departure date.");return false}else{alert("The departure date is prior to today's date.\nPlease enter a valid departure date.");document.getElementById("rt_roundtrip").focus();return false}}else{if(new Date(Ext.getCmp("rt_Return").getValue())<todayDateVal){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The return date is prior to today's date.<br>Please enter a valid return date.");return false}else{alert("The return date is prior to today's date.\nPlease enter a valid return date.");document.getElementById("rt_roundtrip").focus();return false}}else{if(new Date(Ext.getCmp("rt_Return").getValue())<new Date(Ext.getCmp("rt_Depart").getValue())){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The return date is prior to the departure date.<br>Please enter a valid return date.");return false}else{alert("The return date is prior to the departure date.\nPlease enter a valid return date.");document.getElementById("rt_roundtrip").focus();return false}}else{if(!isDate(strTrim(Ext.getCmp("rt_Depart").value),"Departing")){return false}else{if(!isDate(Ext.getCmp("rt_Return").value,"Returning")){return false}}}}}}}if(!validDate(strTrim(Ext.getCmp("rt_Depart").value))){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure date.");return false}else{alert("Please enter a valid departure date.");document.getElementById("rt_roundtrip").focus();return false}}else{if(!validDate(Ext.getCmp("rt_Return").value)){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid return date.");return false}else{alert("Please enter a valid return date.");document.getElementById("rt_roundtrip").focus();return false}}}if(!isDatesOK(Ext.getCmp("rt_Depart").value,Ext.getCmp("rt_Return").value,"/")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The return date is prior to the departure date.<br>Please enter a valid return date.");return false}else{alert("The return date is prior to the departure date.\nPlease enter a valid return date.");document.getElementById("rt_roundtrip").focus();return false}}if(!CompareDates(strTrim(Ext.getCmp("rt_Depart").value),strTrim(Ext.getCmp("rt_Depart").value),"/")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Flights are available for up to 330 days in advance.<br>The date you entered exceeds this number of days.");return false}else{alert("Flights are available for up to 330 days in advance.\nThe date you entered exceeds this number of days.");document.getElementById("rt_roundtrip").focus();return false}}if(!CompareDates(strTrim(Ext.getCmp("rt_Return").value),strTrim(Ext.getCmp("rt_Return").value),"/")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Flights are available for up to 330 days in advance.<br>The date you entered exceeds this number of days.");return false}else{alert("Flights are available for up to 330 days in advance.\nThe date you entered exceeds this number of days.");document.getElementById("rt_roundtrip").focus();return false}}return true},validateAirOW:function(aform){var browser1=navigator.appVersion;if(Ext.getCmp("ow_from").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code.");Ext.getCmp("ow_from").focus();return false}else{alert("Please enter a valid departure airport name/code.");document.getElementById("ow_oneway").focus();return false}}else{if(Ext.getCmp("ow_to").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival to airport name/code.");Ext.getCmp("ow_to").focus();return false}else{alert("Please enter a valid arrival to airport name/code.");document.getElementById("ow_oneway").focus();return false}}else{if((Ext.getCmp("ow_from").getValue()==null)||(Ext.getCmp("ow_from").getValue()=="")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code.");Ext.getCmp("ow_from").focus();return false}else{alert("Please enter a valid departure airport name/code.");document.getElementById("ow_oneway").focus();return false}}else{if((Ext.getCmp("ow_to").getValue()==null)||(Ext.getCmp("ow_to").getValue()=="")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival to airport name/code.");Ext.getCmp("ow_to").focus();return false}else{alert("Please enter a valid arrival to airport name/code.");document.getElementById("ow_oneway").focus();return false}}else{if(Ext.getCmp("ow_from").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code.");Ext.getCmp("ow_from").focus();return false}else{alert("Please enter a valid departure airport name/code.");document.getElementById("ow_oneway").focus();return false}}else{if(Ext.getCmp("ow_to").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code.");Ext.getCmp("ow_to").focus();return false}else{alert("Please enter a valid arrival airport name/code.");document.getElementById("ow_oneway").focus();return false}}else{if(Ext.getCmp("ow_from").getValue()==Ext.getCmp("ow_to").getValue()){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure and arrival city names/codes are same. Please enter valid city names/codes.");Ext.getCmp("ow_from").focus();return false}else{alert("The departure and arrival city names/codes are same. Please enter valid city names/codes.");document.getElementById("ow_oneway").focus();return false}}}}}}}}var date=new Date();var todayDateVal=new Date();todayDateVal.setDate(todayDateVal.getDate()-1);todayDateVal.setHours(23);todayDateVal.setMinutes(59);todayDateVal.setSeconds(59);if(Ext.getCmp("ow_Depart").getValue()==null||Ext.getCmp("ow_Depart").getValue()==""||Ext.getCmp("ow_Depart").getValue().length<6){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure date.");return false}else{alert("Please enter a valid departure date.");document.getElementById("ow_oneway").focus();return false}}else{if(new Date(Ext.getCmp("ow_Depart").getValue())<todayDateVal){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure date is prior to today's date.<br>Please enter a valid departure date.");return false}else{alert("The departure date is prior to today's date.\nPlease enter a valid departure date.");document.getElementById("ow_oneway").focus();return false}}}if(!isDate(Ext.getCmp("ow_Depart").value,"Departing")){return false}if(!validDate(Ext.getCmp("ow_Depart").value)){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure date.");return false}else{alert("Please enter a valid departure date.");document.getElementById("ow_oneway").focus();return false}}if(!CompareDates(strTrim(document.getElementById("ow_Depart").value),strTrim(document.getElementById("ow_Depart").value),"/")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Flights are available for up to 330 days in advance.<br>The date you entered exceeds this number of days.");return false}else{alert("Flights are available for up to 330 days in advance.\nThe date you entered exceeds this number of days.");document.getElementById("ow_oneway").focus();return false}}return true},validateAirMC:function(aform){var browser1=navigator.appVersion;if(Ext.getCmp("mc_l1_from").getValue()==null||strTrim(Ext.getCmp("mc_l1_from").getValue())==""||strTrim(Ext.getCmp("mc_l1_from").getValue()).length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code for the flight 1.");Ext.getCmp("mc_l1_from").focus();return false}else{alert("Please enter a valid departure airport name/code for the flight 1.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l1_to").getValue()==null||Ext.getCmp("mc_l1_to").getValue()==""||Ext.getCmp("mc_l1_to").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code for the flight 1.");Ext.getCmp("mc_l1_to").focus();return false}else{alert("Please enter a valid arrival airport name/code for the flight 1.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l1_from").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code for the flight 1.");Ext.getCmp("mc_l1_from").focus();return false}else{alert("Please enter a valid departure airport name/code for the flight 1.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l1_to").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code for the flight 1.");Ext.getCmp("mc_l1_to").focus();return false}else{alert("Please enter a valid arrival airport name/code for the flight 1.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l1_from").getValue()==Ext.getCmp("mc_l1_to").getValue()){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure and arrival city names/codes are same for flight 1. Please enter valid city names/codes.");Ext.getCmp("mc_l1_from").focus();return false}else{alert("The departure and arrival city names/codes are same for flight 1.Please enter valid city names/codes.");document.getElementById("mc_multicity").focus();return false}}}}}}if((Ext.getCmp("mc_l2_from").getValue()!=null&&strTrim(Ext.getCmp("mc_l2_from").getValue())!="")){if(Ext.getCmp("mc_l2_to").getValue()==null||Ext.getCmp("mc_l2_to").getValue()==""||Ext.getCmp("mc_l2_to").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code for the flight 2.");Ext.getCmp("mc_l2_to").focus();return false}else{alert("Please enter a valid arrival airport name/code for the flight 2.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l2_to").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code for the flight 2.");Ext.getCmp("mc_l2_to").focus();return false}else{alert("Please enter a valid arrival airport name/code for the flight 2.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l2_from").getValue()==Ext.getCmp("mc_l2_to").getValue()){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure and arrival city names/codes are same for flight 2. Please enter valid city names/codes.");Ext.getCmp("mc_l2_from").focus();return false}else{alert("The departure and arrival city names/codes are same for flight 2.Please enter valid city names/codes.");document.getElementById("mc_multicity").focus();return false}}}}}else{if((Ext.getCmp("mc_l2_to").getValue()!=null&&strTrim(Ext.getCmp("mc_l2_to").getValue())!="")){if(Ext.getCmp("mc_l2_from").getValue()==null||Ext.getCmp("mc_l2_from").getValue()==""||Ext.getCmp("mc_l2_from").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code for the flight 2.");Ext.getCmp("mc_l2_from").focus();return false}else{alert("Please enter a valid departure airport name/code for the flight 2.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l2_from").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code for the flight 2.");Ext.getCmp("mc_l2_from").focus();return false}else{alert("Please enter a valid departure airport name/code for the flight 2.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l2_from").getValue()==Ext.getCmp("mc_l2_to").getValue()){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure and arrival city names/codes are same for flight 2. Please enter valid city names/codes.");Ext.getCmp("mc_l2_from").focus();return false}else{alert("The departure and arrival city names/codes are same for flight 2.Please enter valid city names/codes.");document.getElementById("mc_multicity").focus();return false}}}}}}if((Ext.getCmp("mc_l3_from").getValue()!=null&&strTrim(Ext.getCmp("mc_l3_from").getValue())!="")){if(Ext.getCmp("mc_l3_to").getValue()==null||Ext.getCmp("mc_l3_to").getValue()==""||Ext.getCmp("mc_l3_to").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code for the flight 3.");Ext.getCmp("mc_l3_to").focus();return false}else{alert("Please enter a valid arrival airport name/code for the flight 3.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l3_to").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code for the flight 3.");Ext.getCmp("mc_l3_to").focus();return false}else{alert("Please enter a valid arrival airport name/code for the flight 3.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l3_from").getValue()==Ext.getCmp("mc_l3_to").getValue()){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure and arrival city names/codes are same for flight 3. Please enter valid city names/codes.");Ext.getCmp("mc_l3_from").focus();return false}else{alert("The departure and arrival city names/codes are same for flight 3.Please enter valid city names/codes.");document.getElementById("mc_multicity").focus();return false}}}}}else{if((Ext.getCmp("mc_l3_to").getValue()!=null&&strTrim(Ext.getCmp("mc_l3_to").getValue())!="")){if(Ext.getCmp("mc_l3_from").getValue()==null||Ext.getCmp("mc_l3_from").getValue()==""||Ext.getCmp("mc_l3_from").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code for the flight 3.");Ext.getCmp("mc_l3_from").focus();return false}else{alert("Please enter a valid departure airport name/code for the flight 3.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l3_from").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code for the flight 3.");Ext.getCmp("mc_l3_from").focus();return false}else{alert("Please enter a valid departure airport name/code for the flight 3.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l3_from").getValue()==Ext.getCmp("mc_l3_to").getValue()){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure and arrival city names/codes are same for flight 3. Please enter valid city names/codes.");Ext.getCmp("mc_l3_from").focus();return false}else{alert("The departure and arrival city names/codes are same for flight 3.Please enter valid city names/codes.");document.getElementById("mc_multicity").focus();return false}}}}}}if((Ext.getCmp("mc_l4_from").getValue()!=null&&strTrim(Ext.getCmp("mc_l4_from").getValue())!="")){if(Ext.getCmp("mc_l4_to").getValue()==null||Ext.getCmp("mc_l4_to").getValue()==""||Ext.getCmp("mc_l4_to").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code for the flight 4.");Ext.getCmp("mc_l4_to").focus();return false}else{alert("Please enter a valid arrival airport name/code for the flight 4.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l4_to").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid arrival airport name/code for the flight 4.");Ext.getCmp("mc_l4_to").focus();return false}else{alert("Please enter a valid arrival airport name/code for the flight 4.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l4_from").getValue()==Ext.getCmp("mc_l4_to").getValue()){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure and arrival city names/codes are same for flight 4. Please enter valid city names/codes.");Ext.getCmp("mc_l4_from").focus();return false}else{alert("The departure and arrival city names/codes are same for flight 4.Please enter valid city names/codes.");document.getElementById("mc_multicity").focus();return false}}}}}else{if((Ext.getCmp("mc_l4_to").getValue()!=null&&strTrim(Ext.getCmp("mc_l4_to").getValue())!="")){if(Ext.getCmp("mc_l4_from").getValue()==null||Ext.getCmp("mc_l4_from").getValue()==""||Ext.getCmp("mc_l4_from").getValue().length<3){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code for the flight 4.");Ext.getCmp("mc_l4_from").focus();return false}else{alert("Please enter a valid departure airport name/code for the flight 4.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l4_from").getValue()=="Enter city name or choose from the airport code link"){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure airport name/code for the flight 4.");Ext.getCmp("mc_l4_from").focus();return false}else{alert("Please enter a valid departure airport name/code for the flight 4.");document.getElementById("mc_multicity").focus();return false}}else{if(Ext.getCmp("mc_l4_from").getValue()==Ext.getCmp("mc_l4_to").getValue()){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure and arrival city names/codes are same for flight 4. Please enter valid city names/codes.");Ext.getCmp("mc_l4_from").focus();return false}else{alert("The departure and arrival city names/codes are same for flight 4.Please enter valid city names/codes.");document.getElementById("mc_multicity").focus();return false}}}}}}var todayDateVal=new Date();todayDateVal.setDate(todayDateVal.getDate()-1);todayDateVal.setHours(23);todayDateVal.setMinutes(59);todayDateVal.setSeconds(59);if(Ext.getCmp("mc_l1_Depart").getValue()==""||Ext.getCmp("mc_l1_Depart").getValue().length<4||Ext.getCmp("mc_l1_Depart").getValue()==null){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure date for flight 1.");return false}else{alert("Please enter a valid departure date for flight 1.");document.getElementById("mc_multicity").focus();return false}}else{if(new Date(Ext.getCmp("mc_l1_Depart").getValue())<todayDateVal){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure date of flight 1 is prior to today's date.<br>Please enter a valid departure date.");return false}else{alert("The departure date of flight 1 is prior to today's date.\nPlease enter a valid departure date.");document.getElementById("mc_multicity").focus();return false}}}if(!isDate(Ext.getCmp("mc_l1_Depart").value,"Flight 1 Departing")){return false}if(!validDate(Ext.getCmp("mc_l1_Depart").value)){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid flight 1 Departing date.");return false}else{alert("Please enter a valid flight 1 Departing date.");document.getElementById("mc_multicity").focus();return false}}if(!CompareDates(document.getElementById("mc_l1_Depart").value,document.getElementById("mc_l1_Depart").value,"/")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Flights are available for up to 330 days in advance.<br>The date you entered exceeds this number of days for flight 1.");return false}else{alert("Flights are available for up to 330 days in advance.\nThe date you entered exceeds this number of days for flight 1.");document.getElementById("mc_multicity").focus();return false}}if(Ext.getCmp("mc_l2_from").getValue()!=null&&strTrim(Ext.getCmp("mc_l2_from").getValue())!=""){if(Ext.getCmp("mc_l2_Depart").getValue()==""||Ext.getCmp("mc_l2_Depart").getValue().length<6||Ext.getCmp("mc_l2_Depart").getValue()==null){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure date for flight 2.");return false}else{alert("Please enter a valid departure date for flight 2.");document.getElementById("mc_multicity").focus();return false}}else{if((new Date(Ext.getCmp("mc_l2_Depart").getValue())<todayDateVal)||(new Date(Ext.getCmp("mc_l2_Depart").getValue())<new Date(Ext.getCmp("mc_l1_Depart").getValue()))){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure date of flight 2 is either prior to today's date or prior to the departure date of flight 1.<br>Please enter a valid departure date.");return false}else{alert("The departure date of flight 2 is either prior to today's date or prior to the departure date of flight 1.\nPlease enter a valid departure date.");document.getElementById("mc_multicity").focus();return false}}}if(!isDate(Ext.getCmp("mc_l2_Depart").value,"Flight 2 Departing")){return false}if(!validDate(Ext.getCmp("mc_l2_Depart").value)){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid flight 2 departure date.");return false}else{alert("Please enter a valid flight 2 departure date.");document.getElementById("mc_multicity").focus();return false}}if(!CompareDates(document.getElementById("mc_l2_Depart").value,document.getElementById("mc_l2_Depart").value,"/")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Flights are available for up to 330 days in advance.<br>The date you entered exceeds this number of days for flight 2.");return false}else{alert("Flights are available for up to 330 days in advance.\nThe date you entered exceeds this number of days for flight 2.");document.getElementById("mc_multicity").focus();return false}}}else{Ext.getCmp("mc_l2_Depart").setValue(Ext.getCmp("mc_l1_Depart").getValue());Ext.getCmp("mc_l3_Depart").setValue(Ext.getCmp("mc_l1_Depart").getValue());Ext.getCmp("mc_l4_Depart").setValue(Ext.getCmp("mc_l1_Depart").getValue())}if(Ext.getCmp("mc_l3_from").getValue()!=null&&strTrim(Ext.getCmp("mc_l3_from").getValue())!=""){if(Ext.getCmp("mc_l3_Depart").getValue()==""||Ext.getCmp("mc_l3_Depart").getValue().length<6||Ext.getCmp("mc_l3_Depart").getValue()==null){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure date for flight 3.");return false}else{alert("Please enter a valid departure date for flight 3.");document.getElementById("mc_multicity").focus();return false}}if((new Date(Ext.getCmp("mc_l3_Depart").getValue())<todayDateVal)||(new Date(Ext.getCmp("mc_l3_Depart").getValue())<new Date(Ext.getCmp("mc_l2_Depart").getValue()))||(new Date(Ext.getCmp("mc_l3_Depart").getValue())<new Date(Ext.getCmp("mc_l1_Depart").getValue()))){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure date of flight 3 is either prior to today's date or prior to the departure date of flight 1 or flight 2.<br>Please enter a valid departure date.");return false}else{alert("The departure date of flight 3 is either prior to today's date or prior to the departure date of flight 1 or flight 2.\nPlease enter a valid departure date.");document.getElementById("mc_multicity").focus();return false}}if(!isDate(Ext.getCmp("mc_l3_Depart").value,"Flight 3 Departing")){return false}if(!validDate(Ext.getCmp("mc_l3_Depart").value)){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid flight 3 departure date.");return false}else{alert("Please enter a valid flight 3 departure date.");document.getElementById("mc_multicity").focus();return false}}if(!CompareDates(document.getElementById("mc_l3_Depart").value,document.getElementById("mc_l3_Depart").value,"/")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Flights are available for up to 330 days in advance.<br>The date you entered exceeds this number of days for Flight 3.");return false}else{alert("Flights are available for up to 330 days in advance.\nThe date you entered exceeds this number of days for Flight 3.");document.getElementById("mc_multicity").focus();return false}}}else{Ext.getCmp("mc_l3_Depart").setValue(Ext.getCmp("mc_l2_Depart").getValue());Ext.getCmp("mc_l4_Depart").setValue(Ext.getCmp("mc_l2_Depart").getValue())}if(Ext.getCmp("mc_l4_from").getValue()!=null&&strTrim(Ext.getCmp("mc_l4_from").getValue())!=""){if(Ext.getCmp("mc_l4_Depart").getValue()==""||Ext.getCmp("mc_l4_Depart").getValue().length<6||Ext.getCmp("mc_l4_Depart").getValue()==null){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid departure date for flight 4.");return false}else{alert("Please enter a valid departure date for flight 4.");document.getElementById("mc_multicity").focus();return false}}if((new Date(Ext.getCmp("mc_l4_Depart").getValue())<todayDateVal)||(new Date(Ext.getCmp("mc_l4_Depart").getValue())<new Date(Ext.getCmp("mc_l3_Depart").getValue()))||(new Date(Ext.getCmp("mc_l4_Depart").getValue())<new Date(Ext.getCmp("mc_l2_Depart").getValue()))||(new Date(Ext.getCmp("mc_l4_Depart").getValue())<new Date(Ext.getCmp("mc_l1_Depart").getValue()))){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","The departure date of flight 4 is either prior to today's date <br>or prior to the departure date of flight 1 or flight 2 or flight 3.<br>Please enter a valid departure date.");return false}else{alert("The departure date of flight 4 is either prior to today's date \nor prior to the departure date of flight 1 or flight 2 or flight 3.\nPlease enter a valid departure date.");document.getElementById("mc_multicity").focus();return false}}if(!isDate(Ext.getCmp("mc_l4_Depart").value,"Flight 4 Departing")){return false}if(!validDate(Ext.getCmp("mc_l4_Depart").value)){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Please enter a valid flight 4 departure date.");return false}else{alert("Please enter a valid flight 4 departure date.");document.getElementById("mc_multicity").focus();return false}}if(!CompareDates(document.getElementById("mc_l4_Depart").value,document.getElementById("mc_l4_Depart").value,"/")){if(browser1.indexOf("Safari")==-1){Ext.MessageBox.alert("Error!","Flights are available for up to 330 days in advance.<br>The date you entered exceeds this number of days for Flight 4.");return false}else{alert("Flights are available for up to 330 days in advance.\nThe date you entered exceeds this number of days for Flight 4.");document.getElementById("mc_multicity").focus();return false}}}else{Ext.getCmp("mc_l4_Depart").setValue(Ext.getCmp("mc_l3_Depart").getValue())}return true},checkAndSubmit:function(aform){if(this.validateAir(aform)){var extSrcs=new Array();var index=0;if(Ext.getCmp("rt_roundtrip").getValue()==true){if(Ext.getCmp("rt_hotwire").getValue()){extSrcs[index++]="Hotwire"}if(Ext.getCmp("rt_kayak").getValue()){extSrcs[index++]="Kayak"}if(Ext.getCmp("rt_fly").getValue()){extSrcs[index++]="Fly"}if(Ext.getCmp("rt_bookingbuddy").getValue()){extSrcs[index++]="BookingBuddy"}if(Ext.getCmp("rt_travelTicker").getValue()){extSrcs[index++]="TravelTicker"}}if(this.newWindows(extSrcs,aform)){return true}else{return false}}else{return false}},checkAndSubmitOW:function(aform){if(this.validateAirOW(aform)){if(this.newHotelWindowsOW(aform)){return true}}else{return false}},checkAndSubmitMC:function(aform){if(this.validateAirMC(aform)){if(this.newHotelWindowsMC(aform)){return true}else{return true}}else{return false}}});Ext.reg("flightpanel",Cfares.FlightPanel);var tabs=new Cfares.FlightPanel({id:"flights",deferredRender:false,layoutOnTabChange:true,activeTab:0,enableTabScroll:true,width:248,cls:"ssExtSubTab",resizeTabs:true,stateful:false,minTabWidth:88,tabWidth:88,listeners:{tabchange:function(){var tab=this.getActiveTab();if(tab){if(tab.title=="Round Trip"){tab.ownerCt.forwardInputRT();this.showRT()}if(tab.title=="One Way"){tab.ownerCt.forwardInputOW();this.showOW()}if(tab.title=="Multi-City"){tab.ownerCt.forwardInputMC();this.showMC()}}}},items:[{xtype:"panel",id:"roundtrip",title:"Round Trip",items:[air_rt_form]},{xtype:"panel",id:"oneway",title:"One Way",items:[air_ow_form]},{xtype:"panel",id:"multicity",title:"Multi-City",items:[air_mc_form]}]});tabs.putFocus();tabs.doLayout();Ext.BLANK_IMAGE_URL="/scripts/ext2/ext-2.1/resources/images/cfares/s.gif";tabs.render("newsearch");var flights=Ext.getCmp("flights");if(!Ext.getCmp("rt_to").value){air_rt_form.getForm().load({url:"/dyna/searchrq",success:function(res,req){var trip_type=air_rt_form.getComponent("trip_type").value;var aform=air_rt_form.getForm();Ext.Updater.defaults.disableCaching=false;if(trip_type=="oneway"){flights.setActiveTab("oneway");air_ow_form.getForm().load({url:"/dyna/searchrq"})}else{if(trip_type=="multicity"){flights.setActiveTab("multicity");air_mc_form.getForm().load({url:"/dyna/searchrq"})}}trip_type="roundtrip";reArrangeComparisionBoxes()}})}if(document.getElementById("homepageImage")){document.getElementById("homepageImage").style.display="";document.getElementById("errorMsgDiv").style.display=""}Ext.override(Ext.menu.Menu,{autoWidth:function(){var el=this.el,ul=this.ul;if(!el){return}var w="400px";if(w){el.setWidth(w)}else{if(Ext.isIE&&!Ext.isIE8){el.setWidth(this.minWidth);var t=el.dom.offsetWidth;el.setWidth(ul.getWidth()+el.getFrameWidth("lr"))}}}})});