jQuery.noConflict(); trattamenti = ""; hotelTrattamenti = ""; var selectedWeek; var values = new Array(); var inputs = new Array(); function addWaterMark(el){ try { values.push(el.value); el.addEvent('focus',function(){ if (el.value === values[inputs.indexOf(el)]){el.value = ''}; }); el.addEvent('blur',function(){ if(this.value === ''){el.value = values[inputs.indexOf(el)]}; }); } catch(e) {} }; jQuery(document).ready(function() { var curAdults = 0; var curRooms = 0; if (curAdults) { jQuery('select#form_adulti').val(curAdults); } if (curRooms) { jQuery('select#form_camere').val(curRooms); } jQuery('input.cerca').click(function (e) { e.preventDefault(); jQuery('form#box-quotation').submit(); return false; }); jQuery('input.watermark').each(function(){ addWaterMark(jQuery(this)); }); if(jQuery('input#form_datefromIR').length && jQuery('input#form_datetoIR').length) { jQuery('input#form_datefromIR').datepicker({ dateFormat: 'dd/mm/yy' , minDate: 0, defaultDate: 0, showOn: 'both', buttonImage: "/pw/images/calendar.png", //set the class 'week-highlight' for the whole week beforeShowDay: function(date){ var day = date.getDay(); return [true,( day == 0)?"sunday":( day == 6)?"saturday":'']; }, onSelect: function( selectedDate ) { var option = "minDate"; var instance = jQuery(this).data("datepicker"); jQuery.datepicker.parseDate(instance.settings.dateFormat ,selectedDate, instance.settings ); var date2 = jQuery(this).datepicker('getDate', '+1d'); date2.setDate(date2.getDate()+1); jQuery('input#form_datetoIR').datepicker( "option", option, date2); } }); jQuery('input#form_datetoIR').datepicker({ dateFormat: 'dd/mm/yy' , minDate: +1, defaultDate: +7, showOn: 'both', buttonImage: "/pw/images/calendar.png", //set the class 'week-highlight' for the whole week beforeShowDay: function(date){ var day = date.getDay(); return [true,( day == 0)?"sunday":( day == 6)?"saturday":'']; }, onSelect: function( selectedDate ) { var option = "maxDate"; var instance = jQuery(this).data("datepicker"); jQuery.datepicker.parseDate(instance.settings.dateFormat ,selectedDate, instance.settings ); var date2 = jQuery(this).datepicker('getDate', '-1d'); date2.setDate(date2.getDate()-1); jQuery('input#form_datefromIR').datepicker( "option", option, date2); } }); jQuery('input#form_datefromIR').datepicker('setDate','24/11/2017'); jQuery('input#form_datetoIR').datepicker('setDate','26/11/2017'); } trattamenti = jQuery('select[name=trattamento]').html(); hotelTrattamenti = { '1':'Hotel'} ; });