﻿<!--
//findPos function is from http://www.quirksmode.org/js/findpos.html;
//where its workings are explained in more detail.
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

//Display a named menu, at the position of another object
function changesPopupOpen(parent, myBgColor, myContent)
{
	//get the named menu
	var myPopup = document.getElementById('PopupChanges');
	//override the 'display:none;' style attribute
	myPopup.style.display = "";
	//get the placement of the element that invoked the menu...
	var placement = findPos(parent);
	//...and put the menu there
	myPopup.style.left = placement[0] + "px";
	myPopup.style.top = placement[1] + "px";
	
	myPopup.innerHTML = myContent;
	myPopup.style.backgroundColor = myBgColor;
}

//Hide a named menu
function changesPopupClose()
{
	//get the named menu
	var myPopup = document.getElementById('PopupChanges');
	//hide it with a style attribute
	myPopup.style.display = "none";
}

//-->
