function select_news(elemento){
	//alert(elemento.selectedIndex);
	var sel_nanocap = "http://www.nanocap.legambiente.org/?p=newsletter";
	var selezione = elemento.options[elemento.selectedIndex].value;
	if(selezione=="nanocap"){
		document.getElementById('nascondi_par_news').style.display = 'none';
		alert("Verrai ora rediretto alla pagina per registrati alla newsletter Nanocap");
		document.form_newsletter.action = "";
		location.href = sel_nanocap;
	}
	else if(selezione==""){
		document.getElementById('nascondi_par_news').style.display = 'none';
		document.form_newsletter.action = "";
		alert("Devi selezionare una newsletter per poterti iscrivere.");
	}
	else{
		document.getElementById('nascondi_par_news').style.display = 'block';
		document.form_newsletter.action = "http://newsletter.legambiente.org/"+selezione+"/user/process.php";
		document.getElementById('nome').focus();
	}	
	return true;

}

function checkMail(value) {
	var mailregex = new RegExp("^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$");
	if(mailregex.test(value)){
		return(true);
	}
	return(false);
}
function controlla_newsletter(formLA){
	if (document.getElementById('nome').value==""){
		alert ("Devi inserire il tuo nome.");
		document.getElementById('nome').focus();
		return false
	} 
	if (!checkMail(document.getElementById('email').value)){
		alert ("Devi inserire un'indirizzo e-mail corretto.");
		document.getElementById('email').focus();
		return false
	} 
	return true
}



