//-----------------------------------------------------
// 040806 rewriteTLayer added. 
//-----------------------------------------------------
function rewriteLayer (idOrPath, html) 
{
	//if (!bMainLoaded)
	//{
	//	//alert ("not loaded");
	//	return;
	//}
  if (isNN4) {
    var l = idOrPath.indexOf('.') != -1 ? eval(idOrPath) 
             : document[idOrPath];
    if (!l.ol) {
      var ol = l.ol = new Layer (l.clip.width, l);
      ol.moveAbove(l);
      ol.clip.width = l.clip.width;
      ol.clip.height = l.clip.height;
      ol.pageY = l.pageY;
      ol.pageX = l.pageX;
      ol.bgColor = l.bgColor;
      l.visibility = 'hide';
      ol.visibility = 'show';
    }
    var ol = l.ol;
    ol.document.open();
    ol.document.write(html);
    ol.document.close();
  }
  else if (document.all || document.getElementById) {
    var p = idOrPath.indexOf('.');
    var id = p != -1 ? 
              idOrPath.substring(idOrPath.lastIndexOf('.') + 1) 
              : idOrPath;
    if (document.all)
    {
    	if (!document.all[id]) return;
      	document.all[id].innerHTML = html;
    }
    else {
      var l = document.getElementById(id);
      var r = document.createRange();
      r.setStartAfter(l);
      var docFrag = r.createContextualFragment(html);
      while (l.hasChildNodes())
        l.removeChild(l.firstChild);
      l.appendChild(docFrag);
    }
  }
}

//----------------------------------------------------------------

function rewriteTLayer (idOrPath, html) 
{
	//if (!bMainLoaded)
	//{
	//	//alert ("not loaded");
	//	return;
	//}
  if (isNN4) {
    var l = idOrPath.indexOf('.') != -1 ? eval(idOrPath) 
             : document[idOrPath];
    if (!l.ol) {
      var ol = l.ol = new Layer (l.clip.width, l);
      ol.moveAbove(l);
      ol.clip.width = l.clip.width;
      ol.clip.height = l.clip.height;
      ol.pageY = l.pageY;
      ol.pageX = l.pageX;
      ol.bgColor = l.bgColor;
      l.visibility = 'hide';
      ol.visibility = 'show';
    }
    var ol = l.ol;
    ol.document.open();
    ol.document.write(html);
    ol.document.close();
  }
  else if (document.all || document.getElementById) {
    var p = idOrPath.indexOf('.');
    var id = p != -1 ? 
              idOrPath.substring(idOrPath.lastIndexOf('.') + 1) 
              : idOrPath;
    if (document.all)
    {
    	if (!document.all[id]) return;
      	document.all[id].innerText = html;
    }
    else {
      var l = document.getElementById(id);
      var r = document.createRange();
      r.setStartAfter(l);
      var docFrag = r.createContextualFragment(html);
      while (l.hasChildNodes())
        l.removeChild(l.firstChild);
      l.appendChild(docFrag);
    }
  }
}
