﻿/*var so = new SWFObject("index/flash/index.swf", "mymovie", "719", "362", "7", "#ffffff");
//参数意思： 地址，Flash 的 id（不是容器的 id），宽，高，版本需求，背景颜色
//这是最基本的，如果你要高级的设置，就仔细翻翻说明吧。

so.write("banner");*/

//$("#flash_text").load("index/index.html");

var t = n = count = 0;

$(function(){
	
	count = $("#play_list img").size();
	$("#play_list img:not(:first-child)").hide();
	$("#play_info").html($("#play_list a:first-child").find("img").attr('alt'));
	$("#play_text li:first-child").css({"background":"#fff",'color':'#000'});
	$("#play_info").click(function(){window.open($("#play_list a:first-child").attr('href'), "_blank")});
	$("#play_text li").click(function() {
		var i = $(this).text() - 1;
		n = i;
		if (i >= count) return;
		//$("#play_info").html($("#play_list a").eq(i).find("img").attr('alt'));
		//$("#play_info").unbind().click(function(){window.open($("#play_list a").eq(i).attr('href'), "_blank")})
		$("#play_list img").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1500);
		$(this).css({"background":"#fff",'color':'#000'}).siblings().css({"background":"#000",'color':'#fff'});
	});
	t = setInterval("showAuto()", 4000);
	$("#play").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 4000);});
})

function showAuto()
{
	n = n >= (count - 1) ? 0 : n + 1;
	$("#play_text li").eq(n).trigger('click');
}
