var MaxWidth = 140;
var MaxHeight = 160;

var WidthOrig = 0;
var HeightOrig = 0;

function ImgFixSize(img) {
	if (img.width > MaxWidth) {
		img.height = Math.round((MaxWidth/img.width) * img.height);
		img.width = MaxWidth;
	}
	
	if (img.height > MaxHeight) {
		img.width = Math.round((MaxHeight/img.height) * img.width);
		img.height = MaxHeight;
	}
}

function Alt(img) {
	return img.height+20;
}

function Largh(img) {
	return img.width+20;
}
