// JavaScript Document
var t = n = 0, count = j$("#play_list a").size();
j$(function(){	
	j$("#play_list a:not(:first-child)").hide();
	j$("#play_info").html(j$("#play_list a:first-child").find("img").attr('alt'));
	j$("#play_text li:first-child").css({"background":"#fff",'color':'#000'});
	j$("#play_info").click(function(){window.open(j$("#play_list a:first-child").attr('href'), "_blank")});
	j$("#play_text li").click(function() {
		var i = j$(this).text() - 1;
		n = i;
		if (i >= count) return;
		j$("#play_info").html(j$("#play_list a").eq(i).find("img").attr('alt'));
		j$("#play_info").unbind().click(function(){window.open(j$("#play_list a").eq(i).attr('href'), "_blank")})
		j$("#play_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
		j$(this).css({"background":"#fff",'color':'#000'}).siblings().css({"background":"#000",'color':'#fff'});
	});
	t = setInterval("showAuto()", 2000);
	j$("#play").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 2000);});
})

function showAuto()
{
	n = n >= (count - 1) ? 0 : ++n;
	j$("#play_text li").eq(n).trigger('click');
}
