function hide_button(){
 document.getElementById('Invia').style.display='none';
}
function agree(){
 var IE=(window.navigator.userAgent.indexOf('MSIE')>-1)?1:0; 
 if (document.getElementById('frm_agree').checked){
  document.getElementById('Invia').style.display=(IE)?'block':'block';
 }else{
  document.getElementById('Invia').style.display='none';
 }
}
function inizio(){
  document.getElementById('frm_agree').checked=false;
 }
///////////////////////////////////////////////////////////////////
function printpage() {
	window.print();  
}
///////////////////////////////////////////////////////////////////
function change(img){
	document.images["photo"].src = img;
}
////////////////////////////////////////////////////////////////////

var putItThere = null; 

var chasm = screen.availWidth;
var mount = screen.availHeight;


var w = 0;
var h = 0;


function deadCenter(u,w,h) {
  putItThere = window.open(u,'posB','width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 10) * .5));
}

pagina=null;
function apri (url,w,h,x,y){
if (pagina != null)
	pagina.close();
	pagina=window.open(url,null,"fullscreen=no,status=no,resizable=yes,toolbar=no,scrollbars=yes,width="+w+",height="+h+",top="+x+",left="+y);
}
//////////////////////////////////////////////////////////////////////
(function(){

	/*Use Object Detection to detect IE6*/
	var  m = document.uniqueID /*IE*/
	&& document.compatMode  /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand ;
	
	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */ 
		}
		
	}catch(oh){};
})();

/*//////////////////////////////////////////////////////////////////////////////////////*/
pagina=null;
function apriPopup(url,w,h){
	x=screen.width/2-w/2;
	y=screen.height/2-h/2;
	if (pagina != null)
		pagina.close();
	pagina=window.open(url,"","fullscreen=no,status=no,toolbar=no,scrollbars=yes,width="+w+",height="+h+",top="+y+",left="+x);
}

///////////////////////////////////////////////////////////////////////////////////
// Per mantenere selezionato il bottone con il sottomenu
 ///////////////////////////////////////////////////////////////////////////////////
function setStyle(x,classe) {
	document.getElementById(x).className=classe;
}
function setStyleOff(x){
	document.getElementById(x).className="unselect";
}


 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO EMAIL (PER TUTTI I FORM)
 ///////////////////////////////////////////////////////////////////////////////////

var whitespace = " \t\n\r";
function isEmail (s){
	if (isEmpty(s))
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
    if (isWhitespace(s)) return false;
    var i = 1;
    var sLength = s.length;
    while ((i < sLength) && (s.charAt(i) != "@")){
		i++
    }
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;
    while ((i < sLength) && (s.charAt(i) != ".")){
		i++
    }
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}
function isEmpty(s){
	return ((s == null) || (s.length == 0))
}
function isWhitespace (s){
	var i;
	if (isEmpty(s)) return true;
    for (i = 0; i < s.length; i++){
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
    }
    return true;
}



///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO LOGIN
 ///////////////////////////////////////////////////////////////////////////////////
 
function sendAccesso() {
	
	u=document.getElementById("username");
	if(u.value==""){
		alert("Inserire l\'email");
		u.focus();
		return;
	}
	
	if (!isEmail(u.value)){
		alert("Inserisci l\'indirizzo email corretto");
		u.focus();
		return 1;
	}

	c=document.getElementById("password");
	if(c.value==""){
		alert("Inserire la password");
		c.focus();
		return;
	}

	controllo_login(u.value,c.value);

}


///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO REGISTRAZIONE
 ///////////////////////////////////////////////////////////////////////////////////
