var popbackground="#ffffff" //specify backcolor or background image for pop window
var windowtitle="Pressed Petals...Idea Gallery...Larger View"  //pop window title

function detectexist(obj){
return (typeof obj !="undefined")
}

function popImage(imgpath, popwidth, popheight, textdescription){

function getpos(){
leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
toppos=0
winl=(screen.width-popwidth)/2
wint=0
//wint=(screen.height-popheight)
  if (winl<0)winl=0
  if (wint<0)wint=0
if (window.opera){
leftpos-=screenLeft
toppos-=screenTop
}
}

getpos()

var winattributes='width='+popwidth+',height='+popheight+',toolbar=yes,scrollbars=yes,resizable=yes,left='+winl+',top='+wint
var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
if (typeof popwin=="undefined" || popwin.closed)
popwin=window.open("","",winattributes)
else{
getpos()
popwin.moveTo(leftpos, toppos)
popwin.resizeTo(popwidth, popheight+30)
}
popwin.document.open()
popwin.document.write('<html><title>'+windowtitle+'</title><body '+bodyattribute+' topmargin=0 leftmargin=0><table width=610 border=0 cellspacing=1 cellpadding=3 align="center"><tr><td align="center" valign="center" class="tdTopBanner"><img src="sf-images/header/logo.gif"><br><img src="sf-images/spacer.gif" width=50 height=2 border=0></td></tr><tr><td bgcolor="#999933" background="sf-images/header/swatch.gif" valign="top"><img src="sf-images/spacer.gif" width=50 height=1 border=0></td></tr></table><table width=600 border=0 cellspacing=0 cellpadding=0 align="center"><tr><td align="center" valign="center" class="tdTopBanner"><img src="sf-images/spacer.gif" width=50 height=4 border=0></td></tr></table><center><img src="'+imgpath+'" style="margin-bottom: 0.5em"></center><br>'+textdescription+'</body></html>')
popwin.document.close()
popwin.focus()
}