function ControllaEmail(valore)
  {
//          ^[-!#$%&'*+./=\\^'{}~A-Za-z0-9_]+@[A-Za-z0-9_]{1}[-!#$%&'*+./=\\^'{}~A-Za-z0-9_]*\.[A-Za-z]{2,4}$",  
  var re = /^[-!#$%&'*+./=\\^'{}~A-Za-z0-9_]+@[A-Za-z0-9_]{1}[-!#$%&'*+./=\\^'{}~A-Za-z0-9_]*\.[A-Za-z]{2,4}$/;
  return re.test(valore);
  }

function ControllaProv(valore)
  {
  var re = /^[A-Za-z]{2}$/;
  return re.test(valore);
  }

function ControllaNumeroSerie(valore1, valore2, valore3)
  {
  var re1 = /^[A-Za-z0-9]{2}$/;
  var re2 = /^[A-Za-z0-9]{5}$/;
  return re1.test(valore1) && re2.test(valore2) && re2.test(valore3);
  }

function ControllaIdentificativo(valore)
  {
  var re = /^[A-Za-z0-9]{9}$/;
  return re.test(valore);
  }

function ControllaPIVA(valore)
  {
  var re = /^[A-Za-z0-9]{11,16}$/;
  return re.test(valore);
  }

function popup(url,x,y)
  {
  var newWind = null;
  if (parseInt(navigator.appVersion)>=4)
    {
    if (navigator.appName=="Netscape")
      {
      x += 16; y += 16
      }
    else
      {
      x += 20; y += 30
      }
    var winpar = "width=" + x + ",height=" + y;
    var leftPos = Math.floor((screen.width - x)/2) - 6; 
    var topPos = Math.floor((screen.height - y)/2) - 15; 
    if (leftPos < 0)
      leftPos = 0;
    if (topPos < 0)
      topPos = 0;
    winpar += ",location=0,menubar=0,resizeable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,left=" + leftPos + ",top=" + topPos
    if (newWind && !newWind.closed)
      {
      newWind.close()
      newWind = window.open(url, "new_window", winpar)
      }
    else
      {
      newWind = window.open(url, "new_window", winpar)
      }
    }
  else
    {
    window.location = url
    }
  }

