
<!-- 	/*controllo form CONTATTI*/	
function convalida(){
	var erroremsg="";
	frm = document.forms['contatti'];
		
	var chiocciola=frm.email.value.indexOf("@",0);	
	var punto=frm.email.value.indexOf(".",chiocciola);	
	var cippa=frm.email.value.length;


	// dati
	if (frm.Nome.value  == ""){
		erroremsg = erroremsg + "* nome" + "\n";
	}
	
	if (frm.Cognome.value  == ""){
		erroremsg = erroremsg + "* cognome" + "\n";
	}

	if (frm.email.value == ""){
		erroremsg = erroremsg + "* e-mail " + "\n";
		}
		else if (frm.email.value.length<5)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
		}
		else if (chiocciola<0 ||	punto<0 ||	cippa<4)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
	}
	
	if (frm.Commenti.value  == ""){
		erroremsg = erroremsg + "* Note" + "\n";
	}		
	
	if (frm.privacy[1].checked || !frm.privacy[0].checked) {
		erroremsg = erroremsg + "* Informativa sulla privacy" + "\n";
	}
	
	if (erroremsg=="") {
		//alert(invierebbe)
		frm.submit();
	} 
	
	else {
		erroremsg = 'Mancano i seguenti campi obbligatori:\n'+ '\n' + erroremsg;
		alert(erroremsg);
	}
}
//-->
<!-- 	/*controllo form Area riservata RIVENDITORI */	
function convalidaAccessoRivenditori(){
	var erroremsg="";
	frm = document.forms['loginRivenditori'];

	// dati
	if (frm.Username.value  == ""){
		erroremsg = erroremsg + "* Username" + "\n";
	}
	
	if (frm.Password.value  == ""){
		erroremsg = erroremsg + "* Password" + "\n";
	}
	
	if (erroremsg=="") {
		//alert(invierebbe)
		frm.submit();
	} 
	
	else {
		erroremsg = 'Mancano i seguenti campi obbligatori:\n'+ '\n' + erroremsg;
		alert(erroremsg);
	}
}
//-->
<!-- 	/*controllo form Area riservata PRIVATI */	
function convalidaAccessoPrivati(){
	var erroremsg="";
	frm = document.forms['loginPrivati'];

	// dati
	if (frm.Username.value  == ""){
		erroremsg = erroremsg + "* Username" + "\n";
	}
	
	if (frm.Password.value  == ""){
		erroremsg = erroremsg + "* Password" + "\n";
	}
	
	if (erroremsg=="") {
		//alert(invierebbe)
		frm.submit();
	} 
	
	else {
		erroremsg = 'Mancano i seguenti campi obbligatori:\n'+ '\n' + erroremsg;
		alert(erroremsg);
	}
}
//-->

<!-- 	/*controllo Registrazione*/	
function convalidaRegistrazione(){
	var erroremsg="";
	frm = document.forms['registrazione'];
		
	var chiocciola=frm.email.value.indexOf("@",0);	
	var punto=frm.email.value.indexOf(".",chiocciola);	
	var cippa=frm.email.value.length;


	// dati
	if (frm.nome.value  == ""){
		erroremsg = erroremsg + "* nome" + "\n";
	}
	
	if (frm.cognome.value  == ""){
		erroremsg = erroremsg + "* cognome" + "\n";
	}

	if (frm.email.value == ""){
		erroremsg = erroremsg + "* e-mail " + "\n";
		}
		else if (frm.email.value.length<5)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
		}
		else if (chiocciola<0 ||	punto<0 ||	cippa<4)
		{
		erroremsg = erroremsg + "* e-mail (non corretta)" + "\n";
	}
	if (frm.citta.value  == ""){
		erroremsg = erroremsg + "* cittą" + "\n";
	}	
	if (frm.provincia.value  == ""){
		erroremsg = erroremsg + "* provincia" + "\n";
	}		
	
	if (frm.privacy[1].checked || !frm.privacy[0].checked) {
		erroremsg = erroremsg + "* Informativa sulla privacy" + "\n";
	}
	
	if (erroremsg=="") {
		//alert(invierebbe)
		frm.submit();
	} 
	
	else {
		erroremsg = 'Mancano i seguenti campi obbligatori:\n'+ '\n' + erroremsg;
		alert(erroremsg);
	}
}
//-->

<!-- 	/*cambia categoria per i pdf*/	
function cambiacategoria(IDcategoria)
 {
	//alert("aasasas:");
	if (IDcategoria != "")
	{
		//alert("IDcategoria:"+IDcategoria);
		location.href = "pdf.asp?IDcategoria="+IDcategoria;
	}	
	else 
	{
	location.href = "pdf.asp";
	}	
		
 }
//-->

<!-- metodo links
function intercetta() {
    for (var i=0; i<document.links.length; i++)
        if (document.links[i].className=="blank" | document.links[i].className=="numPagina") {
            document.links[i].target="_blank";
        }
}
window.onload = intercetta;
//-->
