//鼠标经过显示和定义class类函数
function proxy(dom,lei,type){
	if(dom){
		dom.hover(
		  function(){
			$(this).addClass(lei);
			if(type==1){
				if($(this).find('.sub').length>0){
					$(this).find('.sub').show();
				}else{
					$(this).addClass(lei+'er');
				}
			}
		  },
		  function(){
			$(this).removeClass(lei);
			if(type==1){
				if($(this).find('.sub').length>0){
					$(this).find('.sub').hide();
				}else{
					$(this).removeClass(lei+'er');
				}
			}
		  }
		);
	}
}
//定义class类函数
function metaddclass(dom,lei){
	if(dom)dom.addClass(lei);
}
//会员中心iftame等高函数
function Iframedom(){  
	var Iframe = $("#iframe");
	var Iframe_Conts = Iframe.contents().find("body");
		Iframe_Conts.css("height","100%");
	var Iframe_div = Iframe_Conts.find("div.main_deng");
	var Iframe_div1 = Iframe_Conts.find("div.main_zhuce");
		Iframe_div.css("margin","0px auto");
		Iframe_div1.css("margin","0px auto");
	var Iframe_Height = Iframe_Conts.outerHeight(true);
		Iframe.height(Iframe_Height);
}
//内页侧导航click函数
function navnow(dom,part2,part3){
	var li = dom.find(".navnow dt[id*='part2_']");
	var dl = li.next("dd.sub");
		dl.hide();
		if(part2.next("dd.sub").length>0)part2.next("dd.sub").show();
		if(part3.length>0)part3.parent('dd.sub').show();
		li.bind('click',function(){
			var fdl = $(this).next("dd.sub");
			if(fdl.length>0){
				fdl.is(':hidden')?fdl.show():fdl.hide();
				fdl.is(':hidden')?$(this).removeClass('launched'):$(this).addClass('launched');
			}
		});
}
//内页侧导航函数
function partnav(c2,c3,jsok){
	var part2 = $('#part2_'+c2);
	var part3 = $('#part3_'+c3);
	metaddclass(part2,'on');
	metaddclass(part3,'on');
	if(jsok==0)$('#sidebar dd.sub').show();
	if(jsok==1)navnow($('#sidebar'),part2,part3);
}
//定义宽度和等高函数
function metaddwdht(dom,p){
	dom.width(dom.find('img').width()+p);
	metHeight(dom);
}

//产品浏览列表函数
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}

//首页滚屏
jQuery(function($){
	var index = 0;
	$('<div id="flow"></div>').appendTo("#myjQuery");

	//滑动导航改变内容	
	$("#myjQueryNav li").hover(function(){
		if(MyTime){
			clearInterval(MyTime);
		}
		index  =  $("#myjQueryNav li").index(this);
		MyTime = setTimeout(function(){
		ShowjQueryFlash(index);
		$('#myjQueryContent').stop();
		} , 0);

	}, function(){
		clearInterval(MyTime);
		MyTime = setInterval(function(){
		ShowjQueryFlash(index);
		index++;
		if(index==5){index=0;}
		} , 3000);
	});
	//滑入 停止动画，滑出开始动画.
	 $('#myjQueryContent li').hover(function(){
			  if(MyTime){
				 clearInterval(MyTime);
			  }
	 },function(){
				MyTime = setInterval(function(){
				ShowjQueryFlash(index);
				index++;
				if(index==5){index=0;}
			  } , 3000);
	 });
	//自动播放
	var MyTime = setInterval(function(){
		ShowjQueryFlash(index);
		index++;
		if(index==5){index=0;}
	} , 3000);
});
function ShowjQueryFlash(i) {
$("#myjQueryContent li").eq(i).animate({opacity: 1},1000).css({"z-index": "1"}).siblings().animate({opacity: 0},1000).css({"z-index": "0"});
$("#flow").animate({ left: i*135+140 +"px"}, 300 ); //滑块滑动
$("#myjQueryNav li").eq(i).addClass("current").siblings().removeClass("current");
}
