window.onload = image_size;

function image_size() {
    for(var x=1; x<=6; x++) {
        var img = document.getElementById('image_'+x);
        if(img && preload_image[x].width) {
            if(preload_image[x].width > preload_image[x].height) {
                img.width = '120';
                img.height = 120/preload_image[x].width * preload_image[x].height;
            }
            else {
                img.height = '100';
                img.width = 100/preload_image[x].height * preload_image[x].width;
            }
        }
    }
}
