var popbackground="texture.jpg" // var windowtitle="" var imgtoolbar="no" var imgalttag="click to close" function detavail(obj){ return (typeof obj !="undefined") } function popupgalimage(imgsrc, imgname, popwidth, popheight){ var windowtitle=imgname function triangulate(){ leftpos=(detavail(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detavail(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0 toppos=(detavail(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detavail(window.screenY)? screenY+innerHeight/2-popheight/2 : 0 if (window.opera){ leftpos-=screenLeft toppos-=screenTop } } triangulate() var windowdesc='width='+popwidth+',height='+popheight+',resizeable=yes,scrollbars=no,left='+leftpos+',top='+toppos var bodydesc=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"' if (typeof popupgalwin=="undefined" || popupgalwin.closed) popupgalwin=window.open("","",windowdesc) else{ popupgalwin.resizeTo(popwidth+10, popheight+30) } popupgalwin.document.open() popupgalwin.document.write(''+windowtitle+''); popupgalwin.document.write(''); popupgalwin.document.write(''+imgalttag+'') popupgalwin.focus() }