var x = null;

function clearChildren(obj) {
  try {
    if(obj.hasChildNodes() && obj.childNodes) {
      while(obj.firstChild) {
        obj.removeChild(obj.firstChild);
      }
    }
  }
  catch(e) {}
}

function buildInfo(id, title) {
  div = document.getElementById('item_'+id);
  
  var fix = 635;
  anstand_1 = div.offsetLeft;
  abstand_gesamt = anstand_1 + fix;
  
  balken = document.getElementById('infobalken');
  balken.style.top = '90px';
  balken.style.left = abstand_gesamt+'px';
  
  clearChildren(balken);
  txt = document.createTextNode(title);
  balken.appendChild(txt);
  
  x = 1;
  //window.setTimeout("showInfo()",50);
  showInfo(); 
}

function hideInfo() {
  if(x == 0) {
    document.getElementById('infobalken').style.display = 'none';
  }
  else{
    window.setTimeout("hideInfo()",50);
  }
}

function showInfo(){
  document.getElementById('infobalken').style.display = '';
  x = 0; 
}