
// Shows the popup form passed in
function ShowPopupForm(oForm, x, y) {
	oForm.style.posLeft = x;
	oForm.style.posTop = y;
	oForm.style.visibility = "visible";
}

// Hides the popup form passed in
function HidePopupForm(oForm) {
	// Hide the Form
	oForm.style.visibility = "hidden";
}

function MovePopupForm(oForm) {
	var y = oForm.offsetTop;
	
	// If the Popup gets off the edge of the screen, move it up a bit
	if ((oForm.offsetTop + oForm.offsetHeight) > (document.body.scrollTop + document.body.clientHeight)) {
		// Adjust y...
		if (oForm.offsetHeight < document.body.clientHeight) {
			// It will fit in - adjust the top accordingly
			y = (document.body.scrollTop + document.body.clientHeight) - oForm.offsetHeight;
		} else {
			// Just move to the top of the screen
			y = document.body.scrollTop;
		}
		
		// Move it...
		oForm.style.posTop = y;
	}

}