function check(field) {
    var qnt;

    qnt=0;
    for (i = 0; i < field.length; i++) {
        if (field[i].checked) {
            qnt++;
        }
    }

    if (qnt>=1&&qnt<=36) {
        document.forms['listap'].elements['cmdMV'].disabled=false;
        document.forms['listap'].elements['pnlControllo'].disabled=false;
        document.forms['listap'].elements['cmdSP'].disabled=false;
        document.forms['listap'].elements['ChkJava'].disabled=false;
        document.forms['listap'].elements['ChkFlash'].disabled=false;
    }else{
        document.forms['listap'].elements['cmdMV'].disabled=true;
        document.forms['listap'].elements['pnlControllo'].disabled=true;
        document.forms['listap'].elements['cmdSP'].disabled=true;
        document.forms['listap'].elements['ChkJava'].disabled=true;
        document.forms['listap'].elements['ChkFlash'].disabled=true;
    }
}

function Splitta(field) {
    var theWidth=390
    var theHeight=330
    var someFeatures = 'scrollbars=yes,toolbar=0,location=no,directories=0,status=0,menubar=0,resizable=1,width=' + theWidth + ',height=' + theHeight;
    for (i = 0; i < field.length; i++) {
        if (field[i].checked) {
            var aPopUpWin = window.open(document.forms['listap'].elements['VarUrl'+i].value, 'Split'+i, someFeatures);
            //alert(document.forms['listap'].elements['VarUrl'+i].value);
        }
    }
}

function launch(url) {
  var w = 480, h = 340;

  if (document.all) {
    /* the following is only available after onLoad */
    w = document.body.clientWidth;
    h = document.body.clientHeight;
  }
  else if (document.layers) {
    w = window.innerWidth;
    h = window.innerHeight;
  }

  var popW = 465, popH = 570;
  var leftPos = (w-popW)/2, topPos = (h-popH)/2;

  self.name = "opener";
  remote = open(url, 'helpWin', "resizable,scrollbars,status,width=" + popW + ",height="+popH+",left="+leftPos+",top="+topPos+"");
}

function openPopUp(thePage, theName, theWidth, theHeight) {
  var someFeatures = 'scrollbars=yes,toolbar=0,location=no,directories=0,status=0,menubar=0,resizable=1,width=' + theWidth + ',height=' + theHeight;
  var aPopUpWin = window.open(thePage, theName, someFeatures);

  if (navigator.appName == "Netscape") {
    aPopUpWin.focus();
  }
}

function showStatus(msg) {
  window.status = msg
  return true
}

function pageSetup() {
    document.forms['listap'].elements['cmdSP'].disabled=true;
    document.forms['listap'].elements['cmdMV'].disabled=true;
    document.forms['listap'].elements['ChkJava'].disabled=true;
    document.forms['listap'].elements['ChkFlash'].disabled=true;
    document.forms['listap'].elements['pnlControllo'].disabled=true;
}

document.observe('dom:loaded', function() {
    pageSetup();
});
