// Copyright 2005 David Cramer
// http://www.davidcramer.net/
// dcramer@gmail.com

var popUp = null;

function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			obj = obj.offsetParent; 
		}
	}
	return curleft;
}
function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop;
			obj = obj.offsetParent; 
		}
	}
	return curtop;
}
function showPop(e, text, l) {
	if (!e) var e = window.event;
	if (!object) var object = (e.target) ? e.target : e.srcElement;
	popUp = document.getElementById("overDiv");
	popUp.innerHTML = text;
	xPos = findPosX(object) + object.offsetWidth - 70;
	yPos = findPosY(object) + object.offsetHeight + 20;
	if (xPos + popUp.offsetWidth > document.body.clientWidth)
	{
		xPos = document.body.clientWidth - popUp.offsetWidth - 22;
	}

	popUp.style.left = xPos + 'px';
	popUp.style.top = yPos + 'px';
	popUp.style.visibility = 'visible';
	if (l == true)
		popUp.style.width = '600px';
}
function hidePop() {
	if (!popUp)
		return false;
	popUp.style.visibility = 'hidden';
	popUp.innerHTML = '';
	popUp = '';
}