//----------------------------------------------
// This group of function serves for dynamic layers 
//----------------------------------------------

var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;


function writetolayer(lay,txt) {
if (ie4) {
	obj= getLyrObj(lay);
	obj.innerHTML = txt;
}
if (ns4) {
document[lay].document.write(txt);
document[lay].document.close();
}
if (ns6) {
over = document.getElementById([lay]);
range = document.createRange();
range.setStartBefore(over);
domfrag = range.createContextualFragment(txt);
while (over.hasChildNodes()) {
over.removeChild(over.lastChild);
}
over.appendChild(domfrag);
   }
}


function getLyrObj(obj)
{  	if(ns4)
	{	compLayr = document.layers[obj]
	}
	else if (ns6)
	{    compLayr = document.getElementById(obj);
	}
	else
	{  compLayr = eval("document.all."+ obj)
	}
	return compLayr
}

function show(layr) 
{	obj = getLyrObj(layr)
	obj.style.visibility = "visible"; 
	obj.style.display = "inline";
}

function hide(layr)
{	obj = getLyrObj(layr)
	obj.style.visibility = "hidden";
	obj.style.display = "none";
}