
		  function Modulo() {

		  var nome = document.modulo.nome.value;
		  var email = document.modulo.email.value;
		  var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
		  var richiesta = document.modulo.richiesta.value;
		
			   if ((nome == "") || (nome == "undefined")) {
				   alert("Inserire il Nome");
				   document.modulo.nome.focus();
				   return false;
				}else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
				  alert("Inserire un indirizzo e-mail corretto.");
				  document.modulo.email.select();
				  return false;
				}else if ((richiesta == "") || (richiesta == "undefined")) {
					  alert("Specificare una richiesta.");
					  document.modulo.richiesta.focus();
					  return false;
			    }
				//INVIA IL MODULO
				else {
				   document.modulo.action = "richiesta_post.php";
				   document.modulo.submit();
				}
		  }
		//--!>

		
function apri(url, w, h) {
var windowprops = "width=" + w + ",height=" + h;
popup = window.open(url,'remote',windowprops+',scrollbars=yes,resizable=no,location=no,menubar=no,status=yes');
}


//calendario
jQuery(function($){
  $.datepicker.regional['it'] = {
      clearText: 'Svuota', clearStatus: '',
      clearStatus: 'Cancella la data corrente',
      closeText: 'Chiudi', closeStatus: '',
      closeStatus: 'Chiudi senza cambiamenti',
      prevText: '&lt;Prec', prevStatus: '',
      prevStatus: 'Mostra il mese precedente',
      nextText: 'Succ&gt;', nextStatus: '',
      nextStatus: 'Mostra il mese successivo',
      currentText: 'Oggi', currentStatus: '',
      currentStatus: 'Mostra il mese corrente',
      monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
      monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'],
      monthStatus: 'Mostra un altro mese',
      yearStatus: 'Mostra un altro anno',
      weekHeader: 'Sm', weekStatus: '',
      weekStatus: 'Settimana dell\'anno',
      dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'],
      dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
      dayNamesMin: ['Do','Lu','Ma','Me','Gio','Ve','Sa'],
      dayStatus: 'Imposta DD come primo giorno della settimana',
      dateStatus: 'Seleziona DD, M d',
      dateFormat: 'dd/mm/yy', firstDay: 1,
      initStatus: 'Seleziona una data',
      isRTL: false
    };
  $.datepicker.setDefaults($.datepicker.regional['it']);
});

            $(document).ready(function() {
              $('#datepicker1').datepicker({
                minDate: 0,
                maxDate: '+3M +10',
                dateFormat: 'dd/mm/yy'
              });
              $('#datepicker2').datepicker({
                minDate: 0,
                maxDate: '+3M +10',
                dateFormat: 'dd/mm/yy'
              });
            });
//calendario FINE


//lightbox + slideshow
$(function() {
    $('#Contenitore a.lightbox').lightBox();
});

function slideSwitch() {
var $active = $('#multimediale IMG.active');

if ( $active.length == 0 ) $active = $('#multimediale IMG:last');

// use this to pull the images in the order they appear in the markup
var $next =  $active.next().length ? $active.next()
    : $('#slideshow IMG:first');

// uncomment the 3 lines below to pull the images in random order

// var $sibs  = $active.siblings();
// var rndNum = Math.floor(Math.random() * $sibs.length );
// var $next  = $( $sibs[ rndNum ] );


$active.addClass('last-active');

$next.css({opacity: 0.0})
    .addClass('active')
    .animate({opacity: 1.0}, 1000, function() {
        $active.removeClass('active last-active');
    });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});
//lightbox + slideshow FINE


