// JavaScript Document

var FitWidth = 92;
var FitHeight = 92;
function ResizePic(ImgTag)
{
    var image = new Image();
 image.src = ImgTag.src;
 if(image.width>0 && image.height>0){
  if(image.width/image.height >= FitWidth/FitHeight){
   if(image.width > FitWidth){
    ImgTag.width = FitWidth;
    ImgTag.height = (image.height*FitWidth)/image.width;
   }
   else{ 
    ImgTag.width = image.width;
    ImgTag.height = image.height;
   }
  }
  else{
   if(image.height > FitHeight){
    ImgTag.height = FitHeight;
    ImgTag.width = (image.width*FitHeight)/image.height;
   }
   else{
    ImgTag.width = image.width; 
    ImgTag.height = image.height;
   }
  }
 }
};//

var FitWidthPage = 176;
var FitHeightPage = 176;
function ResizePicPage(ImgTag)
{
    var image = new Image();
 image.src = ImgTag.src;
 if(image.width>0 && image.height>0){
  if(image.width/image.height >= FitWidthPage/FitHeightPage){
   if(image.width > FitWidthPage){
    ImgTag.width = FitWidthPage;
    ImgTag.height = (image.height*FitWidthPage)/image.width;
   }
   else{ 
    ImgTag.width = image.width;
    ImgTag.height = image.height;
   }
  }
  else{
   if(image.height > FitHeightPage){
    ImgTag.height = FitHeightPage;
    ImgTag.width = (image.width*FitHeightPage)/image.height;
   }
   else{
    ImgTag.width = image.width; 
    ImgTag.height = image.height;
   }
  }
 }
};

var FitWidthinfo = 116;
var FitHeightinfo = 116;
function ResizePicinfo(ImgTag)
{
    var image = new Image();
 image.src = ImgTag.src;
 if(image.width>0 && image.height>0){
  if(image.width/image.height >= FitWidthinfo/FitHeightinfo){
   if(image.width > FitWidthinfo){
    ImgTag.width = FitWidthinfo;
    ImgTag.height = (image.height*FitWidthinfo)/image.width;
   }
   else{ 
    ImgTag.width = image.width;
    ImgTag.height = image.height;
   }
  }
  else{
   if(image.height > FitHeightinfo){
    ImgTag.height = FitHeightinfo;
    ImgTag.width = (image.width*FitHeightinfo)/image.height;
   }
   else{
    ImgTag.width = image.width; 
    ImgTag.height = image.height;
   }
  }
 }
};




var FitWidthbig = 402;
var FitHeightbig = 402;
function ResizePicbig(ImgTag)
{
    var image = new Image();
 image.src = ImgTag.src;
 if(image.width>0 && image.height>0){
  if(image.width/image.height >= FitWidthbig/FitHeightbig){
   if(image.width > FitWidthbig){
    ImgTag.width = FitWidthbig;
    ImgTag.height = (image.height*FitWidthbig)/image.width;
   }
   else{ 
    ImgTag.width = image.width;
    ImgTag.height = image.height;
   }
  }
  else{
   if(image.height > FitHeightbig){
    ImgTag.height = FitHeightbig;
    ImgTag.width = (image.width*FitHeightbig)/image.height;
   }
   else{
    ImgTag.width = image.width; 
    ImgTag.height = image.height;
   }
  }
 }
};

function ResizePicByNum(width, height, ImgTag) {
    var image = new Image();
    image.src = ImgTag.src;
    if (image.width > 0 && image.height > 0) {
        if (image.width / image.height >= width / height) {
            //if (image.width > width) {
                ImgTag.width = width;
                ImgTag.height = (image.height * width) / image.width;
            //}
            //else {
                //ImgTag.width = image.width;
                //ImgTag.height = image.height;
            //}
        }
        else {
            //if (image.height > height) {
                ImgTag.height = height;
                ImgTag.width = (image.width * height) / image.height;
            //}
            //else {
                //ImgTag.width = image.width;
                //ImgTag.height = image.height;
            //}
        }
    } 
}
