  var nowshow;
  var maxshow;
  function show_productimg(num,maxnum){
     maxshow=maxnum;
	 nowshow=num;
	 showpop();
	 for(var i=1;i<maxshow+1;i++){
	 	if(i==nowshow)
			{
				document.getElementById("img"+i).style.display="block";
			}
			else
			{
				document.getElementById("img"+i).style.display="none";
			}
	 }
	 document.getElementById("showimg").style.visibility="visible";
	 document.getElementById("nowimage").innerHTML=num+"/"+maxnum;
  }
  function close_productimg(){
     closepop();
	 document.getElementById("showimg").style.visibility="hidden";
  }
  function gopreview(){
  	
     document.getElementById("img"+nowshow).style.display="none";
	 nowshow=(nowshow-1)>0?nowshow-1:maxshow;
	 document.getElementById("img"+nowshow).style.display="";
	 document.getElementById("nowimage").innerHTML=nowshow+"/"+maxshow; 
  }
  function gonext(){
  	//让所有层都为空
	//for(var i)
     document.getElementById("img"+nowshow).style.display="none";
	 nowshow=(nowshow+1)>maxshow?1:nowshow+1;
	 document.getElementById("img"+nowshow).style.display="";
	 document.getElementById("nowimage").innerHTML=nowshow+"/"+maxshow; 
  }
  //关闭灰色透明背景
  function closepop(){
  	
     document.getElementById("bku").style.visibility="hidden";
	 //document.body.style.overflow=""
     
  }
  
  //显示灰色透明背景
  function showpop(){
  
     //alert(nowshow);
	 document.getElementById("bku").style.width=document.body.scrollWidth;
     document.getElementById("bku").style.height=document.body.scrollHeight;
     document.getElementById("bku").style.visibility="visible";
	 //document.body.style.overflow="hidden"
     
  }
