function localitaselect(loc)
{
	for (jj=0; jj<document.scheda1.localita.options.length; jj++) {
			if (document.scheda1.localita.options[jj].text.toLowerCase() == loc.toLowerCase()) {
			document.scheda1.localita.options[jj].selected = true;
			}
	}
}			





function show_calendar22()
{
	if (document.scheda1.datap.value == null || document.scheda1.datap.value =="")
	var dataestesa = "";
	else
	var dataestesa = document.scheda1.datap.value + " 00:00:00";

show_calendar('document.scheda1.dataa', dataestesa);
}			


function show_calendar22ben()
{
	if (document.scheda1ben.datap.value == null || document.scheda1ben.datap.value =="")
	var dataestesa = "";
	else
	var dataestesa = document.scheda1ben.datap.value + " 00:00:00";

show_calendar('document.scheda1ben.dataa', dataestesa);
}			



function show_calendar23()
{
	if (document.scheda1.dataservizio.value == null || document.scheda1.dataservizio.value =="")
	var dataestesa = "";
	else
	var dataestesa = document.scheda1.dataservizio.value + " 00:00:00";

show_calendar('document.scheda1.dataservizio', dataestesa);
}			





  function apri5() {
      miolink = "condizioni_generali.htm";
     w=window.open(miolink,"MioWeekend5","width=380,height=250,menubar=no,scrollbars=yes,resizable=no");  
  }


  function apri7() {
      miolink = "http://www.cartorange.com/privacy_fullscreen.htm";
     w=window.open(miolink,"privacy","width=500,height=420,menubar=no,scrollbars=yes,resizable=no");  
  }



  function apri8() {
      miolink = "spiegaconf.htm";
     w=window.open(miolink,"MioWeekend5","width=300,height=200,menubar=no,scrollbars=yes,resizable=no");  
  }

  function apri9() {
      miolink = "spiegaprevent.htm";
     w=window.open(miolink,"MioWeekend5","width=300,height=200,menubar=no,scrollbars=yes,resizable=no");  
  }


  function apri10() {
      miolink = "spiegacontratto.htm";
     w=window.open(miolink,"MioWeekend5","width=340,height=200,menubar=no,scrollbars=yes,resizable=no");  
  }





  function aprifoto(fotogrande) {
      miolink = "fotoL.htm?" + fotogrande;
     w=window.open(miolink,"Cartorange","width=80,height=80,menubar=no,scrollbars=mo,resizable=no");  

  }


  function apripopupservizio(idservizio) {
      miolink = "weekend-bestseller2.cgi?idservizio=" + idservizio;
     w=window.open(miolink,"popup2","width=680,height=500,menubar=no,scrollbars=yes,resizable=no"); 
  }



  function apripopupservizio_stampabile(idservizio) {
      miolink = "desktop-cliente-servizio-stampa.cgi?idservizio=" + idservizio;
     w=window.open(miolink,"popup2s","width=680,height=500,menubar=no,scrollbars=yes,resizable=no"); 
  }





  function apripopuppacchetto(idpacchetto) {
      miolink = "weekend-bestseller3.cgi?idbestseller=" + idpacchetto;
     w=window.open(miolink,"popup2","width=680,height=500,menubar=no,scrollbars=yes,resizable=no"); 
  }









function controllacamere(){
	if ((document.scheda1.quantedoppie.options[0].selected) && (document.scheda1.quantesingole.options[0].selected) && (document.scheda1.quantetriple.options[0].selected)) {
		alert ("Attenzione:\nč necessario selezionare il tipo di camera desiderato.");
	}else{
		document.scheda1.submit();
	}
}






  function apribambini() {
      miolink = "bambini.htm";
     w=window.open(miolink,"mioweekend","width=600,height=575,menubar=no,scrollbars=mo,resizable=no");  
  }






