var booking={env:{b_simple_weekdays:['lu','ma','mi','ju','vi','sa','do'],b_simple_weekdays_for_js:['lun','mar','mié','jue','vie','sáb','dom'],b_long_weekdays:['lunes','martes','miércoles','jueves','viernes','sábado','domingo']}}
function addzero(value)
{while(value.length<2)value=String("0")+value;return value;}
function checkDateOrder(frm,ci_day,ci_month_year,co_day,co_month_year){if(document.getElementById){var frm=document.getElementById(frm);var my=frm[ci_month_year].value.split("-");var ci=new Date(my[0],my[1]-1,frm[ci_day].value,12,0,0,0);my=frm[co_month_year].value.split("-");var co=new Date(my[0],my[1]-1,frm[co_day].value,12,0,0,0);if(ci>=co){co.setTime(ci.getTime()+1000*60*60*24);frm[co_day].value=co.getDate();var com=co.getMonth()+1;frm[co_month_year].value=co.getFullYear()+"-"+com;}}}
var calendar=new Object();var tr=new Object();tr.nextMonth="Mes siguiente";tr.prevMonth="Mes anterior";tr.closeCalendar="Cerrar calendario";tr.pressCtlD="Utiliza control-d o selecciona favoritos / agregar en tu navegador";tr.pressCtlP="Utiliza control-p o elige archivo / imprimir";tr.url="http://www.booking.com/index.es.html?aid=341312;label=vl;sid=189b94bcbede651e6baa52947255a90c;tmpl=searchbox";tr.title="Booking.com: Bienvenido";tr.icons="http://q.bstatic.com/static/img";var months=['enero','febrero','marzo','abril','mayo','junio','julio','agosto','septiembre','octubre','noviembre','diciembre'];var $t_hotels='Hoteles'.toLowerCase();var $t_hotels_around='Hoteles cerca de'.toLowerCase().replace(/ /g,'&#160;');var b_today="hoy";var day="d&iacute;a";Date.MILLISECONDS_PER_DAY=Date.prototype.MILLISECONDS_PER_DAY=86400000;var browser=navigator.appName
var version=navigator.appVersion
var startstring=parseFloat(version.indexOf("MSIE"))+1
var browserverion=parseFloat(version.substring(startstring+4,startstring+7))
var isIE5=((browser=="Microsoft Internet Explorer")&&(browserverion<6))?true:false;var isIE6=((browser=="Microsoft Internet Explorer")&&(browserverion>5.5)&&(browserverion<6))?true:false;var destination=document.getElementById('destination');destination.onblur=function(){if(!this.value){this.value=this.getAttribute('title');this.className+=' blur';}}
destination.onfocus=function(){if(this.value==this.getAttribute('title')){this.value='';this.className=this.className.replace(/ blur/,'');}}
destination.onblur();function tickCheckBox(el){if(document.getElementById){if(document.getElementById(el)){document.getElementById(el).checked=false;}}
return true;}
Date.prototype.getTwoDigitMonth=function(){var month=(this.getMonth()+1).toFixed().toString();if(month.length==1){month='0'+month;}
return month;};function checkDateOrder(me,ci_day,ci_month_year,co_day,co_month_year){var
frm=document.getElementById('frm'),my,ci=new Date(0),co=new Date(0),com,today=new Date();if(frm[ci_day].value!=='0')
{ci.setDate(frm[ci_day].value);}
if(frm[ci_month_year].value!=='0')
{my=frm[ci_month_year].value.split("-");ci.setFullYear(my[0]);ci.setMonth(my[1]-1);}
ci.setHours(12);ci.setMinutes(0);ci.setSeconds(0);if(frm[co_day].value!=='0')
{co.setDate(frm[co_day].value);}
if(frm[co_month_year].value!=='0')
{my=frm[co_month_year].value.split("-");co.setFullYear(my[0]);co.setMonth(my[1]-1);}
co.setHours(12);co.setMinutes(0);co.setSeconds(0);if(frm[ci_month_year].value!=='0')
{while(ci.getMonth()!=frm[ci_month_year].value.split("-")[1]-1)
{ci.setDate(ci.getDate()-1);frm[ci_day].value=ci.getDate();}
var cim=ci.getMonth()+1;frm[ci_month_year].value=ci.getFullYear()+"-"+cim;}
if(ci>=co)
{co.setTime(ci.getTime()+Date.prototype.MILLISECONDS_PER_DAY);com=co.getMonth()+1;if(frm[ci_day].value!=='0')
{frm[co_day].value=co.getDate();}
if(frm[ci_month_year].value!=='0')
{frm[co_month_year].value=co.getFullYear()+"-"+com;}}}
function updateDaySelect(me)
{if(!booking.env.b_simple_weekdays_for_js)
{return;}
var frm=document.getElementById('frm');if(frm.getAttribute('id')!=='frm'&&frm.className!=='availForm')
{return;}
if(!frm.checkin_monthday||!frm.checkout_monthday||!frm.checkin_year_month||!frm.checkout_year_month)
{return;}
if(frm.checkin_monthday.value==='0'&&frm.checkout_monthday.value==='0'&&frm.checkin_year_month.value==='0'&&frm.checkout_year_month.value==='0')
{return;}
var
ci_d=frm.checkin_monthday,co_d=frm.checkout_monthday,ci_my,co_my,todaysDate;if(frm.checkin_year_month.value!=='0')
{ci_my=frm.checkin_year_month.value.split("-");}
else
{todaysDate=new Date();ci_my=[todaysDate.getFullYear(),todaysDate.getTwoDigitMonth()];}
if(frm.checkout_year_month.value!=='0')
{co_my=frm.checkout_year_month.value.split("-");}
else
{todaysDate=new Date();co_my=[todaysDate.getFullYear(),todaysDate.getTwoDigitMonth()];}
var
ci_sel=Math.max(ci_d.selectedIndex,0),co_sel=Math.max(co_d.selectedIndex,0),ci_sel_value=ci_d[ci_sel].value,co_sel_value=co_d[co_sel].value,monthDays=[],opt,i;ci_d.innerHTML='';co_d.innerHTML='';var MonthdayPromptOption=function()
{this.option={"_this":this,"@selected":"selected","@class":"day prompt site_experiment_encourage_date_entry_2","@value":0,"#text":"d&iacute;a"};};if(ci_sel_value==='0')
{buildHtmlNode(new MonthdayPromptOption(),ci_d).selected=true;}
if(co_sel_value==='0')
{buildHtmlNode(new MonthdayPromptOption(),co_d).selected=true;}
function writeMonthdaysOptions(numberOfMonthdaysToShow,yearMonthSelectElement,monthDaysArray,monthDaysSelectElement,monthDaySelectValue)
{var i,optionElementInnerHTML,optionElement;for(i=0;i<numberOfMonthdaysToShow;i++)
{optionElement=document.createElement('option');optionElementInnerHTML=i+1;if(yearMonthSelectElement.value!=='0')
{optionElementInnerHTML=monthDaysArray[i]+' '+optionElementInnerHTML;}
optionElement.innerHTML=optionElementInnerHTML;optionElement.value=(i+1);if(i>0&&monthDaySelectValue==i+1)
{optionElement.defaultSelected=optionElement.selected=true;}
monthDaysSelectElement.appendChild(optionElement);}}
monthDays=buildDaysForMonth(ci_my[0],ci_my[1]);var numberOfMonthdaysToShow=31;if(frm.checkin_year_month.value!=='0')
{numberOfMonthdaysToShow=monthDays.length;}
writeMonthdaysOptions(numberOfMonthdaysToShow,frm.checkin_year_month,monthDays,ci_d,ci_sel_value);monthDays=buildDaysForMonth(co_my[0],co_my[1]);numberOfMonthdaysToShow=31;if(frm.checkout_year_month.value!=='0')
{numberOfMonthdaysToShow=monthDays.length;}
writeMonthdaysOptions(numberOfMonthdaysToShow,frm.checkout_year_month,monthDays,co_d,co_sel_value);if(isIE6){ci_d.value=ci_sel_value;co_d.value=co_sel_value;}}
function buildDaysForMonth(year,month)
{var monthDate=new Date(year,month-1);var orgMonth=monthDate.getMonth();var dayArray=[],weekDay;while(monthDate.getMonth()==orgMonth)
{weekDay=(monthDate.getDay()==0)?6:(monthDate.getDay()-1);dayArray.push(booking.env.b_simple_weekdays_for_js[weekDay]);monthDate.setDate(monthDate.getDate()+1);}
return dayArray;}
function buildHtmlNode(elementsObject,targetNode,refChild)
{var
key,counter,found,newElement,newNode;for(key in elementsObject)
{if(elementsObject.hasOwnProperty(key))
{var
prefix=key.substring(0,1),primaryKey=key.substring(1);if(prefix!='_')
{if(prefix=='@')
{if(!targetNode.getAttribute(primaryKey))
{targetNode.setAttribute(primaryKey,elementsObject[key]);}}
else
{if(prefix=='#')
{if(primaryKey=='text')
{found=false;if(targetNode.childNodes&&targetNode.childNodes.length>0)
{counter=0;while(counter<targetNode.childNodes.length&&!found)
{if(targetNode.childNodes[counter].nodeType==Node.TEXT_NODE&&targetNode.childNodes[counter].nodeValue==elementsObject[key])
{found=true;}
counter++;}}
if(!found)
{if(elementsObject[key].indexOf("\n")==-1)
{newNode=document.createTextNode(elementsObject[key]);if(refChild)
{targetNode.insertBefore(newNode,refChild);}
else
{targetNode.appendChild(newNode);}}
else
{var newNodeParts=elementsObject[key].split("\n");for(var i=0;i<newNodeParts.length;i++)
{if(newNodeParts[i].match(/\d\*$/))
{lastSpace=newNodeParts[i].lastIndexOf(" ");newNodeString=newNodeParts[i].substring(0,lastSpace);starImgSrc='http://q.bstatic.com/static/img/icons/stars/'+newNodeParts[i].substr(lastSpace+1,1)+'sterren-small.png';}
else
{newNodeString=newNodeParts[i];starImgSrc='';}
newNode=document.createTextNode(newNodeString);if(refChild)
{targetNode.insertBefore(newNode,refChild);if(starImgSrc)
{newImg=document.createElement('img');newImg.setAttribute('src',starImgSrc);newImg.className="stars";targetNode.insertBefore(newImg,refChild);}}
else
{targetNode.appendChild(newNode);if(starImgSrc)
{newImg=document.createElement('img');newImg.setAttribute('src',starImgSrc);newImg.className="stars";targetNode.appendChild(newImg);}}
if(i<newNodeParts.length-1)
{newBR=document.createElement("br");if(refChild)
{targetNode.insertBefore(newBR,refChild);}
else
{targetNode.appendChild(newBR);}}}}}}
else
{if(primaryKey=='cdata')
{targetNode.appendChild(document.createCDATASection(elementsObject[key]));}}}
else
{if(targetNode)
{if(elementsObject[key].length>0)
{for(counter=0;counter<elementsObject[key].length;counter++)
{if(elementsObject[key][counter])
{if(!elementsObject[key][counter]._node)
{newElement=document.createElement(key);elementsObject[key][counter]._node=newElement;var r=counter+1;while(r<elementsObject[key].length&&!refChild)
{if(elementsObject[key][r])
{refChild=elementsObject[key][r]._node;}
r++;}
if(refChild)
{newNode=targetNode.insertBefore(elementsObject[key][counter]._node,refChild);}
else
{newNode=targetNode.appendChild(elementsObject[key][counter]._node);}
arguments.callee(elementsObject[key][counter],newNode);newElement._elementTree=elementsObject[key][counter];}
else
{arguments.callee(elementsObject[key][counter],elementsObject[key][counter]._node);}}}}
else
{if(elementsObject[key].length!==0)
{if(!elementsObject[key]._node)
{newElement=document.createElement(key);elementsObject[key]._node=newElement;if(refChild)
{newNode=targetNode.insertBefore(elementsObject[key]._node,refChild);}
else
{newNode=targetNode.appendChild(elementsObject[key]._node);}
arguments.callee(elementsObject[key],newNode);newElement._elementTree=elementsObject;}
else
{arguments.callee(elementsObject[key],elementsObject[key]._node);}}}}
else
{if(!elementsObject[key]._node)
{arguments.callee(elementsObject[key],elementsObject[key]._node=targetNode=document.createElement(key));}
else
{arguments.callee(elementsObject[key],elementsObject[key]._node);}}}}}}}
return targetNode;};var td;function buildCal(y,m,d)
{var daysInMonth=[31,0,31,30,31,30,31,31,30,31,30,31];td=new Date();if(!y)
{y=td.getFullYear();}
if(!m)
{m=td.getMonth()+1;}
if(!d)
{d=td.getDate;}
var dt=calendar.caldt;var mDate=new Date(y,m-1,1);var firstMonthDay=mDate.getDay();daysInMonth[1]=(((mDate.getFullYear()%100!=0)&&(mDate.getFullYear()%4==0))||(mDate.getFullYear()%400==0))?29:28;var t='<table class="caltable" cellspacing="0"><tr>';t+='<td class="calheader" colspan="7" class="monthYear">';if(y==td.getFullYear()&&m==td.getMonth()+1)
{t+='<img class="calNoPrevMonth" src="'+tr.icons+'/transparent.png" width="24" height="24" alt="'+tr.prevMonth+'" />';}
else
{t+='<a class="calPrevMonth" href="" onclick="prevMonth( '+y+','+m+' ); return false;" title="'+tr.prevMonth+'"><img src="'+tr.icons+'/transparent.png" width="24" height="24" alt="'+tr.prevMonth+'" /></a>';}
t+='&nbsp;<select name="ym" onchange="goYearMonth( this.options[this.selectedIndex].value );">';var mn=td.getMonth()+1;var yr=td.getFullYear();var last_month=0;for(n=0;n<=11;n++)
{t+='<option value="'+yr+'-'+mn+'"';if(mn==m&&yr==y)
{t+=' selected="selected"';last_month=1;}
else
{last_month=0;}
t+='>'+months[mn-1]+' '+yr+'</option>';mn++;if(mn>12)
{mn=1;yr++;}}
t+=' </select>&nbsp;';if(last_month==1)
{t+='<img class="calNoNextMonth" src="'+tr.icons+'/transparent.png" width="24" height="24" alt="'+tr.nextMonth+'" />';}
else
{t+='<a class="calNextMonth" href="" onclick="nextMonth( '+y+','+m+' ); return false;" title="'+tr.nextMonth+'"><img src="'+tr.icons+'/transparent.png" width="24" height="24" alt="'+tr.nextMonth+'" /></a>';}
t+='</td></tr>';t+='<tr class="dayNames">';var cl;for(dn=0;dn<7;dn++)
{cl='';if((dn%7==5)||(dn%7==6))
{cl+=' weekend';}
t+='<td class="'+cl+'">'+booking.env.b_simple_weekdays[dn]+'</td>';}
t+='</tr><tr class="days">';for(i=1;i<=42;i++)
{var x=i-(firstMonthDay+6)%7;if(x>daysInMonth[m-1]||x<1)
{x='&nbsp;';}
cl='';var href=0;if((i%7==0)||(i%7==6))
{cl+=' weekend';}
if(x>0)
{var xDay=new Date(y,m-1,x);if((xDay.getFullYear()==y)&&(xDay.getMonth()+1==m)&&(xDay.getDate()==d))
{cl+=' selected';href=1;}
if((xDay.getFullYear()==td.getFullYear())&&(xDay.getMonth()==td.getMonth())&&(xDay.getDate()==td.getDate()))
{cl+=' today';href=1;}
else
{if(xDay>td)
{cl+=' future';href=1;}
else
{if(xDay<td)
{cl+=' past';}}}}
t+='<td class="'+cl+'">';if(href)
{t+='<a href="#" onclick="pickDate( '+y+','+m+','+x+',\''+dt+'\' ); return false;">'+x+'</a>';}
else
{t+=x;}
t+='</td>';if(((i)%7==0)&&(i<36))
{t+='</tr><tr class="days">';}}
t+='</tr><tr><td colspan="7"><a href="#" onclick="closeCal(); return false;">'+tr.closeCalendar+'</a></td></tr></table>';document.getElementById("calendar").innerHTML=t;}
function showCalendar(me,calId,dt)
{getDimensions(me);if(document.getElementById)
{var c=document.getElementById(calId);var i=getChildImage(me);var f=document.getElementById('frm');calendar.cal=c;calendar.caldt=dt;calendar.calf=f;var my=f[dt+'_year_month'].value.split("-");y=my[0];m=my[1];d=f[dt+'_monthday'].value;if(y==='0')
{y=new Date().getFullYear();}
buildCal(y,m,d);var box=getDimensions(i);var
left=box.x,top=(box.y+i.offsetHeight);c.style.left=0+'px';c.style.top=0+'px';c.style.display="block";}}
function closeCal()
{calendar.cal.style.display='none';}
function prevMonth(y,m)
{if(new Date(y,m-1,1)<td)
{return;}
if(m>1)
{m--;}
else
{m=12;y--;}
buildCal(y,m);}
function nextMonth(y,m)
{if(m<12)
{m++;}
else
{m=1;y++;}
buildCal(y,m);}
function goYearMonth(ym)
{var ymlist=ym.split("-");buildCal(ymlist[0],ymlist[1]);}
function pickDate(y,m,d,dt)
{var f=calendar.calf;var dt=calendar.caldt;f[dt+'_year_month'].value=y+"-"+m;f[dt+'_monthday'].value=d;tickCheckBox('availcheck');if(dt=="checkin")
{checkDateOrder(f,'checkin_monthday','checkin_year_month','checkout_monthday','checkout_year_month');}
closeCal();updateDaySelect(f);}
function initDaySelect()
{var forms=document.getElementsByTagName('form');for(var i=0;i<forms.length;i++)
{if(forms[i].checkin_monthday)
{updateDaySelect(forms[i]);}}}
function updateDaySelect(me)
{if(!booking.env.b_simple_weekdays_for_js)
{return;}
var frm=document.getElementById('frm');if(frm.getAttribute('id')!=='frm'&&frm.className!=='availForm')
{return;}
if(!frm.checkin_monthday||!frm.checkout_monthday||!frm.checkin_year_month||!frm.checkout_year_month)
{return;}
if(frm.checkin_monthday.value==='0'&&frm.checkout_monthday.value==='0'&&frm.checkin_year_month.value==='0'&&frm.checkout_year_month.value==='0')
{return;}
var
ci_d=frm.checkin_monthday,co_d=frm.checkout_monthday,ci_my,co_my,todaysDate;if(frm.checkin_year_month.value!=='0')
{ci_my=frm.checkin_year_month.value.split("-");}
else
{todaysDate=new Date();ci_my=[todaysDate.getFullYear(),todaysDate.getTwoDigitMonth()];}
if(frm.checkout_year_month.value!=='0')
{co_my=frm.checkout_year_month.value.split("-");}
else
{todaysDate=new Date();co_my=[todaysDate.getFullYear(),todaysDate.getTwoDigitMonth()];}
var
ci_sel=Math.max(ci_d.selectedIndex,0),co_sel=Math.max(co_d.selectedIndex,0),ci_sel_value=ci_d[ci_sel].value,co_sel_value=co_d[co_sel].value,monthDays=[],opt,i;ci_d.innerHTML='';co_d.innerHTML='';var MonthdayPromptOption=function()
{this.option={"_this":this,"@selected":"selected","@class":"day prompt site_experiment_encourage_date_entry_2","@value":0,"#text":day};};if(ci_sel_value==='0')
{buildHtmlNode(new MonthdayPromptOption(),ci_d).selected=true;}
if(co_sel_value==='0')
{buildHtmlNode(new MonthdayPromptOption(),co_d).selected=true;}
function writeMonthdaysOptions(numberOfMonthdaysToShow,yearMonthSelectElement,monthDaysArray,monthDaysSelectElement,monthDaySelectValue)
{var i,optionElementInnerHTML,optionElement;for(i=0;i<numberOfMonthdaysToShow;i++)
{optionElement=document.createElement('option');optionElementInnerHTML=i+1;if(yearMonthSelectElement.value!=='0')
{optionElementInnerHTML=monthDaysArray[i]+' '+optionElementInnerHTML;}
optionElement.innerHTML=optionElementInnerHTML;optionElement.value=(i+1);if(i>0&&monthDaySelectValue==i+1)
{optionElement.defaultSelected=optionElement.selected=true;}
monthDaysSelectElement.appendChild(optionElement);}}
monthDays=buildDaysForMonth(ci_my[0],ci_my[1]);var numberOfMonthdaysToShow=31;if(frm.checkin_year_month.value!=='0')
{numberOfMonthdaysToShow=monthDays.length;}
writeMonthdaysOptions(numberOfMonthdaysToShow,frm.checkin_year_month,monthDays,ci_d,ci_sel_value);monthDays=buildDaysForMonth(co_my[0],co_my[1]);numberOfMonthdaysToShow=31;if(frm.checkout_year_month.value!=='0')
{numberOfMonthdaysToShow=monthDays.length;}
writeMonthdaysOptions(numberOfMonthdaysToShow,frm.checkout_year_month,monthDays,co_d,co_sel_value);if(isIE6){ci_d.value=ci_sel_value;co_d.value=co_sel_value;}}
function buildDaysForMonth(year,month)
{var monthDate=new Date(year,month-1);var orgMonth=monthDate.getMonth();var dayArray=[],weekDay;while(monthDate.getMonth()==orgMonth)
{weekDay=(monthDate.getDay()==0)?6:(monthDate.getDay()-1);dayArray.push(booking.env.b_simple_weekdays_for_js[weekDay]);monthDate.setDate(monthDate.getDate()+1);}
return dayArray;}
function switchDateStack(me,page){var stackPage=me;var testMe=me.parentNode;try{while(testMe.nodeName!='div'){stackPage=testMe;testMe=testMe.parentNode;}}catch(e){}
var stackCount=0;while(stackPage){if(stackPage.nodeName.toLowerCase()=='div'){stackCount++;if(stackCount==page){stackPage.style.display='block';}else{stackPage.style.display='none';}}
stackPage=stackPage.nextSibling;}}
function getChildImage(contextElm)
{contextElm=contextElm.firstChild;while(contextElm.nodeName.toLowerCase()!='img'&&contextElm.nextSibling)
{contextElm=contextElm.nextSibling;}
return contextElm;}
function getDimensions(elm){var box={x:0,y:0,w:0,h:0};if(document.getBoxObjectFor){var boxRef=document.getBoxObjectFor(elm);box.x=boxRef.x;box.y=boxRef.y;box.w=boxRef.width;box.h=boxRef.height;}
else if(elm.getBoundingClientRect){var boxRef=elm.getBoundingClientRect();box.x=boxRef.left;box.y=boxRef.top;box.w=(boxRef.right-boxRef.left);box.h=(boxRef.bottom-boxRef.top);if(document.compatMode&&document.compatMode!='BackCompat'){box.x+=document.documentElement.scrollLeft-2;box.y+=document.documentElement.scrollTop-2;}
else if(!isIE5){box.x+=document.body.scrollLeft-2;box.y+=document.body.scrollTop-2;}}
else{box.w=elm.offsetWidth;box.h=elm.offsetHeight;while(elm){box.x+=elm.offsetLeft;box.y+=elm.offsetTop;if(elm.offsetParent)
elm=elm.offsetParent;else
break;}}
var cc;if(cc=document.getElementById('bodyconstraint'))
box.x-=cc.offsetLeft;return box;}
var currentDate=new Date();var currentYear=1900+currentDate.getYear();var dailyMS=24*60*60*1000;var arrivalDate=new Date(currentDate.getTime());var departureDate=new Date(currentDate.getTime()+1*dailyMS);var arrivalYear=1900+arrivalDate.getYear();var arrivalMonth=1+arrivalDate.getMonth();var arrivalDay=arrivalDate.getDate();var departureYear=1900+departureDate.getYear();var departureMonth=1+departureDate.getMonth();var departureDay=departureDate.getDate();var a=document.frm;if((a.checkin_monthday.selectedIndex==0)&&(a.checkout_monthday.selectedIndex==0)){a.checkin_monthday.options[arrivalDay-1].selected=true;a.checkout_monthday.options[departureDay-1].selected=true;}
var frm=document.getElementById('frm');var my=frm['b_checkin_month'].value.split("-");var ci=new Date(my[0],my[1]-1,frm['b_checkin_day'].value,12,0,0,0);my=frm['b_checkout_month'].value.split("-");var co=new Date(my[0],my[1]-1,frm['b_checkout_day'].value,12,0,0,0);if(ci>=co){co.setTime(ci.getTime()+1000*60*60*24);frm['b_checkout_day'].value=co.getDate();var com=co.getMonth()+1;frm['b_checkout_month'].value=co.getFullYear()+"-"+com;}
