function chiudi()
{
   window.close();
}

function doTimeout(fx, sec)
{
   window.setTimeout(fx, sec);
}

function doRedirect(pag)
{
   sPagina = ""+pag+"";
   location.href = sPagina;
}

function doTimeoutUrl(pagina, sec)
{
   sPagina = "doRedirect(\""+pagina+"\")";
   window.setTimeout(sPagina, sec);
}

function ReloadInserimento(pagina)
{
   parent.frames['inserimento'].location.href = pagina;
}

function ReloadFrame(nomeframe, pagina)
{
   parent.frames[nomeframe].location.href = pagina;
}

function RefreshFrame(nomeframe)
{
   parent.frames[nomeframe].location.reload();
}

function closeAndRefresh(first, second)
{
   parent.frames[first].location.reload();
   if (second != -1)
      parent.frames[second].location.reload();
   doTimeout("chiudi()", 0);
}

function foto(foto, s_width, s_height)
{
   w = s_width + 30;
   h = s_height + 30;
   opts = "menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+w+", height="+h;

   s=window.open(foto, '', opts);
}

function right(e)
{
   if ((navigator.appName == 'Netscape' && (e.button == 2 || e.button == 3)) ||
       (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)))
   {
      alert("Spiacenti, il tasto destro del mouse e' disabilitato ");
      return false;
   }

   return true;
}
