window.onload=function(){
	//大图切换效果
	var shop_turnImg=document.getElementById("shop_turnImg");
	var shop_turnImgLi=[];
	var shop_turnImgLiLen=shop_turnImg.getElementsByTagName("li").length;
	var shop_turnImgA=document.getElementById("shop_turnImgA");
	var shop_turnMaximg=document.getElementById("shop_turnMaximg");
	var shop_turnI=0;
	var shop_Timer=null;
	function loadImgData(num){
		for(loadI=0;loadI<shop_turnImgLiLen;loadI++){
			shop_turnImgLi[loadI].className="";
		}
		shop_turnImgLi[num].className="shop_bannercurrent";
		var StringN=shop_turnImgLi[num].getAttribute("name");
		StringN=StringN.split("|");
		shop_turnImgA.href=StringN[0];
		shop_turnImgA.title=StringN[1];
		shop_turnMaximg.alt=StringN[1];
		shop_turnMaximg.src=StringN[2];
	}
	function shopTimer(){
		if(shop_Timer){
			clearInterval(shop_Timer);
			shop_Timer=null;
		}else{
			shop_Timer=setInterval(shop_turnpic,3000);
		}
	}
	for(shopI=0;shopI<shop_turnImgLiLen;shopI++){
		shop_turnImgLi[shopI]=shop_turnImg.getElementsByTagName("li")[shopI];
		shop_turnImgLi[shopI].index=shopI;
		shop_turnImgLi[shopI].onmouseover=function(){
			shop_turnI=this.index;
			loadImgData(this.index);
			shopTimer();
	    }
		shop_turnImgLi[shopI].onmouseout=function(){
			shopTimer();
		}
	}
	shop_turnImgA.onmouseover=function(){
		shopTimer();
	}
	shop_turnImgA.onmouseout=function(){
		shopTimer();
	}
	function shop_turnpic(){
		if(shop_turnI<shop_turnImgLiLen-1){shop_turnI++}else{shop_turnI=0};
		loadImgData(shop_turnI);
	}
	shop_Timer=setInterval(shop_turnpic,3000);
	
	//公告资讯切换
	var shop_adnewstit=document.getElementById("shop_adnewstit");
	var shop_adnewstitLi=[];
	var shop_adnewstitLilen=shop_adnewstit.getElementsByTagName("li").length;
	for(shopadI=0;shopadI<shop_adnewstitLilen;shopadI++){
		shop_adnewstitLi[shopadI]=shop_adnewstit.getElementsByTagName("li")[shopadI];
	    shop_adnewstitLi[shopadI].index=shopadI;
		shop_adnewstitLi[shopadI].onmouseover=function(){
			for(shopadI2=0;shopadI2<shop_adnewstitLilen;shopadI2++){
				shop_adnewstitLi[shopadI2].className="";
			}
			if(this.index==0){
				shop_adnewstitLi[this.index].className="shop_adnewstitcurrent";
				document.getElementById("shop_adnewsbd1").style.display="block";
				document.getElementById("shop_adnewsbd2").style.display="none";
			}else{
				shop_adnewstitLi[this.index].className="shop_adnewstitcurrent2";
				document.getElementById("shop_adnewsbd1").style.display="none";
				document.getElementById("shop_adnewsbd2").style.display="block";
			}
		}
	}
	
	//精彩推荐
	var shop_tjtit=document.getElementById("shop_tjtit");
	var shop_tjtitLi=[];
	var shop_tjtitLilen=shop_tjtit.getElementsByTagName("li").length;
	for(shoptjI=0;shoptjI<shop_tjtitLilen;shoptjI++){
		shop_tjtitLi[shoptjI]=shop_tjtit.getElementsByTagName("li")[shoptjI];
		shop_tjtitLi[shoptjI].index=shoptjI;
		shop_tjtitLi[shoptjI].onmouseover=function(){
			for(shoptjI2=0;shoptjI2<shop_tjtitLilen;shoptjI2++){
				shop_tjtitLi[shoptjI2].className="";
				document.getElementById("shop_tjbd"+shoptjI2+"").style.display="none";
			}
			shop_tjtitLi[this.index].className="shop_tjtitcurrent";
			document.getElementById("shop_tjbd"+this.index+"").style.display="block";
		}
	}
}