$(document).ready(function(){
	$(".member_list ul li").click(
		function() {
			$(".member_list ul li").removeClass("help_infor_down").siblings(
					"li").removeClass();
			$(this).addClass("help_infor_down");		
			$(".member_list ul li").not(this).addClass("member_list_up");
		});	
	
	/**样式的控制，移到对应的js中
	$(".news_dh ul li").click(
		function() {
			$(".news_dh ul li").removeClass("news_dh_down").siblings(
					"li").removeClass();
			$(this).addClass("news_dh_down");
			$(".news_dh ul li").not(this).addClass("news_dh_up");
		});
	*/
	
	/* .allsort */	
	$(".allsort").hover(function(){
		$(this).find(".extra").addClass("extra-active");
		$(this).find(".sortBox").show();
	},function(){
		$(this).find(".extra").removeClass("extra-active");
		$(this).find(".sortBox").hide();
	});
	
	/* .allbrand */	
	$(".allbrand").hover(function(){
		$(this).find(".extra").addClass("extra-active");
		$(this).find(".sortBox").show();
	},function(){
		$(this).find(".extra").removeClass("extra-active");
		$(this).find(".sortBox").hide();
	});
	
	/* service */	
	$(".service .service-side").click(function(){
		$(this).hide();
		$(".service .service-box").show();
	});	
	$(".service .close").click(function(){
		$(".service .service-side").show();
		$(".service .service-box").hide();
	});	
	
	/* class change Start*/
		$(".goods_px span").click(function(){
			$(".goods_px span").removeClass("lz");
			$(this).addClass("lz");
		});
	/* class change End*/
		
		
	/* arrive Notice Start */
	    $("#altArriveNotice").hide();
		$("#arriveNotice").click(function(){
			easyDialog.open({
				container : 'altArriveNotice',
				isOverlay : false
					
			});
		});
    /* arrive Notice End */
		
	/* certain delete Start */
	    $("#altCertainDelete").hide();
	/* certain delete End */
	
	/* shopping rename Start */
	    $("#altshoppingName").hide();
		$("#saveShoppingCart").click(function(){
			easyDialog.open({
				container : 'altshoppingName',
				isOverlay : false
					
			});
		});		
	/* shopping rename End */	
		
	/* all SelectCheckBox Start */
	    $("#allcheck").click(function() {
			$("input[id='checkboxName']").each(function() {
				$(this).attr("checked", true);
			});
	    });
	   $("#delcheck").click(function() {
	        $("input[id='checkboxName']").each(function() {
	           $(this).attr("checked", false);
	        });
	    });

});

function rollingAdver(direction,intervalTime){
	if(!direction){
		direction = "left";
	}
	if(isNaN(Number(intervalTime))){
		intervalTime = 3 ;
	}
	 var len  = $("#tabNav ul li").length;
	 var index = 0;
	 var def = 0 ;
	 if(direction == "right" || direction == "down"){
	 	index = len -1;
	 }
	 var adTimer;
	 $("#tabNav ul li").mouseover(function(){
		index  =   $("#tabNav ul li").index(this);
		showImg(index);
	 }).eq(index).mouseover();
	 $('#tabfocus').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			adTimer = setInterval(function(){
			showImg(index);
			if(direction == "right" || direction == "down"){
				index--;
				if(index == -1){
					index = len - 1;
				}
			}else{
				index++;
				if(index == len ){
					index=0;
				}
			}
		} , intervalTime*1000);
	 }).trigger("mouseleave");	
}

function showImg(index){
	$("#tabBox > ul > li").eq(index).show().siblings().hide();
	$("#tabNav ul li").removeClass("current")
		.eq(index).addClass("current");
}

