/* CITD POPUP WINDOW SCRIPT [revised to add scrollbars]Version 1.0ACreates a single window that can reused for any additional popups on pageSupports automatic page writing for graphics and flash files as well as allowing for display of html files */function detectexist(obj){return (typeof obj !="undefined")}function citdpopup(mediapath,mediatype,mediawidth,mediaheight,textdescription,popwidth,popheight,scrolling){function getpos(){leftpos = (screen.width) ? (screen.width-popwidth)/2 : 0;toppos = (screen.height) ? (screen.height-popheight)/2 : 0;//leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0//toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0if (window.opera){leftpos-=screenLefttoppos-=screenTop}}getpos()var winattributes= 'width='+popwidth+',height='+popheight+',scrollbars='+scrolling+',resizable=yes,left='+leftpos+',top='+topposif (typeof citdpopwin=="undefined" || citdpopwin.closed)citdpopwin=window.open("","main",winattributes)else{getpos() //uncomment these 2 lines if you wish subsequent popups to be centered toocitdpopwin.moveTo(leftpos, toppos)citdpopwin.resizeTo(popwidth, popheight+30)}switch (mediatype) {case (mediatype="graphic"): citdpopwin=window.open('','main',winattributes);citdpopwin.document.write('<html><head><title>'+textdescription+'</title><link rel=stylesheet type="text/css" href="citdpopup.css"></head><body>')citdpopwin.document.write('<center><img align="center" class="sourceimage" src="'+mediapath+'" width="'+mediawidth+'" height="'+mediaheight+'"></center>')citdpopwin.document.write('<div class="footerleft"><a class="pFo" href="javascript:parent.window.focus();top.window.close()">:: close window ::</a></div></body></html>')citdpopwin.document.close()if (window.focus) {citdpopwin.focus()}breakcase (mediatype="html"): citdpopwin=window.open (mediapath,"main",winattributes)if (window.focus) {citdpopwin.focus()}  breakcase (mediatype="flash"): citdpopwin=window.open('','main',winattributes);citdpopwin.document.write('<html><head><title>'+textdescription+'</title><link rel=stylesheet type="text/css" href="citdpopup.css"></head><body>')citdpopwin.document.write('<center><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" ')citdpopwin.document.write('width="'+mediawidth+'" height="'+mediaheight+'" id="flashfile" ALIGN=""> ')citdpopwin.document.write('<PARAM NAME=movie VALUE="'+mediapath+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=noscale> <PARAM NAME=bgcolor VALUE=#ffffff> ')citdpopwin.document.write('<EMBED src="'+mediapath+'" quality=high scale=noscale bgcolor=#ffffff ')citdpopwin.document.write('width="'+mediawidth+'" height="'+mediaheight+'" NAME="flashfile" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></center>')citdpopwin.document.write('<div class="footerleft"><a class="pFo" href="javascript:parent.window.focus();top.window.close()">:: close window ::</a></div></body></html>')citdpopwin.document.close()if (window.focus) {citdpopwin.focus()}  break}} 
