// Script Menu
function Change(oggetto)
{	
	if (document.getElementById(oggetto)) 
	{		
		if (document.getElementById(oggetto).style.display=="none") 
		{
			document.getElementById(oggetto).style.display='';			
		}
		else 
		{
			document.getElementById(oggetto).style.display="none"
		}
	}
}
// Fine

function Spazi(str)
{
	_str = new String(str);
	var result= new String()
	var lung =_str.length
	var i=0;
	var j=lung-1;
	while ((i<lung) && (_str.charAt(i)==" ")) i++;
	if (i==lung) result="";
	else
	{
	while ((j>0) && (_str.charAt(j)==" ")) j--;
	result=_str.substring(i,j+1)
	}
	return result;
}

function checkMail(mail)
{
	var re_mail=/^[\w\-\.]*[\w\.]\@[\w\.]*[\w\-\.]+[\w\-]+[\w]\.+[\w]+[\w $]/;
	if (!re_mail.exec(mail))
		return false;
	else
		return true;
}

function CheckNumeric(valore)
{ 	
	var flagErr
	
	flagErr=true
	if (valore!="")		
	{
		if (isNaN(valore)) flagErr=false
	}
	else
		flagErr=false
	
	return flagErr;	
 }