// POPUP WINDOW START

var poptitle_old = ""

function ImageBig(imgpath, poptitle, popwidth, popheight)
{
// Adapting the size of the pop-up window
popwidth += 20
popheight += 20

function getpos()
{
// Ermitteln der oberen linken Ecke je nach Browser
if (typeof window.screenLeft != "undefined")
{
   leftpos = screenLeft+document.body.clientWidth/2-popwidth/2
   }
else
   {
   if (typeof window.screenX != "undefined")
      {
      leftpos = screenX+innerWidth/2-popwidth/2
      }
   else
      {
      if (window.opera)
         {
         leftpos-=screenLeft
         }
      else
         {
         leftpos = 0
         }
      }
   }
// oben fixwert
toppos = 50

} // Ende getpos



getpos()
var winattributes='width='+popwidth+',height='+popheight+',resizable=yes,scrollbars=no,left='+leftpos+',top='+toppos+''

// Open new window or not 
// first call
if (typeof bigpopwin=="undefined" || bigpopwin.closed)
   {
   bigpopwin=window.open("","",winattributes)
   }
// subsequent calls
else{
   if (poptitle_old != poptitle)
      {
      bigpopwin.close()
      bigpopwin=window.open("","",winattributes)
      }
   else
      {
      bigpopwin.focus()
      }
   }

// Inhalt des neuen Fensters
bigpopwin.document.open()
bigpopwin.document.write('<html><title>'+poptitle+'</title><body bgcolor="#ffffff"><img src="'+imgpath+'"></body></html>')
bigpopwin.document.close()
bigpopwin.focus()

// Merken aktueller Titel für weiteren Aufruf
poptitle_old = poptitle

}
// POPUP WINDOW END


