
$(document).ready(function () {
	//随滚动条滚动广告
	$ad=$('.scrollAD').size();
	if($ad > 0){
			var oldTopValue = parseInt($('.scrollAD').css('top'));
			var showInfo = function() {
			$('.scrollAD').animate({
				'top': oldTopValue + $(window).scrollTop()
				}, 500);
				var handScroll = setTimeout(showInfo, 500);
			};
			showInfo();
			
			//关闭对联
			$('.scrollAD .close').click( function () {
			$('.scrollAD').hide();
		 });
			
		}//endif
	
});//end ready;


//焦点图
var t = n = count = 0;
$(function(){
	count = $("#slide_list a").size();
	$("#slide_list a:not(:first-child)").hide();
	$("#slide_text li:first").css({"background":"url(images/flash_btnov.png) no-repeat;","color":"#C00"});
	$("#slide_info").click(function(){window.open($("#slide_list a:first-child").attr('href'), "_blank")});
	$("#slide_text li").click(function() {
		var i = $(this).attr('rel')-1;
		n = i;
		if (i >= count) return;
		$("#slide_info").unbind().click(function(){window.open($("#slide_list a").eq(i).attr('href'), "_blank")})
		$("#slide_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
		$(this).css({"background":"url(images/flash_btnov.png) no-repeat;","color":"#C00"}).siblings().css({"background":"url(images/flash_btn.png) no-repeat;","color":"#000"});
	});
	t = setInterval("showAuto()", 6000);
	$(".banner").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 6000);});
})
 
function showAuto()
{
	n = n >= (count - 1) ? 0 : n + 1;
	$("#slide_text li").eq(n).trigger('click');
}

