// JavaScript Document

<!--
/*第一种形式 第二种形式 更换显示样式*/
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}
//-->





$(document).ready(function(){
	var long=$(".zxzj_c li").length;
	$(".zxzj_l").click(function(){
		$(".zxzj_c ul:not(:animated)").animate({"left":"+240"},function(){
			$(".zxzj_c ul").css("left","0");
				//alert("long");
			
			//$("#repeat").append($(".con li").eq(long-1));
			$(".zxzj_c li").eq(long-1).insertBefore($(".zxzj_c ul li").eq(0))
		})
	})
	
	$(".zxzj_r").click(function(){

	
		
		$(".zxzj_c ul:not(:animated)").animate({"left":"-240"},{queue:false, duration:200, complete:function(){
			$(".zxzj_c ul").css("left","0");
				$(".zxzj_c li").eq(0).appendTo("#repeat")
			}	
		})
	})


})





/*banner*/

    var t = n = count = 0;   
    $(function(){   
        count = $("#play_list img").size();   
        $("#play_list img:not(:first-child)").hide();   
        $("#play_text li:first-child").css({"background":"#fff"});  
        $("#play_text li").click(function() {   
            var i = $(this).text() - 1;   
            n = i;   
            if (i >= count) return;   
            $("#play_list img").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);   
            $(this).css({"background":"#fff"}).siblings().css({"background":"#12a417"});   
        });   
        t = setInterval("showAuto()", 2000);   
        $("#play").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 2000);});   
    })    
    function showAuto()   
    {   
        n = n >= (count - 1) ? 0 : n + 1;   
        $("#play_text li").eq(n).trigger('click');   
    }   




// 新闻焦点图

$(function($){

	var showtime = 0;

	$("#img_small a:lt(5)").click(function(){

		var showtime = $("#img_small a:lt(5)").index(this);

		showImg(showtime)	

	});

	$("#img_scroll").hover(function(){

		if(settime)clearInterval(settime);

	},function(){

		settime = setInterval(function(){

			showImg(showtime)

			showtime++;

			if(showtime==5){showtime=0;}

		} , 3000);

	});

	var settime = setInterval(function(){

		showImg(showtime)

		showtime++;

		if(showtime==5){showtime=0;}

	} , 3000);

})

function showImg(i){

	var Link = $("#img_small").eq(i).find("a").attr("href");

	$("#img_small .curr").attr("href",Link);

	$("#img_big a").eq(i).fadeIn(800).siblings("a").fadeOut(600);

	$("#img_small .curr").animate( { top: (i*50) } , 300);

}


$(document).ready(function(){
	$(".hide").hide();
$(".zk").click(
function(){
	$(".con").animate({height:"100%"},{ queue: false, duration: 1000});
	$(".zk").hide();
	$(".hide").show();
	$(".hide").click(
	function(){;
		$(".con").animate({height:"245px"},{ queue: false, duration: 1000});
	$(".zk").show();
	$(".hide").hide();
		}
	)
	
	}
)
})
