<!--
/*
	Purpose 	: A series of generic routines to use with DHTML

	$Revision: 1.3 $ 
	$Date: 2003/03/19 13:34:23 $
	$Author: MEvans $
*/

ns4 = document.layers;

// purpose : Calculate position of obj from left of screen
function calcLeftPos(obj) {

	var pos = 0;
	do {
		pos += obj.offsetLeft;
		obj = obj.offsetParent;
	} while (obj != null);

	return pos
}

// purpose : Calculate position of obj from top of screen
function calcTopPos(obj) {

	var pos = 0;
	do {
		pos += obj.offsetTop;
		obj = obj.offsetParent;
	} while (obj != null);

	return pos
}

// purpose : get a reference to an object, works for IE4+, NS6+
function getObj(name) {

	if (document.layers) return document.layers[name];
	if (document.getElementById) return document.getElementById(name);
	if (document.all) return document.all(name);

  return null;
}


function show_div(div_id) {

	obj = getObj(div_id);
	if (ns4) {
		obj.visibility = 'visible';
	} else {
		obj.style.visibility = 'visible';
	}
}

// purpose	: write html into a DIV or LAYER, works NS 4+, IE 4+
function writeInnerHTML(div_id, html) {

	obj = getObj(div_id);
	if (ns4) {
		obj.document.open()
		obj.document.write(html)
		obj.document.close()
	} else {
		obj.innerHTML = html
	}
}


//-->