
var myTools={initialize:function(){if($('submit-find')){this.submitFind();}
this.tips();this.popups();if($$('.onetimeTrigger')[0]){this.ontime();}
if($$('.datePickerFields')[0]){this.datepicker();}
if($('login-trigger')||$('search-trigger')){this.lsAccordion();}
if($$('.confirmItem')[0]){this.confirmation();}},popups:function(){var poptriggers=[];$A($$('a')).each(function(el){if(el.rel&&el.href&&el.rel.test('^popup','i')){poptriggers.push(el);}},this);if(poptriggers[0]){var myPops=new Popups(poptriggers);}},submitFind:function(){$('submit-find').onclick=function(){window.location.href='hotel/index.htm?country_id='+$('country').value+'&location_id='+$('location').value;return false;}},ontime:function(){var myOnetimes=$$('.onetimeTrigger');var remove=$$('.remove');var myBlocks=$$('.hideBlock');var myOnetime=new Onetime(myOnetimes,myBlocks,{opacity:true,remove:remove});},tips:function(){var tiptriggers=[];var ghatrigger=[];$A($$('input','a','img')).each(function(el){if(el.title&&el.title.test('::')){if(el.getProperty('alt')){el.removeProperty('alt')}
if(el.id!='ghaTipTr'){tiptriggers.push(el);}else if(el.id=='ghaTipTr'){ghatrigger.push(el);}}},this);if(tiptriggers[0]){var myTips=new Tips(tiptriggers);}
if(ghatrigger[0]){var myTips=new Tips($$('.ghaTipTr'),{width:250,offsets:{'x':-100,'y':-120}});}},datepicker:function(){var datepickers=$$('.datePickerFields');var myDatepicker=new TwinCalendar(datepickers[0],{inDDsel:$('checkInDay'),inMMsel:$('checkInMonth'),inYYYYsel:$('checkInYear'),outDDsel:$('checkOutDay'),outMMsel:$('checkOutMonth'),outYYYYsel:$('checkOutYear'),baseOffsetX:-140,baseOffsetY:20,IEHack:true});},confirmation:function(){$A($$('.confirmItem')).each(function(el){el.onchange=function(){if(el.value>1){var check=confirm(String.sprintf(translations.roomsText,el.value.toInt()));if(check==false){el.value="1";}}}.bind(this);},this);},lsAccordion:function(){var togglers=[];var stretchers=[];if($('login-trigger')){togglers.push($('login-trigger'));stretchers.push($('login-for-js'));}
if($('search-trigger')){togglers.push($('search-trigger'));stretchers.push($('search-for-js'));}
if(/MSIE (7.)/.test(navigator.userAgent)){stretchers.forEach(function(el){el.setStyle('position','absolute');});}
var myAccordion=new Fx.Accordion(togglers,stretchers,{display:false,alwaysHide:true});}};window.addEvent('domready',function(){myTools.initialize();if($$('.language select[name=language]')){$$('.language select[name=language]').each(function(element){element.addEvent('change',function(){location.href=location.href.replace(/(\/[a-z]{2}\/)/,'/'+element.getProperty('value')+'/');});});}});
