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

function viewPage1 (thePage,theWidth,theHeight) {
if (NETSCAPE4) {
alert('Image Viewer Incompatible with Netscape 4');
} else {
 if (theWin2 && !theWin2.closed) {
         // alert(theWin2);
          theWin2.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=no,menubar=no,resizable=no,width="+theWidth+",height="+theHeight+",screenX="+xoff+",screenY="+yoff+",top="+yoff+",left="+xoff;
  	theWin2=window.open(thePage,"Crendo1",newWin);
	//theWin2.resizeTo(winw,winh);
	theWin2.focus();
	}
}

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+100;
	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,status=no,resizable=no,width="+winw+",height="+winh+",screenX="+xoff+",screenY="+yoff+",top="+yoff+",left="+xoff;
  	theWin=window.open("","ToniGilbert",newWin);
 
  	theWin.document.write('<HTML><title>Toni Gilbert Image 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();
	}
}
