calin=new YAHOO.widget.CalendarGroup("calin","calinContainer",{pages:2,close:true});calout=new YAHOO.widget.CalendarGroup("calout","caloutContainer",{pages:2,close:true});init=function(language){var today=new Date();var currentDay=today.getDate(),currentMonth=today.getMonth(),currentYear=today.getFullYear();var nextYear=eval(currentYear+1);var next=eval(currentDay+1);var firstDate=eval(currentMonth+1)+"/"+currentDay+"/"+currentYear;var secondDate=eval(currentMonth+1)+"/"+next+"/"+currentYear;var maxdate=eval(currentMonth)+"/"+currentDay+"/"+nextYear;var hiddenInDay=document.getElementById("hotelsearch_checkin_day");var hiddenInMonthYear=document.getElementById("hotelsearch_month_year_checkin");cMonth=(currentMonth<9)?"0"+eval(currentMonth+1):eval(currentMonth+1);cDate=cMonth+"/"+today.getFullYear();function handleTxt(type,args,obj){var dates=args[0];var date=dates[0];var year=date[0],month=date[1],day=date[2];var hiddenInDay=document.getElementById("hotelsearch_checkin_day");var hiddenInMonthYear=document.getElementById("hotelsearch_month_year_checkin");currentMonth=eval(today.getMonth()+1);resta=month-currentMonth;if(resta>=1){month1=month-1}else{month1=month}month1=(month1<10)?"0"+month1:month1;month=(month<10)?"0"+month:month;day=(day<10)?"0"+day:day;hiddenInMonthYear.value=month+"/"+year;mostrarDias("hotelsearch_month_year_checkin",inoptions,"hotelsearch_checkin_day","hotelsearch_checkin_day",1,1,1,day);hiddenInDay.value=day;checkinDate=month+"/"+day+"/"+year;checkinMonthYear=month+"/"+year;caloutpagedate=month1+"/"+year;calout.cfg.setProperty("pagedate",caloutpagedate);calout.cfg.setProperty("mindate",checkinDate);calout.cfg.setProperty("mindate",checkinDate,false);calout.cfg.setProperty("selected",checkinDate);calout.render();changeCheckOutDate();changeNumNights();calin.hide()}function handleTxt2(type,args,obj){var dates=args[0];var date=dates[0];var year=date[0],month=date[1],day=date[2];var hiddenOutDay=document.getElementById("hotelsearch_checkout_day");var hiddenOutMonthYear=document.getElementById("hotelsearch_month_year_checkout");month=(month<10)?"0"+month:month;day=(day<10)?"0"+day:day;hiddenOutMonthYear.value=month+"/"+year;mostrarDias("hotelsearch_month_year_checkout",outoptions,"hotelsearch_checkout_day","hotelsearch_checkout_day",2,1,0,day);hiddenOutDay.value=day;changeNumNights();calout.hide()}calin.selectEvent.subscribe(handleTxt,calin,true);calout.selectEvent.subscribe(handleTxt2,calout,true);if(language=="ar"||language=="ja"||language=="zt"){calin.cfg.setProperty("LOCALE_WEEKDAYS","long");calout.cfg.setProperty("LOCALE_WEEKDAYS","long")}else{calin.cfg.setProperty("LOCALE_WEEKDAYS","short");calout.cfg.setProperty("LOCALE_WEEKDAYS","short")}calin.cfg.setProperty("hide_blank_weeks",true);calout.cfg.setProperty("hide_blank_weeks",true);calin.cfg.setProperty("START_WEEKDAY",1);calout.cfg.setProperty("START_WEEKDAY",1);calin.cfg.setProperty("mindate",firstDate);calin.cfg.setProperty("selected",firstDate);calin.cfg.setProperty("maxdate",maxdate);calin.cfg.setProperty("close",true);calout.cfg.setProperty("mindate",secondDate);calout.cfg.setProperty("selected",secondDate);calout.cfg.setProperty("maxdate",maxdate);calout.cfg.setProperty("close",true);localeArrays=getLocaleLabels(language);localeProperties=getLocaleProperties();for(i=0;i<localeArrays.length;i++){calin.cfg.setProperty(localeProperties[i],localeArrays[i]);calout.cfg.setProperty(localeProperties[i],localeArrays[i])}calin.render();calout.render();YAHOO.util.Event.addListener("show1up","click",calin.show,calin,true);YAHOO.util.Event.addListener("show2up","click",calout.show,calout,true)};