// JavaScript Document
$(function(){
	var tabIndex;
	
//
	$("#newsTab .t h3").mouseover(function(){
		$(this).addClass("cur").siblings().removeClass("cur");
		tabIndex = $("#newsTab .t h3").index(this);
		$("#newsTab .c > li").eq(tabIndex).show().siblings().hide();
	});
	
//
	$("#tab02 .t h3").mouseover(function(){
		$(this).addClass("cur").siblings().removeClass("cur");
		tabIndex = $("#tab02 .t h3").index(this);
		$("#tab02 .c").children().eq(tabIndex).show().siblings().hide();
	});
	
//
	myTab("#wc .center .c","#wc .center .t h3");
	myTab("#zs .center .c","#zs .center .t h3");
	myTab("#jg .center .c","#jg .center .t h3");
	
	function myTab(tabArg1,tabArg2) {
		$(tabArg1).not(":first").hide();
		$(tabArg2).mouseover(function(){
			$(this).addClass("cur").siblings().removeClass("cur");
			tabIndex = $(tabArg2).index(this);
			$(tabArg1).eq(tabIndex).show().siblings(".c").hide();
		});
	}
	
//
	$("#quickLinks .c div").not(":first").hide();
	$("#quickLinks .t h3").mouseover(function(){
		$(this).addClass("cur").siblings().removeClass("cur");
		tabIndex = $("#quickLinks .t h3").index(this);
		$("#quickLinks .c div").eq(tabIndex).show().siblings().hide();
	});
	
//.indexBox .cont .left
	$("#wc .left .img:eq(0)").css("z-index","99");
	$("#zs .left .img:eq(0)").css("z-index","99");
	$("#jg .left .img:eq(0)").css("z-index","99");
	$("#wc .left h3").eq(0).addClass("cur");
	$("#zs .left h3").eq(0).addClass("cur");
	$("#jg .left h3").eq(0).addClass("cur");
	$(".indexBox .left h3").mouseover(function(){
		$(this).addClass("cur").siblings("h3").removeClass("cur");
		tabIndex = $(".indexBox .left h3").index(this);
		$(".indexBox .left .img").eq(tabIndex).css("z-index","99").siblings(".img").css("z-index","0");
	});

//»ÃµÆÆ¬
	myslide("#zt_slide .btn li","#zt_slide .show li");     //×¨ÌâÒ³
	
	function myslide(slideBtn,slideShow){
		var curIndex = 0;
		var myscroll;
		autoscroll();
		
		$(slideBtn).hover(function(){
			stopscroll();
			curIndex = $(slideBtn).index(this);
			$(this).addClass("cur").siblings().removeClass("cur");
			$(slideShow).eq(curIndex).fadeIn().siblings().hide();
		},function(){
			autoscroll();
		});
		
		function autoscroll() {
			var li_num = $(slideBtn).length;
			$(slideBtn).eq(curIndex).addClass("cur").siblings().removeClass("cur");
			$(slideShow).eq(curIndex).fadeIn().siblings().hide();
			curIndex++;
			if(curIndex == li_num) {
				curIndex=0;
			}
			myscroll = setTimeout(autoscroll,5000);
		}
		
		function stopscroll() {
			clearTimeout(myscroll);
		}
	}

});
