// JavaScript Document
	function newWin(url,width,height) {
	window.open(url,"remoteWin","width="+width+",height="+height+",resizable=0,menubar=0,status=0,scrollbars=1");
	}
	
	function newWin2(url,width,height) {
	window.open(url,"remoteWin","width="+width+",height="+height+",resizable=0,menubar=0,status=0,scrollbars=0");
	}
	
	function dispoWin1(a,m,g) {
	window.open("ges_prenot.php?sistemazione_id=1&yearID="+a+"&monthID="+m+"&dayID="+g,"remoteWin","width=543,height=350,resizable=0,menubar=0,status=0,scrollbars=0");
	}
	
	function dispoWin2(a,m,g) {
	window.open("ges_prenot.php?sistemazione_id=2&yearID="+a+"&monthID="+m+"&dayID="+g,"remoteWin","width=543,height=350,resizable=0,menubar=0,status=0,scrollbars=0");
	}
	
	
	var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

//Javascript per controllo modulo disponibilit

  
    function check_form() {
     // Variabili associate ai campi del modulo
     var nome = document.modulo.nome.value;
     var cognome = document.modulo.cognome.value;
     var indirizzo = document.modulo.indirizzo.value;
     var nazione = document.modulo.nazione.value;
     var telefono = document.modulo.telefono.value;
     var email = document.modulo.email.value;
     var email2 = document.modulo.email2.value;
     var si = document.modulo.si.checked;
	 var privacy = document.modulo.privacy[1].checked;

     // Espressione regolare dell'email
     var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
        //Effettua il controllo sul campo NOME
        if ((nome == "") || (nome == "undefined")) {
           alert("Inserisci nome");
           document.modulo.nome.focus();
           return false;
        }
        //Effettua il controllo sul campo COGNOME
        else if ((cognome == "") || (cognome == "undefined")) {
           alert("Inserisci cognome");
           document.modulo.cognome.focus();
           return false;
        }

        //Effettua il controllo sul campo indirizzo
        else if ((indirizzo == "") || (indirizzo == "undefined")) {
           alert("Inserisci indirizzo");
           document.modulo.indirizzo.focus();
           return false;
        }


		else if ((nazione == "") || (nazione == "undefined")) {
           alert("Inserisci lo stato");
           document.modulo.nazione.focus();
           return false;
        }

        //Effettua il controllo sul campo TELEFONO
        else if ((telefono == "") || (telefono == "undefined")) {
           alert("Inserisci numero di telefono");
           document.modulo.telefono.value = "";
           document.modulo.telefono.focus();
           return false;
        }
		
        //Effettua il controllo sul campo CONFERMA PASSWORD
        else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
           alert("Inserisci e-mail corretto");
           document.modulo.email.select();
           return false;
        }

		//Verifica l'uguaglianza tra i campi PASSWORD e CONFERMA PASSWORD
        else if (email != email2) {
           alert("Controlla e-mail");
           document.modulo.email2.value = "";
           document.modulo.email2.focus();
           return false;
        }

		else if (si == false) {
          alert("Conferma se hai letto i termini e condizioni ");
          document.modulo.si.focus();
          return false;
        }
		
	
		else if (privacy == true) {
          alert("Non possiamo processare i tuoi dati senza il consenso al trattamento");
          //document.modulo.privacy.focus();
          return false;
        }
		
        //INVIA IL MODULO
        else {
           return true;
        }
  }



  function check_form_d() {
     // Variabili associate ai campi del modulo
     var nome = document.modulo.nome.value;
     var cognome = document.modulo.cognome.value;
     var indirizzo = document.modulo.indirizzo.value;
     var nazione = document.modulo.nazione.value;
     var telefono = document.modulo.telefono.value;
     var email = document.modulo.email.value;
     var email2 = document.modulo.email2.value;
     var si = document.modulo.si.checked;
	 var privacy = document.modulo.privacy[1].checked;
	 

     // Espressione regolare dell'email
     var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
        //Effettua il controllo sul campo NOME
        if ((nome == "") || (nome == "undefined")) {
           alert("Name Eingeben.");
           document.modulo.nome.focus();
           return false;
        }
        //Effettua il controllo sul campo COGNOME
        else if ((cognome == "") || (cognome == "undefined")) {
           alert("Nachname Eingeben.");
           document.modulo.cognome.focus();
           return false;
        }

        //Effettua il controllo sul campo indirizzo
        else if ((indirizzo == "") || (indirizzo == "undefined")) {
           alert("Adresse Angeben.");
           document.modulo.indirizzo.focus();
           return false;
        }

		else if ((nazione == "") || (nazione == "undefined")) {
           alert("Nation einsetzen. ");
           document.modulo.nazione.focus();
           return false;
        }

        //Effettua il controllo sul campo TELEFONO
        else if ((telefono == "") || (telefono == "undefined")) {
           alert("Telefonnr. Angeben.");
           document.modulo.telefono.value = "";
           document.modulo.telefono.focus();
           return false;
        }
		
        //Effettua il controllo sul campo CONFERMA PASSWORD
        else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
           alert("Korrekte E-mail Adresse einsetzen.");
           document.modulo.email.select();
           return false;
        }

		//Verifica l'uguaglianza tra i campi PASSWORD e CONFERMA PASSWORD
        else if (email != email2) {
           alert("Das besttigte email ist von diesem gewhlten verschieden, zu steuern.");
           document.modulo.email2.value = "";
           document.modulo.email2.focus();
           return false;
        }

		else if (si == false) {
          alert("Besttigen, dass Sie Fristen und Konditionen gelesen haben. ");
          document.modulo.si.focus();
          return false;
        }
		
		else if (privacy == true) {
          alert("Non possiamo processare i tuoi dati senza il consenso al trattamento");
          //document.modulo.privacy.focus();
          return false;
        }
		
        //INVIA IL MODULO
        else {
           return true;
        }
  }
  
  
  
    function check_form_e() {
     // Variabili associate ai campi del modulo
     var nome = document.modulo.nome.value;
     var cognome = document.modulo.cognome.value;
     var indirizzo = document.modulo.indirizzo.value;
     var nazione = document.modulo.nazione.value;
     var telefono = document.modulo.telefono.value;
     var email = document.modulo.email.value;
     var email2 = document.modulo.email2.value;
     var si = document.modulo.si.checked;
	 var privacy = document.modulo.privacy[1].checked;

     // Espressione regolare dell'email
     var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
        //Effettua il controllo sul campo NOME
        if ((nome == "") || (nome == "undefined")) {
           alert("Insert Name.");
           document.modulo.nome.focus();
           return false;
        }
        //Effettua il controllo sul campo COGNOME
        else if ((cognome == "") || (cognome == "undefined")) {
           alert("Insert Surname.");
           document.modulo.cognome.focus();
           return false;
        }

        //Effettua il controllo sul campo indirizzo
        else if ((indirizzo == "") || (indirizzo == "undefined")) {
           alert("Insert Address.");
           document.modulo.indirizzo.focus();
           return false;
        }


		else if ((nazione == "") || (nazione == "undefined")) {
           alert("Insert Nation.");
           document.modulo.nazione.focus();
           return false;
        }

        //Effettua il controllo sul campo TELEFONO
        else if ((telefono == "") || (telefono == "undefined")) {
           alert("Insert Phone number.");
           document.modulo.telefono.value = "";
           document.modulo.telefono.focus();
           return false;
        }
		
        //Effettua il controllo sul campo CONFERMA PASSWORD
        else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
           alert("Insert Correct e-mail address.");
           document.modulo.email.select();
           return false;
        }

		//Verifica l'uguaglianza tra i campi PASSWORD e CONFERMA PASSWORD
        else if (email != email2) {
           alert("The confirmed email is various from that chosen one, to control.");
           document.modulo.email2.value = "";
           document.modulo.email2.focus();
           return false;
        }

		else if (si == false) {
          alert("Confirm that you've read Terms and Conditions. ");
          document.modulo.si.focus();
          return false;
        }
		
	
		else if (privacy == true) {
          alert("Non possiamo processare i tuoi dati senza il consenso al trattamento");
          //document.modulo.privacy.focus();
          return false;
        }
		
        //INVIA IL MODULO
        else {
           return true;
        }
  }
  






