var hideEnabled=true;
function hideCode(id)
{
  setTimeout('doHideCode('+id+')',1000);
  hideEnabled=true;
}

function showCode(id)
{
  hideEnabled=false;
  document.getElementById("code"+id).style.display="block";
}

function doHideCode(id)
{
  if(hideEnabled==true) document.getElementById('code'+id).style.display="none";
}
