//This script belong to Esben Stig Ehrenskjöld. © Copyright 2007 - 2009 All rights reserved.
function sizeImages2(wsize, hsize, strsrc) {
    var img2 = document.getElementById("img2");
    var myDiv = document.getElementById("myDiv");
    
    if (myDiv.currentStyle) {
        strMyDivWidth = parseInt(myDiv.currentStyle["width"]);
        strMyDivHeight = parseInt(myDiv.currentStyle["height"]);
    } 
    else{
        strMyDivWidth = parseInt(document.defaultView.getComputedStyle(myDiv, null).getPropertyValue("width"));
        strMyDivHeight = parseInt(document.defaultView.getComputedStyle(myDiv, null).getPropertyValue("height"));
    }
    img2.src = strsrc;
	if(wsize>hsize){
	    if (hsize > strMyDivHeight) {
	        img2.style.height = strMyDivHeight + "px";
	        img2.style.width = strMyDivHeight * wsize / hsize + "px";
		}
		else{
		    img2.style.width = wsize + "px";
		    img2.style.height = hsize + "px";
		}
	}
	else if (hsize > wsize) {
	if (hsize > strMyDivHeight) {
	    img2.style.height = strMyDivHeight + "px";
	    img2.style.width = strMyDivHeight * wsize / hsize + "px";
		}
		else{
		    img2.style.height = hsize + "px";
		    img2.style.width = wsize + "px";
		}
	}
	else{
	    img2.style.height = hsize + "px";
	    img2.style.width = wsize + "px";
	}
	img2.style.left = strMyDivWidth / 2 - img2.width / 2 + "px";
	img2.style.top = strMyDivHeight / 2 - img2.height / 2 + "px";
};
//End