function controllaparametri(){

	var controllo = 30;

	if (document.scheda1.nome1.value !== "") {
			if (document.scheda1.cognome1.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta1[0].checked) | (document.scheda1.eta1[1].checked) | (document.scheda1.eta1[2].checked) | (document.scheda1.eta1[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.nome2.value !== "") {
			if (document.scheda1.cognome2.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta2[0].checked) | (document.scheda1.eta2[1].checked) | (document.scheda1.eta2[2].checked) | (document.scheda1.eta2[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.nome3.value !== "") {
			if (document.scheda1.cognome3.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta3[0].checked) | (document.scheda1.eta3[1].checked) | (document.scheda1.eta3[2].checked) | (document.scheda1.eta3[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.nome4.value !== "") {
			if (document.scheda1.cognome4.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta4[0].checked) | (document.scheda1.eta4[1].checked) | (document.scheda1.eta4[2].checked) | (document.scheda1.eta4[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.nome5.value !== "") {
			if (document.scheda1.cognome5.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta5[0].checked) | (document.scheda1.eta5[1].checked) | (document.scheda1.eta5[2].checked) | (document.scheda1.eta5[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.nome6.value !== "") {
			if (document.scheda1.cognome6.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta6[0].checked) | (document.scheda1.eta6[1].checked) | (document.scheda1.eta6[2].checked) | (document.scheda1.eta6[3].checked)) {}else{ controllo = controllo -1;}
	}


	if (document.scheda1.cognome1.value !== "") {
			if (document.scheda1.nome1.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta1[0].checked) | (document.scheda1.eta1[1].checked) | (document.scheda1.eta1[2].checked) | (document.scheda1.eta1[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.cognome2.value !== "") {
			if (document.scheda1.nome2.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta2[0].checked) | (document.scheda1.eta2[1].checked) | (document.scheda1.eta2[2].checked) | (document.scheda1.eta2[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.cognome3.value !== "") {
			if (document.scheda1.nome3.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta3[0].checked) | (document.scheda1.eta3[1].checked) | (document.scheda1.eta3[2].checked) | (document.scheda1.eta3[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.cognome4.value !== "") {
			if (document.scheda1.nome4.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta4[0].checked) | (document.scheda1.eta4[1].checked) | (document.scheda1.eta4[2].checked) | (document.scheda1.eta4[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.cognome5.value !== "") {
			if (document.scheda1.nome5.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta5[0].checked) | (document.scheda1.eta5[1].checked) | (document.scheda1.eta5[2].checked) | (document.scheda1.eta5[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.cognome6.value !== "") {
			if (document.scheda1.nome6.value == "") controllo = controllo -1;
			if  ((document.scheda1.eta6[0].checked) | (document.scheda1.eta6[1].checked) | (document.scheda1.eta6[2].checked) | (document.scheda1.eta6[3].checked)) {}else{ controllo = controllo -1;}
	}

	if (document.scheda1.nome1.value == "") controllo = controllo -1;

	if (controllo == 30){
		document.scheda1.submit();
	}else{
		alert("Attenzione: č necessario inserire almeno un nominativo. Inoltre, ogni nominativo inserito deve avere compilati i campi NOME, COGNOME e fascia di etā.");
	}
}





  function canctesto1() {
    if (document.comune.mailcomune.value == "dato obbligatorio") {
	document.comune.mailcomune.value = "";
    }
  }


  function canctesto2() {
    if (document.comune.cellcomune.value == "dato obbligatorio") {
	document.comune.cellcomune.value = "";
    }
  }


  function canctesto3() {
    if (document.comune.indicomune.value == "dato obbligatorio") {
	document.comune.indicomune.value = "";
    }
  }


  function canctesto4() {
    if (document.scheda1.email1.value == "indirizzo e-mail") {
	document.scheda1.email1.value = "";
    }
  }



function prenota(){
	var controllo = 30;
	if (document.comune.contratto.checked) {
		if ((document.comune.mailcomune.value == "") || (document.comune.mailcomune.value == null) || (document.comune.mailcomune.value == "dato obbligatorio")) controllo = controllo -1;
		if ((document.comune.cellcomune.value == "") || (document.comune.cellcomune.value == null) || (document.comune.cellcomune.value == "dato obbligatorio")) controllo = controllo -1;
		if ((document.comune.indicomune.value == "") || (document.comune.indicomune.value == null) || (document.comune.indicomune.value == "dato obbligatorio")) controllo = controllo -1;
		if (controllo == 30){
			document.comune.action = "http://www.cartorange.com/pos/mioweekend_answer_eur.cgi";
			document.comune.submit();
		}else{
			alert("ATTENZIONE!\nč necessario compilare i campi: E-MAIL, TELEFONO e INDIRIZZO,  altrimenti non sarā possibile procedere con la prenotazione.");
		}
	}else{
		alert("ATTENZIONE!\nbisogna selezionare ''ho letto e approvato il contratto'',  altrimenti non sarā possibile procedere con la prenotazione.");
	}
}




function contatta(){
	var controllo = 30;
		if ((document.comune.mailcomune.value == "") || (document.comune.mailcomune.value == null) || (document.comune.mailcomune.value == "dato obbligatorio")) controllo = controllo -1;
		if ((document.comune.cellcomune.value == "") || (document.comune.cellcomune.value == null) || (document.comune.cellcomune.value == "dato obbligatorio")) controllo = controllo -1;
		if ((document.comune.indicomune.value == "") || (document.comune.indicomune.value == null) || (document.comune.indicomune.value == "dato obbligatorio")) controllo = controllo -1;
		if ((document.comune.provcomune.options.value == "") || (document.comune.provcomune.options.value == null) ) controllo = controllo -1;
		if (controllo == 30){
			document.comune.action = "weekend-contattaCPV.cgi";
			document.comune.submit();
		}else{
			alert("ATTENZIONE!\nč necessario compilare i campi: E-MAIL, TELEFONO INDIRIZZO e PROVINCIA,  altrimenti non sarā possibile procedere con la richiesta.\n");
		}
}





function controllaeinvia() {
	if (document.consul.privac[0].checked) {
		document.consul.submit();
	}else{
		alert("ATTENZIONE!\nč necessario scegliere ''ACCETTO'' (tutela della privacy DLGS 30-giu-2003 N.196), altrimenti non sarā possibile inviare la richiesta.");
	}

}


  function avvisaprivacy() {
	alert("ATTENZIONE!\nscegliendo ''NON ACCETTO'', non sarā possibile inviare la richiesta");
  }


