;(function($) {

   $.extend($.fn, {      
      topmenu:function() {	
         // add onmouseover for list items
         this.find("li").each(function () {
            $(this).mouseover(function(obj) {
               $(this).siblings().removeClass("hover");
               $(this).addClass("hover");
            });

            var t = this;

            $(this).mouseout(function(obj) {
               setTimeout(function() { $(t).removeClass("hover") }, 5000);
            });
         });
         
         // activate tab, based on location
			var current = this.find("a").filter(function() { return location.href.toLowerCase().indexOf(this.href.toLowerCase())>=0 });
			if ( current.length ) {
				current.addClass("selected");
				current.parents("li").addClass("active");
			}
      }         
   });
   
})(jQuery);