function check_form_foto(f) {


//if ((f.fupload.value == "") || (f.foto_old.value == "")) {
//alert("Manca l'immagine di Foto");
//f.fupload.focus();
//return (false);
//}

if (f.tipogal_id.value == "") {
alert("Specifica il gruppo!");
f.tipogal_id.focus();
return(false);
}

return (true);


}

//fine check_form_foto



function check_form_fotogruppo(f) {


	if (f.tipogal_testo_i.value == "") {
	alert("Specifica il nome gruppo!");
	f.tipogal_testo_i.focus();
	return(false);
	}

return (true);


}


function check_form_dispo(f) {


if (f.sistemazione_id.value == "") {
alert("Specifica la sistemazione!");
f.tipogal_id.focus();
return(false);
}

return (true);


}

//fine check_form_foto


//fine check_form_fotogruppo

function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}



function check_form_shop() {

  var error = 0;

  var error_message = "ATTENZIONE! ";

  var Nome_Ospite = document.doublecombo.Nome_Ospite.value;

  var Data_Arrivo = document.doublecombo.Data_Arrivo.value;
  
  var Email = document.doublecombo.Email.value;
  

  if (Nome_Ospite == "" || Nome_Ospite.length < 3) {

    error_message = error_message + " Inserisci tuo nome  ";

    error = 1;

  }


   if (Data_Arrivo == "" || Data_Arrivo.length < 3) {

    error_message = error_message + " Inserisci Data di Arrivo ";

    error = 1;

  }
  
  
     if (Email == "" || Email.length < 3) {

    error_message = error_message + " Inserisci tuo e-mail";

    error = 1;

  }


  if (error == 1) {

    alert(error_message);

    return false;

  } else {

    return true;

  }

}

