function popwin(theURL,rw,rh) { //v1.0
	
	var ol = 100; // screen offset limit
	
	var wid = (rw > screen.width-ol)  ? screen.width-ol  : rw; // if requested width is larger than screen, return screen size-ol
	var hei = (rh > screen.height-ol) ? screen.height-ol : rh; // if requested height is larger than screen, return screen size-ol
	
	var pwi = (rh > screen.height-ol) ? 16 : 0;  // if the height is greater than the screen, account for vertical scroll bars.
	var phe = (rw > screen.width-ol) ? 16 : 0;   // if the width is greater than the screen, account for hoizontal scroll bars.
	
	var scr = (rw > screen.width-ol || rh > screen.height-ol) ? ',scrollbars=no' : ''; // if the either dimension is too large, add scroll bars

	var lef = (rw > screen.width-ol)  ? 50  : (screen.width/2) - (rw/2);   // center the window
	var top = (rh > screen.height-ol)  ? 25  : (screen.height/2) - (rh/2); // center the window

	var win = 'width=' + (wid+pwi) + ',height=' + (hei+phe) + ',resizable=no,left=' + lef + ',top=' + top +  scr; // the window features string

	window.open('display.php?file=' + theURL , '' , win); // the action!
}