var SetTimer = function (id,func)
{
	this.initialize.apply(this, arguments);
}
SetTimer.prototype = 
{
	initialize: function(id,time)
	{
		this.id =id;
		this.time = time;
	},
	set: function (func)
	{
		var self = this;
		this.id = setTimeout(func, self.time);
	},
	clear: function ()
	{
		clearTimeout(this.id);
	}
}


var btnActive= {
	active:function (target) {
		target.addClass("active");
		target.attr("style", "cursor:pointer;");
		_t = target.children("ul.sub");
		_t.slideDown("fast");
	},
	inactive:function (target) {
		target.attr("style", "cursor:auto;");
		_t = target.children("ul.sub");
		_t.slideUp("normal");
	}
}

$(function(){
	var subMenu = $("#genreList ul.main li ul.sub");
	var timer = new SetTimer("intID", 400);
	$("#genreList ul.main li.trigger").each(function() {
	
	$(this).hover(
		function(){
				$(this).addClass("active");
				scope = $(this);
				timer.set(function(){
					btnActive.active(scope);
				});
				
		},
		function(){
			$(this).removeClass("active");
			 timer.clear();
			 btnActive.inactive($(this));	 
		}
	);
			
	});


subMenu.hide();
});