﻿function LoadPic(o,minatureWidth,minatureHeight){
    var standardImgWidth=100;
    var standardImgHeight=100;
    if(typeof minatureWidth!= 'undefined'){
        standardImgWidth=minatureWidth;
    }
    if(typeof minatureHeight!= 'undefined'){
        standardImgHeight=minatureHeight;
    }
    var lcadeImg = new Image();
    lcadeImg.src=o.src;
    var width=lcadeImg.width;
    var height=lcadeImg.height;
    
    var original=width/height;
    if(width>standardImgWidth||height>standardImgHeight){
        if(original*standardImgHeight>standardImgWidth){
            width=standardImgWidth;
            height=width/original;
        }
        else{
            height=standardImgHeight;
            width=height*original;
        }
    }
    o.style.width=width+"px";
    o.style.height=height+"px";
}
