DestiniaCalendar.prototype.today=new Date();function DestiniaCalendar(){var currentDay=eval(this.today.getDate()+1),currentMonth=this.today.getMonth(),currentYear=this.today.getFullYear();this.month=currentMonth+1;this.setType=function(type){switch(type){case 0:this.type=type;this.day_element=this.prefix+"_check"+this.action+"_day";this.month_element=this.prefix+"_month_year_check"+this.action;this.datepicker_element=this.prefix+"_datepicker-"+this.action;break;case 1:this.type=type;this.action=(this.action=="in")?1:2;this.day_element=this.prefix+this.action;this.month_element=this.prefix+"_med_"+this.action;this.datepicker_element=this.prefix+"_datepicker-"+this.action;break}};this.handleDates=function(date,checkin){var year=date.substring(6,10),month=date.substring(3,5),day=date.substring(0,2);var hiddenDay=document.getElementById(this.day_element);var hiddenMonthYear=document.getElementById(this.month_element);hiddenMonthYear.value=month+"/"+year;this.mostrarDias(this.month_element,this.select_container_id,this.day_element,this.day_element,1,1,checkin,day,hiddenDay);hiddenDay.value=day};this.loadDate=function(related_day_element,related_month_element){var day=jQuery("#"+this.day_element).val();var month_year=jQuery("#"+this.month_element).val();jQuery("#"+this.datepicker_element).val(day+"/"+month_year);if(related_day_element||related_month_element){jQuery("#"+this.datepicker_element).datepick("option",{minDate:jQuery("#"+related_day_element).val()+"/"+jQuery("#"+related_month_element).val()})}return day+"/"+month_year}}HotelCalendar.prototype=new DestiniaCalendar;function HotelCalendar(){this.mostrarDias=function(b,a,g,f,e,h,d,i,c){if(this.type==0){mostrarDias(b,a,g,f,e,h,d,i)}else{if(this.type==1){c.value=i;switchSelect(this.month_element,a,this.action,2010,this.prefix+"calendar")}}};this.changeCheckOutDate=function(){changeCheckOutDate()};this.changeNumNights=function(){changeNumNights()}}function ComposedCalendar(b,a){this.calendarIn=new HotelCalendar;this.calendarIn.action="in";this.calendarIn.prefix=b;this.calendarIn.setType(a);this.calendarOut=new HotelCalendar;this.calendarOut.action="out";this.calendarOut.prefix=b;this.calendarOut.setType(a);this.month=this.calendarIn.month;this.handleInDates=function(c){this.calendarIn.select_container_id=inoptions;this.calendarIn.handleDates(c,true);this.calendarIn.changeCheckOutDate();this.calendarIn.changeNumNights()};this.handleOutDates=function(c){this.calendarOut.select_container_id=outoptions;this.calendarOut.handleDates(c,false);this.calendarOut.changeNumNights()};this.loadDateIn=function(){this.calendarIn.loadDate()};this.loadDateOut=function(){var c=this.calendarOut.loadDate(this.calendarIn.day_element,this.calendarIn.month_element);this.showMonth(parseInt(c.substring(3,5),10),this.calendarOut.datepicker_element)};this.updateCalendarDates=function(d,c){if(!d){this.loadDateIn()}if(!c){this.loadDateOut()}};this.showMonth=function(c,d){if(c!=this.month){jQuery("#"+d).datepick("option",{monthsOffset:1})}else{jQuery("#"+d).datepick("option",{monthsOffset:0})}}};
