//From here: http://atomgiant.com/2006/05/30/resize-images-with-javascript

function image_resize(which, max) {
	var elem = document.getElementById(which);
	if (elem == undefined || elem == null) return false;
	var orig_width = elem.width;
	var orig_height = elem.height;
	if (max == undefined) max = 100;
	if (elem.width > elem.height) {
		if (elem.width > max) { elem.width = max; elem.height = orig_height*(max/orig_width);}
	} else {
		if (elem.height > max) { elem.height = max; elem.width = orig_width*(max/orig_height);};
	}
} 
