// JavaScript Document //


// fa comparire un layer sopra a risorse //

function disappear()
{document.getElementById('Layer1').style.visibility="hidden"}

function reappear()
{document.getElementById('Layer1').style.visibility="visible"}



// controllo form contatti// 


function controllo_form(theForm){
		if (theForm.nome.value == "") {
    	alert("Please insert your name in the right input text, thank you");
    	theForm.nome.focus();
    	return (false);
		}
		if (theForm.cognome.value == "") {
    	alert("Please insert your surname in the right input text, thank you");
    	theForm.cognome.focus();
    	return (false);
		}
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(theForm.mittente.value))) {
    	alert("Please insert your e mail address in the right input text, thank you");
    	theForm.mittente.focus();
    	return (false);
		}	
		if (theForm.code.value == "") {
    	alert("Please insert the secure code in the right input text, thank you");
    	theForm.code.focus();
    	return (false);
		}
 	 	if (!theForm.privacy.checked) {
    	alert("Please accept the privacy statements in order to send us your mail, thank you");
    	theForm.privacy.focus();		
    	return (false);
		}
	}

// controllo form editoriale// 

function controllo_editoriale(theForm){
		if (theForm.autore.value == "") {
    	alert("Please insert your name in the right input text, thank you");
    	theForm.autore.focus();
    	return (false);
		}
		if (theForm.autore_1.value == "") {
    	alert("Please insert your surname in the right input text, thank you");
    	theForm.autore_1.focus();
    	return (false);
		}
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(theForm.mittente.value))) {
    	alert("Please insert your e mail address in the right input text, thank you");
    	theForm.mittente.focus();
    	return (false);
		}
		if (theForm.titolo.value == "") {
    	alert("Please insert the title of your comment in the right input text, thank you");
    	theForm.titolo.focus();
    	return (false);
		}
		if (theForm.commento.value == "") {
    	alert("Please insert the comment in the right input text, thank you");
    	theForm.commento.focus();
    	return (false);
		}
		if (theForm.code.value == "") {
    	alert("Please insert the secure code in the right input text, thank you");
    	theForm.code.focus();
    	return (false);
		}
}

// controllo form commenti// 

function controllo_commenti(theForm){
		if (theForm.parola_1.value == "") {
    	alert("Please insert your name in the right input text, thank you");
    	theForm.parola_1.focus();
    	return (false);
		}
		if (theForm.parola_2.value == "") {
    	alert("Please insert your surname in the right input text, thank you");
    	theForm.parola_2.focus();
    	return (false);
		}
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(theForm.parola_3.value))) {
    	alert("Please insert your e mail address in the right input text, thank you");
    	theForm.parola_3.focus();
    	return (false);
		}
		if (theForm.testo_rtf.value == "") {
    	alert("Please insert the comment in the right input text, thank you");
    	theForm.testo_rtf.focus();
    	return (false);
		}
		if (theForm.code.value == "") {
    	alert("Please insert the secure code in the right input text, thank you");
    	theForm.code.focus();
    	return (false);
		}
}

// controllo form newsletter// 

function controllo_newsletter(theForm){
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(theForm.email.value))) {
    	alert("Please insert your e mail address in the right input text, thank you");
    	theForm.email.focus();
    	return (false);
		}
}

