var ns4=(document.layers)? true:false;
var ns6=(document.getElementById)? true:false;
var ie4=(document.all)? true:false;
var ie5=false;
if(ie4){
	if((navigator.userAgent.indexOf('MSIE 5')> 0)||(navigator.userAgent.indexOf('MSIE 6')> 0)){
		ie5=true;
	}
	if(ns6){
		ns6=false;
	}
}
if((ns4)||(ie4)||(ns6)){
//	document.onmousemove=mouseMove
//	if(ns4) document.captureEvents(Event.MOUSEMOVE)
}

function rewriteLayer (idOrPath, html) {
  if (document.layers) {
    var l = idOrPath.indexOf('.') != -1 ? eval(idOrPath) 
             : document[idOrPath];
    if (!l.ol) {
      var ol = l.ol = new Layer (l.clip.width, l);
      ol.clip.width = l.clip.width;
      ol.clip.height = l.clip.height;
      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)
      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 layerWrite(objName, text){
	if(ns4){
		var lyr = document.layers[objName].document;
		lyr.write(text);
		lyr.close();
	}else if(ie4){
		document.all[objName].innerHTML = text;
	}else if(ns6){
		over = document.getElementById(objName);	
		range = document.createRange();
		range.setStartBefore(over);
		domfrag=range.createContextualFragment(text);
		while(over.hasChildNodes()){
			over.removeChild(over.lastChild);
		}
		over.appendChild(domfrag);
	}
}

function showObject(obj){
	if(ns4)obj.visibility="show";
	else if(ie4)obj.visibility="visible";
	else if(ns6)obj.style.visibility="visible";
}

function hideObject(obj){
	if(ns4)document.obj.visibility="hide";
	else if(ie4)obj.visibility="hidden";
	else if(ns6)obj.style.visibility="hidden";
}
