var oldId = 0;
function showSub (id)
{
//  if (oldId != id && oldId != 'level1') hideSub (oldId);
//  if (oldId == 'level2' && id == 'level1') hideSub(oldId);
  document.getElementById(id).style.visibility = 'visible';
  oldId = id;
}

function hideSub (id)
{
//  if (id == 0) id = oldId;
  if (id==0){
  	document.getElementById('level1').style.visibility = 'hidden';
  	document.getElementById('level2').style.visibility = 'hidden';
  }
  oldId = 0;
  if (id != 0) {
  document.getElementById(id).style.visibility = 'hidden';
  }
}