function onkeypr(e)
{
  try
  {
    var element;

    // Identificar plataforma alvo através de leitura de eventos.
    if (e.target)
    {
      // Firefox, ?
      element = e.target;
    }
    else if (e.srcElement)
    {
      element = e.srcElement;
    }
    else if (window.event.srcElement)
    {
      // Internet Explorer, ?
      element = window.event.srcElement;
    }

    if (element.nodeType == 3)
    {
      // Safari bug?
      element = element.parentNode;
    }

    if (window.event)
    {
      // Internet Explorer, ?
      keycode = window.event.keyCode;
    }
    else if (e)
    {
      // Firefox, ?
      keycode = e.which;
    }

    if (element.tagName == 'TEXTAREA'
     || element.tagName == 'INPUT')
    {
      // Tecla não será considerada dentro de campos de input.
      return;
    }

    emod = (e) ? (e.eventPhase) ? "W3C" : "NN4" : (window.event) ? "IE4+" : "unknown";

    if (emod == "NN4")
    {
      // Netscape Navigator.
      document.captureEvents(Event.KEYDOWN);
    }

    switch (emod)
    {
      case "IE4+":
      {
        // Internet Explorer, Firefox, ?
        e = window.event;
        alt = (e.altKey) ? true : false;
        ctrl = (e.ctrlKey) ? true : false;
        shift = (e.shiftKey) ? true : false;
        break;
      }
      case "NN4":
      {
        // Netscape Navigator, ?
        alt = ((e.modifiers & Event.ALT_MASK) == Event.ALT_MASK);
        ctrl = ((e.modifiers & Event.CTRL_MASK) == Event.CTRL_MASK);
        shift = ((e.modifiers & Event.SHIFT_MASK) == Event.SHIFT_MASK);
        break;
      }
      case "W3C":
      {
        alt = (e.altKey) ? true : false;
        ctrl = (e.ctrlKey) ? true : false;
        shift = (e.shiftKey) ? true : false;
        break;
      }
    }

    if (alt
     || ctrl
     || shift)
    {
      // Combinações com alt, ctrl e shift são ignoradas.
      return;
    }

    // Obter tecla pressionada.
    var keyPressed = String.fromCharCode(keycode);

    /*
        I nício
        A rtigos
        N otícias
        E mpresa
        F abricantes
    inf O rmações
        S erviços
        C ontactos
      a T alhos
        M apa
    */

    // Com a tecla, seguir o atalho.
    if(keyPressed == "i")
    {
      location.href = "/php/inicio.php5";
    }
    else if(keyPressed == "a")
    {
      location.href = "/php/artigos.php5";
    }
    else if(keyPressed == "n")
    {
      location.href = "/php/noticias/";
    }
    else if(keyPressed == "e")
    {
      location.href = "/php/empresa.php5";
    }
    else if(keyPressed == "f")
    {
      location.href = "/php/fabricantes.php5";
    }
    else if(keyPressed == "o")
    {
      location.href = "/php/informacoes.php5";
    }
    else if(keyPressed == "s")
    {
      location.href = "/php/servicos.php5";
    }
    else if(keyPressed == "c")
    {
      location.href = "/php/contactos.php5";
    }
    else if(keyPressed == "t")
    {
      location.href = "/php/atalhos.php5";
    }
    else if(keyPressed == "m")
    {
      location.href = "/php/mapa.php5";
    }
  }
  catch(err)
  {
    // Prever excepções, mas não fazer nada.
  }
}
