var base_url="http://holiday.bluevendo.pl/client/holidayinn/";var style_url="http://holiday.bluevendo.pl/client/holidayinn/css/";var css_url_main=style_url+"style.css";var css_url_lightbox=style_url+"lightbox.css";var css_url_calendar=style_url+"jscalendar/calendar-blue.css";var chg_user_pwd_addr="http://holiday.bluevendo.pl/user.php";var gmap_width=600;var gmap_height=450;var gmclose_icon_width=16;var gmclose_icon_padding=10;var gmap_msg_bar_height=30;var gmap_msg_bar_padding=10;var ajaxMsgVertMargin=20;var use_gmaps=false;var client_base_url=window.location;var is_map=false;var hide_search_form=false;var hide_loginbox=false;var redir_payform_print="";var auto_search=false;var start_service=null;var end_service=null;var servicetime=end_service-start_service;var params_present=false;var checkin,checkout;var searchEnabled=true;var google_maps_api_key;var is_agent=false;var deferred_payment=false;function loadScript(b){document.write('<script src="',b,'" type="text/javascript"><\/script>')}function loadStyle(b){document.write('<link rel="stylesheet" href="',b,'" type="text/css" media="all" />')}function setCookie(b,e,d,c){if(!c){expDate=new Date();expDate.setDate(expDate.getDate()+d);document.cookie=b+"="+escape(e)+((d==null)?"":";expires="+expDate.toGMTString())}else{document.cookie=b+"="+escape(e)}}function getCookie(b){if(document.cookie.length>0){start=document.cookie.indexOf(b+"=");if(start!=-1){start=start+b.length+1;end=document.cookie.indexOf(";",start);if(end==-1){end=document.cookie.length}return unescape(document.cookie.substring(start,end))}}return""}function getQueryStringParam(b){qryStr=window.location.search.substring(1);qryStrArr=qryStr.split("&");for(i=0;i<qryStrArr.length;i++){param=qryStrArr[i].split("=");if(param[0]==b){return param[1]}}return""}function getLangFromURL(){if(window.location.href.indexOf("en.")!=-1){return"english"}else{if(window.location.href.indexOf("de.")!=-1){return"german"}}return"polish"}var inputParam="";var hotelParam="";var startDataParam="";var endDataParam="";var codeParam="";var categoryParam="";var param;var qS=window.location.search.substring(1);var qSArr=qS.split("&");for(ii=0;ii<qSArr.length;ii++){param=qSArr[ii].split("=");if(param[0]=="BV3input"){inputParam=url_decode(param[1])}else{if(param[0]=="BV3hotel"){hotelParam=url_decode(param[1])}else{if(param[0]=="BV3startData"){startDataParam=param[1]}else{if(param[0]=="BV3endData"){endDataParam=param[1]}else{if(param[0]=="BV3code"){codeParam=param[1]}else{if(param[0]=="BV3category"){categoryParam=param[1]}}}}}}}function isThousands(b){if(Math.floor(b/3)*3==b){return true}return false}function formatMoney(e,g,d,f){var c=Math.round((e*100)-(Math.floor(e)*100));c=""+(c+"0").substring(0,2);e=""+Math.floor(e);var b=g;for(x=0;x<e.length;x++){b+=e.substring(x,x+1);if(isThousands(e.length-x-1)&&(e.length-x-1!=0)){b+=d}}b+=(parseInt(c)>0?c+f:"");return b}function getInternetExplorerVersion(){var d=-1;if(navigator.appName=="Microsoft Internet Explorer"){var b=navigator.userAgent;var c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(c.exec(b)!=null){d=parseFloat(RegExp.$1)}}return d}var ie_ver=getInternetExplorerVersion();function findElemPos(d){var c=d.offsetLeft;var b=d.offsetTop;while(d.offsetParent){c+=d.offsetParent.offsetLeft;b+=d.offsetParent.offsetTop;if(d==document.getElementsByTagName("body")[0]){break}else{d=d.offsetParent}}return[c,b]}function showAJAXLoadIndicator(b){$("body").append('<div id="ajax_load_progress" style="background: white; position: absolute; z-index: 100"><img id="ajax_wait_anim" class="ajaxloaderimg" src="'+base_url+'images/ajaxloader.gif" style="display: block; margin-left: auto; margin-right: auto; padding-top: 10px" /></div>');ajaxImgWidth=$("#ajax_wait_anim").width();ajaxImgHeight=$("#ajax_wait_anim").height();if(ajaxImgHeight<66){ajaxImgHeight=66}contentWidth=$("#BV_content").width();contentHeight=$("#BV_content").height();if(!contentWidth){contentWidth=2*ajaxImgWidth}if(!contentHeight){contentHeight=2*ajaxImgHeight}if(contentHeight<2*ajaxImgHeight){contentHeight=2*ajaxImgHeight}$("#ajax_load_progress").width(contentWidth);$("#ajax_load_progress").height(contentHeight);contentPos=findElemPos(document.getElementById("BV_content"));$("#ajax_load_progress").css("left",contentPos[0]+"px");$("#ajax_load_progress").css("top",contentPos[1]+"px");$("body").append('<div id="ajax_load_progress_msg" class="ajax_loader">'+b+"</div>");$("#ajax_load_progress_msg").width($("#BV_content").width());loadIndPos1=findElemPos(document.getElementById("ajax_load_progress"));loadIndPos2=findElemPos(document.getElementById("ajax_wait_anim"));$("#ajax_load_progress_msg").css("left",loadIndPos1[0]+"px");$("#ajax_load_progress_msg").css("top",loadIndPos2[1]+ajaxImgHeight+ajaxMsgVertMargin+"px");$("#BV_content").css("visibility","hidden")}function hideAJAXLoadIndicator(){$("#ajax_load_progress_msg").remove();$("#ajax_load_progress").remove();$("#BV_content").css("visibility","visible")}function showAutoCompleteProgress(){}function hideAutoCompleteProgress(){}function showGoogleMap(e){var d=document.body;var g=d.offsetHeight;var f=window.pageYOffset;searchEnabled=false;if(!e){exit_msg=translation_close}else{exit_msg=translation_gmaps_dist}if(ie_ver>0&&ie_ver<7){$("body").append('<iframe id="IE6_SELECT_HIDE" style="position: absolute"></iframe>')}$("body").append('<div style="position: absolute" id="GMapLayer"><div id="mapcontent"></div><div id="close_msg_bar">'+exit_msg+'</div><div id="BVAction_close_gmap"><img src="'+base_url+'images/icons/button_cancel.gif" /></div></div>');var c=0,b=0;if(typeof(window.pageYOffset)=="number"){c=window.pageXOffset;b=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){c=document.body.scrollLeft;b=document.body.scrollTop}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){c=document.documentElement.scrollLeft;b=document.documentElement.scrollTop}}}if(navigator.appName=="Netscape"){winW=window.innerWidth;winH=window.innerHeight}else{winW=document.body.offsetWidth;winH=document.body.offsetHeight}gmap_pos_x=c+(winW-gmap_width)/2;gmap_pos_y=b+(winH-gmap_height-gmap_msg_bar_height-2*gmap_msg_bar_padding+1)/2;if(ie_ver>0&&ie_ver<7){$("#IE6_SELECT_HIDE").width(gmap_width);$("#IE6_SELECT_HIDE").height(gmap_height+gmap_msg_bar_height+2*gmap_msg_bar_padding+1);$("#IE6_SELECT_HIDE").css("left",gmap_pos_x+"px");$("#IE6_SELECT_HIDE").css("top",gmap_pos_y+"px")}$("#GMapLayer").width(gmap_width);$("#GMapLayer").height(gmap_height+gmap_msg_bar_height+2*gmap_msg_bar_padding+1);$("#GMapLayer").css("left",gmap_pos_x+"px");$("#GMapLayer").css("top",gmap_pos_y+"px");$("#mapcontent").width(gmap_width);$("#mapcontent").height(gmap_height);$("#BVAction_close_gmap").css("left",(gmap_width-gmclose_icon_width-2*gmclose_icon_padding)+"px");$("#close_msg_bar").width(gmap_width-2*gmap_msg_bar_padding);$("#BVAction_close_gmap").click(function(){hideGoogleMap()});document.onkeyup=function(h){if(h==null){keycode=event.keyCode}else{keycode=h.which}if(keycode==27){hideGoogleMap()}}}function hideGoogleMap(){document.onkeyup="";ie_ver=getInternetExplorerVersion();if(ie_ver>0&&ie_ver<7){$("#IE6_SELECT_HIDE").remove()}$("#mapcontent").remove();$("#close_msg_bar").remove();$("#BVAction_close_gmap").remove();$("#GMapLayer").remove();searchEnabled=true}function joinHash(d){if(d[0].length>1){var c=d[0];var b=1;while(b<d.length){c=c+","+d[b];b++}return c}return d}var XMLHttpFactories=[function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];function createXMLHTTPObject(){var b=false;for(i=0;i<XMLHttpFactories.length;i++){try{b=XMLHttpFactories[i]()}catch(c){continue}break}return b}function sendRequest(c,f,b){var d=createXMLHTTPObject();if(!d){return}var e=b?"POST":"GET";d.open(e,c,true);d.setRequestHeader("User-Agent","XMLHTTP/1.0");if(b){d.setRequestHeader("Content-type","application/x-www-form-urlencoded")}d.onreadystatechange=function(){if(d.readyState!=4){return}try{if(d.status!=200&&d.status!=304){return}f(d)}catch(g){}};if(d.readyState==4){return}d.send(b)}function getAJAX(b){var c=createXMLHTTPObject();if(!c){return}c.open("GET",b,false);c.setRequestHeader("User-Agent","XMLHTTP/1.0");c.send(null);return c.responseText}var bv_action=getQueryStringParam("bvaction");var b_log=false;var b_pas=false;var auth_user=false;var start_now=false;var from_lng=0;var from_lat=0;var rowLastColor="";var destination=null;var curListPage=0,curSortField,curOrder;var selected_currencyid=getQueryStringParam("currencyid");var cur_lng=getLangFromURL();var langid=1;if(cur_lng==""){cur_lng=getCookie("cur_lang");if(cur_lng==""){cur_lng="polish"}}else{setCookie("cur_lang",cur_lng,0,true)}switch(cur_lng){case"english":langid=2;break;case"german":langid=5;break}var wloc=String(window.location);var idx=wloc.indexOf("#");if(idx>=0){wloc=escape(wloc.substr(0,idx))}var extra_params="altref="+wloc+"&current_lang="+cur_lng;str=location.href;if(str.indexOf("www.")!=-1){if(url.indexOf("www.")==-1){url=url.replace("://","://www.")}}else{if(url.indexOf("www.")!=-1){url=url.replace("www.","")}}eval(getAJAX(url+"ajaxproxy.php?step=51&hash="+joinHash(hash)+"&"+extra_params));var site_config=getAJAX(url+"ajaxproxy.php?step=50&hash="+joinHash(hash)+"&"+extra_params);var site_config_array=site_config.split(",");if(google_maps_api_key==""||google_maps_api_key==null){google_maps_api_key=site_config_array[0]}use_gmaps=(site_config_array[1]=="t"?true:false);css_url_main=site_config_array[2];css_url_lightbox=site_config_array[3];css_url_calendar=site_config_array[4];if(use_gmaps){loadScript("http://maps.google.com/maps?file=api&v=2&key="+google_maps_api_key)}loadScript(base_url+"js/jquery.js");loadScript(base_url+"js/jquery.lightbox.js");loadScript(base_url+"destination/cdajax.js");loadScript(base_url+"jscalendar/calendar_stripped.js");loadScript(base_url+"jscalendar/lang/calendar-"+langid+".js");loadScript(base_url+"jscalendar/calendar-setup_stripped.js");loadStyle(css_url_main);loadStyle(css_url_lightbox);loadStyle(css_url_calendar);function setDestination(b){destination=b}function rowHighlight(c,b){if(b){rowLastColor=$(c).css("background-color");$(c).css("background-color","rgb(210, 218, 255)")}else{$(c).css("background-color",rowLastColor)}}function validate(e,d,f,b){if($("#log").val()>0){if(d!="pstring"){return true}}var c=/^firm/;if(f==0){if(c.test(b)){return true}}switch(d){case"select":case"checkbox":case"nullstring":case"opt":return true;case"string":c=/\w+/;return c.test(e);case"number":c=/\d+/;return c.test(e);case"email":c=/^\S+@\w+(\.\w+)+\.?$/;return c.test(e);case"pstring":if($("#log").val()==0){return true}else{c=/\w+/;return c.test(e)}default:return false}}function Search(f,b){var l=this;var d="#666";var e="1px solid #FF0000";var h=1;var k=0;var j=11;var f=f?f:"ajaxproxy.php";var g=true;var c='<div class="waitcircle" style="text-align: center; vertical-align: middle"><img class="ajaxloaderimg" style="display: block; margin-left: auto; margin-right: auto; padding-top: 10px; padding-bottom: 10px" src="'+base_url+'images/ajaxloader.gif"></div>';str=location.href;if(str.indexOf("www.")!=-1){if(f.indexOf("www.")==-1){f=f.replace("://","://www.")}}else{if(f.indexOf("www.")!=-1){f=f.replace("www.","")}}if(bv_action=="voucher"){$("#BV_search_machine").load(f+"&step=56&"+extra_params,{limit:25},function(){BVH_Loaded=true;$("#mnuHolidayInn").click()})}this.reloadPage=function(m,p,o){window.scroll(0,0);l._backToStep(1,false);showAJAXLoadIndicator(translation_please_wait);var n=f+"&step=2&offset="+m+"&sort="+p+"&order="+o+"&currencyid="+selected_currencyid+"&searchqueryid="+$("#searchqueryid").val()+"&searchexecid="+$("#searchexecid").val()+"&"+extra_params;if(hide_search_form){$("#BV_search_machine").hide()}if(hide_loginbox){$("#BV_loginbox").hide()}$("#step1").load(n,{limit:50},function(){hideAJAXLoadIndicator();searchEnabled=true;$("#BVAction_backlist_button").click(function(){if(hide_search_form){$("#BV_search_machine").show()}if(hide_loginbox){$("#BV_loginbox").show()}l._backToStep(1,true)});l._mapInit();l._getResults();searchEnabled=true})};this.printForOverflow=function(){var o=[];if(location.search.length>1){var m=location.search.substring(1);var n=m.split("=");if(n[0]=="bid"&&n[1]){$("#overflow").load(f+"&step=5&bid="+n[1]+"&hash="+joinHash(hash)+"&"+extra_params,{limit:25},function(){})}}};this.buildToBasketList=function(){$("#baskets").remove();$("#basketlist").remove();$("#basketinfo").remove();$("#results").remove();$("#BV_content").html('<div id="results"><div id="baskets"></div><div id="basketlist"></div><div id="basketinfo"></div><div id="userdatachange"></div><div id="userdatachangepassword"></div></div> ')};this.showListBasket=function(){var n="&login="+b_log;var m="&password="+b_pas;regs=/\w+/;if(!regs.test(b_log)||!regs.test(b_pas)){alert(translation_correct_missing_fields);return}showAJAXLoadIndicator(translation_please_wait);l.buildToBasketList();$("#BV_loginbox").fadeOut("slow");$("#basketlist").load(f+"&step=14"+n+m+"&"+extra_params,{limit:25},function(){if($("#userverification").attr("value")!="0"){$("#BV_loginbox").load(f+"&step=16&hide=1"+n+m+"&"+extra_params,{limit:25},function(){auth_user=true;$("#BVAction_reserv_list").click(function(){l.showListBasket()});$("#BVAction_cancel_reserv").click(function(){$("#basketlist").fadeOut("slow");$("#userdatachange").fadeOut("slow");$("#basketinfo").fadeIn("slow");l.askform()});$("#BVAction_user_data").click(function(){$("#basketlist").fadeOut("slow");$("#basketinfo").fadeOut("slow");$("#userdatachange").fadeIn("slow");l.showUserData()});$("#BVAction_logout").click(function(){history.go(0)});$("#BVAction_newsletter_change0").click(function(){var o={};o.step=26;o.email=b_log;$.get(f+"?"+extra_params,o,function(p){alert(translation_removed_from_newsletter);l.showListBasket()})});$("#BVAction_newsletter_change1").click(function(){var o={};o.step=27;o.email=b_log;$.get(f+"?"+extra_params,o,function(p){alert(translation_added2newsletter);l.showListBasket()})})})}else{$("#login_alert").html(translation_bad_login)}hideAJAXLoadIndicator();$("#BVAction_backlist_button").click(function(){history.go(0)});$("#BV_loginbox").fadeIn("slow");$(".nextbasket").click(function(){$("#basketinfo").html("");$("#basketlist").fadeOut("slow",function(){$("#basketinfo").fadeIn("slow")});$("#basketinfo").load(f+"&step=15&bid="+$(this).attr("id")+"&"+extra_params,{limit:25},function(){$("#BVAction_sendcancelask").click(function(){l.askform()});$("#BVAction_backtolistbasket").click(function(){$("#basketinfo").fadeOut("slow",function(){$("#basketlist").fadeIn("slow")})});$("#BVAction_printflow").click(function(){var o=$("#flowaddress").val()+"&hash="+joinHash(hash)+"&"+extra_params;window.open(o,null,"height=480,width=600,status=no,toolbar=no,menubar=no,location=no")})})})})};this.askform=function(){var m={};showAJAXLoadIndicator(translation_please_wait);$("#basketinfo").load(f+"&step=22&bid="+$("#bidhash").val()+"&"+extra_params,{limit:25},function(){hideAJAXLoadIndicator();if(auth_user){$("#BVAction_backtolistbasket").click(function(){l.showListBasket()})}else{$("#BVAction_backtolistbasket").hide()}$("#BVAction_asksend").click(function(){showAJAXLoadIndicator(translation_please_wait);m.bno=$("[name=basketno]").val();m.asktype=$("[name=asktype]:checked").val();m.text=$("[name=asktext]").val();m.login=b_log;$.post(f+"&step=23&hash="+joinHash(hash)+"&"+extra_params,m,function(n){hideAJAXLoadIndicator();if(n=="OK"){if(auth_user){if(confirm(translation_msg_sent_ret2list)){$("#BVAction_backtolistbasket").click()}}else{alert(translation_msg_sent_opcontact)}}else{alert(translation_send_error)}})})})};this.showBasket=function(){return;if(g){$("#BV_loginbox").html(c)}$("#BV_loginbox").load(f+"&step=13&"+extra_params,{limit:25},function(){$("#BVAction_login").click(function(){b_log=$("#BVInput_login").val();b_pas=$("#BVInput_password").val();l.showListBasket()});$("#BVInput_password").keydown(function(m){if(m.keyCode==13){b_log=$("#BVInput_login").val();b_pas=$("#BVInput_password").val();l.showListBasket()}});$("#BVInput_login").keydown(function(m){if(m.keyCode==13&&$("#BVInput_password").val()){b_log=$("#BVInput_login").val();b_pas=$("#BVInput_password").val();l.showListBasket()}});$(".cancel_basket_loginbox").click(function(){l.buildToBasketList();l.askform();hideAJAXLoadIndicator()})})};this.showUserData=function(){var n="&login="+b_log;var m="&password="+b_pas;showAJAXLoadIndicator(translation_please_wait);l.buildToBasketList();$("#userdatachange").load(f+"&step=37&"+n+m+"&"+extra_params,{limit:25},function(){hideAJAXLoadIndicator();$("#BVAction_backtolistbasket").click(function(){l.showListBasket()});$("#BVAction_changeuserdata").click(function(){showAJAXLoadIndicator(translation_please_wait);var p=0;var o={};$(".data").each(function(){if(validate($(this).val(),$(this).attr("data"),$("#invoice").val(),$(this).attr("name"))){o[$(this).attr("name")]=$(this).val();$(this).css("border","1px solid #7F9DB9")}else{p++;$(this).css("border","1px solid #FF0000")}});if(p>0){hideAJAXLoadIndicator();alert(translation_check_fields)}else{$.post(f+"&step=39&"+n+m+"&"+extra_params,o,function(q){hideAJAXLoadIndicator();if(q=="OK"){alert(translation_data_saved);$("#BVAction_backtolistbasket").click()}else{alert(translation_send_error)}})}});$("#BVAction_changepassword").click(function(){showAJAXLoadIndicator(translation_please_wait);$("#userdatachange").fadeOut(function(){$("#userdatachangepassword").load(f+"&step=44&fase=0&"+extra_params,{limit:25},function(){hideAJAXLoadIndicator();$("#BVAction_changepasswordfinal").click(function(){var o=0;var p={};$(".data2").each(function(){if($(this).val()!=""){p[$(this).attr("name")]=$(this).val();$(this).css("border","1px solid #7F9DB9")}else{o++;$(this).css("border","1px solid #FF0000")}});if($("#newpassword").val()!=$("#newpassword2").val()){$("#newpassword").css("border","1px solid #FF0000");$("#newpassword2").css("border","1px solid #FF0000");o=100}if(o>0){hideAJAXLoadIndicator();if(o==100){alert(translation_enter_valid_passwords)}else{alert(translation_check_fields)}}else{$.post(f+"&step=44&fase=1"+n+"&"+extra_params,p,function(q){hideAJAXLoadIndicator();if(q=="OK"){alert(translation_data_saved);b_pas=$("#newpassword").val();$("#BVAction_backtoprofile").click()}else{if(q=="PASSWORD"){alert(translation_enter_valid_old_pwd)}else{alert(translation_send_error)}}})}});$("#BVAction_backtoprofile").click(function(){l.showUserData()})})})})})};this.firstSearch=function(){var m=true};this._calendarSetCheckoutRange=function(){if(checkin.get()>checkout.get()){var n=Date.parseDate(checkin.get(),"%Y-%m-%d");var m=Date.parseDate(checkout.get(),"%Y-%m-%d");n.setDate(n.getDate()+1);checkout.set(n.print("%Y-%m-%d"))}};this._pay=function(){var m={};var n="";h=0;if(!$("input#agree:checked").val()){h++}$(".data").each(function(){if(validate($(this).val(),$(this).attr("data"),$("#invoice").val(),$(this).attr("name"))){m[$(this).attr("name")]=$(this).val();$(this).css("border","1px solid #7F9DB9")}else{h++;$(this).css("border","1px solid #FF0000")}});extra_components="";$(".BVAction_compCheckbox").each(function(){if($(this).is(":checked")){if(extra_components!=""){extra_components+=","}extra_components+=$(this).attr("comp_id")+"x"+$(this).attr("amount")}});m.excmps=extra_components;if(h==0){l._payment(m)}else{alert(translation_check_fields_and_agree)}return m};this._payment=function(o){var p=$("input[name=payment_type]:checked").val();if(is_agent&&deferred_payment){p=-1}var n=$("#country_payment_type").val();var m="&servicesids="+$("#serviceids").val();var q="&step=4"+m;searchEnabled=false;window.scroll(0,0);showAJAXLoadIndicator(translation_please_wait);$.get(f+q+"&payment_type="+p+"&"+extra_params,o,function(s){hideAJAXLoadIndicator();if(isNaN(parseFloat(s))){if(confirm(translation_booking_error)){window.open(chg_user_pwd_addr)}else{$("#BVAction_buy_login").click()}searchEnabled=true;return}var r=b+"?basketid="+s+"&payment_type="+p+"&cpay="+n+"&currencyid="+selected_currencyid;if(p!=-1&&p!=99){if(p==3){r+="&requestid="+ecard_rqid}else{if(p==4){polcard_rqid=getAJAX(f+"&step=58&basketid="+s+"&payment_type="+p+"&cpay="+n+"&paymenttype=TRANSFERS&"+extra_params);if(polcard_rqid=="ERROR!"){alert("Payment system error!");return}r+="&requestid="+polcard_rqid}}window.location=r}else{searchEnabled=false;showAJAXLoadIndicator(translation_please_wait);if(is_agent){agent_data="&al="+b_log+"&ap="+b_pas+"&agent=1"}else{agent_data=""}$("#step3").load(f+"&step=6&bid="+s+"&payment_type="+p+agent_data+"&"+extra_params,{},function(){hideAJAXLoadIndicator();searchEnabled=true;$("#BVAction_end_reservation").click(function(){window.location=redir_payform_print})})}})};this._buyformular=function(m){searchEnabled=false;l._backToStep(3,false);showAJAXLoadIndicator(translation_please_wait);$("#step3").load(f+m+"&"+extra_params,{limit:120},function(){window.scroll(0,0);hideAJAXLoadIndicator();searchEnabled=true;$("#BuyBack").mouseover(function(){$("#BuyBack").toggleClass("BV_BackBtn_hover");$("#BuyBack_l").toggleClass("BV_BackBtnLeft_hover");$("#BuyBack_m").toggleClass("BV_BackBtnMiddle_hover");$("#BuyBack_r").toggleClass("BV_BackBtnRight_hover")}).mouseout(function(){$("#BuyBack").toggleClass("BV_BackBtn_hover");$("#BuyBack_l").toggleClass("BV_BackBtnLeft_hover");$("#BuyBack_m").toggleClass("BV_BackBtnMiddle_hover");$("#BuyBack_r").toggleClass("BV_BackBtnRight_hover")});$("#BVAction_buy_login").click(function(){registeredElement=document.getElementById("registred");newuserElement=document.getElementById("newuser");if(registeredElement.style.display!="none"){registeredElement.style.display="none";newuserElement.style.display="block"}else{registeredElement.style.display="block";newuserElement.style.display="none"}$("#log").val($("#log").val()>0?0:1)});$("#wantinvoice").click(function(){$("#invoiceinfo").slideToggle();$("#invoice").val($("#invoice").val()>0?0:1)});if(b_log&&b_pas){$("#BVInput_login").val(b_log);$("#BVInput_password").val(b_pas);$("#BVAction_buy_login").click()}$("#BVAction_pay").click(function(){l._pay();location=client_base_url+"#payment"});$("#BVAction_hotel_back").click(function(){l._backToStep(2,true)});$(".BVAction_compCheckbox").click(function(){comp_id=$(this).attr("comp_id");roomid=$(this).attr("roomid");totalPriceVal=parseFloat($("#price2pay").html().replace(" ",""));bookingVal=parseFloat($("#booking_value").html().replace(" ",""));priceVal=parseFloat($("#bcompv_"+roomid+"_"+comp_id).val());if($(this).is(":checked")){totalPriceVal+=priceVal;bookingVal+=priceVal;$("#bcprice_"+roomid+"_"+comp_id).show();$("#bctprice_"+roomid+"_"+comp_id).show()}else{totalPriceVal-=priceVal;bookingVal-=priceVal;$("#bcprice_"+roomid+"_"+comp_id).hide();$("#bctprice_"+roomid+"_"+comp_id).hide()}$("#price2pay").html(formatMoney(totalPriceVal,""," ",","));$("#booking_value").html(formatMoney(bookingVal,""," ",","))})})};this._getResults=function(){$(".photo_lightbox").lightBox();$(".show_object").click(function(){window.scroll(0,0);l._backToStep(2,false);showAJAXLoadIndicator(translation_please_wait);var m=f+"&step=2&placeid="+$(this).attr("id")+"&searchqueryid="+$("#searchqueryid").val()+"&searchexecid="+$("#searchexecid").val()+"&currencyid="+$("#currencyid").val()+"&"+extra_params;if(hide_search_form){$("#BV_search_machine").hide()}if(hide_loginbox){$("#BV_loginbox").hide()}$("#step2").load(m,{limit:50},function(){hideAJAXLoadIndicator();searchEnabled=true;$("#BVAction_backlist_button").click(function(){if(hide_search_form){$("#BV_search_machine").show()}if(hide_loginbox){$("#BV_loginbox").show()}l._backToStep(1,true)});l._hotel()})});$(".change_Page").click(function(){curListPage=$(this).attr("offset");l.reloadPage(curListPage,curSortField,curOrder)});$(".header_placename").click(function(){if(curSortField=="name"){if(curOrder=="asc"){curOrder="desc"}else{curOrder="asc"}}else{curOrder="asc"}l.reloadPage(curListPage,"name",curOrder)});$(".header_location").click(function(){});$(".header_price").click(function(){if(curSortField=="price"){if(curOrder=="asc"){curOrder="desc"}else{curOrder="asc"}}else{curOrder="asc"}l.reloadPage(curListPage,"price",curOrder)})};this._hotel=function(){var m=l._hotel_actions();var n=0;$(".al").each(function(){var o=parseFloat($(this).attr("price")*$(this).val());n=parseFloat(o)+parseFloat(n);m[$(this).attr("searchresultid")]=$(this).val();avail_allotment=parseInt($(this).attr("avail_allotment"));if(!avail_allotment||$(this).val()>avail_allotment){$("#msg_"+$(this).attr("id")).show()}else{$("#msg_"+$(this).attr("id")).hide()}});$("#sum").html(formatMoney(n,""," ",",")+" ");$("#submithid").val(n);$("#BVAction_buy").click(function(){if($("#submithid").val()<=0){alert(translation_error_1room)}else{var p;var o="&services=";for(p in m){if(m[p]>0&&p>0){o+=","+p+"_"+m[p]}}var q="&step=3"+o+"&placeid="+$("#placeid").attr("value");if(is_agent){q+="&al="+b_log+"&ap="+b_pas+"&agent=1"}l._buyformular(q)}})};this._hotel_actions=function(){var o=new Array();$("#photos a").lightBox();$("#HotelBack").mouseover(function(){$("#HotelBack").toggleClass("BV_BackBtn_hover");$("#HotelBack_l").toggleClass("BV_BackBtnLeft_hover");$("#HotelBack_m").toggleClass("BV_BackBtnMiddle_hover");$("#HotelBack_r").toggleClass("BV_BackBtnRight_hover")}).mouseout(function(){$("#HotelBack").toggleClass("BV_BackBtn_hover");$("#HotelBack_l").toggleClass("BV_BackBtnLeft_hover");$("#HotelBack_m").toggleClass("BV_BackBtnMiddle_hover");$("#HotelBack_r").toggleClass("BV_BackBtnRight_hover")});if(use_gmaps){if(GBrowserIsCompatible()){GUnload();var p=new GMap2(document.getElementById("maphotel"));p.setCenter(new GLatLng($("#maphotel").attr("glat"),$("#maphotel").attr("glng")),parseInt($("#maphotel").attr("zoom"),10));p.addControl(new GLargeMapControl());var m=new GLatLng($("#maphotel").attr("glat"),$("#maphotel").attr("glng"));var n=new GMarker(m);p.addOverlay(n)}}$(".al").change(function(){var r=0;var q=$(this).attr("id");cur_id=q.split("_");base_id=cur_id[0];offer_id=cur_id[1];otherOffers=$("select[id^='"+base_id+"']");for(i=0;i<otherOffers.length;i++){id_array=otherOffers[i].id.split("_");if(id_array[1]!=offer_id){$("#"+q).val(parseInt($("#"+q).val())+parseInt($("#"+otherOffers[i].id).val()));$("#"+otherOffers[i].id).val(0)}}$(".al").each(function(){var s=parseFloat($(this).attr("price")*$(this).val());r=parseFloat(s)+parseFloat(r);o[$(this).attr("searchresultid")]=$(this).val();avail_allotment=parseInt($(this).attr("avail_allotment"));if(!avail_allotment||$(this).val()>avail_allotment){$("#msg_"+$(this).attr("id")).show()}else{$("#msg_"+$(this).attr("id")).hide()}});$("#sum").html(formatMoney(r,""," ",",")+" ");$("#submithid").val(r)});return o};this._mapInit=function(){$(".mapmarker").click(function(){if(!use_gmaps){return}is_map=true;showGoogleMap(0);$("#bookingsearchformContainer").hide();var o=$(this).attr("glat");var r=$(this).attr("glng");var p=$(this).attr("zoom");if(GBrowserIsCompatible()){var q=new GMap(document.getElementById("mapcontent"));var m=new GLatLng(o,r);q.setCenter(m,parseInt(p,10));q.addControl(new GLargeMapControl());var n=new GMarker(m);q.addOverlay(n)}})};this._formular_actions=function(){$("#extras").hide();$("#more").click(function(){$("#extras").toggle()});$(".roomselect").hide();$("#add").click(function(){var m=parseInt($("#cr").val());$("#cr").val(m==3?3:++m);$(".roomtype_record").each(function(){if($(this).attr("nr")<=m){$(this).show("slow")}});$("#del").show("slow");if($("#cr").val()>2){$("#add").hide("slow")}});$("#del").click(function(){var m=parseInt($("#cr").val());$("#cr").val(m==1?1:--m);$(".roomtype_record").each(function(){if($(this).attr("nr")>m){$("#numofrooms"+$(this).attr("nr")).val(0);$(this).hide("slow")}});if($("#cr").val()<2){$("#del").hide("slow")}if($("#cr").val()<3){$("#add").show("slow")}});$("select.Ym , select.d").change(function(){l._calendarSetCheckoutRange()})};this._get_params=function(){var o=$("#checkindate_d").val()>9?$("#checkindate_d").val():"0"+$("#checkindate_d").val();var m=$("#checkoutdate_d").val()>9?$("#checkoutdate_d").val():"0"+$("#checkoutdate_d").val();var p="";p+="&checkindate="+$("#checkindate_Ym").val()+"-"+o;p+="&checkoutdate="+$("#checkoutdate_Ym").val()+"-"+m;if($("#noresults").val()!="0"){p+="&roomtypeid="+$("#roomtypeid").val();p+="&roomtypeid2="+$("#roomtypeid2").val();p+="&roomtypeid3="+$("#roomtypeid3").val();p+="&numofrooms="+$("#numofrooms").val();p+="&numofrooms2="+$("#numofrooms2").val();p+="&numofrooms3="+$("#numofrooms3").val();p+="&placetypeid="+$("#placetypeid").val();p+="&currencyid="+$("#currencyid").val();p+="&countrooms="+$("#cr").val();p+="&equipment=";if($("#more:checked").val()){$("input[class=equipment]:checked").each(function(){p+=","+$(this).val()});p+="&offercode="+$("#offercode").val()}if(!destination){}else{p+="&"+destination.type+"="+destination.id}var n=f+"&step=2"+p+"&"+extra_params}else{var n=f+"&step=2&country=1001&noresults=1"+p+"&"+extra_params}if(is_agent){n+="&al="+b_log+"&ap="+b_pas+"&agent=1"}selected_currencyid=$("#currencyid").val();return n};this._buildAreas=function(){$("#results").remove();$("#baskets").remove();$("#basketlist").remove();$("#basketinfo").remove();$("#BV_content").html('<a name="details" id="a_details"></a><a name="booking" id="a_booking"></a><a name="payment" id="a_payment"></a><div id="results"></div>');$("#results").html('<div id="step1"></div><div id="step2"></div><div id="step3"></div><div id="step4"></div>');$("#a_details").click(function(){alert("Details")});$("#a_booking").click(function(){alert("Booking")})};this._backToStep=function(n,m){switch(m){case false:switch(n){case 1:$("#step1").show();$("#step2").hide();$("#step3").hide();break;case 2:$("#step2").show();$("#step1").hide();$("#step3").hide();break;case 3:$("#step3").show();$("#step2").hide();$("#step1").hide();break}break;case true:switch(n){case 1:$("#step2").fadeOut(function(){$("#step1").fadeIn()});break;case 2:$("#step3").fadeOut(function(){$("#step2").fadeIn()});break}break}};this.searchMachine=function(){if(start_service!=null&&end_service!=null){if(start_service>=end_service){end_service=start_service+1}}if(g&&!auto_search&&bv_action!="search"){$("#BV_search_machine").html(c)}switch(bv_action){case"voucher":$("#BV_search_machine").load(f+"&step=56&"+extra_params,{limit:25},function(){BVH_Loaded=true;$("#mnuHolidayInn").click()});break;case"payment":$("#BV_content").load(f+"&step=59&"+extra_params,{limit:25},function(){});case"search":default:if(bv_action!="search"){$("#BV_search_machine").load(f+"&s_s="+start_service+"&s_e="+end_service+"&"+extra_params,{limit:25},function(){$("#del").hide();var o=false;destination="";var n=new DestinationAutoComplete(document.getElementById("destination_text"));if(start_now){$("#BVAction_start_search").click()}l._formular_actions();$("#BVAction_start_search").click(function(){var r=$("#checkindate_d").val()>9?$("#checkindate_d").val():"0"+$("#checkindate_d").val();var q=$("#checkoutdate_d").val()>9?$("#checkoutdate_d").val():"0"+$("#checkoutdate_d").val();var s="";s+="checkindate="+$("#checkindate_Ym").val()+"-"+r;s+="&checkoutdate="+$("#checkoutdate_Ym").val()+"-"+q;if($("#noresults").val()!="0"){s+="&roomtypeid="+$("#roomtypeid").val();s+="&roomtypeid2="+$("#roomtypeid2").val();s+="&roomtypeid3="+$("#roomtypeid3").val();s+="&numofrooms="+$("#numofrooms").val();s+="&numofrooms2="+$("#numofrooms2").val();s+="&numofrooms3="+$("#numofrooms3").val();s+="&placetypeid="+$("#placetypeid").val();s+="&currencyid="+$("#currencyid").val();s+="&countrooms="+$("#cr").val();s+="&equipment=";if($("#more:checked").val()){$("input[class=equipment]:checked").each(function(){s+=","+$(this).val()});s+="&offercode="+$("#offercode").val()}if(!destination){}else{s+="&"+destination.type+"="+destination.id}}else{s+="&country=1001&noresults=1"}if(search_results_page.indexOf("?")!=-1){search_results_page+="&"}else{search_results_page+="?"}location=search_results_page+"bvaction=search&"+s});if(inputParam!=""||hotelParam!=""||startDataParam!=""||endDataParam!=""||codeParam!=""||categoryParam!=""){if(inputParam!=""){$("#destination_text").val(inputParam)}else{if(hotelParam!=""){$("#destination_text").val(hotelParam);o=true}}if(startDataParam!=""){var m=startDataParam.split("!");$("#checkindate_d").ready(function(){$("#checkindate_d option").each(function(){if($(this).val().indexOf(m[0])==0){$(this).attr("selected","selected")}})});$("#checkindate_Ym").ready(function(){$("#checkindate_Ym option").each(function(){if($(this).val().indexOf(m[2]+"-"+m[1])==0){$(this).attr("selected","selected")}})})}if(endDataParam!=""){var p=endDataParam.split("!");$("#checkoutdate_d").ready(function(){$("#checkoutdate_d option").each(function(){if($(this).val().indexOf(p[0])==0){$(this).attr("selected","selected")}})});$("#checkoutdate_Ym").ready(function(){$("#checkoutdate_Ym option").each(function(){if($(this).val().indexOf(p[2]+"-"+p[1])==0){$(this).attr("selected","selected")}})})}if(codeParam!=""){$("#offercode").val(codeParam)}if(categoryParam!=""){$("#placetypeid").ready(function(){$("#placetypeid option:contains("+categoryParam+")").attr("selected","selected")})}params_present=true;n.asp=true}else{if(auto_search==true){$("#BVAction_start_search").click()}}})}if(bv_action=="search"){$(document).ready(function(){l._buildAreas();var m=f+"&step=2&"+qS+"&"+extra_params;showAJAXLoadIndicator(translation_please_wait);l._backToStep(1,false);$("#step1").load(m,function(){hideAJAXLoadIndicator();l._mapInit();l._getResults();searchEnabled=true})})}}}}function DestinationAutoComplete(b){this.idPrefix="destinationAutoCompleteElement_";this.inputElement=document.getElementById("destination_text");this.enableCitymap=true;this.searchAction="ajaxproxy.php?step=9&hash="+hash;this.minChars=0;this.maxElementsOnList=9;this.listRootElement=null;this.elements=new Array();this.allElements=new Array();this.currentList=0;this.startList=0;this.oldSearchRequest="";this.loadingStarted=false;this.loadingDone=false;this.asp=false;this.documentBodyOnClick=null;this.mouseMoveActive=true;c=this;b.onkeyup=function(){var d=arguments[0]||window.event;c.keyUp(d)};b.onkeydown=function(){var d=arguments[0]||window.event;c.keyDown(d)};this.activeElement=null;var c=this;this.onload=function(){c.filter();c.repaint()};c.load()}DestinationAutoComplete.prototype.keyUp=function(b){a=b.keyCode;switch(b.keyCode){case 38:case 40:case 13:case 9:return false}if(this.inputElement.value.length<this.minChars){clearTimeout(this.searchTimeout);this.dropList();return}if(this.inputElement.value==this.oldSearchRequest){clearTimeout(this.searchTimeout);return}this.load();if(this.loadingDone){this.filter();this.repaint()}};DestinationAutoComplete.prototype.check=function(){var b=this.inputElement.value;var f=this.allElements;var e=new Array(f.length);for(var d=0;d<f.length;d++){e[d]=f[d].name.toUpperCase().indexOf(b.toUpperCase())}var c=0;for(var d=0;d<e.length;d++){if(e[c]==-1){c=d}}for(var d=0;d<e.length;d++){if((e[d]<e[c])&&(e[d]>-1)){c=d}}if(e[c]>-1){setDestination(f[c])}return 1};DestinationAutoComplete.prototype.load=function(b){var c=this;if(!(this.loadingStarted||this.loadingDone)){this.loadingStarted=true;this.loadingDone=false;cdAJAX.setDefaultParameters({group:null,unique:true});showAutoCompleteProgress();cdAJAX.get({url:c.searchAction,parameters:{search:c.inputElement.value},onSuccess:function(e){hideAutoCompleteProgress();var d=getDestinationsResponse();c.loadList(d);c.loadingDone=true;getDestinationsResponse=null;if(c.onload){}while(this.asp==true){}if(params_present){$("#BVAction_start_search").click()}},onError:function(d){c.raiseError("Error while fetching destinations: "+d.status)}})}};DestinationAutoComplete.prototype.keyDown=function(b){a=b.keyCode;switch(b.keyCode){case 38:this.currentList--;if(this.currentList<0){this.currentList=0}this.stopMouseMove();this.repaint();break;case 40:this.currentList++;if(this.currentList>=this.elements.length){this.currentList=this.elements.length-1}this.stopMouseMove();this.repaint();break;case 13:if(this.elements.length>0){this.select(this.elements[this.currentList])}else{this.inputElement.value="";destination=""}break;case 9:if(this.elements.length>0){this.select(this.elements[this.currentList])}else{this.dropList();this.inputElement.value="";destination=""}break;default:this.activeElement=null;break}return false};DestinationAutoComplete.prototype.dropList=function(){this.showSelect();if(this.listRootElement){document.body.removeChild(this.listRootElement);this.listRootElement=null}this.elements=new Array();this.currentList=0;this.startList=0;this.oldSearchRequest="";document.body.onclick=this.documentBodyOnClick;this.documentBodyOnClick=null};DestinationAutoComplete.prototype.createRootListElement=function(){this.listRootElement=document.createElement("div");var b=this.getAbsolutePos(this.inputElement);this.listRootElement.className="autocomplete";this.listRootElement.style.position="absolute";this.listRootElement.style.top=(b[3])+"px";this.listRootElement.style.left=(b[0])+"px";this.listRootElement.style.width=(b[2]-b[0]+10)+"px";document.body.appendChild(this.listRootElement)};DestinationAutoComplete.prototype.createListElement=function(d,f,h){this.elements.push(d);var g=document.createElement("div");g.className="element";var b=this.inputElement.value;while(b.search("[*]")>=0){b=b.replace("*","Z")}var e=d.name.replace(new RegExp("("+b+")","i"),"<u>$1</u>");g.innerHTML='<span classname="'+d.type+'">'+e+"</span>";g.style.display=f?"block":"none";g.id=this.idPrefix+this.inputElement.id+h;var c=this;g.onmouseover=function(){me=arguments[0]||window.event;return c.mouseOver(me)};g.onmouseout=function(){me=arguments[0]||window.event;return c.mouseOut(me)};g.onclick=function(){me=arguments[0]||window.event;return c.click(me)};this.listRootElement.appendChild(g)};DestinationAutoComplete.prototype.raiseError=function(b){alert(b)};DestinationAutoComplete.prototype.loadList=function(b){this.allElements=b};DestinationAutoComplete.prototype.filter=function(){this.dropList();this.createRootListElement();var f=0;var d=this.inputElement.value;while(d.search("[*]")>=0){d=d.replace("*","Z")}var h=new RegExp(d,"i");var c=new Array();for(var g=0;g<this.allElements.length;g++){var k=this.allElements[g];if(!h.test(k.name)){continue}c.push(k)}var b=new RegExp("^"+d,"i");c.sort(function(j,e){var l=b.test(j.name);var m=b.test(e.name);if(l==m){return 0}if(l){return -1}if(m){return 1}return 0});for(var g=0;g<c.length;g++){var k=c[g];this.createListElement(k,f<this.maxElementsOnList,f);f++}if(0==f){this.dropList()}};DestinationAutoComplete.prototype.repaint=function(){this.activeElement=null;if(!this.listRootElement){return}var f=this.listRootElement.getElementsByTagName("div");var b=0;if(this.currentList>=this.startList+this.maxElementsOnList){this.startList=this.currentList-this.maxElementsOnList+1}else{if(this.currentList<this.startList){this.startList=this.currentList}}for(var d in f){if("object"!=typeof f[d]){continue}f[d].style.display=b>=this.startList&&b<this.startList+this.maxElementsOnList?"block":"none";f[b].className=b==this.currentList?"element over":"element";b++}this.hideSelect();if(!this.documentBodyOnClick){this.documentBodyOnClick=document.body.onclick;destination=""}var c=this;var e=function(){document.body.onclick=function(){c.dropList()}};setTimeout(e,50)};DestinationAutoComplete.prototype.mouseOver=function(){if(!this.mouseMoveActive){return}var b=arguments[0]||window.event;this.currentList=this.getTargetIdForMouseEvent(b);this.repaint()};DestinationAutoComplete.prototype.mouseOut=function(){};DestinationAutoComplete.prototype.click=function(){var c=arguments[0]||window.event;var b=this.getTargetIdForMouseEvent(c);this.select(this.elements[b])};DestinationAutoComplete.prototype.select=function(b){this.inputElement.value=b.name;this.activeElement=b;setDestination(b);if(this.enableCitymap){this.citymapMoveTo(b.lat,b.lng,b.zoom)}this.dropList()};DestinationAutoComplete.prototype.stopMouseMove=function(){this.mouseMoveActive=false;var b=this;var c=function(){b.mouseMoveActive=true};setTimeout(c,100)};DestinationAutoComplete.prototype.getTargetIdForMouseEvent=function(d){var c;if(d.target){c=d.target}else{if(d.srcElement){c=d.srcElement}}if(!c){return}if(c.nodeType==3){c=c.parentNode}while("DIV"!=c.tagName.toUpperCase()){c=c.parentNode}var b=new RegExp(this.idPrefix+this.inputElement.id+"([0-9]+)");var e=b.exec(c.id);return e[1]};DestinationAutoComplete.prototype.getAbsolutePos=function(e){var c=typeof e=="string"?document.getElementById(e):e;e=c;var b=0,d=0;while(c){d+=c.offsetTop;b+=c.offsetLeft;c=c.offsetParent}return new Array(b,d,b+e.offsetWidth,d+e.offsetHeight)};DestinationAutoComplete.prototype.get=function(){if(this.activeElement){return this.activeElement}var b=this.inputElement.value.toUpperCase();for(var c=0;c<this.allElements.length;c++){var d=this.allElements[c];if(b==d.name.toUpperCase()){this.activeElement=d;return d}}return null};DestinationAutoComplete.prototype.hideSelect=function(){this.showSelect();this._selects=new Array();if(!this.listRootElement){return}var d=this.getAbsolutePos(this.listRootElement);var c=document.getElementsByTagName("select");for(var b in c){var e=c[b];if(this._inSelects(e)){continue}if("object"!=typeof e){continue}var g=this.getAbsolutePos(e);if((d[2]<g[0]||d[3]<g[1])||(d[0]>g[2]||d[1]>g[3])){continue}var f=e.style.visibility;e.style.visibility="hidden";this._selects.push(new Array(e,f))}};DestinationAutoComplete.prototype.showSelect=function(){if(!this._selects){return}var b;while(b=this._selects.pop()){b[0].style.visibility=b[1]}};DestinationAutoComplete.prototype._inSelects=function(c){var b;while(b in this._selects){if(this._selects[b][0]==c){return true}}return false};DestinationAutoComplete.prototype._getFromAllElements=function(d,e){for(var b=0;b<this.allElements.length;b++){var c=this.allElements[b];if(c.type!=d){continue}if(c.id!=e){continue}return c}return null};DestinationAutoComplete.prototype._set=function(c,d){var b=this._getFromAllElements(c,d);if(!b){return}this.activeElement=b;this.inputElement.value=b.name};DestinationAutoComplete.prototype.set=function(c,d){if(this.loadingDone){this._set(c,d);return}var b=this;this.onload=function(){b._set(c,d)};this.load()};DestinationAutoComplete.prototype.citymapMoveTo=function(d,b,c){if("undefined"==typeof CityMap){return}CityMap.moveCurrentMapTo(d,b,c)};function DateSelect(c){this._id=c;var b=this;Calendar.setup({daFormat:"%Y-%m-%d",displayArea:b._id+"_value",button:b._id+"_button",range:new Array(this._getFirstDate().getFullYear(),this._getLastDate().getFullYear()),onUpdate:function(d){b._updateCalendar(d)},dateStatusFunc:function(d){return b._getDateStatus(d)},showsTime:false,singleClick:true});this.setRange(this.formatDate(this._getFirstDate()),this.formatDate(this._getLastDate()));this.set(this.formatDate(this._getFirstDate()));document.getElementById(this._id+"_Ym").onchange=function(){b._updateSelect()};document.getElementById(this._id+"_d").onchange=function(){b._updateSelect()}}DateSelect.prototype.set=function(c){var b=typeof c=="string"?this.parseDate(c):c;if(b>=this._getFirstDate()&&b<=this._getLastDate()){this._setCalendar(b);this._setSelect(b)}};DateSelect.prototype.get=function(){return this.formatDate(this.parseDate(document.getElementById(this._id+"_value").innerHTML))};DateSelect.prototype._getFirstDate=function(){var c=document.getElementById(this._id+"_Ym");var b=c.options[0].value+"-01";return this.parseDate(b)};DateSelect.prototype._getLastDate=function(){var e=document.getElementById(this._id+"_Ym");var b=e.options[e.options.length-1].value+"-01";var c=this.parseDate(b);c.setDate(c.getMonthDays());return c};DateSelect.prototype._updateCalendar=function(b){this._setCalendar(b.date);this._setSelect(b.date);if(this._id=="checkindate"){this._calendarSetCheckinRange()}else{this._calendarSetCheckoutRange()}this._onchange()};DateSelect.prototype._updateSelect=function(){var c=this._getSelectedValue(document.getElementById(this._id+"_Ym"));var d=this.parseDate(c+"-"+this._getSelectedValue(document.getElementById(this._id+"_d")));var b=this.parseDate(c+"-01");if(d.getMonth()!=b.getMonth()){d=b;d.setDate(d.getMonthDays())}if(d<this._rangeStartDate){d=this._rangeStartDate}else{if(d>this._rangeEndDate){d=this._rangeEndDate}}this._setSelect(d);this._setCalendar(d);if(this._id=="checkindate"){this._calendarSetCheckinRange()}else{this._calendarSetCheckoutRange()}this._onchange()};DateSelect.prototype._calendarSetCheckinRange=function(){var e=Date.parseDate(checkin.get(),"%Y-%m-%d");var c=Date.parseDate(checkout.get(),"%Y-%m-%d");var b=parseInt((c.getTime()-e.getTime())/86400000);e.setDate(e.getDate()+parseInt(servicetime));if(b<=0){checkout.set(e.print("%Y-%m-%d"))}};DateSelect.prototype._calendarSetCheckoutRange=function(){var e=Date.parseDate(checkin.get(),"%Y-%m-%d");var c=Date.parseDate(checkout.get(),"%Y-%m-%d");var b=parseInt((c.getTime()-e.getTime())/86400000);if(b<=0){e.setDate(e.getDate()+parseInt(servicetime));checkout.set(e.print("%Y-%m-%d"))}};DateSelect.prototype._setSelect=function(c){var b=c.getFullYear()+"-"+this._formatDatePart(c.getMonth()+1);var f=""+c.getDate();var e=this;this._setSelectByValue(document.getElementById(e._id+"_Ym"),b);this._setSelectByValue(document.getElementById(e._id+"_d"),f)};DateSelect.prototype._setCalendar=function(b){document.getElementById(this._id+"_value").innerHTML=this.formatDate(b)};DateSelect.prototype.parseDate=function(e){var g=new String(e);var h=g.split("-");if(h.length!=3){return null}var d=h[0];var f=h[1].charAt(0)=="0"?parseInt(h[1].substr(1,1)):parseInt(h[1]);var b=h[2].charAt(0)=="0"?parseInt(h[2].substr(1,1)):parseInt(h[2]);var c=new Date(d,f-1,b);if(isNaN(c)){return null}c.setHours(0);c.setMinutes(0);c.setSeconds(0);c.setMilliseconds(0);return c};DateSelect.prototype.formatDate=function(b){return b.getFullYear()+"-"+this._formatDatePart(b.getMonth()+1)+"-"+this._formatDatePart(b.getDate())};DateSelect.prototype._formatDatePart=function(c){var b=new String(c);return b.length==1?"0"+b:b};DateSelect.prototype._setSelectByValue=function(b,d){if(!b.options){return}for(var c=0;c<b.options.length;c++){if(b.options[c].value!=d){continue}b.selectedIndex=c;return}};DateSelect.prototype._getSelectedValue=function(b){if(!b){return}return b.options[b.selectedIndex].value};DateSelect.prototype._getDateStatus=function(b){if(b<this._rangeStartDate||b>this._rangeEndDate){return true}return false};DateSelect.prototype._getMonthString=function(b){return"aaa"+b};DateSelect.prototype.setRange=function(b,e){var c=b?this.parseDate(b):this._rangeStartDate;var d=e?this.parseDate(e):this._rangeEndDate;if(c>=this._getFirstDate()){this._rangeStartDate=c}else{this._rangeStartDate=this._getFirstDate()}if(d<=this._getLastDate()){this._rangeEndDate=d}else{this._rangeEndDate=this._getLastDate()}};DateSelect.prototype.setStartOfRange=function(b){var c=b?this.parseDate(b):this._rangeStartDate;if(c>=this._getFirstDate()){this._rangeStartDate=c}else{this._rangeStartDate=this._getFirstDate()}};DateSelect.prototype._onchange=function(){if(this._onchangeCallback){this._onchangeCallback(this)}};DateSelect.prototype.setOnchangeCallback=function(b){this._onchangeCallback=b};function url_decode(c){var b=/\+/g;var d=getInternetExplorerVersion();c=c.replace(/%25/g,"%");if(d==7){c=c.replace("ó","%C3%B3")}return utf8_decode(unescape(String(c).replace(b," ")))}function utf8_decode(b){var d="";var e=0;var f=c1=c2=0;while(e<b.length){f=b.charCodeAt(e);if(f<128){d+=String.fromCharCode(f);e++}else{if((f>191)&&(f<224)){c2=b.charCodeAt(e+1);d+=String.fromCharCode(((f&31)<<6)|(c2&63));e+=2}else{c2=b.charCodeAt(e+1);c3=b.charCodeAt(e+2);d+=String.fromCharCode(((f&15)<<12)|((c2&63)<<6)|(c3&63));e+=3}}}return d};