
  /**
   * Apre una nuova finestra del browser secondo i parametri passati in input
   * controllando che tipo di browser ha fatto la richiesta e dimensionando la
   * finestra nel modo pił opportuno in base ai parametri ricevuti
   */
  function nuova(url,target,widthEx,heightEx,widthNav,heightNav,toolbar,location,status,menubar,scrollbars,resizable)
  {
  
    if(widthNav == null)
      widthNav = widthEx;
    if(heightNav == null)
      heightNav = heightEx;
    if(toolbar == null)
      toolbar = 'no';
    if(location == null)
      location = 'no';
    if(status == null)
      status = 'no';
    if(menubar == null)
      menubar = 'no';
    if(scrollbars == null)
      scrollbars = 'no';
    if(resizable == null)
      resizable = 'no';

    var width = widthEx;
    var height = heightEx;
    if(navigator.appName == "Netscape")
    {
      width = widthNav;
      height = heightNav;
    }
    desktop = window.open(url, target, "toolbar="+toolbar+",location="+location+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",width="+width+",height="+height+",resizable="+resizable+"");
    desktop.focus();
  }


  /**
   * Ricarica la pagina che ha lanciato la popup in base all'url
   * in input, e chiude la popup
   * @param  url  la location della pagina principale
   */
  function closeAndReload(url)
  {
    if(url != "")
      window.opener.location = url;
    window.close();
  }

  /**
   * Ricarica la matrice contenente la pagina che ha lanciato la popup in base all'url
   * in input, e chiude la popup
   * @param  url  la location della pagina principale
   */
  function closeAndReloadTop(url)
  {
    if(url != "")
      parent.opener.top.location = url;
    window.close();
  }



