﻿var t = n = count = 0;
$(document).ready(function () {

count = $("#playShow1 a").size();

$(function(){
$("#playShow1 a:not(:first-child)").hide();
$("#playText1").html($("#playShow1 a:first-child").find("img").attr('alt'));
$("#playNum1 a:first").css({"background":"#FFD116",'color':'#A8471C'});
$("#playText1").click(function(){window.open($("#playShow1 a:first-child").attr('href'), "_blank")});
$("#playNum1 a").click(function() {
   var i = $(this).text() - 1;
   //n = i;			//每次在开始播放，还算继续
   if (i >= count){
	   return;
   }
   
   $("#playText1").html($("#playShow1 a").eq(i).find("img").attr('alt'));
   $("#playText1").unbind().click(function(){window.open($("#playShow1 a").eq(i).attr('href'), "_blank")})
   $("#playShow1 a").filter(":visible").css({display:"none"});
   $("#playShow1 a").eq(i).css({display:"block"});
   
   $(this).css({"background":"#FFD116",'color':'#A8471C'}).siblings().css({"background":"#D7D6D7",'color':'#000'});
});
t = setInterval("showAuto()", 3000);
$("#play1").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 3000);});
});



});


function showAuto()
{
n = n >= (count - 1) ? 0 : ++n;
$("#playNum1 a").eq(n).trigger('click');
}






