function popupDisplay(mediaType, mediaId, xDim, yDim, scrollBars, resizableChoice)
{
	fString="<script>\nfunction twAjustePopUp()\n{\nif (pict.complete)\n{\nif((pict.width+12)<screen.width) {a=pict.width+12;} else {a=screen.width;}\nif((pict.height+62)<screen.height) {b=pict.height+62;} else {b=screen.height;}\nthis.resizeTo(a, b);\n}\nelse\n{\nsetTimeout('twAjustePopUp()',200);\n}\n}\nfunction resizeEmbed()\n{\ndoc.width=document.body.clientWidth;\ndoc.height=document.body.clientHeight;\n}\n</script>\n";
	if(scrollBars==true) {scrollBars="yes";} else {scrollBars="no";}
	if(resizableChoice==true) {resizableChoice="yes";} else {resizableChoice="no";}
	if(xDim==0||!xDim)
	{
		xDim=(screen.width)/3;
	}
	if(yDim==0||!yDim)
	{
		yDim=(screen.height)/3;
	}
	contentString="";
	switch(mediaType)
	{
		case "4":
			contentString="<img name=\"pict\" id=\"pict\" src='pictures/gallery/"+mediaId+"'/>";
			break;
		case "7":
			browser = navigator.appName;
    		if (browser == "Microsoft Internet Explorer")
				{contentString="<embed name=\"doc\" id=\"doc\" src='files/"+mediaId+"' align=\"center\" width=\""+xDim+"\" height=\""+yDim+"\">";}
			else
				{contentString="<iframe name=\"doc\" id=\"doc\" src='files/"+mediaId+"' align=\"center\" width=\""+xDim+"\" height=\""+yDim+"\"></iframe>";}
			break;
	}
	OpenWindow=window.open("", "newwin", "height="+yDim+",width="+xDim+",status=no,toolbar=no,scrollbars=no,menubar=no,resizable="+resizableChoice);

	OpenWindow.document.write("<HTML>");
	OpenWindow.document.write("<TITLE>Popup</TITLE>");
	OpenWindow.document.write("<head><style type=\"text/css\">");
	OpenWindow.document.write("<!--");
	OpenWindow.document.write("body {margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;}");
	OpenWindow.document.write("-->");
	OpenWindow.document.write("</style>");
	
	OpenWindow.document.write(fString);
	OpenWindow.document.write("</head>");
	OpenWindow.document.write("<BODY");
	if(mediaType=="7") {OpenWindow.document.write(" onResize='resizeEmbed();'");}
	OpenWindow.document.write(">");
	OpenWindow.document.write(contentString);
	OpenWindow.document.write("</BODY>");
	OpenWindow.document.write("</HTML>");
	if(mediaType=="4")
	{
		OpenWindow.document.write("<SCRIPT>twAjustePopUp();</SCRIPT>");
	}
	OpenWindow.document.write("<SCRIPT>window.focus();</SCRIPT>");
	OpenWindow.document.close();
}