//nav sub menu
var isNavHover=false;

//focus img player
var t = n = 0;
var count = 0;

$(document).ready(function(){

count = $("#play_list a").size();

//nav sub menu
$('.nav_sub,.nav_sub_div').hover(
	function() {
		if(isNavHover==false ){$('.nav_sub_div').hide();}//fadeOut(500);}
		isNavHover=true;
		$(this).children('.nav_sub_div').fadeIn(500);
	},
	function() {
		setTimeout(
			function () {
			if(!isNavHover){
				$('.nav_sub_div').hide();//fadeOut(500);
			}}
		,750);
		isNavHover=false;
	}
);

//Hot Tab Index
var isTabRndHover;
var isTabDivHover;
isTabRndHover=true;isTabDivHover=false;
$("#hot_tab_year_view,#hot_tab_month_view,#hot_tab_year,#hot_tab_month,#hot_tab_rnd,#hot_tab_comment,#hot_tab_new").click(function(){
	 $("#hot_tab_list").html('<div class="hot_tab_loading"><img src="http://www.happydone.com/images/loading.gif" /></div>');
	 $(".current_tab").removeClass("current_tab");
	 $(this).addClass("current_tab");
	 if($(this).attr("id")=="hot_tab_rnd"){isTabRndHover=true;}else{isTabRndHover=false;}
	 if($(this).attr("id")=="hot_tab_new"){
		$("#hot_tab_list").load("index.php?option=com_hot_tab",{"type":$(this).attr("id"), "itemid":parseInt(Math.random()*100000)});
	 } else
	{
		$("#hot_tab_list").load("index.php?option=com_hot_tab",{"type":$(this).attr("id"), "itemid":parseInt(Math.random()*100000)});
	}
	 return false; 
});
$("#hot_tab_list").mouseover(function(){isTabDivHover=true;})
$("#hot_tab_list").mouseout(function(){isTabDivHover=false;})

$("#hot_tab_list").html('<div class="hot_tab_loading"><img src="http://www.happydone.com/images/loading.gif" /></div>');
$("#hot_tab_list").load("index.php?option=com_hot_tab");
		
$("#hot_tab_ctl_l,#hot_tab_ctl_r").click(function(){
alert("^__^ Ahhhhh, just a joke, do nothing.");
});

$('.comment_body').hover(
	function() {
		$(this).find('.commentmetadata').stop(true,true).show();
	},
	function() {
		$(this).find('.commentmetadata').stop(true,true).hide();
	}
);


$('.entry').hover(
	function() {
		$(this).find('.meta_view_link').stop(true,true).fadeIn();
	},
	function() {
		$(this).find('.meta_view_link').stop(true,true).fadeOut();
	}
);
});
