var infoPaneVisible = false;

function disableAnchor(obj, disable){
  if(disable){
    var href = obj.getAttribute("href");
    if(href && href != "" && href != null){
       obj.setAttribute('href_bak', href);
    }
    obj.removeAttribute('href');
  }
  else{
    obj.setAttribute('href', obj.attributes['href_bak'].nodeValue);
    obj.setAttribute('href', obj.attributes['href_bak'].nodeValue);
  }
}

function showInfoPane() {
  if (!infoPaneVisible) {
    new Effect.Appear('infoOverlay', { duration: 0.2, from: 0.0, to: 0.95 }); 
    new Effect.Appear('infoButton', { duration: 0.2, from: 1.0, to: 0.5 }); 
    disableAnchor(document.getElementById('infoButtonLink'), true)
    infoPaneVisible = true;
  }
}

function hideInfoPane() {
  if (infoPaneVisible) {
    new Effect.Fade('infoOverlay', { duration: 0.2});
    new Effect.Appear('infoButton', { duration: 0.2, from: 0.5, to: 1.0 }); 
    disableAnchor(document.getElementById('infoButtonLink'), false)
    infoPaneVisible = false;
  }
}
