function switchTab(a){for(var b=$$("#boxVoliHotel li.position"),c=$$("#boxVoliHotel div.content"),d=$$("#boxVoliHotel div.box_Tabbed")[0],f=0,e=0;e<b.length;e++)if(e==a-1){b[e].addClassName("selected");f+=b[e].clientHeight}else b[e].removeClassName("selected");for(e=0;e<c.length;e++)if(e==a-1){c[e].show();f+=c[e].clientHeight}else c[e].hide();d.setStyle({height:f+"px"})}
function scelta(a){$("formVolo").hide();$("formVHA").hide();$("formHotel").hide();$("formVH").hide();$("formVacanze").hide();$("formAuto").hide();$("formVA").hide();$("formAttr").hide();switch(a){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 shuffle(a){for(var b,c=[],d=0;d<a;d++)c[d]=d;for(d=c.length-1;d>0;d--){a=Math.floor(Math.random()*c.length);b=c[d];c[d]=c[a];c[a]=b}return c}
function showBoxIdee(){var a=$$("#boxIdee div.viaggivolihotel");if(a&&a.length>0){var b=Math.floor(Math.random()*a.length),c=b+1<a.length?b+1:0;a[b].removeClassName("viaggivolihotel");a[c].removeClassName("viaggivolihotel")}if((a=$$("#boxIdee div.viaggihotel"))&&a.length>0){b=Math.floor(Math.random()*a.length);a[b].removeClassName("viaggihotel")}}var prelinkt="http://it.wwte33.com/pubspec/scripts/eap.asp?GOTO=PACKAGEWIZ&eapid=794-30033&frairport=ROM&",postlink="&numadult=1&numroom=1&packagetype=2";
function getLinkDestination(a){return prelinkt+"destid="+a+"&destids="+a+postlink}function gotoDestination(a){a=a.options[a.selectedIndex].value;a!=""&&window.open(getLinkDestination(a)+"&rfrr=794.30033.MappamondoMenu.A2A1","_blank")}
function setLinkMappa(){for(var a=$$("#cartina area"),b=$$("#destinazioneViaggio optgroup"),c=new Hash,d=0;d<b.length;d++){var f=b[d].getAttribute("label");f&&c.set(f,b[d])}for(d=0;d<a.length;d++){f=a[d].getAttribute("alt");if(b=c.get(f)){Element.cleanWhitespace(b);b=b.childElements();f=Math.floor(Math.random()*b.length);b=b[f].getAttribute("value");a[d].href=getLinkDestination(b)+"&rfrr=794.30033.MappamondoRandom.A2A2"}}}
function makeCalendar(a,b,c){return Calendar.setup({inputField:a,dateFormat:"%d/%m/%y",trigger:b,min:new Date,onSelect:function(){if(c){c.args.min=Calendar.intToDate(this.selection.get());c.moveTo(c.args.min,false)}this.hide()}})}
function setUpCalendar(){var a=new Date,b=new Date(a.getTime()+6048E5);a=new Date(a.getTime()+7776E5);$("f_formvolo_from").value=Calendar.printDate(b,"%d/%m/%y");$("f_formvolo_to").value=Calendar.printDate(a,"%d/%m/%y");$("f_formhotel_from").value=Calendar.printDate(b,"%d/%m/%y");$("f_formhotel_to").value=Calendar.printDate(a,"%d/%m/%y");$("f_formauto_from").value=Calendar.printDate(b,"%d/%m/%y");$("f_formauto_to").value=Calendar.printDate(a,"%d/%m/%y");$("f_formattr_from").value=Calendar.printDate(b,
"%d/%m/%y");$("f_formattr_to").value=Calendar.printDate(a,"%d/%m/%y");$("f_formvha_from").value=Calendar.printDate(b,"%d/%m/%y");$("f_formvha_to").value=Calendar.printDate(a,"%d/%m/%y");$("f_formvh_from").value=Calendar.printDate(b,"%d/%m/%y");$("f_formvh_to").value=Calendar.printDate(a,"%d/%m/%y");$("f_formva_from").value=Calendar.printDate(b,"%d/%m/%y");$("f_formva_to").value=Calendar.printDate(a,"%d/%m/%y");$("f_formvacanze_from").value=Calendar.printDate(b,"%d/%m/%y");$("f_formvacanze_to").value=
Calendar.printDate(a,"%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()}Event.observe(window,"load",initializeViaggi);
