  /* centra i pop up sullo schermo */
  function centerPopX(popW){ if(!popW) popW=500; return ((screen.availWidth - popW)/2);  }
  function centerPopY(popH){ if(!popH) popH=270; return ((screen.availHeight - popH)/2); }

    var newwin;
    function launchwin(winurl,winname,winfeatures)
    {
      newwin = window.open(winurl,winname,winfeatures);
      if(javascript_version > 1.0)
      {
        setTimeout('newwin.focus();',250);
      }
    }


    /* mostra/nasconde sottomenu */
    function apri()
    {
      ogg   = "";
      oggs  = apri.arguments;
      if(document.getElementById)
      {
        for(a = 0; a < oggs.length; a++)
        {
          ogg = document.getElementById(oggs[a]).style;
          if(ogg.display == "block") ogg.display = "none";
          else ogg.display = "block";
        }
      }
    }


    /* scambia le due immagini testata del menu */
    function chImgHead(ogg,nomeImg,start,uOpen,uClose)
    {
      if((typeof(ogg.op)=='undefined')&&(start=='o')) ogg.op = true;

      if(ogg.op)
      {
        ogg.op = false;
        document.images[nomeImg].src = uClose;
      }
      else
      {
        ogg.op = true;
        document.images[nomeImg].src = uOpen;
      }
    }

    /*
      effettua il preload di immmagini
      (bisogna caricare anche la funzione MM_preloadImages)
      da posizionare sull'onload dell'immagine con cui fare
      il rollover.
      ogg      è l'oggetto (si può usare 'this')
      img2load è l'url dell'immagine da caricare
      loaded   è una proprietà creata per l'oggetto che indica
               che il preload è stato effettuato (serve per explorer:
               evita il continuo preload ogni mouseover)

    */
    function autoPreload(ogg,img2load)
    {
      if((typeof(ogg.loaded)=="undefined")||ogg.loaded!=1)
      {
        MM_preloadImages(img2load);
        ogg.loaded = 1;
      }
    }

