var fieldstocheck = new Array();
    fieldnames = new Array();

function checkform() {
  for (i=0;i<fieldstocheck.length;i++) {
    if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "") {
      alert("Per favore, inserisci il tuo "+fieldnames[i]);
      eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
      return false;
    }
  }

  if(! compareEmail())
  {
    alert("Gli indirizzi Email inseriti non coincidono");
    return false;
  }
  return true;
}


function addFieldToCheck(value,name) {
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}

function compareEmail()
{
  return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}

function openWin(url, id, height, width)
{
        var left, top;
        left = (screen.width - width) / 2;
        top = (screen.height - height) / 2;
        settings='height=' + height + ',width=' + width + ',scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no,left=' + left + ',top=' + top;
        var newWindow = window.open(url,id,settings);
        newWindow.focus();
}
// -->
