function loadPicture(img){
  pic = new Image();
  pic.src = (img);
  checkPicture(img);
}

function checkPicture(img){
  if ((pic.width!=0)&&(pic.height!=0)) {
    openPicture(img);
  }
  else {
    doit = "checkPicture('"+img+"')";
    interval = setTimeout(doit, 20);
  }
}

function openPicture(img){
  width = pic.width + 40;
  height = pic.height + 20;
  strOpen = "width="+ width +", height=" + height;
  win = popUp(img,width,height);
  //win = openIT1(img,width,height,null,null,'chrome',0,true,true,true,'Zoom','Zoom');
}

function rollOver(imgDocID1,imgObjName1) {
  document.images[imgDocID1].src = eval(imgObjName1 + ".src")
}

function popUp(m_file, m_width, m_height) {
  var p = null;
  m_width = m_width + 30;
  m_height = m_height + 30;
  p = window.open(m_file,"zoom","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,noresize,width="+m_width+",height="+m_height+",top=0,left=0,screenX=0,screenY=0");
}

function checkForm(theForm) {
  for (var i = 0; i < theForm.length; i++) {
    req = document.getElementById(theForm.elements[i].id).required;
    if (req == "y") {
      if (theForm.elements[i].value.length < 1) {
        alert("Valore richiesto! Inserire un valore nel campo "+theForm.elements[i].id+".");
        theForm.elements[i].focus();
        return (false);
      }
    }
  }
}