var popbackground="#FFFFFF" //specify backcolor or background image for pop window
var windowtitle="Product Window"  //pop window title
function detectexist(obj){
return (typeof obj !="undefined")
}

function jkpopimage(imgpath, popwidth, popheight, textdescription){

function getpos(){
leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/5-popwidth/1 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/5-popheight/1 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 5
if (window.opera){
leftpos-=screenLeft
toppos-=screenTop
}
}

getpos()
var winattributes='width='+popwidth+',height='+popheight+',resizable=no,left='+leftpos+',top='+toppos
var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
if (typeof jkpopwin=="undefined" || jkpopwin.closed)
jkpopwin=window.open("","",winattributes)
else{
getpos() 
jkpopwin.moveTo(leftpos, toppos)
jkpopwin.resizeTo(popwidth, popheight+30)
}
jkpopwin.document.open()
jkpopwin.document.write('<html><title>'+windowtitle+'</title><body topmargin=0 rightmargin=0 leftmargin=0 bottommargin=0 '+bodyattribute+'><table align=center cellpadding="0" cellspacing="0" border="0" width="238" height="200"><tbody><tr><td height=200 align="center" valign="top"><img src="'+imgpath+'" style="margin-bottom: 0.01em"></td></tr><tr><td align="left" height=15><img src="../images/product_details.gif" width="191" height="13"></td></tr><tr><td height="60" valign="top" style="padding-left:5px; text-align:left; padding-top:10px; font-family:tahoma; vertical-align:top; font-weight:"bold";  class="nocells" bgcolor="#B4FF12">'+textdescription+'</td></tr><tr><td width="1" background="../images/doted1.gif"></td></tr><tr></tr><tr><td align="center"><a href="javascript:window.close();"><img src="../images/close.gif" border=0></img></a></td></tr></tbody></table></body></html>')
jkpopwin.document.close()
jkpopwin.focus()
}

