
  
  //******************************************************************************

  // df

  function Project() {
  }
  
  Project.activeId = undefined;
  
  //******************************************************************************
  
  Project.displayContent = function (button) {
    if (! button) {
      return;
    }
    if (button.id == Project.activeId) {
      return;
    }
    Project._resetActive();
    var content = document.getElementById(button.id + '_CONTENT');
    if (button) {
      var cn = button.className;
      cn = cn.replace(/ ?\bactive\b/,'');
      cn += ' active';
      button.className = cn;
    }
    if (content) {
      var cn = content.className;
      cn = cn.replace(/ ?\bvisible\b/,'');
      cn += ' visible';
      content.className = cn;
    }
    Project.activeId = button.id;
  }
  
  //******************************************************************************
  
  Project._resetActive = function () {
    var button = document.getElementById(Project.activeId);
    var content = document.getElementById(Project.activeId + '_CONTENT');
    if (button) {
      var cn = button.className;
      cn = cn.replace(/ ?\bactive\b/,'');
      button.className = cn;
    }
    if (content) {
      var cn = content.className;
      cn = cn.replace(/ ?\bvisible\b/,'');
      content.className = cn;
    }
  }
  
  //******************************************************************************
  
  Project.unactivateParent = function (idx) {
    var button = document.getElementById(idx);
    if (! button) {
      return;
    }
    var parent = button.parentNode;
    if (parent) {
      var cn = parent.className;
      cn = cn.replace(/ ?\bactive\b/,'');
      parent.className = cn;
    }
  }
  
  //******************************************************************************
  
  Project.activateParent = function (idx) {
    var button = document.getElementById(idx);
    if (! button) {
      return;
    }
    var parent = button.parentNode;
    if (parent) {
      var cn = parent.className;
      cn = cn.replace(/ ?\bactive\b/,'');
      cn += ' active';
      parent.className = cn;
    }
  }
  
  //******************************************************************************
  
  Project.manageSound = function () {
    var soundAllowed = Tools.getCookieValue('Guillaume_Sound'); 
    if (soundAllowed == 'nosound') {
      Project.stopSound();
      return;
    }
    Project.startSound();
  }
  
  //******************************************************************************
  
  Project.stopSound = function () {
    Tools.setCookieValue('nosound', 'Guillaume_Sound');
    if (IE) {
      Project.stopSoundIE();
    }
    var elem = document.getElementById('sound');
    while (elem.childNodes.length) {
      elem.removeChild(elem.childNodes[0]);
    }
    var a = document.createElement('a');
    a.href = 'javascript:void(0);';
    a.onclick = Project.startSound;
    a.innerHTML = '&gt; Sound an';
    elem.appendChild(a);
  }
  
  //******************************************************************************
  
  Project.startSound = function () {
    Tools.setCookieValue('sound', 'Guillaume_Sound');
    if (IE) {
      Project.stopSoundIE();
    }
    var elem = document.getElementById('sound');
    while (elem.childNodes.length) {
      elem.removeChild(elem.childNodes[0]);
    }
    var a = document.createElement('a');
    a.href = 'javascript:void(0);';
    a.onclick = Project.stopSound;
    a.innerHTML = '&gt; Sound aus';
    var div = document.createElement('div');
    div.id = 'sound-object';
    div.style.visibility = 'hidden';
    var o = document.createElement('object');
    o.data = 'data/business.mp3';
    o.type = 'audio/mp3';
    o.width = '1';
    o.height = '1';
    var op = document.createElement('param');
    op.name = 'audiofile';
    op.value = 'data/business.mp3';
    o.appendChild(op);
    div.appendChild(o);
    elem.appendChild(a);
    elem.appendChild(div);
  }
  
  //******************************************************************************
  
  Project.stopSoundIE = function () {
    Tools.setCookieValue('nosound', 'Guillaume_Sound');
    var head = document.getElementsByTagName('head')[0];
    var bgsound = document.getElementById('ie-sound');
    if (bgsound) {
      head.removeChild(bgsound);
    }
    var elem = document.getElementById('sound');
    while (elem.childNodes.length) {
      elem.removeChild(elem.childNodes[0]);
    }
    var a = document.createElement('a');
    a.href = 'javascript:void(0);';
    a.onclick = Project.startSound;
    a.innerHTML = '&gt; Sound an';
    elem.appendChild(a);
  }
  
  //******************************************************************************
  
  Project.startSoundIE = function () {
    Tools.setCookieValue('sound', 'Guillaume_Sound');
    var head = document.getElementsByTagName('head')[0];
    var bgsound = document.getElementById('ie-sound');
    if (bgsound) {
      head.removeChild(bgsound);
    }
    var elem = document.getElementById('sound');
    while (elem.childNodes.length) {
      elem.removeChild(elem.childNodes[0]);
    }
    var a = document.createElement('a');
    a.href = 'javascript:void(0);';
    a.onclick = Project.stopSound;
    a.innerHTML = '&gt; Sound aus';
    elem.appendChild(a);
    var head = document.getElementsByTagName('head')[0];
    var bgsound = document.createElement('bgsound');
    bgsound.src = 'data/business.mp3';
    bgsound.loop = 'infinite';
    bgsound.balance = '10';
    bgsound.volume = '10';
    bgsound.delay = '0';
    head.appendChild(bgsound);
  }

