$(document).ready(function(){
    //首页分类切换
	$(".sort2,.sort3,.sort4").hide();
	/*
	$("#sort .pBody h2 a").click(function(){
	    return false;
	});
	$("#sort1 ,#sort2,#sort3, #sort4").bind('click',function(){
			$("."+this.id).siblings(".pDetail").hide().end().show();
	});
	*/
	//厂商
	$(".range div").hide();
	$(".khd_1,.khd_2,.khd_3,.khd_4,.khd_5,.khd_6").css({"display":""}); 					  
	/*$("#bz_1,#dh_1,#yy_1,#bd_1,#khd_1,#bz_2,#dh_2,#yy_2,#bd_2,#khd_2,#bz_3,#dh_3,#yy_3,#bd_3,#khd_3,#bz_4,#dh_4,#yy_4,#bd_4,#khd_4,#bz_5,#dh_5,#yy_5,#bd_5,#khd_5,#bz_6,#dh_6,#yy_6,#bd_6,#khd_6").bind('click',function(){
		$("."+this.id).siblings("div").hide();
		$("."+this.id).css({"display":""});
							   });	
    */							   
			 });
//导航条切换 
$(document).ready(function(){
	var pre = location.href.split("/")[3]?("/"+location.href.split("/")[3]+"/"):"/";
	$("a[href="+pre+"]").parent().siblings().removeClass("selected").end().addClass("selected");
	$(".mainnav li").bind('mouseover',function(){
		if(!$(this).hasClass("selected")){
			$(this).siblings().removeClass("selected").end().addClass("selected");
		}
	}).bind('mouseout',function(){
		$("a[href="+pre+"]").parent().siblings().removeClass("selected").end().addClass("selected");
	});
});
//列表页中部切换listnav
$(document).ready(function(){
	$(".listnav li").bind('mouseover',function(){
		if(!$(this).hasClass("selected")){
			$(this).siblings().removeClass("selected").end().addClass("selected");
		}
	});
});	
//内容页中部切换down-nav
$(document).ready(function(){
	$(".down-nav li").bind('mouseover',function(){
		if(!$(this).hasClass("selected")){
			$(this).siblings().removeClass("selected").end().addClass("selected");
		}
	});
});			 
//字母切换
$(document).ready(function(){
	//$(".hotsort-main").css({"height","22px"});
	$(".hotsort-main ul:gt(0)").hide();
	$(".hotsort-nav a").click(function(){
	    return false;
	});
	$(".hotsort-nav a").not($(".more")[0]).bind('mouseover',function(){
		var ulId=$( ".hotsort-nav a" ).not($(".more")[0]).index( $(this)[0] );
		ulId = parseInt(ulId);
		//alert(ulId);
        if($(this).hasClass("selected")){
		    $(".hotsort-main ul").eq(ulId).siblings().hide().end().show('fast');
		}else if(!$(this).hasClass("selected")){
		    $(this).siblings().removeClass("selected").end().addClass("selected");
		    $(".hotsort-main ul").eq(ulId).siblings().hide().end().show();
		}
	});
	$(".hotsort-nav .more").click(function(){
		if($(".hotsort-nav .more").html()=="展开"){
			$(".hotsort-main").css({"height":"100%"});
			$(".hotsort-nav .more").html("收起");
		}else if($(".hotsort-nav .more").html()=="收起"){
	        $(".hotsort-main").css({"height":"85px","overflow":"hidden"});	
	        $(".hotsort-nav .more").html("展开");	
		}			
	});
	});
//厂商轮播
$(document).ready(function(){
	$("#supplier li:gt(5)").hide();
	$("#RightArra").toggle(function(){
		$("#supplier li").slice(6).siblings().hide().end().show();
	},function(){
		$("#supplier li").slice(0,6).siblings().hide().end().show();
	});
});


