/* Cacher le menu ... */

var direction = true;
var step = 0;
var margeMenu = 280;

function albRes ()
{
  // Hiding
  if(direction && step < 15) {
    step++;

    document.getElementById('centre').style.marginTop = Math.round((1 - (step / 15)) * 130).toString() + 'px';
    document.getElementById('centre').style.marginLeft = (Math.round((1 - (step / 15)) * 256) - 6).toString() + 'px';

    document.getElementById('haut').style.top = (-1 * Math.round((step / 15) * 130)).toString() + 'px';
    document.getElementById('gauche').style.left = (-1 * Math.round((step / 15) * 245)).toString() + 'px';

    if (step >= 15) {
      direction = false;
      margeMenu = 20;
      document.getElementById('gauche').style.display = 'none';
      document.getElementById('haut').style.display = 'none';
      document.cookie = "albumID0=1;path=/;";

    }
    else
      window.setTimeout(albRes, 35);
  }
  else if (!direction && step > 0) {
    if (step == 15) {
      document.getElementById('gauche').style.display = 'block';
      document.getElementById('haut').style.display = 'block';
    }
    step--;

    document.getElementById('centre').style.marginTop = Math.round((1 - (step / 15)) * 130).toString() + 'px';
    document.getElementById('centre').style.marginLeft = (Math.round((1 - (step / 15)) * 256) - 6).toString() + 'px';

    document.getElementById('haut').style.top = (-1 * Math.round((step / 15) * 130)).toString() + 'px';
    document.getElementById('gauche').style.left = (-1 * Math.round((step / 15) * 245)).toString() + 'px';

    if (step <= 0) {
      direction = true;
      margeMenu = 280;
      document.cookie = "albumID0=0;path=/;";

    }
    else
      window.setTimeout(albRes, 35);
  }

  if(document.getElementById('limage'))
    dim(0, 1);

  return false;
}
