custom_tags = function () {
    var _this = this;
    var this_page = (_this.options.page != "") ? _this.options.page : "/";
    
    $(document).ready(function () {
        
        var menu_item = _this.getTags("menu_item");
       /* for (_mi in menu_item) {
                try {
                $(menu_item[_mi]).mouseenter(function () {
                        $(this).addClass("over")
                });
                
                $(menu_item[_mi]).mouseleave(function () {
                        if ($(this).find('a[href$="' + this_page + '"]').size() == 0)
                        $(this).removeClass("over")
                });
            } catch (err) {}
        }
       */ 
      for (_mi in menu_item) {
          //console.log($(menu_item[_mi]).find('a[href$="' + this_page + '"]').size() + " " + this_page)
          if ($(menu_item[_mi]).find('a[href$="' + this_page + '"]').size() == 1) {
              $(menu_item[_mi]).find('a[href$="' + this_page + '"]').addClass("over")
          }
      }

    });
}

custom_tags.prototype.href = top.location.href;
custom_tags.prototype.page = function () {
    var _this = this;
    return _this.href.substring(_this.href.lastIndexOf('/') + 1);
}
custom_tags.prototype.options = {
    page: house.prototype.page()
}



custom_tags.prototype.getTags = function (tagname) {    
    var elements =  (document.getElementsByTagName("my:" + tagname).length>0) 
		? document.getElementsByTagName("my:" + tagname) 
		: document.getElementsByTagName(tagname) ;
    return elements;
}

var _custom_tags = new custom_tags();
