var t = count = n = 0;
$(function(){
	// home banner
	$(".home-big-img a:not(:first)").hide();
	$home_num_nav = $(".home-num-nav span");
	$home_big_img = $(".home-big-img a");
	count = $home_big_img.length;
	t = setInterval("showAuto()", 5000);
	$home_num_nav.click(function(){
		var home_num_nav = $(".home-num-nav span").index(this);
		$(this).addClass("home-selected").siblings().removeClass("home-selected");
		$home_big_img.filter(":visible").fadeOut(500).parent().children().eq(home_num_nav).fadeIn(1000); 
	});
	$("#home-banner").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 5000);});
	
	// shop banner
	$(".shop-big-img a:not(:first)").hide();
	$shop_num_nav = $(".shop-num-nav span");
	$shop_big_img = $(".shop-big-img a");
	count = $shop_big_img.length;
	$shop_num_nav.click(function(){
		var shop_num_nav = $(".shop-num-nav span").index(this);
		$(this).addClass("shop-selected").siblings().removeClass("shop-selected");
		$shop_big_img.filter(":visible").fadeOut(500).parent().children().eq(shop_num_nav).fadeIn(1000);
	});
	$(".shop-banner-pic").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 3000);});
	
	// base banner
	$(".base-big-img a:not(:first)").hide();
	$base_num_nav = $(".base-num-nav span");
	$base_big_img = $(".base-big-img a");
	count = $base_big_img.length;
	$base_num_nav.click(function(){
		var base_num_nav = $(".base-num-nav span").index(this);
		$(this).addClass("base-selected").siblings().removeClass("base-selected");
		$base_big_img.filter(":visible").fadeOut(500).parent().children().eq(base_num_nav).fadeIn(1000); 
	});
	$(".base-banner").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 3000);}); 
})
function showAuto()   
{   
	n = n >= 3 ? 0 : (n + 1);
	$home_num_nav.eq(n).trigger('click');
}
