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