﻿


function SetImageWidthAndHeight(ImageClassName, ImageWidth, ImageHeight) {

    $(window).load(function() {
    
        $("." + ImageClassName).each(function() {


            var maxWidth = ImageWidth;
            var maxHeight = ImageHeight;
            var ratio = 0;
            var width = $(this).width();
            var height = $(this).height();

            // check image wdith
            // if (width > maxWidth) {
                // ratio = maxWidth / width;
                // $(this).css("width", maxWidth);
                // height = height * ratio;
                // $(this).css("height", height);
            // }

            // // check image height
            // if (height > maxHeight) {
                // ratio = maxHeight / height;
                // $(this).css("height", maxHeight);
                // width = width * ratio;
                // $(this).css("width", width * ratio);
            // }
        });

   });
   

}
