
function getClientWidthx()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getElementPositionx(elemID) {
    var offsetTrail = document.getElementById(elemID);
    var offsetLeft = 0;
    var offsetTop = 0;
    while (offsetTrail) {
        offsetLeft += offsetTrail.offsetLeft;
        offsetTop += offsetTrail.offsetTop;
        offsetTrail = offsetTrail.offsetParent;
    }
   
	return {left:offsetLeft, top:offsetTop};
}


function getPopup(obj_id, pop_id, lp, tp)
{
	popup = document.getElementById(pop_id);
	obj = document.getElementById(obj_id);
	if (navigator.vendor != "Apple Computer, Inc.") {		
		pos = getElementPositionx(obj_id);		
		if ((getClientWidthx()-pos.left)<325) {
			popup.style.right = 0+'px';
			popup.style.left = 'auto';
		}
		else {
			popup.style.left = (pos.left-20)+'px';
		}
		popup.style.display = 'block';
		popup.style.top = (pos.top-180)+'px';
	}
	else {	
		if (lp != 5) {
			popup.style.left = 225 + (120*lp) + 'px';
		}
		else {
			popup.style.left = (225 + (120*lp)) - 165 + 'px';
		}
		popup.style.top = (415 + (120*tp)) - 165 + 'px';
		popup.style.display = 'block';
		
	}	
}

function hidePopup(hidename) 
{
		var hblock = document.getElementById(hidename);
		hblock.style.display = 'none';
}




