
// Figure out the browser ...
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

function Prepare(page)
{
	alert(page);	
}

function Popup(width, height, url, type)
{ 
	if (type == "scroll")
		PopupWindow = window.open ('', '', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1,height=1');
	else if (type == "tool")
		PopupWindow = window.open ('', '', 'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1,height=1');
	else
		PopupWindow = window.open ('', '', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=1,height=1');
	PopupWindow.focus();
	PopupWindow.location.href = url;
	PopupWindow.resizeTo(width+30, height+56);
}


function hideLayer(lay)
{
	if (ie4) {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 (ie4) {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 (ie4) {
		document.all[lay].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);
	}
}


