(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=new Singleton(A,{name:"car",otherCategory:"car-trainstation",cookieName:"carForm",noDropoff:false,defaultDriverAge:25,initialize:function(){if(!this._base_initialize()){return }if(BOM.detect("safari|mac")){forEach($$(".timeselect"),function(M){M.style.background="none"})}if(Style.hasClass("searchform-"+this.name,"nodropoff")){this.noDropoff=true}var J,K=this._form;if(Query.up(K,"table.popup")){Style.set(J=Element("div"),{width:"100%",position:"absolute",left:0});K.appendChild(J)}this.pickupDefaultFocus=this.noDropoff?this.name+"-pickup-date":this.name+"-dropoff";this._pickup=new CompLoc({type:"car",field:this.name+"-pickup",hidden:this.name+"-pickupCode",nextFocus:this.name+"-sameagency",container:J});__Eo(this._pickup,"change",bind(this.onPickupChange,this));__Eo(this._pickup,"keydown",bind(this.onPickupDropoffMod,this));if($(this.name+"-pickup")){try{$(this.name+"-pickup").focus()}catch(L){}}this._dropoff=new CompLoc({type:"car",field:this.name+"-dropoff",hidden:this.name+"-dropoffCode",nextFocus:this.name+"-pickup-date",container:J});__Eo(this._dropoff,"change",bind(this.onDropoffChange,this));__Eo(this._dropoff,"keydown",bind(this.onPickupDropoffMod,this));this.displayFormatShort=({hu:"%Y. %M %d."})[getLang()]||"%d %M %Y";this.displayFormatLong=({hu:"%Y. %M %d. %S"})[getLang()]||"%S %d %M %Y";this._pickupDate=new DatePicker({direction:DatePicker.DIR_DEP,field:this.name+"-pickup-date",nextFocus:this.name+"-pickup-hour",displayFormat:this.displayFormatShort,preReturnDays:3,offsetLeft:0,oldNaming:true,container:J});this._dropoffDate=new DatePicker({direction:DatePicker.DIR_RET,field:this.name+"-dropoff-date",nextFocus:this.name+"-dropoff-hour",depPicker:this._pickupDate,displayFormat:this.displayFormatShort,preReturnDays:3,offsetLeft:-63,oldNaming:true,container:J});__Eo(this._pickupDate,"set",bind(this.todayDateSet,this,"pickup",1));__Eo(this._dropoffDate,"set",bind(this.todayDateSet,this,"dropoff",2));__Eo(this._dropoffDate,"set",bind(this.clearDateErrorMsg,this));__Eo(this._pickupDate,"set",bind(this.clearDateErrorMsg,this));__Eo(this.name+"-dropoff-hour","change",bind(this.clearDateErrorMsg,this));__Eo(this.name+"-dropoff-minute","change",bind(this.clearDateErrorMsg,this));var I=$(this.name+"-driver-age");if(!I.value){I.value=this.defaultDriverAge}Event.observe(I,"blur",Event.bind(this.onDriverAgeBlur,this));Event.observe(I,"focus",Event.bind(function(){I.select()},this));
__Eo(this.name+"-driver-age","change",bind(this.clearDriverAgeErrorMsg,this));this.onDriverAgeBlur();__Eo(this.name+"-sameagency","change",bind(this.onSameAgencyMod,this));if(IE){Event.observe($(this.name+"-sameagency").parentNode,"click",Event.bind(this.onSameAgencyMod,this))}Event.observe($(this.name+"-sameagency"),"blur",Event.bind(this.onSameAgencyBlur,this));this.onSameAgencyMod();this._pickupDate.retPicker=this._dropoffDate;this.moreLess();var H=$("car-subcategory-"+this.name);if(H&&!this.ajaxHP){H.checked=true;__Eo("car-subcategory-"+this.otherCategory,"click",bind(this.subCategoryClick,this));if(IE){__Eo("car-subcategorylink-"+this.otherCategory,"click",bind(this.subCategoryClick,this))}}this.loadForm();Event.observe(this._form,"submit",bind(function(){if(this.withMore){urchinTracker("/SearchForm/Car/Homepage/Action/SearchButtonClick/AdvanceForm")}else{urchinTracker("/SearchForm/Car/Homepage/Action/SearchButtonClick/RegularForm")}},this));return true},subCategoryClick:function(){this.saveForm();var H=$("car-subcategory-car-trainstation");if(!H.checked){H=$("car-subcategory-car")}var I=$$("label[for="+H.id+"] a",H.parentNode)[0];if((I)&&(I.href)){window.location.href=I}},saveForm:function(){window.Cookie&&Cookie.save(this.cookieName,this._serialize($("#searchform-"+this.name),[this.name+"-pickup",this.name+"-pickupCode",this.name+"-dropoff",this.name+"-dropoffCode","car-subcategory-car","car-subcategory-car-trainstation"]))},toMore:function(){this._pickupDate.displayFormat=this.displayFormatLong;this._dropoffDate.displayFormat=this.displayFormatLong;this._pickupDate.saveToFields();this._dropoffDate.saveToFields()},toLess:function(){this._pickupDate.displayFormat=this.displayFormatShort;this._dropoffDate.displayFormat=this.displayFormatShort;this._pickupDate.saveToFields();this._dropoffDate.saveToFields()},loadForm:function(){var J=window.Cookie&&Cookie.load(this.cookieName),H,I;if(J){J=JSON.decode(J);for(H in J){if(I=$(this.name+H)){I.value=J[H]}}if(J.withMore){this.moreLess(null,true)}Cookie.destroy(this.cookieName)}},onSameAgencyBlur:function(){if(!$(this.name+"-sameagency").checked){$(this.name+"-dropoff").focus()}},onDriverAgeBlur:function(){var H=$(this.name+"-driver-age"),I;I=H.value.replace(/[^\d]/g,"")*1;if((!I)||(I>150)){I=this.defaultDriverAge}H.value=I},onPickupChange:function(I){var H=$(this.name+"-dropoff"),J;J=H.disabled;H.disabled=false;if((!H.value)||(this.sameagency)){H.value=$(this.name+"-pickup").value}H.disabled=J;$(this.name+"-dropoffCode").value=$(this.name+"-pickupCode").value},onDropoffChange:function(){var H=$(this.name+"-pickup");if(!H.value){H.value=$(this.name+"-dropoff").value;$(this.name+"-pickupCode").value=$(this.name+"-dropoffCode").value}},onPickupDropoffMod:function(){this._setError(this.name+"-pickup","");this._setError(this.name+"-dropoff","")},clearDateErrorMsg:function(){this._setError(this.name+"-dropoff-date","")},clearDriverAgeErrorMsg:function(){this._setError(this.name+"-driver-age","")},todayDateSet:function(J,I){var K=new Date(),L=24*3600000,N=10,M,H;if(this["_"+J+"Date"].value*1==DateTools.getDayDate(new Date())*1){M=K.getHours()+I;if(M>23){this["_"+J+"Date"].set(K*1+L);M=M%23}H=Math.floor(K.getMinutes()/10)*10;this.buildOptions(J,M,23,M);$(this.name+"-"+J+"-hour").value=M;$(this.name+"-"+J+"-minute").value=(H<10?"0":"")+String(H)}else{if($(this.name+"-"+J+"-hour").options.length<24){this.buildOptions(J,0,23,N);$(this.name+"-"+J+"-minute").value="00"}if((J=="pickup")&&(this["_pickupDate"].value*1<this["_dropoffDate"].value*1)){this.buildOptions("dropoff",0,23,$(this.name+"-dropoff-hour").value)}}this._lastModifiedDP=J},buildOptions:function(L,O,P,H){var N=$(this.name+"-"+L+"-hour"),K="",I="",J;var M=function(Q,S,U,R){var T=new DOM.Element("option",{text:U,value:S});if(R){T.selected="selected"}Q.options.add(T)};for(J=N.options.length-1;J>=0;J--){N.remove(J)}for(J=O;J<=P;J++){M(N,J,(J<10?"0":"")+String(J),J==H)}},onSameAgencyMod:function(){var H=$(this.name+"-sameagency"),I=$(this.name+"-dropoff");if(H.checked){this.sameagency=true;this.onPickupChange();I.setAttribute("disabled",true);Style.addClass(I,"disabled");this.dropoffComploc=false}else{this.sameagency=false;I.removeAttribute("disabled");Style.removeClass(I,"disabled");this.dropoffComploc=true}},fill:function(I){if(!I){return }if(I&&I.pickupCode&&!I.dropoffCode){I.dropoffCode=I.pickupCode;I.dropoff=I.pickup}var H,J=bind(function(K){return liligo.$(K.replace(/^-/,this.name+"-"))},this);if(H=I.pickupDate){this._pickupDate.set(H)}if(H=I.dropoffDate){this._dropoffDate.set(H)}if(H=I.pickup){J("-pickup").value=H}if(H=I.pickupCode){J("-pickupCode").value=H}if(H=I.dropoff){J("-dropoff").value=H}if(H=I.dropoffCode){J("-dropoffCode").value=H}if(H=I.pickupHour){J("-pickup-hour").value=H}if(H=I.dropoffHour){J("-dropoff-hour").value=H}if(H=I.pickupMinute){J("-pickup-minute").value=H}if(H=I.dropoffMinute){J("-dropoff-minute").value=H}if(H=I.driverAge){J("-driver-age").value=H}if(H=I.category){J("-category").value=H}if(H=I.transmission){J("-transmission").value=H}if(H=I.aircond){J("-aircond").value=H}if(I&&I.pickupCode==I.dropoffCode){J("car-sameagency").checked=true}else{J("car-sameagency").checked=false}this.onSameAgencyMod();if(I.submit){this._onSubmit()}},_serialize:function(L,J){var K=L,I=[],H={},M;I=I.concat($$("input",K));I=I.concat($$("select",K));forEach(I,function(N){if((N.id)&&(N.value)&&(!ArrayGen.contains(J,N.id))){M=N.id.replace(this.name,"");H[M]=N.value}},this);H.withMore=this.withMore;return JSON.encode(H)},_validate:function(){var J="homepage_top_form_car_alert_";this._setError(this.name+"-dropoff-date","");this._setError(this.name+"-pickup","");if(!$(this.name+"-pickup").value){this._setError(this.name+"-pickup",J+"pickup");return false}if(!$(this.name+"-pickupCode").value){this._setError(this.name+"-pickup",J+"pickup_invalid");return false}if(!$(this.name+"-dropoff").value){this._setError(this.name+"-dropoff",J+"dropoff");return false}if(!$(this.name+"-dropoffCode").value){this._setError(this.name+"-dropoff",J+"dropoff_invalid");
return false}if($(this.name+"-driver-age").value*1<18){this._setError(this.name+"-driver-age",J+"age");return false}if(this._pickupDate.value*1==this._dropoffDate.value*1){var I=$(this.name+"-pickup-hour").value*1+$(this.name+"-pickup-minute").value*60,H=$(this.name+"-dropoff-hour").value*1+$(this.name+"-dropoff-minute").value*60;if(I>=H){this._setError(this.name+"-dropoff-date",J+"date");return false}}return true},_doSubmit:function(){this._base__doSubmit()}});liligo.SEOSearchForm=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:"seo-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($("seo-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("/seo/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="/seo/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($("seopage-"+H)){Event.observe($$("a",$("seotab-"+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:$("seopage-lang"),skin:"default-whitebg",close:true,title:labels.seotab_language});popup.create();popup.show()}else{$("seo-content").className=H}})}});forEach(["package","route","hotel","car"],function(H){if($("crosslink-"+H)){new CrosslinkPager(H)}});if($("seo-lang")){__Eo("seo-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}
