//var mediumHeight = 87;
var mediumHeight = 114;
var mediumWidth = 114;
function processMediumImage(obj){
    var newImg = new Image();
    newImg.src = obj.src;
    var height = newImg.height;
    var width = newImg.width;
    if(width > height){
        if(width >= mediumWidth) obj.style.width = mediumWidth+"px";
        else obj.style.width = width+"px";
    }else{
        if(height >= mediumHeight){
            obj.style.width = "";
            obj.style.height = mediumHeight+"px";
        }else{
            obj.style.width = "";
            obj.style.height = height+"px";
        }
    }
    //obj.style.visibility = "visible";
    obj.style.display = "";
}

//var smallHeight = 56;
var smallHeight = 75;
var smallWidth = 75;
function processSmallImage(obj){
    var newImg = new Image();
    newImg.src = obj.src;
    var height = newImg.height;
    var width = newImg.width;
    if(width > height){
        if(width >= smallWidth) obj.style.width = smallWidth+"px";
        else obj.style.width = width+"px";
    }else{
        if(height >= smallHeight){
            obj.style.width = "";
            obj.style.height = smallHeight+"px";
        }else{
            obj.style.width = "";
            obj.style.height = height+"px";
        }
    }
    //obj.style.visibility = "visible";
    obj.style.display = "";
}

var mainPickHeight = 140;
var mainPickWidth = 180;
function processMainPick(obj){
    var newImg = new Image();
    newImg.src = obj.src;
    var height = newImg.height;
    var width = newImg.width;
    if(width > height){
        if(width >= mainPickWidth) obj.style.width = mainPickWidth+"px";
        else obj.style.width = width+"px";
    }else{
        if(height >= mainPickHeight){
            obj.style.width = "";
            obj.style.height = mainPickHeight+"px";
        }else{
            obj.style.width = "";
            obj.style.height = height+"px";
        }
    }
    //obj.style.visibility = "visible";
    //obj.style.display = "";
}

var miniPickHeight = 90;
var miniPickWidth = 90;
function processMiniPick(obj){
    var newImg = new Image();
    newImg.src = obj.src;
    var height = newImg.height;
    var width = newImg.width;
    if(width > height){
        if(width >= miniPickWidth) obj.style.width = miniPickWidth+"px";
        else obj.style.width = width+"px";
    }else{
        if(height >= miniPickHeight){
            obj.style.width = "";
            obj.style.height = miniPickHeight+"px";
        }else{
            obj.style.width = "";
            obj.style.height = height+"px";
        }
    }
    //obj.style.visibility = "visible";
    //obj.style.display = "";
}

var avatorHeight = 57;
var avatorWidth = 77;
function processAvator(obj){
    var newImg = new Image();
    newImg.src = obj.src;
    var height = newImg.height;
    var width = newImg.width;
    if(width > height){
        if(width >= avatorWidth) obj.style.width = avatorWidth+"px";
        else obj.style.width = width+"px";
    }else{
        if(height >= avatorHeight){
            obj.style.width = "";
            obj.style.height = avatorHeight+"px";
        }else{
            obj.style.width = "";
            obj.style.height = height+"px";
        }
    }
    //obj.style.visibility = "visible";
    //obj.style.display = "";
}