﻿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(500);
	$(this).css({"border":"solid 3px #FF8C01"}).siblings().css({"border":"solid 3px #cccccc"});
	
	});
	

	t2 = setInterval("showAuto2()", 3000);
	$("#play").hover(function(){clearInterval(t2)}, function(){t2 = setInterval("showAuto2()", 3000);});
})

function showAuto2()
{
	n2 = n2 >= (count2 - 1) ? 0 : n2 + 1;

	$("#PlayText li").eq(n2).trigger('click');
}