function send_registrazione(){
	c=document.getElementById("email");
	if(c.value==""){
		alert("Inserire la mail");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Inserisci l'indirizzo e-mail corretto");
		c.focus();
		return 1;
	}

	c=document.getElementById("pass");	
	if(c.value=="" || c.value.length<8){	
		alert("Inserisci la password con un minimo di 8 caratteri");
		c.focus();
		return;
	
	}

	c2=document.getElementById("conferma");	
	if(c.value!=c2.value ){	
		alert("I valori delle due password sono differenti");
		c2.focus();
		return;
	
	}

	c=document.getElementById("piva");
	if(c.value==""){
		alert("Inserire la Partita IVA o il Codice Fiscale");
		c.focus();
		return;
	}

	c=document.getElementById("nome");
	if(c.value==""){
		alert("Inserire il nome");
		c.focus();
		return;
	}

	c=document.getElementById("cognome");
	if(c.value==""){
		alert("Inserire il cognome");
		c.focus();
		return;
	}

	c=document.getElementById("indirizzo");
	if(c.value==""){
		alert("Inserire l'indirizzo");
		c.focus();
		return;
	}
		c=document.getElementById("civico");
	if(c.value==""){
		alert("Inserire il numero civico");
		c.focus();
		return;
	}
		c=document.getElementById("citta");
	if(c.value==""){
		alert("Inserire la città");
		c.focus();
		return;
	}

	c=document.getElementById("cap");
	if(c.value==""){
		alert("Inserire il CAP");
		c.focus();
		return;
	}
	c=document.getElementById("provincia");
	if(c.value==""){
		alert("Inserire la provincia");
		c.focus();
		return;
	}
	c=document.getElementById("nazione");
	if(c.value==""){
		alert("Inserire la nazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("telefono");
	c2=document.getElementById("cellulare");
	if(c.value=="" && c2.value==""){
		alert("Inserire almeno un numero di cellulare o di telefono");
		c.focus();
		return;
	}




	c=document.getElementById("frm_agree");
	if (!c.checked){
		alert("Leggi l\'informativa sulla privacy e spunta la casella \'Acconsento il trattamento dei dati personali\'");
		c.focus();
		return;
	}
	
	document.getElementById("azionex").value='iscrizione';
	document.getElementById("formDati").action='registrazione_ita.php';
	document.getElementById("formDati").submit();
}







 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO CANCELLAZIONE REGISTRAZIONE
 ///////////////////////////////////////////////////////////////////////////////////
function cancella_registrazione(){
	var c;
	c=document.getElementById("email_cancella");
	if(c.value==""){
		alert("Inserire l'email");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Inserisci l'indirizzo email corretto");
		c.focus();
		return;
	}
	
	c=document.getElementById("azione_cancella");
	c.value='cancella';
	
	document.getElementById("formCancella").action='registrazione_ita.php';
	document.getElementById("formCancella").submit();


}


 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO CAMBIA EMAIL
 ///////////////////////////////////////////////////////////////////////////////////
function sendCambiaEmail(){

	c=document.getElementById("email_cambia");
	if(c.value==""){
		alert("Inserire la nuova email nel campo 'cambia email'");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Inserisci l'indirizzo email corretto nel campo 'cambia email'");
		c.focus();
		return;
	}
	
	if(confirm("Stai per cambiare la tua email per accedere al sito LauraF.\nCliccare OK per confermare.")){
		c=document.getElementById("formCambiaEmail");
		c.azione_cambia_email.value='aggiorna';
		c.action='aggiorna-dati_ita.php';
		c.submit();
	}
}

 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO CAMBIA PASSWORD
 ///////////////////////////////////////////////////////////////////////////////////
function sendCambiaPass(){

	c=document.getElementById("pass_nuova");	
	if(c.value=="" || c.value.length<8){	
		alert("Inserisci la nuova password con un minimo di 8 caratteri");
		c.focus();
		return;
	
	}

	c2=document.getElementById("conferma_pass_nuova");	
	if(c.value!=c2.value ){	
		alert("I valori delle due password sono differenti");
		c2.focus();
		return;
	
	}
	
	if(confirm("Stai per cambiare la tua password per accedere al sito LauraF.\nCliccare OK per confermare.")){
		c=document.getElementById("formCambiaPass");
		c.azione_cambia_pass.value='aggiorna';
		c.action='aggiorna-dati_ita.php';
		c.submit();
	}
}


 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO AGGIORNA DATI FATTURAZIONE
 ///////////////////////////////////////////////////////////////////////////////////
function sendAggiornaDatiFatturazione(){

	c=document.getElementById("nomeDatiFatturazione");
	if(c.value==""){
		alert("Inserire il nome per la fatturazione");
		c.focus();
		return;
	}

	c=document.getElementById("cognomeDatiFatturazione");
	if(c.value==""){
		alert("Inserire il cognome per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("pivacfDatiFatturazione");
	if(c.value==""){
		alert("Inserire la Partita IVA o il Codice Fiscale per la fatturazione");
		c.focus();
		return;
	}

	c=document.getElementById("indirizzoDatiFatturazione");
	if(c.value==""){
		alert("Inserire l'indirizzo per la fatturazione");
		c.focus();
		return;
	}
		c=document.getElementById("civicoDatiFatturazione");
	if(c.value==""){
		alert("Inserire il numero civico per la fatturazione");
		c.focus();
		return;
	}
		c=document.getElementById("cittaDatiFatturazione");
	if(c.value==""){
		alert("Inserire la città per la fatturazione");
		c.focus();
		return;
	}

	c=document.getElementById("capDatiFatturazione");
	if(c.value==""){
		alert("Inserire il CAP per la fatturazione");
		c.focus();
		return;
	}
	c=document.getElementById("provinciaDatiFatturazione");
	if(c.value==""){
		alert("Inserire la provincia per la fatturazione");
		c.focus();
		return;
	}
	c=document.getElementById("nazioneDatiFatturazione");
	if(c.value==""){
		alert("Inserire la nazione per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("telefonoDatiFatturazione");
	c2=document.getElementById("cellulareDatiFatturazione");
	if(c.value=="" && c2.value==""){
		alert("Inserire almeno un numero di cellulare o di telefono per la fatturazione");
		c.focus();
		return;
	}
	
	if(confirm("Stai per aggiornare i dati relativi alla fatturazione.\nCliccare OK per confermare.")){
		c=document.getElementById("formAggiornaDatiFatturazione");
		c.azione_cambia_dati_fatturazione.value='aggiorna';
		c.action='aggiorna-dati_ita.php';
		c.submit();
	}

}


///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO AGGIORNA DATI SPEDIZIONE
 ///////////////////////////////////////////////////////////////////////////////////
function sendAggiornaDatiSpedizione(){

	c=document.getElementById("nomeDatiSpedizione");
	if(c.value==""){
		alert("Inserire il nome per la spedizione");
		c.focus();
		return;
	}

	c=document.getElementById("cognomeDatiSpedizione");
	if(c.value==""){
		alert("Inserire il cognome per la spedizione");
		c.focus();
		return;
	}
	
	c=document.getElementById("campanelloDatiSpedizione");
	if(c.value==""){
		alert("Inserire un Nome per il campo 'Nome sul campanello' per la spedizione");
		c.focus();
		return;
	}

	c=document.getElementById("indirizzoDatiSpedizione");
	if(c.value==""){
		alert("Inserire l'indirizzo per la spedizione");
		c.focus();
		return;
	}
		c=document.getElementById("civicoDatiSpedizione");
	if(c.value==""){
		alert("Inserire il numero civico per la spedizione");
		c.focus();
		return;
	}
		c=document.getElementById("cittaDatiSpedizione");
	if(c.value==""){
		alert("Inserire la città per la spedizione");
		c.focus();
		return;
	}

	c=document.getElementById("capDatiSpedizione");
	if(c.value==""){
		alert("Inserire il CAP per la spedizione");
		c.focus();
		return;
	}
	c=document.getElementById("provinciaDatiSpedizione");
	if(c.value==""){
		alert("Inserire la provincia per la spedizione");
		c.focus();
		return;
	}
	c=document.getElementById("nazioneDatiSpedizione");	
	if(c.value==""){
		alert("Inserire la nazione per la spedizione");
		c.focus();
		return;
	}
	
	if(confirm("Stai per aggiornare i dati relativi alla spedizione.\nCliccare OK per confermare.")){
		c=document.getElementById("formAggiornaDatiSpedizione");
		c.azione_cambia_dati_spedizione.value='aggiorna';
		c.action='aggiorna-dati_ita.php';
		c.submit();
	}

}


///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO RECUPERO PASSWORD
 ///////////////////////////////////////////////////////////////////////////////////
function send_recupero_password(){

	c=document.getElementById("email");
	if(c.value==""){
		alert("Inserire l'email");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Inserisci l'indirizzo email corretto");
		c.focus();
		return;
	}
	
	c=document.getElementById("formRecuperoPassword");
	c.azione.value='send';
	c.action='recupera-password_ita.php';
	c.submit();
}


 ///////////////////////////////////////////////////////////////////////////////////
 // RIMUOVI PRODOTTO CARRELLO
 ///////////////////////////////////////////////////////////////////////////////////

function RimuoviProdottoCarrello(idrimuovi){
	if(confirm("Rimuovere questo prodotto dal carrello?\nCliccare OK per confermare.")){
	document.getElementById("formCarrello").azionex.value='rimuovi';
	document.getElementById("formCarrello").action='shopping-bag_ita.php';
	document.getElementById("formCarrello").idrimuovi.value=idrimuovi;
	document.getElementById("formCarrello").submit();
	}
}

 ///////////////////////////////////////////////////////////////////////////////////
 // AGGIORNA PRODOTTO CARRELLO
 ///////////////////////////////////////////////////////////////////////////////////
function AggiornaProdottoCarrello(idaggiorna){
	if(confirm("Aggiornare la quantità di questo prodotto?\nCliccare OK per confermare.")){
	document.getElementById("formCarrello").azionex.value='aggiorna';
	document.getElementById("formCarrello").action='shopping-bag_ita.php';
	document.getElementById("formCarrello").idaggiorna.value=idaggiorna;
	document.getElementById("formCarrello").submit();
	}
}
 ///////////////////////////////////////////////////////////////////////////////////
 // RIMUOVI ACCESSORIO CARRELLO
 ///////////////////////////////////////////////////////////////////////////////////
function RimuoviAccessorioCarrello(idrimuovi){
	if(confirm("Rimuovere questo prodotto dal carrello?\nCliccare OK per confermare.")){
	document.getElementById("formCarrello").azionex.value='rimuoviaccessorio';
	document.getElementById("formCarrello").action='shopping-bag_ita.php';
	document.getElementById("formCarrello").idrimuovi.value=idrimuovi;
	document.getElementById("formCarrello").submit();
	}
}

 ///////////////////////////////////////////////////////////////////////////////////
 // AGGIORNA ACCESSORIO CARRELLO
 ///////////////////////////////////////////////////////////////////////////////////
function AggiornaAccessorioCarrello(idaggiorna){
	if(confirm("Aggiornare la quantità di questo prodotto?\nCliccare OK per confermare.")){
	document.getElementById("formCarrello").azionex.value='aggiornaaccessorio';
	document.getElementById("formCarrello").action='shopping-bag_ita.php';
	document.getElementById("formCarrello").idaggiorna.value=idaggiorna;
	document.getElementById("formCarrello").submit();
	}
}

 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO DATI FATTURAZIONE
 ///////////////////////////////////////////////////////////////////////////////////
 
function sendDatiFatturazione(){

	c=document.getElementById("nomeDatiFatturazione");
	if(c.value==""){
		alert("Inserire un nome per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("cognomeDatiFatturazione");
	if(c.value==""){
		alert("Inserire un cognome per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("pivacfDatiFatturazione");
	if(c.value==""){
		alert("Inserire una Partita IVA se una azienda o Codice Fiscale se una persona fisica per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("indirizzoDatiFatturazione");
	if(c.value==""){
		alert("Inserire un indirizzo per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("civicoDatiFatturazione");
	if(c.value==""){
		alert("Inserire un civico per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("cittaDatiFatturazione");
	if(c.value==""){
		alert("Inserire una città per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("capDatiFatturazione");
	if(c.value==""){
		alert("Inserire un CAP per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("provinciaDatiFatturazione");
	if(c.value==""){
		alert("Inserire una provincia per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("nazioneDatiFatturazione");
	if(c.value==""){
		alert("Inserire un nazione per la fatturazione");
		c.focus();
		return;
	}
	
	c=document.getElementById("telefonoDatiFatturazione");
	c2=document.getElementById("cellulareDatiFatturazione");
	if(c.value=="" && c2.value==""){
		alert("Inserire almeno un numero di cellulare o di telefono");
		c.focus();
		return;
	}
	
	c=document.getElementById("emailDatiFatturazione");
	if(c.value==""){
		alert("Inserire una email per la fatturazione");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Inserire un'indirizzo email corretto per la fatturazione");
		c.focus();
		return 1;
	}

	document.getElementById("controlloDatiFatturazione").value='aggiorna';
	document.getElementById("formDatiFatturazione").action='shopping-bag-spedizione_ita.php';
	document.getElementById("formDatiFatturazione").submit();
}






 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO DATI SPEDIZIONE
 ///////////////////////////////////////////////////////////////////////////////////
 
function sendDatiSpedizione(){

	c=document.getElementById("nomeDatiSpedizione");
	if(c.value==""){
		alert("Inserire un nome per la spedizione");
		c.focus();
		return;
	}
	
	c=document.getElementById("cognomeDatiSpedizione");
	if(c.value==""){
		alert("Inserire un cognome per la spedizione");
		c.focus();
		return;
	}
	
	c=document.getElementById("campanelloDatiSpedizione");
	if(c.value==""){
		alert("Inserire un nome per il campo 'Nome sul campanello'");
		c.focus();
		return;
	}
	
	c=document.getElementById("indirizzoDatiSpedizione");
	if(c.value==""){
		alert("Inserire un indirizzo per la spedizione");
		c.focus();
		return;
	}
	
	c=document.getElementById("civicoDatiSpedizione");
	if(c.value==""){
		alert("Inserire una civico per la spedizione");
		c.focus();
		return;
	}
	
	c=document.getElementById("cittaDatiSpedizione");
	if(c.value==""){
		alert("Inserire una città per la spedizione");
		c.focus();
		return;
	}
	
	c=document.getElementById("capDatiSpedizione");
	if(c.value==""){
		alert("Inserire un CAP per la spedizione");
		c.focus();
		return;
	}
	
	c=document.getElementById("provinciaDatiSpedizione");
	if(c.value==""){
		alert("Inserire una provincia per la spedizione");
		c.focus();
		return;
	}
	
	c=document.getElementById("nazioneDatiSpedizione");
	if(c.value==""){
		alert("Inserire un nazione per la spedizione");
		c.focus();
		return;
	}
/*
	c=document.getElementById("giornoDatiSpedizione");
	if(c.value==""){
		alert("Inserire un giorno preferito per la ricezione del pacco");
		c.focus();
		return;
	}
*/	
	/*
	// Definisco il numero di radio disponibili!
	var n_opt = 2;
	var n = (n_opt - 1);
	c=document.getElementById("ampmDatiSpedizione");
	for (i=0; i<=n; i++){
	if (document.formDatiSpedizione.ampmDatiSpedizione[i].checked){
			//alert("Ok un voto");
      		break;
    	}else{
	  		if(i == n){
				alert("Selezionare una preferenza per la consegna: mattino o pomeriggio");
				c.focus();
				return;
	  		}
		}
	}
	*/
	/*c=document.getElementById("orarioDatiSpedizione");
	if(c.value==""){
		alert("Inserire un orario preferito per la ricezione del pacco");
		c.focus();
		return;
	}*/

	document.getElementById("controlloDatiSpedizione").value='aggiorna';
	document.getElementById("formDatiSpedizione").action='shopping-bag-pagamento_ita.php';
	document.getElementById("formDatiSpedizione").submit();
}


 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO TIPO PAGAMENTO
 ///////////////////////////////////////////////////////////////////////////////////
 
function sendTipoPagamento(){

	
	
	// Definisco il numero di radio disponibili!
	var n_opt = 3;
	var metodo = "";
	var n = (n_opt - 1);
	c=document.getElementById("pagamento");
	for (i=0; i<=n; i++){
	if (document.formDatiPagamento.pagamento[i].checked){
			//alert("Ok un voto");
			metodo=document.formDatiPagamento.pagamento[i].value;
      		break;
    	}else{
	  		if(i == n){
				alert("Selezionare una preferenza per il pagamento");
				c.focus();
				return;
	  		}
		}
	}
	
	

		document.getElementById("formDatiPagamento").azione.value='invia';
	
		document.getElementById("formDatiPagamento").action='shopping-bag-riepilogo_ita.php';

		document.getElementById("formDatiPagamento").submit();
}



 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO LOGIN ORDINE
 ///////////////////////////////////////////////////////////////////////////////////
function loginOrdine(){

	c=document.getElementById("email");
	if(c.value==""){
		alert("Inserire la mail");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Inserisci l'indirizzo e-mail corretto");
		c.focus();
		return ;
	}
	
	c=document.getElementById("pass");
	if(c.value==""){
		alert("Inserire la password");
		//c.focus();
		return;
	}
	
	
	
	document.getElementById("azione").value='login';
	document.getElementById("formDatiFatturazione").action='shopping-bag-dati_ita.php';
	document.getElementById("formDatiFatturazione").submit();
}

 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO AVANZAMENTO
 ///////////////////////////////////////////////////////////////////////////////////
function sendBag(){

	document.getElementById("formDati").action='shopping-bag-messaggio_ita.php';
	document.getElementById("formDati").submit();
	


}
///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO MESSAGGIO SEGRETO
 ///////////////////////////////////////////////////////////////////////////////////
function sendMessaggioSegreto(){

	var c,d;	
	
	c=document.getElementById("messaggioSegreto");
	d=document.getElementById("dataApertura");
	if((c.value!="" && d.value=="") ||(c.value=="" && d.value!="")){
		alert("Inserire il messaggio segreto e la data dalla quale potrà essere letto il messaggio.");
		c.focus();
		return;
	}

	c=document.getElementById("emailSorpresa");
	if (c.value!="" && !isEmail(c.value)){
		alert("Inserisci l'indirizzo e-mail corretto");
		c.focus();
		return ;
	}


	document.getElementById("azione").value='messaggio';
	document.getElementById("formDati").action='shopping-bag-dati_ita.php';
	document.getElementById("formDati").submit();
}

///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO CONTATTI
 ///////////////////////////////////////////////////////////////////////////////////
function send(){

	c=document.getElementById("nome");
	if(c.value==""){
		alert("Inserire il nome");
		c.focus();
		return;
	}

	c=document.getElementById("cognome");
	if(c.value==""){
		alert("Inserire il cognome");
		c.focus();
		return;
	}

	c=document.getElementById("email");
	if(c.value==""){
		alert("Inserire la mail");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Inserisci l'indirizzo e-mail corretto");
		c.focus();
		return 1;
	}
	
	c=document.getElementById("note");
	if(c.value==""){
		alert("Inserire un messaggio");
		c.focus();
		return;
	}
	
	c=document.getElementById("frm_agree");
	if (!c.checked){
		alert("Leggi l\'informativa sulla privacy e spunta la casella \'Acconsento il trattamento dei dati personali\'");
		c.focus();
		return;
	}
	
	document.getElementById("formDati").azione.value='send';
	document.getElementById("formDati").action='contattaci_ita.php';
	document.getElementById("formDati").submit();
}


///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO INVIA AMICO
 ///////////////////////////////////////////////////////////////////////////////////
function send_amico(){

	c=document.getElementById("nome");
	if(c.value==""){
		alert("Inserire il nome");
		c.focus();
		return;
	}

	c=document.getElementById("email_mitt");
	if(c.value==""){
		alert("Inserire la tua mail");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Inserisci l'indirizzo e-mail corretto");
		c.focus();
		return 1;
	}
	c=document.getElementById("email_dest");
	if(c.value==""){
		alert("Inserire la mail del destinatario");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Inserisci l'indirizzo e-mail corretto");
		c.focus();
		return 1;
	}
	

	
	c=document.getElementById("frm_agree");
	if (!c.checked){
		alert("Leggi l\'informativa sulla privacy e spunta la casella \'Acconsento il trattamento dei dati personali\'");
		c.focus();
		return;
	}
	
	document.getElementById("formDati").azione.value='send';
	document.getElementById("formDati").action='invia-amico_ita.php';
	document.getElementById("formDati").submit();
}

///////////////////////////////////////////////////////////////////////////////////
 // INVIA SCRIGNOINVIA AMICO
 ///////////////////////////////////////////////////////////////////////////////////
function send_scrigno(){

	c=document.getElementById("casella1");
	if(c.value==""){
		alert("Inserire il codice");
		c.focus();
		return;
	}
	c=document.getElementById("casella2");
	if(c.value==""){
		alert("Inserire il codice");
		c.focus();
		return;
	}
	c=document.getElementById("casella3");
	if(c.value==""){
		alert("Inserire il codice");
		c.focus();
		return;
	}
	c=document.getElementById("casella4");
	if(c.value==""){
		alert("Inserire il codice");
		c.focus();
		return;
	}
	c=document.getElementById("casella5");
	if(c.value==""){
		alert("Inserire il codice");
		c.focus();
		return;
	}
	c=document.getElementById("casella6");
	if(c.value==""){
		alert("Inserire il codice");
		c.focus();
		return;
	}


	document.getElementById("frmscrigno").azione.value='send';
	document.getElementById("frmscrigno").action='cartolina_ita.php';
	document.getElementById("frmscrigno").submit();
}

///////////////////////////////////////////////////////////////////////////////////
 // INVIA RICERCA 
 ///////////////////////////////////////////////////////////////////////////////////
function send_ricerca_spalla(){

	c=document.getElementById("categoriaProdotto");
	var n_opt = 5;
	var metodo = "";
	var n = (n_opt - 1);
	
	for (i=0; i<=n; i++){
	if (document.ricerca.categoriaProdotto[i].checked){
			//alert("Ok un voto");
			metodo=document.ricerca.categoriaProdotto[i].value;
      		break;
    	}
	}

	var variabile='';
	if(metodo==1)
		variabile='/nomeCategoria=Birikino/filtro=Si';
	else if(metodo==2)
		variabile='/nomeCategoria=Birikina/filtro=Si';
	else if(metodo==3)
		variabile='/nomeCategoria=Birikini/filtro=Si';
	else if(metodo=='venduti')
		variabile='/nomeCategoria=venduti/filtro=Si';
	else if(metodo=='visto')
		variabile='/nomeCategoria=visto/filtro=Si';
	document.getElementById("ricerca").action=PATH_SERVER+'prodotti_ita.php'+variabile;
	document.getElementById("ricerca").submit();

}

/*// ANTI-SPAM ////////////////////////////////////////////////////////////////////////////////////*/
function DisplayMail(Server, Login, Display){
if ((Display.length == 0) || (Display.indexOf('@')+1)) {
document.write("<a href=" + "'mai" + "lto:" + Login + "@" + Server + "'>" + Login + "@" + Server + "</a>"); }
else {
document.write("<a href=" + "'mai" + "lto:" + Login + "@" + Server + "'>" + Display + "</a>"); }
}







 