// Source: JavaScript Codebook, Addison Wesley Verlag
function Popup4Image()
{
  this.lastWidth = 0;
  this.lastHeight = 0;
  this.childWin = null;

  this.showImageInSize = showImageInSize;
}

function showImageInSize(src, target, width, height)
{
  if(document.layers || window.opera)
  {
    var x=y=-8;
  } 
  else
  {
  	var x=y=-0;
  }

  var html='<HTML><HEAD><title>LUPE</title>' +
           ' <style type="text/css"> ' +
           '   body {margin-left:'+x+'px; margin-top:'+y+'px; ' +
           '         margin-right:0px; margin-bottom:0px; ' +
           '         text-align : center;} ' +
           ' </style> ' +
           '</HEAD>' +
           '<body>' +
           '<img src="' + src + '" border="0">' +
           '</body> </html>';

  if( this.childWin && !this.childWin.closed) 
  {
    diffX = width - this.lastWidth;
    diffY = height - this.lastHeight;
    this.childWin.resizeBy(diffX, diffY);
  } 
  else 
  {
    this.childWin = window.open(
                       "dummy.html",
                       target,
                       "width="+width+",height="+height+",resizable=1"
                                );
  }
  this.lastWidth = width;
  this.lastHeight = height;
  
  with(this.childWin.document)
  {
    open(); write(html); close();
  }
  this.childWin.resizeTo(width, height);
  this.childWin.focus();
}
var popup = new Popup4Image();

function swDivPopup(filename)
{
  $('swDivPopup').innerHTML="<a href=\"#\" onclick=\"$('swDivPopupBackground').hide(); $('swDivPopup').hide(); return false;\"><img src=\""+filename+"\" border=0 title=\"Anklicken, um die Ansicht zu schließen.\"  vspace=5 hspace=5><img src=\"img/icon_close.png\" border=0 alt=\"\" align=\"top\"><br>Schlie&szlig;en</a>";
  $('swDivPopupBackground').show(); $('swDivPopup').show();
}

if(!document.getElementById('swDivPopup'))
{
  document.write('<div id="swDivPopupBackground" style="display:none;"></div><div id="swDivPopup"  style="display:none;"></div>');
}

/*
#swDivPopupBackground {  background-color:#FFFFFF; opacity:0.7; filter:Alpha(opacity=70); z-index:10; width:100%; height:100%; position:absolute; left:0px; top:0px;}
#swDivPopup { text-align:center; width:1000px; height:90%; position:absolute; left:0px; top:10%; z-index:20; }

<a href="##itempicname2##" onclick="swDivPopup(this.href); return false;"><img src="img/icon_lupe.png" border=0 title="Vergrößerte Ansicht"></a>
*/