// JavaScript Document
$(document).ready(function() {
			   
	       var d=300;
                
                $('#navigation > li').hover(
                function () {
                    $('a',$(this)).stop().animate({
                        'marginTop':'-2px'
                    },200);
                },
                function () {
                    $('a',$(this)).stop().animate({
                        'marginTop':'-65px'
                    },200);
                }
            );
           
$("a#news").fancybox({
					 'opacity' : true,
					 'overlayColor':'#cccccc',
					 'transitionIn':'elastic',
					 'transitionOut':'elastic',
					 'centerOnScroll':true,
					 'hideOnOverlayClick':false,
					 'padding':5,
					 'titleShow':false})
 });
function controlla_news() {
	document.getElementById("n_errore").innerHTML="";
	var n_nome = document.n_modulo.n_nome.value;
	var n_email = document.n_modulo.n_email.value;
	
	if ((n_nome == "") || (n_nome == "undefined")) {
	document.getElementById("n_errore").innerHTML="Inserire il nome";
	return false;}
	
	else if ((n_email.indexOf("@") == (-1)) || (n_email == "") || (n_email == "undefined")) {
	document.getElementById("n_errore").innerHTML="Inserire un email valido";
	return false; }
			
	else if (document.n_modulo.privacy.checked == false)  {
	document.getElementById("n_errore").innerHTML="accetta la privacy";
	return false; }
	
	else {
	//document.n_modulo.method = "Post";
	//document.n_modulo.action = "invia_news.php";
    document.n_modulo.submit();
	xmlhttpPost('invia_news.php', 'n_modulo', 'n_errore', 'Wait...');return false;
}}
