// JavaScript Document
function thumb_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 = 124;
	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);};
	}
} 