relatedImg = [];
			relatedCount = 0;
			function thumb_resize(which, max) {
				relatedImg[relatedCount] = which;
				relatedCount++;
			}
			function proccess_resize() {
				for(i=0; i<relatedCount; i++) {
					var elem = document.getElementById(relatedImg[i]);
					var orig_width = elem.width;
					var orig_height = elem.height;
					max = 50;
					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);};
					}
					document.getElementById(relatedImg[i]).style.visibility="visible";
					document.getElementById(relatedImg[i]).style.position="static";
					
				}
			}
			
			window.onload=function(){
			  proccess_resize();
			}