//Switch1
function SwitchTab(num){
 for(var id = 1;id<=2;id++)
 {
  var ss="tb"+id;
  if(id==num)
  document.getElementById(ss).style.display="block";
  else
  document.getElementById(ss).style.display="none";
 }
 
 for(var id = 1;id<=2;id++)
 {
  var bb="tab"+id;
  if(id==num)
  document.getElementById(bb).className="td_on";
  else
  document.getElementById(bb).className="td_off";
 } 
}
//Switch2
function SwitchTab1(num){
 for(var id = 1;id<=1;id++)
 {
  var ss="ttb"+id;
  if(id==num)
  document.getElementById(ss).style.display="block";
  else
  document.getElementById(ss).style.display="none";
 }
 
 for(var id = 1;id<=1;id++)
 {
  var bb="ttab"+id;
  if(id==num)
  document.getElementById(bb).className="ttd_on";
  else
  document.getElementById(bb).className="ttd_off";
 } 
}



var flag=false; 
function DrawImage(ImgD){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>=500/500){ 
   if(image.width>500){
    ImgD.width=500; 
    ImgD.height=(image.height*500)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
  else{ 
   if(image.height>500){
    ImgD.height=500; 
    ImgD.width=(image.width*500)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
 }
}

