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();
	}
}


function viewImage (thePic,theWidth,theHeight) {
if (NETSCAPE4) {
alert('Image Viewer Incompatible with Netscape 4');
} else {
        if (theWin && !theWin.closed) {
         // alert(theWin);
          theWin.document.close();
        }
	addScrolls="no";
	theWinWidth = theWidth+30;
	theWinHeight = theHeight+115;
	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);
	}
	newWin="scrollbars="+addScrolls+",menubar=no,resizable=no,width="+winw+",height="+winh+",screenX="+xoff+",screenY="+yoff+",top="+yoff+",left="+xoff;
  	theWin=window.open("","sportslog",newWin);
 
  	theWin.document.write('<HTML><title>SportsLog Viewer</title><BODY bgcolor="#FFFFFF"><center><a href="javascript:window.close()"><img src="/images/closewinbut.gif" border="0" width="89" height="10" alt="close window"></a></center><br><a href="javascript:close()"><img src="' + thePic + '" border=0></a></body></HTML>');
 
  	//theWin.document.title = "Foo";
  	//theWin.document.bgColor = "#CCCCCC"
	theWin.resizeTo(winw,winh);
	theWin.focus();
	}
}