function showLayer(i, img)
{
  if(document.getElementById('topic'+i)){
    document.getElementById('topic0').style.display = "none";
    document.getElementById('topic'+i).style.display = 'block';
  }
  if(document.getElementById('topicImg'+i)){
    document.getElementById('topicImg0').style.visibility = "hidden";
    document.getElementById('topicImg'+i).style.visibility = 'visible';
  }
  if(document.getElementById('button'+i)){
    document.getElementById('button'+i).src = img;
  }
}

function revertLayer(i, img)
{
  if(document.getElementById('topicImg0')){
    document.getElementById('topicImg0').style.visibility = "visible";
  }
  if(document.getElementById('topic0')){
    document.getElementById('topic0').style.display = "block";
  }
  for(var c=1;c<=8;c++){
    if(document.getElementById('topicImg'+c)){
      document.getElementById('topicImg'+c).style.visibility = "hidden";
    }
    if(document.getElementById('topic'+c)){
      document.getElementById('topic'+c).style.display = "none";
    }
  }
  if(document.getElementById('button'+i)){
    document.getElementById('button'+i).src = img;
  }
}

function bg(obj,color)
{
  if(color.length<3){
    obj.style.backgroundColor='transparent';
  }else{
    obj.style.backgroundColor=color;
  }
}
