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("Insert your e-mail, please.");
		u.focus();
		return;
	}
	
	if (!isEmail(u.value)){
		alert("Warning! Please fill in a correct email address.");
		u.focus();
		return 1;
	}

	c=document.getElementById("password");
	if(c.value==""){
		alert("Insert your password, please.");
		c.focus();
		return;
	}

	controllo_login(u.value,c.value);

}


///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO REGISTRAZIONE
 ///////////////////////////////////////////////////////////////////////////////////
function send_registrazione(){
	c=document.getElementById("email");
	if(c.value==""){
		alert("Insert your e-mail, please.");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Warning! Please fill in a correct email address.");
		c.focus();
		return 1;
	}

	c=document.getElementById("pass");	
	if(c.value=="" || c.value.length<8){	
		alert("Your password must have at least eight characters.");
		c.focus();
		return;
	
	}

	c2=document.getElementById("conferma");	
	if(c.value!=c2.value ){	
		alert("The two passwords are different.");
		c2.focus();
		return;
	
	}

	c=document.getElementById("piva");
	if(c.value==""){
		alert("Insert your VAT number or National Insurance Number or Tax Code,please.");
		c.focus();
		return;
	}

	c=document.getElementById("nome");
	if(c.value==""){
		alert("Insert your name, please.");
		c.focus();
		return;
	}

	c=document.getElementById("cognome");
	if(c.value==""){
		alert("Insert your surname, please.");
		c.focus();
		return;
	}

	c=document.getElementById("indirizzo");
	if(c.value==""){
		alert("Insert your address, please.");
		c.focus();
		return;
	}
		c=document.getElementById("civico");
	if(c.value==""){
		alert("Insert your number,please");
		c.focus();
		return;
	}
		c=document.getElementById("citta");
	if(c.value==""){
		alert("Insert your city, please.");
		c.focus();
		return;
	}

	c=document.getElementById("cap");
	if(c.value==""){
		alert("Insert your zip code, please.");
		c.focus();
		return;
	}
	c=document.getElementById("provincia");
	if(c.value==""){
		alert("Insert your province, please.");
		c.focus();
		return;
	}
	c=document.getElementById("nazione");
	if(c.value==""){
		alert("Insert your country, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("telefono");
	c2=document.getElementById("cellulare");
	if(c.value=="" && c2.value==""){
		alert("Insert al least your telephone or mobile number, please. ");
		c.focus();
		return;
	}




	c=document.getElementById("frm_agree");
	if (!c.checked){
		alert("Please, read the privacy policy and check for consense of processing personal data.");
		c.focus();
		return;
	}
	
	document.getElementById("azionex").value='iscrizione';
	document.getElementById("formDati").action='registrazione_eng.php';
	document.getElementById("formDati").submit();
}







 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO CANCELLAZIONE REGISTRAZIONE
 ///////////////////////////////////////////////////////////////////////////////////
function cancella_registrazione(){
	var c;
	c=document.getElementById("email_cancella");
	if(c.value==""){
		alert("Insert your e-mail, please.");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Warning! Please fill in a correct email address.");
		c.focus();
		return;
	}
	
	c=document.getElementById("azione_cancella");
	c.value='cancella';
	
	document.getElementById("formCancella").action='registrazione_eng.php';
	document.getElementById("formCancella").submit();


}


 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO CAMBIA EMAIL
 ///////////////////////////////////////////////////////////////////////////////////
function sendCambiaEmail(){

	c=document.getElementById("email_cambia");
	if(c.value==""){
		alert("Insert a news e-mail, please");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Warning! Please fill in a correct email address in 'change mail' field.");
		c.focus();
		return;
	}
	
	if(confirm("You are about to change your e-mail to access the web site.\nClick OK to confirm.")){
		c=document.getElementById("formCambiaEmail");
		c.azione_cambia_email.value='aggiorna';
		c.action='aggiorna-dati_eng.php';
		c.submit();
	}
}

 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO CAMBIA PASSWORD
 ///////////////////////////////////////////////////////////////////////////////////
function sendCambiaPass(){

	c=document.getElementById("pass_nuova");	
	if(c.value=="" || c.value.length<8){	
		alert("Insert a news password (at least eight characters)");
		c.focus();
		return;
	
	}

	c2=document.getElementById("conferma_pass_nuova");	
	if(c.value!=c2.value ){	
		alert("The two password are different.");
		c2.focus();
		return;
	
	}
	
	if(confirm("You are about to change your password to access the web site.\nClick OK to confirm.")){
		c=document.getElementById("formCambiaPass");
		c.azione_cambia_pass.value='aggiorna';
		c.action='aggiorna-dati_eng.php';
		c.submit();
	}
}


 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO AGGIORNA DATI FATTURAZIONE
 ///////////////////////////////////////////////////////////////////////////////////
function sendAggiornaDatiFatturazione(){

	c=document.getElementById("nomeDatiFatturazione");
	if(c.value==""){
		alert("Insert your name for the invoice, please.");
		c.focus();
		return;
	}

	c=document.getElementById("cognomeDatiFatturazione");
	if(c.value==""){
		alert("Insert your surname for the invoice, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("pivacfDatiFatturazione");
	if(c.value==""){
		alert("Insert your VAT number or National Insurance Number or Tax Code,please.");
		c.focus();
		return;
	}

	c=document.getElementById("indirizzoDatiFatturazione");
	if(c.value==""){
		alert("Insert the address for the invoice, please.");
		c.focus();
		return;
	}
		c=document.getElementById("civicoDatiFatturazione");
	if(c.value==""){
		alert("Insert your number for the invoice, please.");
		c.focus();
		return;
	}
		c=document.getElementById("cittaDatiFatturazione");
	if(c.value==""){
		alert("Insert your city for the invoice, please.");
		c.focus();
		return;
	}

	c=document.getElementById("capDatiFatturazione");
	if(c.value==""){
		alert("Insert your zip code for the invoice, please.");
		c.focus();
		return;
	}
	c=document.getElementById("provinciaDatiFatturazione");
	if(c.value==""){
		alert("Insert your province for the invoice, please.");
		c.focus();
		return;
	}
	c=document.getElementById("nazioneDatiFatturazione");
	if(c.value==""){
		alert("Insert your country for the invoice, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("telefonoDatiFatturazione");
	c2=document.getElementById("cellulareDatiFatturazione");
	if(c.value=="" && c2.value==""){
		alert("Insert a telephone number or mobile number for the invoice, please.");
		c.focus();
		return;
	}
	
	if(confirm("You are about to change your personal data for the invoice.\nClick ok to confirm.")){
		c=document.getElementById("formAggiornaDatiFatturazione");
		c.azione_cambia_dati_fatturazione.value='aggiorna';
		c.action='aggiorna-dati_eng.php';
		c.submit();
	}

}


///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO AGGIORNA DATI SPEDIZIONE
 ///////////////////////////////////////////////////////////////////////////////////
function sendAggiornaDatiSpedizione(){

	c=document.getElementById("nomeDatiSpedizione");
	if(c.value==""){
		alert("Insert the name for the shipment, please.");
		c.focus();
		return;
	}

	c=document.getElementById("cognomeDatiSpedizione");
	if(c.value==""){
		alert("Insert the surname  for the shipment, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("campanelloDatiSpedizione");
	if(c.value==""){
		alert("Insert the name on the doorbell for the shipment, please. ");
		c.focus();
		return;
	}

	c=document.getElementById("indirizzoDatiSpedizione");
	if(c.value==""){
		alert("Insert the address  for the shipment, please.");
		c.focus();
		return;
	}
		c=document.getElementById("civicoDatiSpedizione");
	if(c.value==""){
		alert("Insert the number  for the shipment, please.");
		c.focus();
		return;
	}
		c=document.getElementById("cittaDatiSpedizione");
	if(c.value==""){
		alert("Insert the city  for the shipment, please.");
		c.focus();
		return;
	}

	c=document.getElementById("capDatiSpedizione");
	if(c.value==""){
		alert("Insert the xip code  for the shipment, please.");
		c.focus();
		return;
	}
	c=document.getElementById("provinciaDatiSpedizione");
	if(c.value==""){
		alert("Insert the province for the shipment, please.");
		c.focus();
		return;
	}
	c=document.getElementById("nazioneDatiSpedizione");	
	if(c.value==""){
		alert("Insert the country for the shipment, please.");
		c.focus();
		return;
	}
	
	if(confirm("You are about to change the data for the shipment. \nClick OK to confirm.")){
		c=document.getElementById("formAggiornaDatiSpedizione");
		c.azione_cambia_dati_spedizione.value='aggiorna';
		c.action='aggiorna-dati_eng.php';
		c.submit();
	}

}


///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO RECUPERO PASSWORD
 ///////////////////////////////////////////////////////////////////////////////////
function send_recupero_password(){

	c=document.getElementById("email");
	if(c.value==""){
		alert("Insert your e-mail.");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Warning! Please fill in a correct email address.");
		c.focus();
		return;
	}
	
	c=document.getElementById("formRecuperoPassword");
	c.azione.value='send';
	c.action='recupera-password_eng.php';
	c.submit();
}


 ///////////////////////////////////////////////////////////////////////////////////
 // RIMUOVI PRODOTTO CARRELLO
 ///////////////////////////////////////////////////////////////////////////////////

function RimuoviProdottoCarrello(idrimuovi){
	if(confirm("Do you want to remove this product from the cart?\nClick OK to confirm.")){
	document.getElementById("formCarrello").azionex.value='rimuovi';
	document.getElementById("formCarrello").action='shopping-bag_eng.php';
	document.getElementById("formCarrello").idrimuovi.value=idrimuovi;
	document.getElementById("formCarrello").submit();
	}
}

 ///////////////////////////////////////////////////////////////////////////////////
 // AGGIORNA PRODOTTO CARRELLO
 ///////////////////////////////////////////////////////////////////////////////////
function AggiornaProdottoCarrello(idaggiorna){
	if(confirm("Do you want to change the quantity of this product?\nClicck OK to confirm.")){
	document.getElementById("formCarrello").azionex.value='aggiorna';
	document.getElementById("formCarrello").action='shopping-bag_eng.php';
	document.getElementById("formCarrello").idaggiorna.value=idaggiorna;
	document.getElementById("formCarrello").submit();
	}
}
 ///////////////////////////////////////////////////////////////////////////////////
 // RIMUOVI ACCESSORIO CARRELLO
 ///////////////////////////////////////////////////////////////////////////////////
function RimuoviAccessorioCarrello(idrimuovi){
	if(confirm("Do you want to remove this product from the cart?\nClick OK to confirm.")){
	document.getElementById("formCarrello").azionex.value='rimuoviaccessorio';
	document.getElementById("formCarrello").action='shopping-bag_eng.php';
	document.getElementById("formCarrello").idrimuovi.value=idrimuovi;
	document.getElementById("formCarrello").submit();
	}
}

 ///////////////////////////////////////////////////////////////////////////////////
 // AGGIORNA ACCESSORIO CARRELLO
 ///////////////////////////////////////////////////////////////////////////////////
function AggiornaAccessorioCarrello(idaggiorna){
	if(confirm("Do you want to change the quantity of this product?\nClicck OK to confirm.")){
	document.getElementById("formCarrello").azionex.value='aggiornaaccessorio';
	document.getElementById("formCarrello").action='shopping-bag_eng.php';
	document.getElementById("formCarrello").idaggiorna.value=idaggiorna;
	document.getElementById("formCarrello").submit();
	}
}

 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO DATI FATTURAZIONE
 ///////////////////////////////////////////////////////////////////////////////////
 
function sendDatiFatturazione(){

	c=document.getElementById("nomeDatiFatturazione");
	if(c.value==""){
		alert("Insert the namefor the invoice, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("cognomeDatiFatturazione");
	if(c.value==""){
		alert("Insert the surname for the invoice, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("pivacfDatiFatturazione");
	if(c.value==""){
		alert("Insert your VAT number or National Insurance Number or Tax Code,please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("indirizzoDatiFatturazione");
	if(c.value==""){
		alert("Insert the address for the invoice, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("civicoDatiFatturazione");
	if(c.value==""){
		alert("Insert the numberfor the invoice, please.");
		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("Insert the zip code for the invoice, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("provinciaDatiFatturazione");
	if(c.value==""){
		alert("Insert the province for the invoice, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("nazioneDatiFatturazione");
	if(c.value==""){
		alert("Insert the country for the invoice, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("telefonoDatiFatturazione");
	c2=document.getElementById("cellulareDatiFatturazione");
	if(c.value=="" && c2.value==""){
		alert("Insert a telephone number or a mobile number,please");
		c.focus();
		return;
	}
	
	c=document.getElementById("emailDatiFatturazione");
	if(c.value==""){
		alert("Insert the email for the invoice, please.");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Warning! Please fill in a correct email address.");
		c.focus();
		return 1;
	}

	document.getElementById("controlloDatiFatturazione").value='aggiorna';
	document.getElementById("formDatiFatturazione").action='shopping-bag-spedizione_eng.php';
	document.getElementById("formDatiFatturazione").submit();
}






 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO DATI SPEDIZIONE
 ///////////////////////////////////////////////////////////////////////////////////
 
function sendDatiSpedizione(){

	c=document.getElementById("nomeDatiSpedizione");
	if(c.value==""){
		alert("Insert the name for the shipment, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("cognomeDatiSpedizione");
	if(c.value==""){
		alert("Insert the surname for the shipment, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("campanelloDatiSpedizione");
	if(c.value==""){
		alert("Insert the name on the doorbell for the shipment, please'");
		c.focus();
		return;
	}
	
	c=document.getElementById("indirizzoDatiSpedizione");
	if(c.value==""){
		alert("Insert the address for the shipment, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("civicoDatiSpedizione");
	if(c.value==""){
		alert("Insert the number for the shipment, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("cittaDatiSpedizione");
	if(c.value==""){
		alert("Insert the city for the shipment, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("capDatiSpedizione");
	if(c.value==""){
		alert("Insert the zipcode for the shipment, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("provinciaDatiSpedizione");
	if(c.value==""){
		alert("Insert the province for the shipment, please.");
		c.focus();
		return;
	}
	
	c=document.getElementById("nazioneDatiSpedizione");
	if(c.value==""){
		alert("Insert the country for the shipment, please.");
		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_eng.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("Please, select the payment type.");
				c.focus();
				return;
	  		}
		}
	}
	
	

		document.getElementById("formDatiPagamento").azione.value='invia';
	
		document.getElementById("formDatiPagamento").action='shopping-bag-riepilogo_eng.php';

		document.getElementById("formDatiPagamento").submit();
}



 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO LOGIN ORDINE
 ///////////////////////////////////////////////////////////////////////////////////
function loginOrdine(){

	c=document.getElementById("email");
	if(c.value==""){
		alert("Insert your e-mail, please.");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Warning! Please fill in a correct email address.");
		c.focus();
		return ;
	}
	
	c=document.getElementById("pass");
	if(c.value==""){
		alert("Insert your password, please.");
		//c.focus();
		return;
	}
	
	
	
	document.getElementById("azione").value='login';
	document.getElementById("formDatiFatturazione").action='shopping-bag-dati_eng.php';
	document.getElementById("formDatiFatturazione").submit();
}

 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO AVANZAMENTO
 ///////////////////////////////////////////////////////////////////////////////////
function sendBag(){

	document.getElementById("formDati").action='shopping-bag-messaggio_eng.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("Insert your message here and the date which you would like your message to be read.");
		c.focus();
		return;
	}

	c=document.getElementById("emailSorpresa");
	if (c.value!="" && !isEmail(c.value)){
		alert("Warning! Please fill in a correct email address.");
		c.focus();
		return ;
	}


	document.getElementById("azione").value='messaggio';
	document.getElementById("formDati").action='shopping-bag-dati_eng.php';
	document.getElementById("formDati").submit();
}

///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO CONTATTI
 ///////////////////////////////////////////////////////////////////////////////////
function send(){

	c=document.getElementById("nome");
	if(c.value==""){
		alert("Insert your name, please.");
		c.focus();
		return;
	}

	c=document.getElementById("cognome");
	if(c.value==""){
		alert("Insert your surname, please.");
		c.focus();
		return;
	}

	c=document.getElementById("email");
	if(c.value==""){
		alert("Insert your e-mail, please.");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Warning! Please fill in a correct email address.");
		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_eng.php';
	document.getElementById("formDati").submit();
}


///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLO INVIA AMICO
 ///////////////////////////////////////////////////////////////////////////////////
function send_amico(){

	c=document.getElementById("nome");
	if(c.value==""){
		alert("Insert your name, please.");
		c.focus();
		return;
	}

	c=document.getElementById("email_mitt");
	if(c.value==""){
		alert("Inserire la tua mail");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Warning! Please fill in a correct email address.");
		c.focus();
		return 1;
	}
	c=document.getElementById("email_dest");
	if(c.value==""){
		alert("Insert the mail of the recipient");
		c.focus();
		return;
	}

	if (!isEmail(c.value)){
		alert("Warning! Please fill in a correct email address.");
		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_eng.php';
	document.getElementById("formDati").submit();
}

///////////////////////////////////////////////////////////////////////////////////
 // INVIA SCRIGNOINVIA AMICO
 ///////////////////////////////////////////////////////////////////////////////////
function send_scrigno(){

	c=document.getElementById("casella1");
	if(c.value==""){
		alert("Insert the code, please.");
		c.focus();
		return;
	}
	c=document.getElementById("casella2");
	if(c.value==""){
		alert("Insert the code, please.");
		c.focus();
		return;
	}
	c=document.getElementById("casella3");
	if(c.value==""){
		alert("Insert the code, please.");
		c.focus();
		return;
	}
	c=document.getElementById("casella4");
	if(c.value==""){
		alert("Insert the code, please.e");
		c.focus();
		return;
	}
	c=document.getElementById("casella5");
	if(c.value==""){
		alert("Insert the code, please.");
		c.focus();
		return;
	}
	c=document.getElementById("casella6");
	if(c.value==""){
		alert("Insert the code, please.");
		c.focus();
		return;
	}


	document.getElementById("frmscrigno").azione.value='send';
	document.getElementById("frmscrigno").action='cartolina_eng.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_eng.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>"); }
}







 