function showorhide(whichone, style) {
	document.getElementById(whichone).className = style;
	var windowWidth = document.documentElement.clientWidth;
	var popupWidth = $("#" + whichone).width();
	var newTop = $(document).scrollTop() + 200;
	if (newTop < 10)
		newTop = 10;
	$("#" + whichone).css({
		"position": "absolute",
		"top": newTop,
		"left": ((windowWidth / 2) - (popupWidth / 2))
	});
}

function findPos(obj) {
	var curleft = 0;
	var curtop = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curleft += obj.offsetLeft-obj.scrollLeft;
			curtop += obj.offsetTop-obj.scrollTop;
			var position = '';
			if (obj.style && obj.style.position) 
				position = obj.style.position.toLowerCase();
			if ((position == 'absolute')||(position == 'relative')) 
				break;
			while (obj.parentNode != obj.offsetParent) {
				obj = obj.parentNode;
				curleft -= obj.scrollLeft;
				curtop -= obj.scrollTop;
			}
			obj = obj.offsetParent;
		}
	} else {
		if (obj.x)
			curleft += obj.x;
		if (obj.y)
			curtop += obj.y;
	}
	return [curleft,curtop];
}

function getStyleObject(objectId) {
	// W3C DOM
	if(document.getElementById && document.getElementById(objectId)) {
		return document.getElementById(objectId).style;
	} 
	// MSIE 4 DOM
	else if (document.all && document.all(objectId)) {
		return document.all(objectId).style;
	} 
	// NN 4 DOM.. note: this won't find nested layers
	else if (document.layers && document.layers[objectId]) {
		return document.layers[objectId];
	}
	else {
		return false;
	}
}
