var ie = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

function hidelayer(lay) {
	if (ie) {document.all[lay].style.visibility = "hidden";}
	if (ns4) {document.layers[lay].visibility = "hide";}
	if (ns6) {document.getElementById([lay]).style.display = "none";}
}

function showlayer(lay) {
	if (ie) {document.all[lay].style.visibility = "visible";}
	if (ns4) {document.layers[lay].visibility = "show";}
	if (ns6) {document.getElementById([lay]).style.display = "block";}
}

function writetolayer(lay,txt) {
	if (ie) {
		document.all[lay].innerHTML = txt;
	}
	
	if (ns4) {
			document[lay].document.write(txt);
			document[lay].document.close();
	}
	
	if (ns6) {
		wt_over = document.getElementById([lay]);
		wt_range = document.createRange();
		wt_range.setStartBefore(wt_over);
		wt_domfrag = wt_range.createContextualFragment(txt);
		while (wt_over.hasChildNodes()) {
			wt_over.removeChild(wt_over.lastChild);
		}
		wt_over.appendChild(wt_domfrag);
	}
}