(function(){
  var $dw = function(){
    this.currentmenu = function(){
      $("#leftMenus li a").each(function(){
        if(document.URL.match($(this).attr("href"))){
          $(this).parent("li").addClass("current").end().parent("li").parent("ul").prev("a").parent("li").addClass("current");
        };
        if(document.URL.match("godius/guide")){
          if(document.URL.match("item")&&$(this).attr("href").match("item")){
            //例外 item
            $(this).parent("li").addClass("current");
          }else
          if(document.URL.match("magic_")&&$(this).attr("href").match("magic_")){
            //例外 magic_
            $(this).parent("li").addClass("current");
          }else
          if(document.URL.match("monster")&&$(this).attr("href").match("monster")){
            //例外 monster
            $(this).parent("li").addClass("current");
          }else
          if(document.URL.match("guide/build")&&$(this).attr("href").match("build")){
            $(this).parent("li").addClass("current");
          }else
          if(document.URL.match("guide/guild") && $(this).attr("href").match("guild")){
            $(this).parent("li").addClass("current");
          }
        }else
        if(document.URL.match("godius/support")){
          if(document.URL.match("faq")&&$(this).attr("href").match("faq")){
            //例外 faq
            $(this).parent("li").addClass("current");
          }
        }

      });
    };
    this.ready = function (func) {
      var self = this;
      $(function () { func.apply(self, arguments); });
      return this;
    };
  };
  $dw = window.$dw = new $dw;
})();
$dw.ready(function(){
  $dw.currentmenu();
});
