	function setImgWidth() {
		scaleImg();
	}

	function fitsInWindow() {
		if (navigator.appName=="Netscape") spacerID1 = "spacer1";
		else spacerID1 = "spacer2";
				
		if (navigator.appName=="Netscape") spacerID2 = "spacer3";
		else spacerID2 = "spacer4";
		
		if (actualWidth<=tableWidth()) {		
			spacerA = document.getElementById(spacerID1);
			if (actualWidth <= 750) spacerA.style.width="770px";
			else {
		      if (tableWidth() <= 750) spacerA.style.width="770px";
		      else spacerA.style.width=(actualWidth+20) + "px";
			}
			
	        spacerB = document.getElementById(spacerID2);
			if (actualWidth <= 750) spacerB.width=1;
			else {
		      if (tableWidth() <= 750) spacerB.width=1;
		      else spacerB.width=(actualWidth+20-750)/2;
			}

	        topW = document.getElementById("top");
			if (actualWidth <= 750) topW.style.width="752px";
			else {
		      if (tableWidth() <= 750) topW.style.width="752px";
		      else topW.style.width=actualWidth+2+"px";
			}
			
	        botW = document.getElementById("bot");
			if (actualWidth <= 750) botW.style.width="752px";
			else {
		      if (tableWidth() <= 750) botW.style.width="752px";
		      else botW.style.width=actualWidth+2+"px";
			}

			document.getElementById('thepic').width=actualWidth;
		    showMsg("none");
			return true;
		}

	    spacerA = document.getElementById(spacerID1);
		if (tableWidth() <= 750) spacerA.style.width="770px";
		else spacerA.style.width=(tableWidth()+20) + "px";

	    spacerB = document.getElementById(spacerID2);
		if (tableWidth() <= 750) spacerB.width=1;
		else spacerB.width=(tableWidth()+20-750)/2;
		
	    topW = document.getElementById("top");
		if (tableWidth() <= 750) topW.style.width="752px";
		else topW.style.width=tableWidth()+2+"px";

	    botW = document.getElementById("bot");
		if (tableWidth() <= 750) botW.style.width="752px";
		else botW.style.width=tableWidth()+2+"px";

        return false;
	}

	function tableWidth() {
		if (navigator.appName=="Netscape") return windowWidth()-52;
		else return windowWidth()-57;	
	}

	function windowWidth() {
		if (navigator.appName=="Netscape") return window.innerWidth;
		return document.body.offsetWidth;
	}

	function scaleImg() {		
		if (fitsInWindow())	return;
	
		what = document.getElementById('thepic');
		
		if (what.width >= tableWidth() && what.width < actualWidth) {
			what.width=actualWidth;
			showMsg("block");
		} else {
		    if (tableWidth() <= 750) what.width=750;
		    else what.width=tableWidth();
			showMsg("block");
		}
	}
	
	function liveResize() {		
        if (fitsInWindow()) return;
		
		what = document.getElementById('thepic');
		
		if (tableWidth() <= 750) what.width=750;
		else what.width=tableWidth();
		showMsg("block");
    }
	
	function showMsg(what) {
		document.getElementById('scaleclick').style.display=what;
	}

	onresize=liveResize;
