// JavaScript Document


//aggiumgi ai preferiti
function addbookmark(url, title){
	var bookmarkurl = url
	var bookmarktitle = title
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}


//CONTROLLI FORM

//CONTATTI

function inviaFormNuoviUtenti(){
	//if(document.formNuoviUtenti.RadioGroup1[1].checked){
	//alert("Per inviare il messaggio accettare il trattamento dei dati personali selezionando la voce Accetta.")
	//return;
	//}
		var re = /^[A-Za-z0-9]/
		var str = document.formNuoviUtenti.nome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Nome.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.formNuoviUtenti.cognome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Cognome.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.formNuoviUtenti.mail.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo E-mail.");
		return;
		
		}
		
		
		var re = /^[A-Za-z0-9]/
		var str = document.formNuoviUtenti.login.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Login.");
		return;
		
		}

		var re = /^[A-Za-z0-9]{6,10}/
		var str = document.formNuoviUtenti.pwd.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Password. La password deve contenere almeno di 6 caratteri alfanumerici.");
		return;
		
		}
	
	document.formNuoviUtenti.submit();
	}
	
function invioFormRichiediPassword(){
		var re = /^[A-Za-z0-9]/
		var str = document.formRichiediPassword.mail.value
		if(!re.test(str)){
		alert("Compilare il campo Mail.");
		return;
		
		}
	
	document.formRichiediPassword.submit();
	}
	
	
	function paginaSucc(pagina, cat, nome_pagina){
document.location.href = nome_pagina+"?page="+pagina+"&cat="+cat
}



function inviaFormRicerca(){
document.formRicerca.submit(); 
}


function inviaFormContattiGen(){
	//if(document.formNuoviUtenti.RadioGroup1[1].checked){
	//alert("Per inviare il messaggio accettare il trattamento dei dati personali selezionando la voce Accetta.")
	//return;
	//}
		var re = /^[A-Za-z0-9]/
		var str = document.formContatti.nome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Nome.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.formContatti.cognome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Cognome.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.formContatti.valmail.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo E-mail.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.formContatti.mess.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Messaggio.");
		return;
		
		}


	if(document.formContatti.RadioGroup1[1].checked){
	alert("Per inviare il messaggio accettare il trattamento dei dati personali selezionando la voce Accetta.")
	return;
	}
	
	document.formContatti.submit();
	}

