function writeTo(id,text)
{
  if (document.getElementById)
  {
    x = document.getElementById(id);
    x.innerHTML = '';
    x.innerHTML = text;
  }
  else if (document.all)
  {
    x = document.all[id];
    x.innerHTML = text;
  }
  else if (document.layers)
  {
    x = document.layers[id];
    text2 = '<P CLASS="testclass">' + text + '</P>';
    x.document.open();
    x.document.writeTo(text2);
    x.document.close();
  }
};

function get(id)
{
 if (document.all) tlayer=eval("document.all." + id);
 if (document.layers) tlayer = document.layers[id];
 if (!document.all && document.getElementById) tlayer = document.getElementById(id);
 return tlayer;
};

var lockedtext='';
var locked=0;

function resetMenu()
{
 locked=get(lockedtext);
 if (locked)
 {
  locked.style.backgroundColor='white';
  locked.style.textAlign='right';
 }
};

function setMenu(id)
{
 if (locked)
 {
  locked.style.backgroundColor='';
  locked.style.textAlign='';
 };
 lockedtext=id;
 resetMenu()
};

function s(id) { tlayer=get(id);if (tlayer!=locked)  tlayer.style.backgroundColor='white';};
function u(id) { tlayer=get(id);if (tlayer!=locked) tlayer.style.backgroundColor=''; };
