var theWindow = null;

function popupMedia(filename, width, height) {
	// pad the width and height to account for our header, footer, margins, etc.
	width += 100;
	height += 100;
	var mediaURL = "media_popup.php?fname=" + filename;
	if (theWindow) {
		if (!theWindow.closed){
			theWindow.close();
		}	
	}		
	theWindow = open(mediaURL, "MediaPopup", "width="+width+",height="+height+",scrollbars=yes,resizeable=no,toolbar=no,menubar=no,titlebar=no,status=no,screenX=0,screenY=0");
}
