function checkRelease(){var e=new Date();var a=e.getDate()+2;var b=document.get_country.check_in_month_year.value.split("/");var c=b[0];if((document.get_country.check_in_month_year.value<a)&&(c==e.getMonth()+1)){alert("Debe reservar con un periodo minimo de 48 horas")}else{this.form.submit()}}Calendar._DN=new Array("domenica","luned?","marted?","mercoled?","gioved?","venerd?","sabato","domenica");Calendar._MN=new Array("gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre");Calendar._TT={};Calendar._TT.TOGGLE="Cambia presentazioni giorni settimana";Calendar._TT.PREV_MONTH="Prev. mese (cliccare per aprire menu)";Calendar._TT.GO_TODAY="Vedere Oggi";Calendar._TT.NEXT_MONTH="Prossimo mese (cliccare per aprire menu)";Calendar._TT.SEL_DATE="Seleziona data";Calendar._TT.PART_TODAY=" (oggi)";Calendar._TT.CLOSE="Chiudi";Calendar._TT.TODAY="Oggi";Calendar._TT.DEF_DATE_FORMAT="dd-mm-y";Calendar._TT.TT_DATE_FORMAT="D, M d";Calendar._TT.WK="sem";var oldLink=null;function setActiveStyleSheet(e,f){var d,c,b;for(d=0;(c=document.getElementsByTagName("link")[d]);d++){if(c.getAttribute("rel").indexOf("style")!=-1&&c.getAttribute("title")){c.disabled=true;if(c.getAttribute("title")==f){c.disabled=false}}}if(oldLink){oldLink.style.fontWeight="normal"}oldLink=e;return false}function selected(f,b){var d=b.split("/");var a=d[0];var e=d[1];var c=d[2];f.sel.value=a;miForm=document.getElementById(f.formName);switch(f.sel.id){case"sel1":document.get_country.check_in_month_year.value=e+"/"+c;break;case"sel2":document.get_country.check_out_month_year.value=e+"/"+c;break;case"sel_1_in_field":miForm.check_in_date.value=a+"/"+e+"/"+c;break;case"sel_1_out_field":miForm.check_out_date.value=a+"/"+e+"/"+c;break;case"sel_2_in_field":miForm.check_in_day.value=a;miForm.check_in_month_year.value=e+"/"+c;break;case"sel_2_out_field":miForm.check_out_day.value=a;miForm.check_out_month_year.value=e+"/"+c;break;case"sel_3_in_field":miForm.check_in_day.value=a;miForm.check_in_month.value=e;miForm.check_in_year.value=c;break;case"sel_3_out_field":miForm.check_out_day.value=a;miForm.check_out_month.value=e;miForm.check_out_year.value=c;break;case"sel_0_in":miForm.check_in_0_date.value=a+"/"+e+"/"+c;break;case"sel_1_in":miForm.check_in_1_date.value=a+"/"+e+"/"+c;break;case"sel_2_in":miForm.check_in_2_date.value=a+"/"+e+"/"+c;break;case"sel_3_in":miForm.check_in_3_date.value=a+"/"+e+"/"+c;break;case"sel_4_in":miForm.check_in_4_date.value=a+"/"+e+"/"+c;break;case"sel_5_in":miForm.check_in_5_date.value=a+"/"+e+"/"+c;break;case"sel_6_in":miForm.check_in_6_date.value=a+"/"+e+"/"+c;break;case"sel_7_in":miForm.check_in_7_date.value=a+"/"+e+"/"+c;break}f.callCloseHandler();x=changeNumNights(f.sel.id,f.formName)}function closeHandler(a){a.hide()}function showCalendar(f,e,b){var a=new Date();var c=document.getElementById(f);if(calendar!=null&&typeof calendar=="object"){calendar.hide()}else{var d=new Calendar(true,a,selected,closeHandler);d.weekNumbers=false;d.formName=b;calendar=d;d.setRange(1900,2070);d.create()}calendar.setDateFormat(e);calendar.sel=c;calendar.showAtElement(c);return false}var MINUTE=60*1000;var HOUR=60*MINUTE;var DAY=24*HOUR;var WEEK=7*DAY;function isDisabled(b){var a=new Date();return(Math.abs(b.getTime()-a.getTime())/DAY)>10}function flatSelected(c,a){var b=document.getElementById("preview");b.innerHTML=a}function calculateDifference(b,e){var d=b.getTime()-e.getTime();var a=1000*60*60*24;var c=Math.round(d/a);return c}function changeNumNights(b,a){if(a=="get_country"){switch(b){case"sel1":checkout_date=new Date(document.get_country.check_out_month_year.value.substr(0,2)+"/"+document.get_country.checkout_day.value+"/"+document.get_country.check_out_month_year.value.substr(3,6));checkin_date=new Date(document.get_country.check_in_month_year.value.substr(0,2)+"/"+document.get_country.checkin_day.value+"/"+document.get_country.check_in_month_year.value.substr(3,6));break;case"sel2":checkout_date=new Date(document.get_country.check_out_month_year.value.substr(0,2)+"/"+document.get_country.checkout_day.value+"/"+document.get_country.check_out_month_year.value.substr(3,6));checkin_date=new Date(document.get_country.check_in_month_year.value.substr(0,2)+"/"+document.get_country.checkin_day.value+"/"+document.get_country.check_in_month_year.value.substr(3,6));break;case"sel_1_in_field":case"sel_1_out_field":checkout_date=new Date(document.get_country.check_out_date.value.substr(3,2)+"/"+document.get_country.check_out_date.value.substr(0,2)+"/"+document.get_country.check_out_date.value.substr(6,2));checkin_date=new Date(document.get_country.check_in_date.value.substr(3,2)+"/"+document.get_country.check_in_date.value.substr(0,2)+"/"+document.get_country.check_in_date.value.substr(6,2));break;case"sel_2_in_field":case"sel_2_out_field":checkout_date=new Date(document.get_country.check_out_month_year.value.substr(0,2)+"/"+document.get_country.check_out_day.value+"/"+document.get_country.check_out_month_year.value.substr(3,6));checkin_date=new Date(document.get_country.check_in_month_year.value.substr(0,2)+"/"+document.get_country.check_in_day.value+"/"+document.get_country.check_in_month_year.value.substr(3,6));break;case"sel_3_in_field":case"sel_3_out_field":checkout_date=new Date(document.get_country.check_out_month.value+"/"+document.get_country.check_out_day.value+"/"+document.get_country.check_out_year.value);checkin_date=new Date(document.get_country.check_in_month.value+"/"+document.get_country.check_in_day.value+"/"+document.get_country.check_in_year.value);break}num_nights=calculateDifference(checkout_date,checkin_date);document.get_country.num_nights.value=num_nights}};