function getElement(element) {

	if (document.getElementById) // this is the way the standards work

		return document.getElementById(element);

	else if (document.all) // this is the way old msie versions work

		return document.all[element];

	else if (document.layers) // this is the way nn4 works

		return document.layers[element];

}

function getStyle(objectId) {

	// cross-browser function to get an object's style object given its
	if(document.getElementById && document.getElementById(objectId)) // W3C DOM

		return document.getElementById(objectId).style;

	else if (document.all && document.all(objectId)) // MSIE 4 DOM

		return document.all(objectId).style;

	else if (document.layers && document.layers[objectId]) // NN 4 DOM.. note: this won't find nested layers

		return document.layers[objectId];

	else

		return false;

}

function showHideElement(whichElement, action) {

	var element = getElement(whichElement);

	if (action == 'toogle') {
		if (document.layers)
			state = element.visibility
		else
			state = element.style.visibility
		if (state == 'hidden')
			action = 'visible'
		else
			action = 'hidden'
	}

	if (document.layers)

		element.visibility = action;

	else

		element.style.visibility = action;

}

function moveToTop(whichElement) {

	var the_style = getStyle(whichElement);

	if (document.layers) {

		the_style.left = 0;
		the_style.top = 0;

	} else {

		the_style.left = 0 + "px";
		the_style.top = 0 + "px";

	}

}