//fine checkform3


function check_form_shop_e() {

  var error = 0;

  var error_message = "ATTENTION! ";

  var Nome_Ospite = document.doublecombo.Nome_Ospite.value;

  var Data_Arrivo = document.doublecombo.Data_Arrivo.value;
  
  var Email = document.doublecombo.Email.value;
  

  if (Nome_Ospite == "" || Nome_Ospite.length < 3) {

    error_message = error_message + " Insert your name  ";

    error = 1;

  }


   if (Data_Arrivo == "" || Data_Arrivo.length < 3) {

    error_message = error_message + " Insert Arrival Date ";

    error = 1;

  }
  
  
     if (Email == "" || Email.length < 3) {

    error_message = error_message + " Insert E-mail";

    error = 1;

  }


  if (error == 1) {

    alert(error_message);

    return false;

  } else {

    return true;

  }

}

//fine checkform3

 function check_gb_i() {
     // Variabili associate ai campi del modulo
     var nome = document.modulo.nome.value;
     var dove = document.modulo.dove.value;
     var email = document.modulo.email.value;

     // Espressione regolare dell'email
     var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
        //Effettua il controllo sul campo NOME
        if ((nome == "") || (nome == "undefined")) {
           alert("Inserisci nome");
           document.modulo.nome.focus();
           return false;
        }

        //Effettua il controllo sul campo indirizzo
        else if ((dove == "") || (dove == "undefined")) {
           alert("Inserisci localita'");
           document.modulo.indirizzo.focus();
           return false;
        }

	
        //Effettua il controllo sul campo CONFERMA PASSWORD
        else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
           alert("Inserisci e-mail corretto");
           document.modulo.email.select();
           return false;
        }

        //INVIA IL MODULO
        else {
           return true;
        }
  }
  
  //fine checkform3

 function check_gb_e() {
     // Variabili associate ai campi del modulo
     var nome = document.modulo.nome.value;
     var dove = document.modulo.dove.value;
     var email = document.modulo.email.value;

     // Espressione regolare dell'email
     var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
        //Effettua il controllo sul campo NOME
        if ((nome == "") || (nome == "undefined")) {
           alert("Insert name");
           document.modulo.nome.focus();
           return false;
        }

        //Effettua il controllo sul campo indirizzo
        else if ((dove == "") || (dove == "undefined")) {
           alert("Insert city name'");
           document.modulo.indirizzo.focus();
           return false;
        }

	
        //Effettua il controllo sul campo CONFERMA PASSWORD
        else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
           alert("Insert correct e-mail");
           document.modulo.email.select();
           return false;
        }

        //INVIA IL MODULO
        else {
           return true;
        }
  }
  
  //fine checkform3

 function check_gb_d() {
     // Variabili associate ai campi del modulo
     var nome = document.modulo.nome.value;
     var dove = document.modulo.dove.value;
     var email = document.modulo.email.value;

     // Espressione regolare dell'email
     var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
        //Effettua il controllo sul campo NOME
        if ((nome == "") || (nome == "undefined")) {
           alert("Name Eingeben");
           document.modulo.nome.focus();
           return false;
        }

        //Effettua il controllo sul campo indirizzo
        else if ((dove == "") || (dove == "undefined")) {
           alert("Adresse Angeben'");
           document.modulo.indirizzo.focus();
           return false;
        }

	
        //Effettua il controllo sul campo CONFERMA PASSWORD
        else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
           alert("Korrekte E-mail Adresse einsetzen");
           document.modulo.email.select();
           return false;
        }

        //INVIA IL MODULO
        else {
           return true;
        }
  }
  
  
  
  function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}
