function addEvent(obj, evType, fn) {
	if (obj.addEventListener) {
		obj.addEventListener(evType, fn, false);
		return true;
	} else if (obj.attachEvent) {
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} else {
		return false;
	}
}

function removeEvent(obj, evType, fn) { 
	if (obj.removeEventListener) {
		obj.removeEventListener(evType, fn, false);
		return true;
	} else if (obj.detachEvent) {
		var r = obj.detachEvent("on"+evType, fn);
		return r;
	} else {
		return false;
	}
}

function externalLinks() {
	if (!document.getElementsByTagName)
		return;
	var anchors = document.getElementsByTagName("a");
	for (var i = 0; i < anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
		}
	}
}

function topMenuList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("topmenu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function initPage() {
	externalLinks();
	topMenuList();
}

addEvent(window, "load", initPage);

		jQuery(function($) {
      $('#categoriesBox ul li').each(function() {
      
       if ($(this).children(':eq(1)')[0] != undefined) {
        
        var ul_tag = $(this).children(':eq(1)');
       
        $(this).children(':eq(0)').addClass('more').mouseover(function() {
          $(this).next().css('display','block');
        }).mouseout(function() {
          $(this).next().css('display','none');
        }).next().mouseover(function() {
          ul_tag.css('display','block');
        }).mouseout(function() {
          ul_tag.css('display','none');
        });
       }
      
      });
      
});


