var dati = new Array();
function mostra(id,evt){
var scroll=document.body.scrollTop;
asse_x = evt.clientX;
asse_y = evt.clientY+scroll;
var larghezza= document.body.clientWidth;
if (asse_x > 390){asse_x=asse_x-370};
document.getElementById("testo").style.left=asse_x+10;
document.getElementById("testo").style.top=asse_y+10;
document.getElementById("testo").style.display = "block";
document.getElementById("testo").innerHTML = dati[id];
}
function spegni() {
document.getElementById("testo").style.display = "none";
}

function openNewWindow(address,name)
{
	
	window.open (address,name,"dependent=yes,toolbar=no,status=no,scrollbars=yes,resizable=yes,alwaysLowered=yes");

}


function openNewWindowEx(address,name,x,y)
{

	var parm = "width="+x+",height="+y+",left=0, top=0,dependent=yes,toolbar=no,status=no,scrollbars=no,resizable=no,alwaysRaised=yes";
	window.open (address,name,parm);
    

}

function sponsor (name){
window.parent.frame.location.href=name;
}
function Form1_Validator(theForm)
{
  if (theForm.societa.value == "")
  {
    alert("ATTENZIONE! Compilare il campo  \"Societā\".");
    theForm.societa.focus();
    return (false);
  }
  if (theForm.nome.value == "")
  {
    alert("ATTENZIONE! Compilare il campo  \"nome\".");
    theForm.nome.focus();
    return (false);
  }

  if (theForm.cognome.value == "")
  {
    alert("ATTENZIONE! Compilare il campo  \"Cognome\".");
    theForm.cognome.focus();
    return (false);
  }
  if (theForm.indirizzo.value == "")
  {
    alert("ATTENZIONE! Compilare il campo  \"indirizzo\".");
    theForm.indirizzo.focus();
    return (false);
  }

  if (theForm.cap.value == "")
  {
    alert("ATTENZIONE! Compilare il campo  \"CAP\".");
    theForm.cap.focus();
    return (false);
  }

  if (theForm.cap.value.length < 5)
  {
    alert("Codice \"CAP\" deve essere di 5 cifre.");
    theForm.cap.focus();
    return (false);
  }

  if (theForm.cap.value.length > 5)
  {
    alert("Codice \"CAP\" troppo lungo.");
    theForm.cap.focus();
    return (false);
  }

  var checkOK = "0123456789-.";
  var checkStr = theForm.cap.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch != ".")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Il campo \"CAP\" č solo numerico.");
    theForm.cap.focus();
    return (false);
  }

  if (theForm.citta.value == "")
  {
    alert("ATTENZIONE! Compilare il campo  \"cittā\".");
    theForm.citta.focus();
    return (false);
  }

  if (theForm.provincia.value == "")
  {
    alert("ATTENZIONE! Compilare il campo  \"Provincia\".");
    theForm.provincia.focus();
    return (false);
  }

  if (theForm.telefono.value == "")
  {
    alert("ATTENZIONE! Compilare il campo  \"Telefono\".");
    theForm.telefono.focus();
    return (false);
  }
  
  if (theForm.fax.value == "")
  {
    alert("ATTENZIONE! Compilare il campo  \"Fax\".");
    theForm.fax.focus();
    return (false);
  }  
  if (theForm.email.value == "")
  {
    alert("ATTENZIONE! Compilare il campo  \"e-mail\".");
    theForm.email.focus();
    return (false);
  }

  return (true);
}
