var CHb=CHb||{};CHb.Global=(function(b,a){var c={de:{rates:"Raten einsehen",interstitial:"Sie werden auf eine sichere buchungsseite der Choice Hotels weitergeleitet",checkin:"Anreisedatum",checkout:"Abreisedatum",adults:"Erwachsene",children:"Kinder",rooms:"Zimmer",guarantee:"Internet Bestpreis-Garantie",book:"Zimmer buchen"},en:{rates:"View Rates",interstitial:"You are being taken to a secure booking page powered by Choice Hotels ",checkin:"Check-in Date",checkout:"Check-out Date",adults:"Adults",children:"Children",rooms:"Rooms",guarantee:"Best Internet Rate Guarantee",book:"Book a Room"},es:{rates:"Ver Tarifas",interstitial:"Lo estamos redireccionando a una pagina segura de reservaciones de Choice Hotels M&eacute;xico",checkin:"Fecha de registro",checkout:"Fecha de salida",adults:"Adultos",children:"Ni&ntilde;os",rooms:"Habitaciones",guarantee:"Mejor Tarifa Garantizada en Internet",book:"Reserve una habitaci&oacute;n"},fr_CA:{rates:"R&eacute;server",interstitial:"Vous allez etre redirige vers une page securisee de Choice Hotels",checkin:"Date d'arriv&eacute;e",checkout:"Date de d&eacute;part",adults:"Adultes",children:"Enfants",rooms:"Chambres",guarantee:"Garantie du meilleur tarif en ligne",book:"R&eacute;server"},fr_FR:{rates:"R&eacute;server",interstitial:"Vous allez etre redirige vers une page securisee de Choice Hotels",checkin:"Date d'arriv&eacute;e",checkout:"Date de d&eacute;part",adults:"Adultes",children:"Enfants",rooms:"Chambres",guarantee:"Meilleur Tarif Internet Garanti",book:"R&eacute;server"},it:{rates:"Visualizza tariffe",interstitial:"Stai per essere trasferito ad una pagina sicura per prenotazioni con Choice Hotels",checkin:"Data di arrivo",checkout:"Data di partenza",adults:"Adulti",children:"Bambini",rooms:"Camere",guarantee:"Garanzia della miglior tariffa Internet",book:"Prenota una camera"},country:{AU:{country:"Australia",logos:["australasia","170","32"]},CA:{country:"Canada",logos:["canada","185","70"]},CZ:{country:"Czech Republic",logos:["europe","148","32"]},FR:{country:"France",logos:["europe","148","32"]},DE:{country:"Germany",logos:["europe","148","32"]},IE:{country:"Ireland",logos:["europe","148","32"]},IT:{country:"Italy",logos:["europe","148","32"]},MX:{country:"Mexico",logos:["mexico","150","32"]},NZ:{country:"New Zealand",logos:["australasia","170","32"]},UK:{country:"UK",logos:["europe","148","32"]}}},d={init:function(){var f=new Date(),e=a.createElement("link");e.type="text/css";e.rel="stylesheet";e.href=chb_config.filepath+"css/chb-styles.css";a.getElementsByTagName("head")[0].appendChild(e);a.getElementById("CHb-widget").className+=" "+chb_config.orientation;if(!b.jQuery){d.loadScript(chb_config.filepath+"js/jquery-1.6.2.min.js",function(){d.scriptsLoaded()})}else{if(parseInt(jQuery.fn.jquery,10)<1.5){d.loadScript(chb_config.filepath+"js/jquery-1.6.2.min.js",function(){d.scriptsLoaded()})}else{d.scriptsLoaded()}}},scriptsLoaded:function(){d.loadScript(chb_config.filepath+"js/jquery-ui-1.8.16.custom.min.js",function(){d.loadScript(chb_config.filepath+"js/jquery.ui.datepicker-"+chb_config.language+".js",function(){jQuery("#CHb-widget").html('<form action="'+chb_config.bookingurl+'" method="get" style="background-color: '+chb_config.background_color+"; color: "+chb_config.text_color+'"><h4 style="border-color: '+chb_config.divider_color+';">'+c[chb_config.language].book+'</h4><fieldset id="CHb-widget-dates"><p class="first" style="border-color: '+chb_config.divider_color+';"><label for="checkin">'+c[chb_config.language].checkin+'</label><br /><input type="text" name="checkin" class="picker" id="checkin" value="" placeholder="dd-mm-yyyy"/></p><p style="border-color: '+chb_config.divider_color+';"><label for="checkout">'+c[chb_config.language].checkout+'</label><br /><input type="text" name="checkout" class="picker" id="checkout" value="" placeholder="dd-mm-yyyy"/></p></fieldset><fieldset id="CHb-widget-details"><p><label for="adults">'+c[chb_config.language].adults+'</label><br /><select name="adults" id="adults"><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><option value="7">7</option><option value="8">8</option><option value="9">9</option></select></p><p><label for="children">'+c[chb_config.language].children+'</label><br /><select name="children" id="children"><option value="0">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><option value="7">7</option><option value="8">8</option><option value="9">9</option></select></p><p><label for="rooms">'+c[chb_config.language].rooms+'</label><br /><select name="rooms" id="rooms"><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><option value="7">7</option><option value="8">8</option><option value="9">9</option></select></p><input type="hidden" id="promo" name="promo" value="'+chb_config.promo+'"></fieldset><p id="CHb-widget-submit"><button type="submit" style="background-color: '+chb_config.button_background_color+"; color: "+chb_config.button_text_color+"; text-shadow: 0 -1px 0 "+chb_config.button_background_color+';">'+c[chb_config.language].rates+"</button><br/><b>"+c[chb_config.language].guarantee+"</b></p></form>");var e=c[chb_config.language].interstitial;if(chb_config.language==="en"){e+=c.country[chb_config.country].country}jQuery('<div id="CHb-interstitial"><div id="CHb-interstitial-content"><p><img src="'+chb_config.filepath+"img/logos."+c.country[chb_config.country].logos[0]+'.png" height="'+c.country[chb_config.country].logos[2]+'" width="'+c.country[chb_config.country].logos[1]+'" /></p><p>'+e+'</p><img src="'+chb_config.filepath+'img/choice-loader.gif" height="32" width="32" /></div></div>').appendTo("body").css({left:-9999,top:-9999});var f=jQuery(".picker").attr("readonly","readonly").datepicker({minDate:0,numberOfMonths:2,showAnim:"slideDown",dateFormat:"dd-mm-yy",onSelect:function(i){var j=this.id==="checkin"?"minDate":"maxDate",g=jQuery(this).data("datepicker"),h=jQuery.datepicker.parseDate(g.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,i,g.settings);f.not(this).datepicker("option",j,h)}});jQuery("#CHb-widget form").submit(function(){d.BlockUI();jQuery("#CHb-interstitial").css({left:"50%","margin-top":(parseInt(jQuery("#CHb-interstitial").outerHeight(),10)/2)*-1,top:"50%"});var g=jQuery(this).attr("action")+"?checkin="+jQuery("#checkin").val()+"&checkout="+jQuery("#checkout").val()+"&adults="+jQuery("#adults").val()+"&children="+jQuery("#children").val()+"&rooms="+jQuery("#rooms").val()+'&promo='+jQuery("#promo").val();b.setTimeout(function(){b.location=g},2000);return false})})})},loadScript:function(f,g){var e=a.createElement("script");e.type="text/javascript";if(e.readyState){e.onreadystatechange=function(){if(e.readyState==="loaded"||e.readyState==="complete"){e.onreadystatechange=null;g()}}}else{e.onload=function(){g()}}e.src=f;a.getElementsByTagName("head")[0].appendChild(e)},addLoadEvent:function(e){var f=b.onload;if(typeof b.onload!=="function"){b.onload=e}else{b.onload=function(){if(f){f()}e()}}},BlockUI:function(){if(jQuery("#UIBlock").length===0){jQuery('<div id="UIBlock" />').css({background:"#000",cursor:"wait",height:"100%",left:0,opacity:0.6,position:"fixed",top:0,width:"100%",zIndex:10000}).appendTo("body");if(jQuery.browser.msie&&(jQuery.browser.version<7)){jQuery("#UIBlock").css({position:"absolute",top:jQuery(b).scrollTop()})}}},unBlockUI:function(){jQuery("#UIBlock").fadeOut(100,function(){jQuery(this).remove()})}};return d})(this,this.document);CHb.Global.addLoadEvent(CHb.Global.init);window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments))}};
