var maxWidth,maxHeight,Xpos,Ypos,topXpos,topYpos,Xadj,Yadj,zoomBox,zoomStep=0,zoomLink,zoomNew;

function zoomWindow(myLink,zlink,maxw,maxh,tox,toy) {
if (arguments.length > 2) zoomNew=1;
scrollH=(window.pageYOffset!=null)?window.pageYOffset:document.body.scrollTop;
maxWidth=maxw?maxw:window.innerWidth?innerWidth:document.body.clientWidth;
maxHeight=maxh?maxh:window.innerHeight?innerHeight:document.body.clientHeight;
topXpos=tox?tox:0;
topYpos=(toy?toy:0)+scrollH;
Xpos=myLink.pageX?myLink.pageX:myLink.clientX;
Ypos=(myLink.pageY?myLink.pageY:myLink.clientY)+(document.all?scrollH:0);
Xadj=topXpos+myLink.screenX-Xpos;
Yadj=topYpos+myLink.screenY-Ypos;
if (document.createElement && document.body.appendChild && !zoomBox) {
	zoomBox=document.createElement("div");
	zoomBox.style.position="absolute";
	document.body.appendChild(zoomBox);
} else if (document.all && !zoomBox) {
	document.all[document.all.length-1].outerHTML+='<div id="zoomBoxDiv" style="position:absolute"></div>';
	zoomBox=document.all.zoomBoxDiv;
} else if (document.layers && !zoomBox) {
	zoomBox=new Layer(maxWidth);
	zoomBox.style=zoomBox;
	}
zoomLink=zlink;
WindowZoom();
}

function WindowZoom() {
zoomStep+=1;
zPct=(10-zoomStep)/25
if (document.layers) {
	zoomBox.moveTo(topXpos+zPct*(Xpos-topXpos),topYpos+zPct*(Ypos-topYpos));
	zoomBox.document.open();
	zoomBox.document.write("<table width='"+maxWidth*(1-zPct)+"' height="+maxHeight*(1-zPct)+" border=2 cellspacing=0><tr><td></td></tr></table>");
	zoomBox.document.close();
	} else {
	zoomBox.style.border="2px solid #999999";
	zoomBox.style.left=topXpos+zPct*(Xpos-topXpos);
	zoomBox.style.top=topYpos+zPct*(Ypos-topYpos);
	zoomBox.style.width=maxWidth*(1-zPct);
	zoomBox.style.height=maxHeight*(1-zPct);
	}
zoomBox.style.visibility="visible";
if (zoomStep < 10) setTimeout("WindowZoom("+Xpos+","+Ypos+","+topXpos+","+topYpos+")",35);
else {
	zoomBox.style.visibility='hidden';
	zoomStep=0;
if (zoomLink && zoomNew) {
		var w=window.open(zoomLink,'','width='+maxWidth+',height='+maxHeight+',left='+Xadj+',top='+Yadj+',scrollbars=yes,resizable=yes,toolbar=no');
		zoomNew=null;
		}
	}
}