﻿var t2 = n2 = count2 = 0;
$(function(){
	count2 = $("#PlayList a").size();

	$("#PlayList a:not(:first-child)").hide();

	$("#PlayText li").click(function() {
		var i = $(this).attr("id") - 1;
		n2 = i;
		if (i >= count2) return;
		$("#PlayList a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
		$(this).css({"margin-top":"176px"}).siblings().css({"margin-top":"186px"});
	
	});
//	
//	$("#PlayText li").hover(function() {
//		var i = $(this).attr("id") - 1;
//		n2 = i;
//		if (i >= count2) return;
//		$("#PlayList a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
//		$(this).css({"margin-top":"176px"}).siblings().css({"margin-top":"186px"});
//	
//	});
	t2 = setInterval("showAuto2()", 4000);
	$("#play").hover(function(){clearInterval(t2)}, function(){t2 = setInterval("showAuto2()", 4000);});
})

function showAuto2()
{
	n2 = n2 >= (count2 - 1) ? 0 : n2 + 1;

	$("#PlayText li").eq(n2).trigger('click');
}