function resize (img, max) {	
	width = img.width;
	height = img.height;
	if (width >= height) {												
		height = (max * height)/ width;
		width = max;
	} else {												
		width = (max * width)/ height;
		height = max;
	}
	img.width = width;
	img.height = height;
}
											
