(function(){eval(liligo.namespace);var G=new Class({constructor:function(H){this.form=$(H)},submit:function(){G._fireEvent("submit",this.form);this.form.submit()}},{init:function(){Observable.makeIt(this)},hookSubmit:function(I){var H=I.submit;I._=I.submit;I.submit=function(){G._fireEvent("submit",this);this.submit=H;this.submit();this.submit=arguments.callee}}});var B=liligo.SearchForm=new Abstract(Observable,{name:null,ajaxHP:false,allowMultipleSubmits:false,errorMessageBgImage:"/v3/homepage/img/error-msg-bg.png",submitBtnLoadingImage:"/v3/searchforms/common/img/"+liligo.getLang()+"/submit-loading.png",init:function(){B.last=this},initialize:function(){if(window.config&&window.config.ajaxHP){this.ajaxHP=true}var H=this;if(!H._form){H._form=$("searchform-"+H.name)}if(H._form){__Eo(H._form,"submit",__EbS(H._onSubmit,H));if(typeof G!="undefined"){G.hookSubmit(H._form)}}else{return false}if(!H._submitButton){H._submitButton=$(H.name+"-submit");H._submitButton.disabled=this._submitted}H.initialized=true;this.preload();return true},preload:function(){preload([this.errorMessageBgImage,this.submitBtnLoadingImage])},_validate:function(){return true},fill:nullFunc,preset:function(){var H=(config&&config[this.name]&&extend(config[this.name].preset,(this.getValuesInCookie2JSON?this.getValuesInCookie2JSON():{})))||(this.getValuesInCookie2JSON&&this.getValuesInCookie2JSON());if(H&&this.fill!=nullFunc){this.fill(H)}},_submitted:false,_onSubmit:function(H){if(this._submitted&&!this.allowMultipleSubmits){return }if(this._validate()){this._submitted=true;this._doSubmit()}},_doSubmit:function(){this._fireEvent("doSubmit");if(this._submitButton){if(!this.allowMultipleSubmits){this._submitButton.src=this.submitBtnLoadingImage;this._submitButton.setAttribute("disabled","disabled")}}this._form.submit();return true},_setError:function(K,I,L){if(!L&&(typeof K=="object")&&(K.constructor==[].constructor)){var H=false;forEach(K,function(M){if(this._setError(M,I,true)){H=true}},this);return H}Style.setClassIf(I,K,"error");Style.setClassIf(I,this._form,"error");if(I){$(this._form.id+"-error").innerHTML=labels[I];try{$(K).focus()}catch(J){}}return !!I},addHidden:function(H,J){var I=Element("input",{type:"hidden",name:H,value:J});this._form.appendChild(I);return I}});var D=new Class(Observable,{constructor:function(){this._list=[]},add:function(H){this._list.push(H)},open:function(){var N=this._list,O=N.length,L,M,P,Q,H=screen.availWidth||800,J=screen.availHeight||600,I=Math.min(800,Math.floor(H/O-10));try{for(L=0;L<O;L++){Q=N[L];M=open("","","height="+J+",width="+I+",left="+Math.floor((I+10)*L)+",top=0,menubar=1,location=1,resizable=1,scrollbars=1,toolbar=1,status=1");M.blur();P=M.document;P.write("<body></body>");P.close();P.body.appendChild(form=Element("form",{method:"post",action:Q.url},P));if(Q.parameters){forEach(Q.parameters,function(S,R){form.appendChild(Element("input",{type:"hidden",name:R,value:S},P))})}form.submit()}}catch(K){return false}finally{focus()}return true}});var A=new Abstract(B,{name:null,withMore:false,initialize:function(){if(!this._base_initialize()){return false}if($(this.name+"-more-")){__Eo(this.name+"-more-","click",__EbS(this.moreLess,this,true))}if($(this.name+"-more")){__Eo(this.name+"-more","click",__EbS(this.moreLess,this,true))}__Eo(this.name+"-less","click",__EbS(this.moreLess,this,false));return true},toMore:nullFunc,toLess:nullFunc,moreLess:function(I,H){this.withMore=typeof H!="undefined"?H:this.withMore;Style.setClassIf(this.withMore,this._form,"more");H?this.toMore():this.toLess()}});var E=Class({constructor:function(I,J,H){this._block=I;this._popUnders=J;this._fromInputElem=$("air-from");this._fromHiddenInputElem=$("air-fromCode");this._toInputElem=$("air-to");this._toHiddenInputElem=$("air-toCode");this._isFetching=false;this._cache={};this._form=H;this._prevContent="";this._checkBoxState={};this._isFlightResultsPage=false;this._isLaunchCompareSite=true;if(liligo.air&&liligo.air.header){this._isFlightResultsPage=true}this._setCheckboxes();if(config.air&&config.air.preset.toCode||this._isFlightResultsPage){this._defaultHTML="";this._isDefault=false;this._prevContent=this._fromInputElem.value+"_"+this._toInputElem.value}else{this._defaultHTML=this._block.innerHTML;this._isDefault=true}Event.observe(H._fromLoc,"keydown",bind(function(K){if(K.keyCode==Event.KEY_TAB||K.keyCode==Event.KEY_RETURN){return }this._reset()},this));Event.observe(H._toLoc,"keydown",bind(function(K){if(K.keyCode==Event.KEY_TAB||K.keyCode==Event.KEY_RETURN){return }this._reset()},this));__Eo(H._fromLoc,"change",bind(this._change,this));__Eo(H._fromLoc,"unchange",bind(this._change,this));__Eo(H._toLoc,"change",bind(this._change,this));__Eo(H._toLoc,"unchange",bind(this._change,this))},_setCheckboxes:function(){forEach($$("input",this._block),function(H){if(this._isFlightResultsPage){H.checked=false}else{H.checked=Style.hasClass(H,"checked")}},this)},_storeCheckboxState:function(){forEach($$("input",this._block),function(H){this._checkBoxState[H.id]=H.checked},this)},_restoreCheckboxState:function(){forEach($$("input",this._block),function(H){H.checked=this._checkBoxState[H.id]!=undefined?this._checkBoxState[H.id]:H.checked},this)},_reset:function(){if(this._isDefault){this._isFetching=false;return }if(this._isFetching){return }this._isFetching=true;this._storeCheckboxState();this._prevContent="";this._resetDo()},_resetDo:function(){var H=this;if(H._defaultHTML){H._isFetching=false;H._resetFinish(H._defaultHTML);return }new AjaxRequest("/v3/searchforms/air/data/compareSite.jsp",{method:"post",onSuccess:function(J,I){H._defaultHTML=I;H._isFetching=false;H._resetFinish(I)}})},_resetFinish:function(H){this._block.innerHTML=H;this._setCheckboxes();this._restoreCheckboxState();this._isDefault=true},_getContent:function(K,H){var J,I=this._prevContent&&this._prevContent.split("_");if(K.id=="air-from"){J=H.label+"_"+(I[1]||"")}else{J=(I[0]||"")+"_"+H.label}return J},_getCacheKey:function(I,H){var J;if(I.id=="air-from"){J=H.value.split(",")[1]+"_"+(this._toHiddenInputElem.value.split(",")[1]||"")
}else{J=(this._fromHiddenInputElem.value.split(",")[1]||"")+"_"+H.value.split(",")[1]}return J},_change:function(J,H){var I=this._getContent(J,H);if(this._prevContent==I){return }this._isDefault=false;this._prevContent=I;this._storeCheckboxState();this._changeDo(J,H)},_changeDo:function(K,H){var J=this,L=this._getCacheKey(K,H),I=L.split("_");if(J._cache[L]){J._isFetching=false;J._changeFinish(J._cache[L]);return }new AjaxRequest("/v3/searchforms/air/data/compareSite.jsp",{method:"post",parameters:{fromCityId:I[0],toCityId:I[1]},onSuccess:function(N,M){J._prevContent=H.label;J._cache[L]=M;J._isFetching=false;J._changeFinish(M)}})},_changeFinish:function(H){this._isDefault=false;this._block.innerHTML=H;this._setCheckboxes();this._restoreCheckboxState()},setDefaultStateToFalse:function(){this._defaultHTML="";this._isDefault=false},updateCompareSite:function(H,I){this._change(null,H);this._change(null,I)},launchCompareSites:function(){var H={},I=[];forEach(this._form._form.elements,function(J){H[J.name]=J.value});forEach($$("input",this._block),function(J){if(J.checked&&J.value&&this._isLaunchCompareSite){I.push(J.id.replace(/air-cs-/,""));this._popUnders.add({url:"/air_v3/compareSite/launch.jsp",parameters:extend({compareSiteId:J.value},H)})}else{Style.removeClass(J,"checked");J.checked=false}},this);return I},setLaunchCompareSite:function(H){this._isLaunchCompareSite=H},getLaunchCompareSite:function(){return this._isLaunchCompareSite}});new Singleton(A,{name:"air",initialize:function(){if(!this._base_initialize()){return }if(typeof (D)!="undefined"){this._popUnders=new D()}else{this._popUnders={open:nullFunc,add:nullFunc}}$("air-from-nearby").checked=true;$("air-direct").checked=$("air-hotel").checked=false;$("air-from").value=$("air-to").value="";var H=$("air-content");this._splitCompareSite=H.className.match(/splitCompareSite\-(\d)/)[1]*1;this._compareSiteSplitted=Style.hasClass("air-content","compareSiteSplitted");if($("searchform-air")){$("searchform-air").action=((window.config&&window.config.flightUrl)?window.config.flightUrl:"")+"/air/SearchFlights.jsp"}var I,J=this._form;if(Query.up(J,"table.popup")){Style.set(I=Element("div"),{width:"100%",position:"absolute",left:0});J.appendChild(I)}this._fromLoc=new CompLoc({type:"air",field:"air-from",nextFocus:"air-to",prevFocus:"air-submit",container:I});__Eo(this._fromLoc,"keydown",bind(this._setError,this,"air-from",null));this._toLoc=new CompLoc({type:"air",field:"air-to",prevFocus:"air-from",nextFocus:"air-out-date",container:I});__Eo(this._toLoc,"keydown",bind(this._setError,this,"air-to",null));__Eo("air-to","focus",bind(this.preload,this,true));this._outDate=new DatePicker({direction:DatePicker.DIR_DEP,field:"air-out-date",oldNaming:true,oneWayRadio:"air-subcategory-oneway",container:I});this._retDate=new DatePicker({direction:DatePicker.DIR_RET,field:"air-ret-date",depPicker:this._outDate,oldNaming:true,oneWayRadio:"air-subcategory-oneway",container:I});__Eo(this._retDate,"set",bind(this.toRoundtrip,this));this._outDate.retPicker=this._retDate;this.initializeNearby();this.moreLess();$("air-flexible").checked=false;__Eo("air-subcategory-oneway","click",__EbS(this.toOneway,this));__Eo("air-subcategory-roundtrip","click",__EbS(this.toRoundtrip,this));if(!BOM.detect("firefox")){__Eo("air-subcategory-oneway-link","click",__EbS(this.toOneway,this));__Eo("air-subcategory-roundtrip-link","click",__EbS(this.toRoundtrip,this))}this._roundTripInput=this.addHidden("roundTrip");if(!this.ajaxHP){forEach(document.getElementsByName("air-subcategory"),function(K){if(K.id.indexOf("oneway")==-1&&K.id.indexOf("roundtrip")==-1){__Eo(K,"click",__Eb(this.subCategoryClick,this,K.id+"-link"))}},this);forEach($$("label > a"),function(K){if(K.id.indexOf("oneway")==-1&&K.id.indexOf("roundtrip")==-1){__Eo(K,"click",__EbS(this.subCategoryClick,this,K.id))}},this)}this._splitSiteunderActive=(document.cookie.match(/split16_hpsiteunder_carhotel=B/));if(this._splitSiteunderActive){liligo.forEach(liligo.$$("#air-compare input[type=checkbox]"),function(K){Style.removeClass(K,"checked")})}if($("air-subcategory-oneway")&&$("air-subcategory-oneway").checked){this.toOneway()}if(this._splitCompareSite){this.compareSite=new E($("air-compare"),this._popUnders,this)}return true},updateCompareSite:function(I,H){this.compareSite&&this.compareSite.updateCompareSite(I,H)},preload:function(H){if(H){this._base_preload()}},subCategoryClick:function(J,I){this.setValues2Cookie(I);var H="air";if(I.split("-")[2]=="multi"){H+="-multi"}window.location.href="/v3/searchforms/"+H},_doSubmit:function(){var K=!Style.hasClass(this._form,"oneway");this._roundTripInput.value=K?"roundTrip":"oneWay";if(!Style.hasClass(this._form,"more")){var L=$("air-flexible").checked;$("air-out-flexibility").value=$("air-ret-flexibility").value=L?3:0}if($("air-hotel").checked){this._launchHotel()}var M=this._splitCompareSite,J;if(M){J=this.compareSite.launchCompareSites();if(J.length){this.addHidden("focusResults","1")}}this._popUnders.open();if(this._compareSiteSplitted){this.addHidden("splitCompareSite",M);var I="/Comparesite/Flight",H=I+"/SearchLaunched";urchinTracker(H);if(M){urchinTracker(H+"/"+J.length);forEach(J,function(N){urchinTracker(I+"/CompareLaunched/"+N)})}}this._base__doSubmit()},_launchHotel:function(){var H={};forEach(this._form.elements,function(I){H[I.name]=I.value});this._popUnders.add({url:((window.config&&window.config.hotelUrl)?window.config.hotelUrl:"")+"/hotel/searchHotelsByFlight.jsp",parameters:H})},initializeNearby:function(){var I=function(){if(!$("air-to-nearby")||!$("air-from-nearby")){return }$("air-to-nearby").checked=$("air-from-nearby").checked;if(IE){setTimeout(bind(arguments.callee,0,true),10)}};var H=function(){if(!$("air-to-nearby")||!$("air-from-nearby")){return }$("air-from-nearby").checked=$("air-to-nearby").checked;if(IE){setTimeout(bind(arguments.callee,0,true),10)}};Event.observe("air-from-nearby",{keyup:I,change:I,mouseup:I});Event.observe("for-air-from-nearby",{keyup:I,mouseup:I});
Event.observe("air-to-nearby",{keyup:H,change:H,mouseup:H});Event.observe("for-air-to-nearby",{keyup:H,mouseup:H})},fill:function(I){if(!I){return }var J;if(J=I.toSubCategory){$(I.toSubCategory).checked=true;setTimeout(bind(function(){if(I.toSubCategory=="air-subcategory-oneway"){this.toOneway()}else{if(I.toSubCategory=="air-subcategory-roundtrip"){this.toRoundtrip()}}},this),0)}if(J=I.from){$("air-from").value=J}if(J=I.fromCode){$("air-fromCode").value=J}if(J=I.to){$("air-to").value=J}if(J=I.toCode){$("air-toCode").value=J}if(J=I._class){$("air-class").value=J}if((J=I.adults)!==undefined){$("air-adults").value=J}if((J=I.children)!==undefined){$("air-children").value=J}if((J=I.infants)!==undefined){$("air-infants").value=J}if((J=I.roundtrip)!==undefined){this.setRoundtrip(J)}if((J=I.direct)!==undefined){$("air-direct").checked=J}if(J=I.dtime){$("air-out-time").value=J}if(J=I.rtime){$("air-ret-time").value=J}if(J=I.fromDateParts||I.fromDate){this._outDate.set(J)}if(J=I.toDateParts||I.toDate){this._retDate.set(J)}if((J=I.nearby)!==undefined){$("air-from-nearby").checked=$("air-to-nearby").checked=J}var H=false;if((J=I.depDayInterval)!==undefined){$("air-out-flexibility").value=J;H=true}if((J=I.retDayInterval)!==undefined){$("air-ret-flexibility").value=J;H=true}if(H){this.copyFlex(true)}if((this.compareSite&&(J=I.fillCompareSite)!==undefined)){this.compareSite.setLaunchCompareSite(J)}if(I.submit){this._onSubmit()}},getValuesInJSON:function(H){var I=this.name,J={from:[$(I+"-from").value],fromCode:[$(I+"-fromCode").value],to:[$(I+"-to").value],toCode:[$(I+"-toCode").value],fromDate:[this._outDate.value.getTime()],toDate:[this._retDate.value.getTime()],dtime:[$(I+"-out-time").value],fromNearby:[$(I+"-from-nearby").checked],toNearby:[$(I+"-to-nearby").checked],_class:$(I+"-class").value,adults:$(I+"-adults").value,children:$(I+"-children").value,infants:$(I+"-infants").value,direct:$(I+"-direct").checked};if(H){extend(J,{toSubCategory:H.split("-link")[0]})}return J},getValuesInJSON2String:function(H){return JSON.escape(JSON.encode(this.getValuesInJSON(H))).replace(/,/g,"%%")},getValuesInCookie2JSON:function(){if(!(window.Cookie&&Cookie.load&&Cookie.destroy)){return }var H=Cookie.load("getSearchJSON");if(H){H=H.replace(/%%/g,",")}Cookie.destroy("getSearchJSON");return JSON.decode(JSON.decode(H))||false},setValues2Cookie:function(H){if(!(window.Cookie&&Cookie.save)){return }Cookie.save("getSearchJSON",this.getValuesInJSON2String(H))},toOneway:function(){this.setRoundtrip(false)},toRoundtrip:function(){this.setRoundtrip(true)},toOnewayRountrip:function(J){var I=Event.element(J),H;if(!I.id){return false}H=I.id.match(/.*-oneway$/);this.setRoundtrip(!H);$("air-roundtrip-"+(H?"oneway":"roundtrip")).checked="checked";if(I.tagName=="input"){Event.stop(J)}},setRoundtrip:function(I){this.roundtrip=I;Style.setClassIf(!I,this._form,"oneway");if(I){this._retDate.set(this._retDate.value);if(this.withMore===false){this._outDate.nextFocus=$("air-ret-date")}else{this._outDate.nextFocus=$("air-out-time")}}else{var H=labels.homepage_top_form_air_roundtrip_oneway;$("air-ret-date").value=H;if(this.withMore===false){this._outDate.nextFocus=$("air-adults")}else{this._outDate.nextFocus=$("air-out-time")}}setTimeout(function(){var J=$("air-subcategory-"+(I?"roundtrip":"oneway"));if(J){J.checked="checked"}},10)},toMore:function(){this._fromLoc.nextFocus=$("air-from-nearby");this._toLoc.nextFocus=$("air-to-nearby");this._outDate.nextFocus=$("air-out-time");this._retDate.nextFocus=$("air-ret-time");this.copyFlex(false);try{$("air-from").focus()}catch(H){}},toLess:function(){this._fromLoc.nextFocus=$("air-to");this._toLoc.nextFocus=$("air-out-date");if(this.roundtrip===false){this._outDate.nextFocus=$("air-adults")}else{this._outDate.nextFocus=$("air-ret-date")}this._retDate.nextFocus=$("air-adults");this.copyFlex(true);try{$("air-from").focus()}catch(H){}},copyFlex:function(H){if(H){$("air-flexible").checked=1*$("air-out-flexibility").value+1*$("air-ret-flexibility").value}else{$("air-out-flexibility").value=$("air-ret-flexibility").value=3*$("air-flexible").checked}},_validate:function(){if(!$("air-from").value||!$("air-fromCode").value){return !this._setError("air-from","homepage_top_form_air_alert_departure")}this._setError("air-from","");if(!$("air-to").value||!$("air-toCode").value){return !this._setError("air-to","homepage_top_form_air_alert_destination")}this._setError("air-to","");try{if((this._fromLoc.hidden.value.split(",")[1]==this._toLoc.hidden.value.split(",")[1])){return !this._setError("air-from","homepage_top_form_air_same_city")}}catch(H){}return true}});liligo.SCSearchForm=B.last;if(!liligo._v3_popup_overlays_shown){liligo._v3_popup_overlays_shown=0}var C=new Class(Observable,{y:100,skin:"default",close:true,className:"",overlay:true,fixOverlay:false,opacity:0.8,bgColor:"#b4cf01",canvasWidth:"100%",constructor:function(H){extend(this,H||{});this.id=unique();this.templateData=extend({id:this.id,skin:this.skin,close:this.close},this.templateData||{})},show:function(H){this.create();if(!H){this._fireEvent("hide")}H=H!==false;this._showOverlay(H);if(H&&IE6){this._reposition()}Style.showIf(H,this._container);if(IE6){if(this.wheelObserver){this._wheelObserver.stop();this._resizeObserver.stop();this._scrollObserver.stop()}if(H){this._wheelObserver=new Event.Observer(document,"resize",bind(this._reposition,this));this._resizeObserver=new Event.Observer(window,"resize",bind(this._reposition,this));this._scrollObserver=new Event.Observer(window,"scroll",bind(this._reposition,this))}forEach($$("select"),function(I){I.style.visibility=!H?"visible":"hidden"});forEach($$("select",this._container),function(I){I.style.visibility="visible"})}if(H){this._fireEvent("show")}},hide:function(){this.show(false)},create:function(){if(this._container){return }var I=Element("div",{className:"skin-"+this.skin+" "+this.className,innerHTML:this.template.process(this.templateData)});Style.set(I,{display:"none",position:"fixed",top:this.y+"px",left:0,width:this.canvasWidth,zIndex:45});
DOM.add(I);__Eo(I,"click",__Eb(this._containerClick,this));var J=this.content,H=$("popup-"+this.id+"-content"),K=$("popup-"+this.id+"-close");if(typeof J=="string"){H.innerHTML=J}else{H.appendChild(J);Style.show(J)}if(K){__Eo(K,"click",__EbS(this.hide,this))}if(this.title){var L=$("popup-"+this.id+"-title");if(L){L.innerHTML=this.title}}this._container=I},_containerClick:function(I){var H=Event.element(I);if(H==this._container){this.hide()}},_reposition:function(){if(this._overlay){this._updateOverlay()}var H=this._container;H.style.position="absolute";H.style.top=document.documentElement.scrollTop+this.y+"px"},_showOverlay:function(H){if(!this.overlay){return }H=H!==false;if(!this._overlay){var I=DOM.add("div");Style.set(I,{position:"fixed",display:"none",opacity:this.opacity,top:0,left:0,width:"100%",height:"100%",zIndex:40,backgroundColor:this.bgColor});this._overlay=I;if(IE6){this._updateOverlay()}if(!this.fixOverlay){__Eo(this._overlay,"click",bind(this.hide,this))}}Style.showIf(H,this._overlay);var J="addClass";if(H){liligo._v3_popup_overlays_shown++}else{if(--liligo._v3_popup_overlays_shown<=0){J="removeClass";liligo._v3_popup_overlays_shown=0}}Style[J](document.body,"v3-popup-with-overlay");if(IE6){if(this._ieInterval){clearInterval(this._ieInterval);this._resizeObserver.stop();this._scrollObserver.stop()}if(H){this._ieInterval=setInterval(bind(this._updateOverlay,this),300);this._resizeObserver=new Event.Observer(window,"resize",bind(this._updateOverlay,this));this._scrollObserver=new Event.Observer(window,"scroll",bind(this._updateOverlay,this))}}},_updateOverlay:function(){var H=document.body,I=document.documentElement.clientHeight||H.clientHeight;H.style.height="auto";Style.set(this._overlay,{position:"absolute",width:H.scrollWidth+"px",height:Math.max(H.scrollHeight,I)+"px"})}});this.Popup=C;HotelWidget=new Class(Observable,{targetId:"hotelwidget",container:"sc-result",containerOffsetX:445,visible:null,constructor:function(H){extend(this,H);this.target=$(this.targetId);Event.observe(window,"resize",bind(function(){this.hide()},this));Event.observe(this.target,"click",bindAsEventListener(this.onWidgetClick,this));Mediator.addEventListener("Filters",function(J,I){if(I=="before_startFiltering"){this.hide()}},this);Mediator.addEventListener("Layout.ResultDisplay",function(J,I){if(I=="before_setPage"){this.hide()}},this);if(BOM.detect("ie6")){this.safelayer=new H.safelayer("safelayer",this.targetId)}},onWidgetClick:function(I){var H=Event.element(I);if(H.id=="swclosebtn"){this.hide();Event.stop(I);return }if(H.name=="hotel-submit"){this._fireEvent("doSubmit");this.hide()}},show:function(K,J){var N=Geometry.position($("sc-result")),I=Geometry.position(J.parentNode),M=this.getSearchJSON(K);if(this.hotelform){this.hotelform.moreLess(null,false)}this.hotelform.fill(M);this.hotelform.resetSubmit();var H=N[0]+this.containerOffsetX,L=N[1]+(I[1]-N[1]-80);this.target.style.left=H+"px";this.target.style.top=L+"px";if(BOM.detect("ie6")){this.safelayer.move(H,L);this.safelayer.show()}Style.show(this.target);this.visible=K},hide:function(){if(this.hotelform){this.hotelform.moreLess(null,false)}Style.hide(this.target);if(BOM.detect("ie6")){this.safelayer.hide()}this.visible=null},getSearchJSON:function(H){var I=window.results[H];return{to:(I.to)?I.to:window.config.hotel.preset.to,toCode:(I.toCode)?I.toCode:window.config.hotel.preset.toCode,name:I.acc_name,stars:I.acc_stars}}});HotelForm=new Class(A,{name:"UID-hotel",maxNights:60,initialize:function(){if(!this._base_initialize()){return }this._city=new CompLoc({type:"hotel",field:"UID-hotel-city",hidden:"UID-hotel-cityCode",nextFocus:"UID-hotel-from-date"});__Eo(this._city,"keydown",bind(this._setError,this,"hotel-city",""));$("UID-hotel-city").value="";this._fromDate=new DatePicker({direction:DatePicker.DIR_DEP,field:"UID-hotel-from-date",nextFocus:"UID-hotel-to-date",offsetLeft:5,preReturnDays:1,oldNaming:true});__Eo(this._fromDate,"set",bind(this.updateNights,this));this._toDate=new DatePicker({direction:DatePicker.DIR_RET,field:"UID-hotel-to-date",nextFocus:"UID-hotel-rooms",depPicker:this._fromDate,offsetLeft:4,preReturnDays:1,minDays:1,oldNaming:true});__Eo(this._toDate,"set",bind(this.updateNights,this));this._fromDate.retPicker=this._toDate;this.updateNights();this._initRooms();for(var H=1;H<=5;H++){$("UID-hotel-category-"+H).checked=true}this.moreLess();return true},constructor:function(){this.initialize()},resetSubmit:function(){this._submitted=false;this._submitButton.disabled=false},fill:function(H){if(!H){return }var I;if(I=H.name){$("UID-hotel-name").value=I}if(I=H.to){$("UID-hotel-city").value=I}if(I=H.toCode){$("UID-hotel-cityCode").value=I}if(I=H.arrDate){this._fromDate.set(I)}if(I=H.depDate){this._toDate.set(I)}this.updateNights();if((H.minPrice!==undefined)&&(H.maxPrice!==undefined)){$("UID-hotel-max-price").value=H.minPrice+"-"+H.maxPrice}if(I=H.rooms){$("UID-hotel-rooms").value=I.length;this._onRoomsChange();forEach(I,function(K,J){J++;$("UID-hotel-adults-"+J).value=K.adults;$("UID-hotel-children-"+J).value=K.children})}if(H.submit){this._onSubmit()}},updateNights:function(){var I=Math.ceil((this._toDate.value-this._fromDate.value)/86400000);this.nights=I;$("UID-hotel-nights").innerHTML=I;var H=$("UID-hotel-nights").parentNode;Style.setClassIf(I>1,H,"plural");Style.setClassIf(I<2,H,"singular");if(I>this.maxNights){this._setError("UID-hotel-to-date-picker","homepage_top_form_hotel_alert_nights");return false}else{this._setError("UID-hotel-to-date-picker");return true}},toLess:function(){var J=$("UID-hotel-rooms").value;for(var H=1;H<=J;H++){$("UID-hotel-adults-"+H).value=2;$("UID-hotel-children-"+H).value=0}try{$("UID-hotel-city").focus()}catch(I){}},toMore:function(){try{$("UID-hotel-city").focus()}catch(H){}},_initRooms:function(){var H=3,J=new VTemplate("/sc/v3/common/templates/hotel-room.vm",function(N){var O=new liligo.__VT_StringCat(),L="function",M=0;if(N.velocityCount){M=N.velocityCount}O.push('	<label for="UID-hotel-adults-');
O.push(N.roomNumber);O.push('" class="number">');O.push(N.roomNumber);O.push('.</label>	<select id="UID-hotel-adults-');O.push(N.roomNumber);O.push('" name="room');O.push(N.roomNumber);O.push('adults" class="adults">		<option value="0">0</option><option value="1">1</option><option value="2" selected="selected">2</option>		<option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option>	</select>	<select id="UID-hotel-children-');O.push(N.roomNumber);O.push('" name="room');O.push(N.roomNumber);O.push('children" class="children">		<option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option>		<option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option>	</select>');return O.toString()});rooms=this._rooms={};for(var I=1;I<=H;I++){var K=rooms[I]=$("UID-hotel-room-"+I);Style.hide(K);K.innerHTML=J.process({roomNumber:I});__Eo(K,"mousedown",__Eb(this._onRoomAction,this,I));__Eo(K,"change",__Eb(this._onRoomAction,this,I))}Style.show(rooms[1]);this._onRoomsChange();__Eo("UID-hotel-rooms","change",bind(this._onRoomsChange,this))},_onRoomAction:function(J,H){var I=Event.element(J);if(I.nodeName!="SELECT"){return }this._setError(["UID-hotel-adults-"+H,"UID-hotel-children-"+H])},_onRoomsChange:function(){var H=$("UID-hotel-rooms").value,I=this._rooms;Style.setClassIf(H==1,"UID-hotel-persons","single");Style.showIf(H>1,I[2]);Style.showIf(H>2,I[3])},_validate:function(){var L="homepage_top_form_hotel_alert_alert_";if(!$("UID-hotel-city").value){this._setError("UID-hotel-city",L+"city");return false}this._setError("UID-hotel-city","");var M=1*$("UID-hotel-rooms").value;for(var K=1;K<=M;K++){var I=1*$("UID-hotel-adults-"+K).value,J=1*$("UID-hotel-children-"+K).value,H=["UID-hotel-adults-"+K,"UID-hotel-children-"+K];if(I+J>10){return !this._setError(H,L+"guests")}this._setError(H,"");if(!I&&J){return !this._setError(H,L+"adults")}this._setError(H,"");if(!I&&!J){return !this._setError(H,L+"rooms")}this._setError(H,"")}return this.updateNights()},_doSubmit:function(){var H=$("UID-hotel-max-price").value;if(H=="-1"){H=[-1,-1]}else{H=H.split(/-/)}this.addHiddens({roomdetails:"true",room1type:1,room2type:1,room3type:1,nights:this.nights,minPrice:H[0],maxPrice:H[1],javaDates:1});this._base__doSubmit();this._submitButton.src="/sc/v3/common/img/"+getLang()+"/searchwidget_submit.png"},addHiddens:function(H){forEach(H,function(J,I){this.addHidden(I,J)},this)}});window.hpPopup=Abstract({name:null,submit:null,opener:false,noForm:false,initialize:function(){if(this.initialized){return }this.initialized=true;if(this.opener){__Eo(this.opener,"click",__EbS(this.show,this))}if(!this.noForm){Event.observe("hp-"+this.name+"-form","submit",this.bindedSubmit=Event.bindStop(this.submit,this))}__Eo("hp-"+this.name+"-close","click",__EbS(this.close,this))},hashOpen:function(){var H=document.location.hash;if(H&&H.indexOf(this.name)!=-1){this.show()}},show:function(){if(!this.initialized){this.initialize()}if(!this.noFade){hpPopupTools.setPosition("hp-"+this.name);hpPopupTools.fadeScreen(true)}Style.show("hp-"+this.name)},close:function(){Style.hide("hp-"+this.name);if(!this.noFade){hpPopupTools.fadeScreen(false)}},setError:function(I,H,J){I=$(I);if(J){I=I.parentNode}if(H===null){Style.removeClass(I,"error");Style.removeClass(I,"valid")}else{Style.setClassIf(H,I,"error");Style.setClassIf(!H,I,"valid")}return H}});window.hpPopupTools=Singleton({tabChain:Class({constructor:function(){var L=this.observers=this.observers||[],I=arguments,K,J=Event;if(I.length==1&&typeof I[0]=="object"&&I[0].length){I=I[0]}this.list=I;for(var H=0;H<I.length-1;H++){K=function(N,M){if(N.keyCode==J.KEY_TAB){try{if(N.shiftKey){if(M){$(I[M-1]).focus()}}else{$(I[M+1]).focus()}}catch(O){}J.stop(N)}};K=J.bind(K,0,H);L.push(new J.Observer(I[H],"keydown",K))}},remove:function(){var I=this.observers,H;while(H=I.shift()){H.stop()}delete this.list}}),Shadow:Class({constructor:function(I,K){K=K||{};this.params={offsetX:4,offsetY:4,opacity:0.25,color:"#9d9d9d",zIndex:55,img:"/myliligo/popups/common/img/shadow-gray-alpha.png"};if((K.color=="#c9db58")&&!K.img){K.img="/myliligo/popups/common/img/shadow-green-alpha.png"}K=extend(this.params,K);var J=Geometry.dimension(this.elem=I=$(I)),L=Geometry.position(I),H=[];Style.hide(this.div=Element("div"));document.body.insertBefore(this.div,document.body.firstChild);Style.set(this.div,{opacity:K.opacity,zIndex:K.zIndex});(this.inner=Element("div")).style.position="relative";this.div.appendChild(this.inner);if(J[0]>20){H.push('<div style="height:20px;width:',J[0]-20,"px;position:absolute;background:",K.color,';right:20px;bottom:0"></div>')}if(J[1]>20){H.push('<div style="width:',J[0],"px;height:",J[1]-20,"px;position:absolute;background:",K.color,';bottom:20px;right:0"></div>')}H.push('<div style="width:',Math.min(J[0],20),"px;height:",Math.min(J[0],20),"px;position:absolute;bottom:0;right:0;");if(IE){H.push("filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='",K.img,"', sizingmethod='crop')")}else{H.push("background:url(",K.img,") 100% 100%;")}H.push('"></div>');this.inner.innerHTML=H.join("");Style.set(this.inner,{height:J[1]+"px",width:J[0]+"px"});Style.set(this.div,{position:"absolute",display:"block",left:L[0]+K.offsetX+"px",top:L[1]+K.offsetY+"px"})},remove:function(){this.div.removeChild(this.inner);document.body.removeChild(this.div);delete this.inner;delete this.div;this.remove=nullFunc}}),setPosition:function(K,L,I){K=$(K);if(self.pageYOffset){offset=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){offset=document.documentElement.scrollTop}else{if(document.body){offset=document.body.scrollTop}}}if(I){var H,J=0;if(self.innerHeight){J=self.innerHeight}else{if((H=document.documentElement)&&H.clientHeight){J=H.clientHeight}else{if(document.body){J=document.body.clientHeight}}}L=Math.round((J-Geometry.dimension(K)[1])/2)}else{if(L==undefined){L=100
}}K.style.top=offset+L+"px"},getViewportY:function(){var H;if(self.innerHeight){return[window.pageYOffset,window.pageYOffset+self.innerHeight]}else{if((H=document.documentElement)&&H.clientHeight){return[H.scrollTop,H.scrollTop+H.clientHeight]}else{if(document.body){return[document.body.scrollTop,document.body.scrollTop+document.body.clientHeight]}}}},fadeScreen:function(J,K){var M={opacity:0.8,zIndex:40,color:"#abc600",minHeight:0};extend(M,K||{});if(!this.fader){this.fader=Element("div");Style.set(this.fader,{position:"absolute",top:0,left:0,overflow:"hidden",display:"none"});document.body.insertBefore(this.fader,document.body.firstChild)}if(J){var L,H,I=0;if(self.innerHeight){I=self.innerHeight}else{if((H=document.documentElement)&&H.clientHeight){I=H.clientHeight}else{if(document.body){I=document.body.clientHeight}}}var N=document.body.style.height;document.body.style.height="auto";if(document.body&&(document.body.scrollWidth||document.body.scrollHeight)){L=[document.body.scrollWidth+"px",Math.max(document.body.scrollHeight,M.minHeight,I)+"px"]}else{if(document.body.offsetWidth){L=[document.body.offsetWidth+"px",Math.max(document.body.offsetHeight,M.minHeight,I)+"px"]}else{L=["100%","100%"]}}document.body.style.height=N;DatePicker&&DatePicker.actual&&DatePicker.actual.close();Style.set(this.fader,{opacity:M.opacity,zIndex:M.zIndex,backgroundColor:M.color,width:L[0],height:L[1]});if(IE){forEach($$("select"),function(O){O.style.visibility="hidden"})}Style.show(this.fader)}else{Style.hide(this.fader);if(IE){forEach($$("select"),function(O){O.style.visibility="visible"})}}}});CrosslinkPager=new Class({constructor:function(H){this.widget=H;this.current=1;this.box=$("crosslink-"+this.widget);this.prevPage=$("crosslink-"+this.widget+"-prev");this.nextPage=$("crosslink-"+this.widget+"-next");this.items=$$(".crosslink-items li",$("crosslink-"+this.widget));this.pagers=$$(".crosslink-pages a",$("crosslink-"+this.widget));Event.observe(this.prevPage,"click",Event.bindStop(function(){this.prevnext(-1)},this));Event.observe(this.nextPage,"click",Event.bindStop(function(){this.prevnext(+1)},this));forEach(this.pagers,function(I,J){Event.observe(I,"click",Event.bindStop(function(){this.setpage(J+1)},this))},this);Event.observe(this.box,"mouseover",bind(function(){clearInterval(this.timerId)},this));Event.observe(this.box,"mouseout",bind(function(I){this.mouseout(I)},this));this.starttimer()},setpage:function(H){Style.hide(this.items[this.current-1]);Style.removeClass(this.pagers[this.current-1],"active");Style.show(this.items[H-1]);Style.addClass(this.pagers[H-1],"active");this.current=H},prevnext:function(H){if((H>0)&&(this.current+H>this.items.length)){this.setpage(1)}else{if((H<0)&&(this.current+H<1)){this.setpage(this.items.length)}else{this.setpage(this.current+H)}}},starttimer:function(){this.timerId=setInterval(bind(function(){this.prevnext(1)},this),8000)},mouseout:function(J){var I=(window.event)?J.srcElement:J.target;if(I.className!="hp-widget-content"){return }var H=(J.relatedTarget)?J.relatedTarget:J.toElement;if(H){while(H!=I&&H.nodeName!="BODY"){H=H.parentNode}if(H==I){return }setTimeout(bind(function(){this.prevnext(1);this.starttimer()},this),1000)}}});liligo.jsOp=function(I,H){I=I.replace(/ /g,"/");if(!I.match(/.*\/$/)){I+=(!H?".jsp":"."+H)}window.open(I,"_self")};liligo.SEOApp=new Application({init:function(){},initialize:function(){if($("airwidget")){airWidget=new AirWidget({airform:new AirForm()})}else{if($("hotelwidget")){hotelWidget=new HotelWidget({hotelform:new HotelForm(),safelayer:new Class(SafeLayer,{constructor:function(I,H){H=this.element=$(H);H.style.zIndex=91;this.iframe=$(I);this.container=document.body}})})}}forEach(["guide","air","route","hotel","car","news","depnews","lang"],function(H){if($("scpage-"+H)){Event.observe($$("a",$("sctab-"+H))[0],"click",function(I){Event.stop(I);if(H=="lang"){popup=new C({y:220,template:new liligo.VTemplate("/v3/popups/templates/default.vm",function(L){var M=new liligo.__VT_StringCat(),J="function",K=0;if(L.velocityCount){K=L.velocityCount}M.push('	<table class="popup" cellspacing="0">		<tr>			<td class="popup-frame-tl">				<div id="popup-');M.push(L.id);M.push('-title" class="popup-title"></div>				');if(L.close){M.push('					<a id="popup-');M.push(L.id);M.push('-close" class="popup-close" href="');M.push("#close");M.push('">						');M.push(L.labels.common_popup_close);M.push("					</a>				")}M.push('			</td>			<td class="popup-frame-tr"></td>		</tr>		<tr>			<td class="popup-content" id="popup-');M.push(L.id);M.push('-content">			</td>			<td class="popup-frame-right"></td>		</tr>		<tr>			<td colspan="2">				<span class="popup-frame-bl"></span>				<span class="popup-frame-br"></span>			</td>		</tr>	</table>');return M.toString()}),content:$("scpage-lang"),skin:"default-whitebg",close:true,title:labels.seotab_language});popup.create();popup.show()}else{$("sc-content").className=H}})}});forEach(["package","route","hotel","car"],function(H){if($("crosslink-"+H)){new CrosslinkPager(H)}});if($("sc-lang")){__Eo("sc-lang","click",__Eb(this.langClick,this))}new F("footer-nofollow")},langClick:function(I){var H=Event.element(I);if((Style.hasClass(H,"langsel"))||(Style.hasClass(H.parentNode,"langsel"))){Event.stop(I);this.box=Query.selectNode("div.lang_wrapper",this._div);Style.showIf(this.box.style.display,this.box)}}});domLoaded(function(){liligo.SEOApp.initialize();liligo.addScript(config.ajaxHPsrc);var H=setInterval(function(){if(liligo.hp){clearInterval(H);liligo.hp.formHtmls[window.config.form]=$("searchbox").innerHTML;new liligo.hp.formEventTracker("searchbox")}},100)});var F=new Class({constructor:function(I){if(!(this.target=$(I))){return false}var H;forEach($$("a[class]",this.target),function(J){if((H=J.className.match(/url:([^ ]*)/))&&(H[1])){J.href=H[1];J.className=J.className.replace(/url:[^ ]*/,"")}})}})})();function buzzrelaunch(A,C,D){document.getElementById("searchid").value=A;if((C)&&(D)){document.getElementById("relform_outdate").value=C;
document.getElementById("relform_retdate").value=D}var B=document.getElementsByName("relaunch")[0];B.action=((window.config&&window.config.flightUrl)?window.config.flightUrl:"")+"/air/callbackSearch.jsp?buzz=true";B.submit()}function carSearch(A){document.getElementById("searchid").value=A;var B=document.getElementsByName("relaunch")[0];B.action=((window.config&&window.config.carUrl)?window.config.carUrl:"")+"/cars/sc.jsp";B.submit()}function redirectLink(json){var linkParams=eval(json);var queryParams=linkParams.query.split("&");var form=document.getElementById("redirectForm");form.innerHTML="";form.action=linkParams.server+linkParams.url;for(var i=0;i<queryParams.length;i++){var pair=queryParams[i].split("=");var input=document.createElement("input");input.type="hidden";input.name=pair[0];input.value=pair[1];form.appendChild(input)}form.submit();return false}
