var NETSCAPE4 = (document.layers);
var theWin
var theWin1

function viewPage (thePage,theWidth,theHeight) {
if (NETSCAPE4) {
alert('Image Viewer Incompatible with Netscape 4');
} else {
 if (theWin1 && !theWin1.closed) {
         // alert(theWin1);
          theWin1.document.close();
        }
	addScrolls="no";
	theWinWidth = theWidth+30;
	theWinHeight = theHeight+65;
	if(screen && theWinWidth>screen.width){
		winw=screen.width-30;
		xoff=15;
		addScrolls="yes";
	}else{
		winw=theWinWidth;
		xoff=(screen.width/2)-(theWinWidth/2);
	}
	if(screen && theWinHeight>screen.height){
		winh=screen.height-40;
		yoff=10;
		addScrolls="yes";
	}else{
		winh=theWinHeight;
		yoff=(screen.height/2)-(theWinHeight/2);
	}
	addScrolls="yes";
	newWin="scrollbars="+addScrolls+",menubar=no,resizable=yes,width="+winw+",height="+winh+",screenX="+xoff+",screenY="+yoff+",top="+yoff+",left="+xoff;
  	theWin1=window.open(thePage,"Crendo1",newWin);
	theWin1.resizeTo(winw,winh);
	theWin1.focus();
	}
}
