$(function() {
/*
·â×°$U.hoverDelay
*/
  (function() {
    function hoverDelay(target, overFn, outFn, overTime, outTime) {
      if (!target.length) target = [target];
      for (var i = 0,
      len = target.length; i < len; i++) { (function() {
          var overId, outId;
          target[i].onmouseover = function() {
            clearTimeout(outId);
            var ele = this;
            overId = setTimeout(function() {
              overFn.apply(ele)
            },
            overTime)
          };
          target[i].onmouseout = function() {
            clearTimeout(overId);
            var ele = this;
            outId = setTimeout(function() {
              outFn.apply(ele)
            },
            outTime)
          }
        })()
      }
    };
    window.$U = window.$U || {};
    window.$U.hoverDelay = window.$U.hoverDelay || hoverDelay
  })();

  function childNodes(ele, tagName) {
    var childs = ele.childNodes;
    var temp = [];
    for (var i = 0; i < childs.length; i++) {
      if (childs[i].nodeType == 1 && (tagName ? (childs[i]["tagName"] == tagName) : true)) {
        temp.push(childs[i]);
      };
    };
    return temp;
  };
  function removeAll(ele) {
    for (var i = 0; i < ele.length; i++) {
      ele[i].className = ele[i].className.replace(/this/, " ");
    };
  };
  function hideAll(ele) {
    for (var i = 0; i < ele.length; i++) {
      ele[i].style.display = "none";
    };
  };

  var navsT = document.getElementById("J-nav").getElementsByTagName("li");
  var contsT = childNodes(document.getElementById("J-cont"), "DIV");
  for (var j = 0; j < navsT.length; j++) { (function() {
      var cur = j;
      var lists = contsT;
      var navs = navsT;
      function handle() {
        try {
          if (!navs[cur].className.indexOf("this") > -1) {
            removeAll(navs);
            navs[cur].className += " this";
            hideAll(lists);
            lists[cur].style.display = "block";
          };
        } catch(e) {};
      };
      $U.hoverDelay(navs[cur], handle,
      function() {},
      50, 0)
    })();
  };

})
