  function Popup( popupWidth, popupHeight, popupIMG, popupURL )
  {
    var pageSize  = getPageSize();

    var overlayWidth  = pageSize[0];
    var overlayHeight = pageSize[1];

    //var popupLeft   = pageSize[0] / 2 - popupWidth / 2;;
    // Position mittig über der Seite und nicht mittig im Browser
    var popupLeft   = 955 / 2 - popupWidth / 2;;
    var popupTop    = 10;
    
    document.getElementById( 'popupimg' ).src          = popupIMG;
    document.getElementById( 'popupimg' ).style.width  = popupWidth;
    document.getElementById( 'popupimg' ).style.height = popupHeight;
    document.getElementById( 'popuplink' ).href        = popupURL;

    PopupPosition( 'overlay', overlayWidth, overlayHeight, 0, 0 );
    PopupOpacity ( 'overlay', 0 );
    PopupShow    ( 'overlay' );
    
    PopupPosition( 'popup', popupWidth, popupHeight, popupLeft, popupTop );
    PopupOpacity ( 'popup', 0 );
    PopupShow    ( 'popup' );
    
    PopupFadeIn();
  }

  
  function PopupPosition( id, width, height, left, top )
  {
    document.getElementById( id ).style.width  = width  + 'px';
    document.getElementById( id ).style.height = height + 'px';
    document.getElementById( id ).style.left   = left   + 'px';
    document.getElementById( id ).style.top    = top    + 'px';
  }

  
  function PopupOpacity( id, value )
  {
     document.getElementById( id ).style.opacity = value / 100;
     document.getElementById( id ).style.filter = 'alpha(opacity=' + value + ')';
  }

  function PopupShow( id )
  {
    document.getElementById( id ).style.display    = "block";
    document.getElementById( id ).style.visibility = 'visible';
  }

  
  function PopupHide( id )
  {
    document.getElementById( id ).style.display    = "none";
    document.getElementById( id ).style.visibility = 'hidden';
  }

  function PopupFadeIn()
  {
    for( var i = 0 ; i <= 100 ; i++ )
    {
      setTimeout( 'PopupOpacity( \'popup\'  , ' + ( 0.9 * i ) + ')' , 8 * i );
      setTimeout( 'PopupOpacity( \'overlay\', ' + ( 0.7 * i ) + ')' , 8 * i );
    }
  }

  
  function PopupFadeOut()
  {
    for( var i = 0 ; i <= 100 ; i++ )
    {
      setTimeout( 'PopupOpacity( \'popup\'  , ' + ( 0.9 * (100 - i) ) + ')' , 8 * i );
      setTimeout( 'PopupOpacity( \'overlay\', ' + ( 0.7 * (100 - i) ) + ')' , 8 * i );
    }
    
    setTimeout( 'PopupHide(\'popup\'  )', 800 );
    setTimeout( 'PopupHide(\'overlay\')', 800 );
  }

  
  document.write("<div id='overlay'></div>");
  document.write("<div id='popup'>");
  document.write("<a id='popuplink' href='' target='_blank'><img id='popupimg' src='' width='' height='' border='' alt=''></a>");
  document.write("<div style='position:absolute; top: 5px; right: 5px;'><a href='javascript:PopupFadeOut();'><img src='./template/images/close.png' width='13' height='13' border='0' alt=''/></a></div>");
  document.write("</div>");