/*按比例生成缩略图*/
function DrawImage(ImgD,W,H){ 
  var flag=false; 
  var image=new Image(); 
  image.src=ImgD.src; 
  if(image.width>0 && image.height>0){ 
    flag=true; 
    if(image.width/image.height>= W/H){ 
      if(image.width>W){
        ImgD.width=W; 
        ImgD.height=(image.height*H)/image.width; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      ImgD.alt= ""; 
    } 
    else{ 
      if(image.height>H){
        ImgD.height=H; 
        ImgD.width=(image.width*W)/image.height; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      ImgD.alt=""; 
    } 
  }
}

function show(i)
{    
	var object=document.getElementById(i);
	var pic=document.getElementById("smallpic_"+i);
	
	if (object.style.display == "none")
		{     
			object.style.display = "";
			pic.src="images/img_3_1.jpg";
		}
	else
		{     
			object.style.display = "none";    
			pic.src="images/img_3.jpg";
		}   
	return false;
}

function getBack()
{
	var url= document.referrer;
	if(url !="")
	{
		window.location.href=document.referrer;
	}
	else
	{
		window.location.href="ProductList.asp";	
	}
	return false;	
}

function closewindow()
{
	window.close();
}

function get_bakNews()
{
	var url=document.referrer;
	if(url !="")
	{
		window.location.href=document.referrer;	
	}
	else
	{
		window.location.href="zixun.asp";	
	}
}

function getbak_down()
{
	var url=document.referrer;
	if(url !="")
	{
		window.location.href=url
	}
	else
	{
		window.location.href="DownList.asp";	
	}
	return false;	
}

function open_sever_mem(mem)
{
	var mem1=document.getElementById(mem);
	var smallpic=document.getElementById("smallpic_"+mem);
	mem1.style.display="";
	smallpic.src="images/img_3_1.jpg";
}