// JavaScript Document

function checkInfo(list)
{
	
	var msg
	var email2 = /\w+@\w+.+\w{2,4}$/;
	
	msg = "";
	
	if (list.nome.value.length == 0)
	{
		list.nome.focus();
		msg += "Il NOME e' obbligatorio.\n";
	}
	
	if (list.citta.value.length == 0)
	{
		list.citta.focus();
		msg += "La CITTA' e' obbligatoria.\n";
	}
	
	if (list.tel.value.length == 0)
	{
		list.tel.focus();
		msg += "Il NUMERO DI TELEFONO e' obbligatorio.\n";
	}
	
	if (list.tel.value.length != 0) 
	{
		if (isNaN(list.tel.value) || list.tel.value.length < 5 ) {
			msg += "Il TELEFONO e' errato\n";
			list.tel.focus();
		}
	}
	
	if (list.email.value.length == 0)
	{
		list.email.focus();
		msg += "L'EMAIL e' obbligatoria.\n";
	}
	
	if ((list.email.value.length != 0) && (!list.email.value.match(email2)))
	{
		list.email.focus();
		msg += "L' EMAIL non è corretta\n";
	}
	
	if (list.info.value.length == 0)
	{
		list.info.focus();
		msg += "INFO e' obbligatorio.\n";
	}
	
	if(msg != "")
		alert("ATTENZIONE :"+msg)
	else
		list.submit();

}

//******************************************************************************

jQuery(function(){
	   
jQuery("#tab a")
	.css( {backgroundPosition: "right 0"} )
	.mouseover(function(){
		jQuery(this).stop().animate({backgroundPosition:"(right -px)"}, {duration:400})
	})
	.mouseout(function(){
		jQuery(this).stop().animate({backgroundPosition:"(right 0)"}, {duration:400})
	})
	
				jQuery("#tab a span")
	.css( {backgroundPosition: "left 0"} )
	.mouseover(function(){
		jQuery(this).stop().animate({backgroundPosition:"(0 -px)"}, {duration:400})
	})
	.mouseout(function(){
		jQuery(this).stop().animate({backgroundPosition:"(left 0)"}, {duration:400})
	})

});