var popbackground="imagens/pixel_fundo_geral.gif"
var windowtitle="::: OFM - Portugal :::::::::::::::::::::::::::::::::::::::"

function detectexist(obj){
return (typeof obj !="undefined")
}

function popimage(imgpath, popwidth, popheight, textdescription, data){
function getpos(){
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+',resizable=no,left='+leftpos+',top='+toppos
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+'><font face="Verdana, Arial, Helvetica, sans-serif" color="#CC660B" style="font-size: 10pt;"><b>'+textdescription+'</b><br><font face="Verdana, Arial, Helvetica, sans-serif" color="#CC660B" style="font-size: 7pt;">'+data+'<br><br></font></font><img src="'+imgpath+'" style="margin-bottom: 0.5em"><br></body></html>')
popwin.document.write("<html><body><center><INPUT type='image' src='imagens/fechar.gif'"+"onClick='self.close()'></center></body></html>");
popwin.document.close()
popwin.focus()
}
