/*
   Digitalkameramuseum - Javascript-Funktionen
*/

XDisp = 0;
YDisp = 0;

function Fensterbreite(win)
  {
  if (win == undefined) win = window;
  if (win.innerWidth) { return win.innerWidth; }
  else
    {
    if (win.document.documentElement && win.document.documentElement.clientWidth)
      { return win.document.documentElement.clientWidth; }
    return win.document.body.offsetWidth;
    }
  }
  
function Fensterhoehe(win)
  {
  if (win == undefined) win = window;
  if (win.innerHeight) { return win.innerHeight; }
  else
    {
    if (win.document.documentElement && win.document.documentElement.clientHeight)
      { return win.document.documentElement.clientHeight; }
    return win.document.body.offsetHeight;
    }
  }

function Einblenden( i, name )
  {
  xm  = Fensterbreite() / 2 + pageXOffset;
  ym  = Fensterhoehe() / 2 + pageYOffset;
  XDisp = xm;
  YDisp = ym;

  det.style.width  = parseInt(810 / 100 * i) + 'px';
  det.style.height = parseInt(590 / 100 * i) + 'px';
  det.style.left   = parseInt(xm - 405 / 100 * i) + 'px';
  det.style.top    = parseInt(ym - 295 / 100 * i) + 'px';

  if( i<100 ) { window.setTimeout( "Einblenden( " + (i+4) + ", '" + name + "' );", 10 ); }
  else { document.getElementById('detimg').src = bild.src; }  
  }

function BildZeigen( name )
  {
  bild = new Image();
  bild.src = 'detail/'+name;
  det = document.getElementById('detail');
  det.style.width = '0px';
  det.style.height = '0px';
  det.style.display='inline';

  window.setTimeout( "Einblenden( 4, '" + name + "' );", 20 );
  }

function Ausblenden( i )
  {
  xm  = Fensterbreite() / 2;
  ym  = Fensterhoehe() / 2;

  xm = XDisp;
  ym = YDisp;

  det.style.width  = parseInt(810 / 100 * i) + 'px';
  det.style.height = parseInt(590 / 100 * i) + 'px';
  det.style.left   = parseInt(xm - 405 / 100 * i) + 'px';
  det.style.top    = parseInt(ym - 295 / 100 * i) + 'px';

  if( i>0 ) { window.setTimeout( "Ausblenden( " + (i-4) + " );", 10 ); }
  else { document.getElementById('detail').style.display = 'none'; }  
  }

function BildSchliessen()
  {
  bild = new Image();
  bild.src = '../bilder/pixel.gif';
  det = document.getElementById('detail');
  xm  = window.innerWidth / 2;
  ym  = window.innerHeight / 2;
  document.getElementById('detimg').src = bild.src;
  
  window.setTimeout( "Ausblenden( 100 );", 20 );
  }

