window.onload=function(){
	//***************左侧热卖推荐****************
	var shop_prohotbd=document.getElementById("shop_prohotbd");
	var shop_prohotbdLi=[];
	var shop_prohotbdLilen=shop_prohotbd.getElementsByTagName("li").length;
	for(shopI=0;shopI<shop_prohotbdLilen;shopI++){
		shop_prohotbdLi[shopI]=shop_prohotbd.getElementsByTagName("li")[shopI];
		shop_prohotbdLi[shopI].index=shopI;
		shop_prohotbdLi[shopI].onmouseover=function(){
			for(shopI2=0;shopI2<shop_prohotbdLilen;shopI2++){
				shop_prohotbdLi[shopI2].className="";
			}
			shop_prohotbdLi[this.index].className="shop_prohotbdlicurrent";
		}
	}
	//内容页右侧底部漂浮
	setInterval(scrollDiv,100);
	//window.onscroll = scrollDiv;
	var myDiv = document.getElementById("scrollmyDiv");
    var myDivTop = getPosition(myDiv).top;
	function scrollDiv(){
		 var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
		 if(scrollTop >= myDivTop){
			 myDiv.className = "shop_active";
		 } 
		 if(scrollTop <= myDivTop){
			 myDiv.className = "";
		 }
	} 
	//获取元素在页面里的位置和宽高
	function getPosition(obj){
		 var top = 0;
		 var left = 0;
		 var width = obj.offsetWidth;
		 var height = obj.offsetHeight;
		 while(obj.offsetParent){
	         top += obj.offsetTop;
			 left += obj.offsetLeft;
			 obj = obj.offsetParent;
		 }
		 return {"top":top,"left":left,"width":width,"height":height};
	}
	
	//右侧图片展示效果
	var shop_protr=document.getElementById("shop_protr");
	var shop_protrLi=[];
	var shop_protrLilen=shop_protr.getElementsByTagName("li").length;
	for(shopproI=0;shopproI<shop_protrLilen;shopproI++){
		shop_protrLi[shopproI]=shop_protr.getElementsByTagName("li")[shopproI];
		shop_protrLi[shopproI].index=shopproI;
		shop_protrLi[shopproI].onmouseover=function(){
	        for(shopproI2=0;shopproI2<shop_protrLilen;shopproI2++){
				shop_protrLi[shopproI2].className="";
			}
			shop_protrLi[this.index].className="shop_protrcurrent";
		}
	}
	
	//*****************中间banner大图轮播*****************
	var shop_probanenr=document.getElementById("shop_probanenr");
	var shop_probanenrLi=[];
	var shop_probanenrLilen=shop_probanenr.getElementsByTagName("li").length;
	var shop_probannerA=document.getElementById("shop_probannerA");
	var shop_proMaxImg=document.getElementById("shop_proMaxImg");
	var shop_turnI=0;
	var shop_Timer=null;
	//以下是js滤镜特效
	shop_proMaxImg.style.filter ='revealTrans';//设置滤镜参数
	shop_proMaxImg.style.filter.duration =1.000;//设置滤镜参数-滤镜转换过程为1.0秒延迟
	shop_proMaxImg.style.filter.transition =23;//设置滤镜参数-滤镜种数
	function use_Filter(obj){//js滤镜效果函数
	    with(obj){
			filters(0).transition=23;
			filters(0).apply();
			filters(0).play();
		}
	}
	function loadImgdata(num){
		for(shopimgI2=0;shopimgI2<shop_probanenrLilen;shopimgI2++){
			shop_probanenrLi[shopimgI2].className="";
		}
		shop_probanenrLi[num].className="shop_banenrcurrent";
		var StringN=shop_probanenrLi[num].getAttribute("name");
		StringN=StringN.split("|");
		shop_probannerA.href=StringN[0];
		shop_probannerA.title=StringN[1];
		shop_proMaxImg.alt=StringN[1];
		shop_proMaxImg.src=StringN[2];
		use_Filter(shop_proMaxImg);//js滤镜效果启用
	}
	function shopTimer(){
		if(shop_Timer){
			clearInterval(shop_Timer);
			shop_Timer=null;
		}else{
			shop_Timer=setInterval(shop_turnpic,3000);
		}
	}
	for(shopimgI=0;shopimgI<shop_probanenrLilen;shopimgI++){
		shop_probanenrLi[shopimgI]=shop_probanenr.getElementsByTagName("li")[shopimgI];
		shop_probanenrLi[shopimgI].index=shopimgI;
		shop_probanenrLi[shopimgI].onmouseover=function(){
			shop_turnI=this.index;
	        loadImgdata(this.index);
			shopTimer();
		}
		shop_probanenrLi[shopimgI].onmouseout=function(){
			shopTimer();
		}
	}
	shop_probannerA.onmouseover=function(){
		shopTimer();
	}
	shop_probannerA.onmouseout=function(){
		shopTimer();
	}
	function shop_turnpic(){
		if(shop_turnI<shop_probanenrLilen-1){shop_turnI++}else{shop_turnI=0};
		loadImgdata(shop_turnI);
	}
	shop_Timer=setInterval(shop_turnpic,3000);
}