$(document).ready(function(e) {
    tabA();
	tableColor();
});
//TAB函数
function tabA(){
	var $tab_list = $(".tabA li");
	var $tab_box = $(".tab-box");
	var $prev = $(".tab-box1 .prev");
	var $next = $(".tab-box1 .next");
	var $tab_box1Length = $(".tab-box1 .tab-box li").length;
	var $tab_box1Width = $(".tab-box1 .tab-box li").width();
	var page = 1;
	$tab_list.mousemove(function(){
		$(this).parent(".tabA").children("li").removeClass("present");
		$(this).addClass("present");
		$(this).parent(".tabA").siblings(".tab-box").hide().eq($(this).index()).show();
	});	
	//上一页
	$prev.hover(function(){
			$(this).css({"opacity":"1"})
		},function(){
			$(this).css({"opacity":"0.3"})
		}).click(function(){
			if(page == 1){
				$(this).siblings("div").children(".tab-box").stop(false,false).animate({left:-($tab_box1Length-1)*$tab_box1Width+"px"},400);
				page = $tab_box1Length;
			}else{
				$(this).siblings("div").children(".tab-box").stop(false,false).animate({left:"+="+$tab_box1Width+"px"},400);
				page--
			}
	});
	//下一页
	$next.hover(function(){
			$(this).css({"opacity":"1"});
		},function(){
			$(this).css({"opacity":"0.3"});
		}).click(function(){
			if(page == ($tab_box1Length)){
				$(this).siblings("div").children(".tab-box").stop(false,false).animate({left:0+"px"},400);
				page = 1;
			}else{
				$(this).siblings("div").children(".tab-box").stop(false,false).animate({left:"-="+$tab_box1Width+"px"},400);
				page++
			}			
	});
};
//结束
function tableColor(){
	$table = $("#color-table tr:odd");
	$table.css({"background":"#e8e8e8"});	
}