function cambia_residence(choice) {
 if (choice == 1) {
 document.getElementById('monolocale').style.display="block";
 document.getElementById('res_1').style.backgroundColor="#9FC3C3";
 document.getElementById('res_1').style.color="#5F5F5F";

 document.getElementById('bilocale').style.display="none";
 document.getElementById('res_2').style.backgroundColor="#5F5F5F";
 document.getElementById('res_2').style.color="#9FC3C3";

 document.getElementById('trilocale').style.display="none";
 document.getElementById('res_3').style.backgroundColor="#5F5F5F";
 document.getElementById('res_3').style.color="#9FC3C3";

 document.getElementById('residence').style.display="none";
 document.getElementById('res_4').style.backgroundColor="#5F5F5F";
 document.getElementById('res_4').style.color="#9FC3C3";

 }
 if (choice == 2) {
 document.getElementById('monolocale').style.display="none";
 document.getElementById('res_1').style.backgroundColor="#5F5F5F";
 document.getElementById('res_1').style.color="#9FC3C3";

 document.getElementById('bilocale').style.display="block";
 document.getElementById('res_2').style.backgroundColor="#9FC3C3";
 document.getElementById('res_2').style.color="#5F5F5F";

 document.getElementById('trilocale').style.display="none";
 document.getElementById('res_3').style.backgroundColor="#5F5F5F";
 document.getElementById('res_3').style.color="#9FC3C3";

 document.getElementById('residence').style.display="none";
 document.getElementById('res_4').style.backgroundColor="#5F5F5F";
 document.getElementById('res_4').style.color="#9FC3C3";
 }
 if (choice == 3) {
 document.getElementById('monolocale').style.display="none";
 document.getElementById('res_1').style.backgroundColor="#5F5F5F";
 document.getElementById('res_1').style.color="#9FC3C3";

 document.getElementById('bilocale').style.display="none";
 document.getElementById('res_2').style.backgroundColor="#5F5F5F";
 document.getElementById('res_2').style.color="#9FC3C3";

 document.getElementById('trilocale').style.display="block";
 document.getElementById('res_3').style.backgroundColor="#9FC3C3";
 document.getElementById('res_3').style.color="#5F5F5F";

 document.getElementById('residence').style.display="none";
 document.getElementById('res_4').style.backgroundColor="#5F5F5F";
 document.getElementById('res_4').style.color="#9FC3C3";

 }
 if (choice == 4) {
 document.getElementById('monolocale').style.display="none";
 document.getElementById('res_1').style.backgroundColor="#5F5F5F";
 document.getElementById('res_1').style.color="#9FC3C3";

 document.getElementById('bilocale').style.display="none";
 document.getElementById('res_2').style.backgroundColor="#5F5F5F";
 document.getElementById('res_2').style.color="#9FC3C3";

 document.getElementById('trilocale').style.display="none";
 document.getElementById('res_3').style.backgroundColor="#5F5F5F";
 document.getElementById('res_3').style.color="#9FC3C3";

 document.getElementById('residence').style.display="block";
 document.getElementById('res_4').style.backgroundColor="#9FC3C3";
 document.getElementById('res_4').style.color="#5F5F5F";

 }

}

function cambia_hotel(choice) {
 if (choice == 1) {
 document.getElementById('executive').style.display="block";
 document.getElementById('hotel_1').style.backgroundColor="#9FC3C3";
 document.getElementById('hotel_1').style.color="#5F5F5F";

 document.getElementById('hotel').style.display="none";
 document.getElementById('hotel_2').style.backgroundColor="#5F5F5F";
 document.getElementById('hotel_2').style.color="#9FC3C3";

 document.getElementById('suite').style.display="none";
 document.getElementById('hotel_3').style.backgroundColor="#5F5F5F";
 document.getElementById('hotel_3').style.color="#9FC3C3";
 }
 if (choice == 2) {
 document.getElementById('hotel').style.display="none";
 document.getElementById('hotel_1').style.backgroundColor="#5F5F5F";
 document.getElementById('hotel_1').style.color="#9FC3C3";

 document.getElementById('suite').style.display="block";
 document.getElementById('hotel_2').style.backgroundColor="#9FC3C3";
 document.getElementById('hotel_2').style.color="#5F5F5F";

 document.getElementById('executive').style.display="none";
 document.getElementById('hotel_3').style.backgroundColor="#5F5F5F";
 document.getElementById('hotel_3').style.color="#9FC3C3";

 }
 if (choice == 3) {
 document.getElementById('suite').style.display="none";
 document.getElementById('hotel_1').style.backgroundColor="#5F5F5F";
 document.getElementById('hotel_1').style.color="#9FC3C3";

 document.getElementById('executive').style.display="none";
 document.getElementById('hotel_2').style.backgroundColor="#5F5F5F";
 document.getElementById('hotel_2').style.color="#9FC3C3";

 document.getElementById('hotel').style.display="block";
 document.getElementById('hotel_3').style.backgroundColor="#9FC3C3";
 document.getElementById('hotel_3').style.color="#5F5F5F";

 }

}
