function fixImageSize(e)
{
	e = e || window.event;
	var img = e.target || e.srcElement;
	if (img.tagName == "IMG")
	{
		var cont = img.parentNode;
		var w = cont.clientWidth;
		var h = cont.clientHeight;
		var a = img.offsetWidth / img.offsetHeight;
		if (a > w / h)
		{
			img.width  = w;
			img.height = (w / a);
		}
		else
		{
			img.width  = (h * a);
			img.height = h;
		}
	}
}

