// Menu testata

sfHover = function() {
	var sfEls = document.getElementById("testata").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


// Menu laterale

sfHover = function() {
	var sfEls = document.getElementById("left").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);






function Confirm_User()
{


	if (celex_form.privacy.checked==false)
	{
  	alert("Attenzione:\nPer la registrazione devi Accettare le condizioni per la privacy");
  	return false;
 	}


	if (celex_form.nome.value=="") 
	{
	alert("Attenzione:\nInserisci il tuo Nome");
	celex_form.nome.style.background = "#FFFF00";
	celex_form.nome.focus();
	return false;
	}


	if (celex_form.cognome.value=="") 
	{
	alert("Attenzione:\nInserisci il tuo Cognome");
	celex_form.cognome.style.background = "#FFFF00";
	celex_form.cognome.focus();
	return false;
	}


	if (celex_form.email.value=="") 
	{
	alert("Attenzione:\nInserisci l'indirizzo Email");
	celex_form.email.style.background = "#FFFF00";
	celex_form.email.focus();
	return false;
	}


	if (!celex_form.email.value=="")
	{
	var re = new RegExp("^[!#$&'*+/-9=?A-Z^-~-]+(\\.[!#$&'*+/-9=?A-Z^-~-]+)*@[!#$&'*+/-9=?A-Z^-~-]+(\\.[!#$&'*+/-9=?A-Z^-~-]+)+$","");

	if (!celex_form.email.value.match(re))
	{
	alert("Attenzione!!!\nInserisci correttamente l'indirizzo \"Email\".\n");
	celex_form.email.style.background = "#FFFF00"; 
	celex_form.email.select();
	return false;
	} 
	}


	if (celex_form.indirizzo.value=="") 
	{
	alert("Attenzione:\nInserisci il tuo Indirizzo");
	celex_form.indirizzo.style.background = "#FFFF00";
	celex_form.indirizzo.focus();
	return false;
	}

	
	if (celex_form.cap.value=="") 
	{
	alert("Attenzione:\nInserisci il CAP");
	celex_form.cap.style.background = "#FFFF00";
	celex_form.cap.focus();
	return false;
	}


	if (celex_form.comune.value=="") 
	{
	alert("Attenzione:\nInserisci il Comune");
	celex_form.comune.style.background = "#FFFF00";
	celex_form.comune.focus();
	return false;
	}


	if (celex_form.prov.value=="") 
	{
	alert("Attenzione:\nInserisci la Provincia");
	celex_form.prov.style.background = "#FFFF00";
	celex_form.prov.focus();
	return false;
	}



	if (celex_form.pass_cd.value=="") 
	{
	alert("Attenzione:\nScegli la tua Password");
	celex_form.pass_cd.style.background = "#FFFF00";
	celex_form.pass_cd.focus();
	return false;
	}
		

celex_form.submit()
} 




function Confirm_UserP()
{
newp=celex_form_mod.pass.value;


	if (newp != celex_form_mod.confirm_pass.value) 
	{
	alert("Attenzione:\nVERIFICA nuova Password");
	celex_form_mod.pass.style.background = "#FFFF00";
	celex_form_mod.confirm_pass.style.background = "#FFFF00";
	return false;
	}


	if (celex_form_mod.nome.value=="") 
	{
	alert("Attenzione:\nInserisci il tuo Nome");
	celex_form_mod.nome.style.background = "#FFFF00";
	celex_form_mod.nome.focus();
	return false;
	}


	if (celex_form_mod.cognome.value=="") 
	{
	alert("Attenzione:\nInserisci il tuo Cognome");
	celex_form_mod.cognome.style.background = "#FFFF00";
	celex_form_mod.cognome.focus();
	return false;
	}


	if (celex_form_mod.mail.value=="") 
	{
	alert("Attenzione:\nInserisci l'indirizzo Email");
	celex_form_mod.mail.style.background = "#FFFF00";
	celex_form_mod.mail.focus();
	return false;
	}


	if (!celex_form_mod.mail.value=="")
	{
	var re = new RegExp("^[!#$&'*+/-9=?A-Z^-~-]+(\\.[!#$&'*+/-9=?A-Z^-~-]+)*@[!#$&'*+/-9=?A-Z^-~-]+(\\.[!#$&'*+/-9=?A-Z^-~-]+)+$","");

	if (!celex_form_mod.mail.value.match(re))
	{
	alert("Attenzione!!!\nInserisci correttamente l'indirizzo \"Email\".\n");
	celex_form_mod.mail.style.background = "#FFFF00"; 
	celex_form_mod.mail.select();
	return false;
	} 
	}


	if (celex_form_mod.indirizzo.value=="") 
	{
	alert("Attenzione:\nInserisci il tuo Indirizzo");
	celex_form_mod.indirizzo.style.background = "#FFFF00";
	celex_form_mod.indirizzo.focus();
	return false;
	}

	
	if (celex_form_mod.cap.value=="") 
	{
	alert("Attenzione:\nInserisci il CAP");
	celex_form_mod.cap.style.background = "#FFFF00";
	celex_form_mod.cap.focus();
	return false;
	}


	if (celex_form_mod.comune.value=="") 
	{
	alert("Attenzione:\nInserisci il Comune");
	celex_form_mod.comune.style.background = "#FFFF00";
	celex_form_mod.comune.focus();
	return false;
	}


	if (celex_form_mod.prov.value=="") 
	{
	alert("Attenzione:\nInserisci la Provincia");
	celex_form_mod.prov.style.background = "#FFFF00";
	celex_form_mod.prov.focus();
	return false;
	}


celex_form_mod.submit()
} 





function sped_gratis()
{
document.getElementById("sped").value ='0.00';
form_control.type_trasp.value = 'Ritiro presso il Punto Vendita';

var table=document.getElementById("spedizione");
table.style['display'] = 'none';
table.style['width'] = '610';

var table=document.getElementById("ritiro");
table.style['display'] = 'inline';
table.style['width'] = '610';

calc_toto();
}



function paga_sped()
{
var quantu = document.getElementById("trasporto").value;

document.getElementById("sped").value = quantu;
form_control.type_trasp.value = 'Spedizione con Corriere';

var table=document.getElementById("spedizione");
table.style['display'] = 'inline';
table.style['width'] = '610';

var table=document.getElementById("ritiro");
table.style['display'] = 'none';
table.style['width'] = '610';

calc_toto();
}


