// JavaScript Document
function openWindow(apri, w, h) {
        var style = "top=0, left=0,width="+w+", height="+h+",status=no, menubar=no, toolbar=no, scrollbars=yes";
		window.open(apri, "", style);
}
function goPage(npage){
	
	document.changePage.page.value = npage;
	document.changePage.submit();
	
}
function goDiv(ndiv,npage){
	
	document.changeDiv.pagediv.value = ndiv;
	document.changeDiv.page.value = npage;
	document.changeDiv.submit();
	
}
function validContact(theForm){

	nome = theForm.nome.value;
	cognome = theForm.cognome.value;
	indirizzo = theForm.indirizzo.value;
	citta = theForm.citta.value;
	provincia = theForm.provincia.value;
	cap = theForm.cap.value;
	email = theForm.email.value;
	
	if(nome ==""){
		alert('Inserire il nome');
		theForm.nome.focus();
		return(false);
	}
	
	if(cognome == ""){
		alert('Inserire il cognome');
		theForm.cognome.focus();
		return(false);
	}
	
	if(indirizzo == ""){
		alert('Inserire l\' indirizzo');
		theForm.indirizzo.focus();
		return(false);
	}
	
	if(citta == ""){
		alert('Inserire la cittą');
		theForm.citta.focus();
		return(false);
	}
	
	if(provincia == ""){
		alert('Inserire la provincia');
		theForm.provincia.focus();
		return(false);
	}
	
	if(cap== ""){
		alert('Inserire il cap');
		theForm.cap.focus();
		return(false);
	}
	
	if(email == ''){
		alert("inserire il proprio indirizzo email");
		theForm.email.focus();
		return(false);
	}
	else
	{
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!filter.test(email)){
			alert('Per favore inserisci un indirizzo email valido');
			theForm.email.focus();
			return(false);
		}
	}
	
	privacy = -1;
	if (theForm.privacy.checked) {
			privacy = 1;
	}
	
	if (privacy == -1) {
		alert("Devi selezionare la sezione relativa alle Norme sulla Privacy");
		return false;
	}
	
	return(true);

}
function Docnews(nome){
	
	document.downloadDocNews.nome.value = nome;
	document.downloadDocNews.submit();
}
function Docpro(nome){
	
	document.downloadDocPro.nome.value = nome;
	document.downloadDocPro.submit();
}
function Docev(nome){
	
	document.downloadDocEv.nome.value = nome;
	document.downloadDocEv.submit();
}