function scelta(form){$('#formVolo').hide();$('#formVHA').hide();$('#formHotel').hide();$('#formVH').hide();$('#formVacanze').hide();$('#formAuto').hide();$('#formVA').hide();$('#formAttr').hide();switch(form){case"formVolo":$('#formVolo').show();break;case"formHotel":$('#formHotel').show();break;case"formAuto":$('#formAuto').show();break;case"formAttr":$('#formAttr').show();break;case"formVHA":$('#formVHA').show();break;case"formVH":$('#formVH').show();break;case"formVA":$('#formVA').show();break;case"formVacanze":$('#formVacanze').show();break;}}
function makeCalendar(field,trigger,right_cal){return Calendar.setup({inputField:field,dateFormat:"%d/%m/%y",trigger:trigger,min:new Date(),onSelect:function(){if(right_cal){right_cal.args.min=Calendar.intToDate(this.selection.get());right_cal.moveTo(right_cal.args.min,false);}
this.hide();}});}
function setUpCalendar(){var today=new Date();var day=24*60*60*1000;var date1=new Date(today.getTime()+(day*7));var date2=new Date(today.getTime()+(day*9));$('f_formvolo_from').value=Calendar.printDate(date1,"%d/%m/%y");$('f_formvolo_to').value=Calendar.printDate(date2,"%d/%m/%y");$('f_formhotel_from').value=Calendar.printDate(date1,"%d/%m/%y");$('f_formhotel_to').value=Calendar.printDate(date2,"%d/%m/%y");$('f_formauto_from').value=Calendar.printDate(date1,"%d/%m/%y");$('f_formauto_to').value=Calendar.printDate(date2,"%d/%m/%y");$('f_formattr_from').value=Calendar.printDate(date1,"%d/%m/%y");$('f_formattr_to').value=Calendar.printDate(date2,"%d/%m/%y");$('f_formvha_from').value=Calendar.printDate(date1,"%d/%m/%y");$('f_formvha_to').value=Calendar.printDate(date2,"%d/%m/%y");$('f_formvh_from').value=Calendar.printDate(date1,"%d/%m/%y");$('f_formvh_to').value=Calendar.printDate(date2,"%d/%m/%y");$('f_formva_from').value=Calendar.printDate(date1,"%d/%m/%y");$('f_formva_to').value=Calendar.printDate(date2,"%d/%m/%y");$('f_formvacanze_from').value=Calendar.printDate(date1,"%d/%m/%y");$('f_formvacanze_to').value=Calendar.printDate(date2,"%d/%m/%y");makeCalendar('f_formvolo_from','f_formvolo_from_trigger',makeCalendar('f_formvolo_to','f_formvolo_to_trigger',null));makeCalendar('f_formhotel_from','f_formhotel_from_trigger',makeCalendar('f_formhotel_to','f_formhotel_to_trigger',null));makeCalendar('f_formauto_from','f_formauto_from_trigger',makeCalendar('f_formauto_to','f_formauto_to_trigger',null));makeCalendar('f_formattr_from','f_formattr_from_trigger',makeCalendar('f_formattr_to','f_formattr_to_trigger',null));makeCalendar('f_formvha_from','f_formvha_from_trigger',makeCalendar('f_formvha_to','f_formvha_to_trigger',null));makeCalendar('f_formvh_from','f_formvh_from_trigger',makeCalendar('f_formvh_to','f_formvh_to_trigger',null));makeCalendar('f_formva_from','f_formva_from_trigger',makeCalendar('f_formva_to','f_formva_to_trigger',null));makeCalendar('f_formvacanze_from','f_formvacanze_from_trigger',makeCalendar('f_formvacanze_to','f_formvacanze_to_trigger',null));}
function initializeViaggi(){setUpCalendar();}
$(window).load(initializeViaggi);
