// sniffa il browser
function sniffBrowser()
{
  if(document.layers) return "ns4";

  if(document.getElementById && document.all)
  {
    if((navigator.userAgent.toLowerCase().indexOf('opera')!=-1) || (typeof(window.opera) != "undefined")) return "op";
    return "ie5+";
  }
  if(!document.getElementById && document.all)
  {
     return "ie4";
  }
  if(document.getElementById && !document.all) return "ns6";

}
var navTipo = sniffBrowser();

function showCopyrightAlert()
{
  alert("        www.comune.trevignano.tv.it\n\nTutti i diritti sui contenuti del sito sono riservati \ne non sono riproducibili senza autorizzazione.");
}

function clearRightMouseButton(e)
{
  switch(navTipo)
  {
    case "ns6"  :
    case "ns4"  :
      if(e.which == 3 || e.which == 2)
      {
        showCopyrightAlert();
        e.cancelBubble = true;
        e.returnValue = false;
        return false;
      }
      break;
    case "op"   :
    case "ie4"  :
    case "ie5+" :
      if(!e) e = window.event;
      if(e.button == 2 || e.button == 3)
      {
        showCopyrightAlert();
        e.cancelBubble = true;
        e.returnValue = false;
        return false;
      }
      break;
    default     : break;
  }
  return true;
}

/*
document.onmousedown    = clearRightMouseButton;
document.oncontextmenu  = new Function("return false;");
if(navTipo == "ns4")
{
  window.captureEvents(Event.MOUSEDOWN);
  window.onmousedown = clearRightMouseButton;
}*/