/**
 * JavaScript general requerido por la estructura base. Código no génerico.
 */

/* Inicilización. */
(function () {
   /* Carga de dependencias. */
   dome.include("dome.util.Event");

   /* Alias */
   var Event = dome.util.Event;

   /* Hack para el menú en IE6. */
   var ua = dome.userAgent();

   Event.onDomReady(
      function () {
         dome.include("DWCommon", "ESP/js/");

         /* Solucionar el comportamiento de :hover para IE6 e inferiores. Si el agente es otro entonces no se hace
          * nada y se tira de CSS por lo que no afecta a la accesibilidad. */
         if (ua.ie > 0 && ua.ie < 7) {
            var root = document.getElementById("menuNav");

            for (var i = 0; i < root.childNodes.length; i++) {
               var node = root.childNodes[i];
               if (node.nodeName == "LI") {
                  node.onmouseover = function() {
                     this.className += " over";
                  };
                  node.onmouseout = function() {
                     this.className = this.className.replace(" over", "");
                  };
               }
            }
         }
      }
   );

})();

