var xOffset = 30;
var yOffset = 10;
function showPopup (targetObjectId, eventObj) {
    if(eventObj) {
	hideCurrentPopup();
	eventObj.cancelBubble = true;
	var newXCoordinate = (eventObj.pageX)?eventObj.pageX + xOffset:eventObj.x + xOffset + ((document.body.scrollLeft)?document.body.scrollLeft:0);
	var newYCoordinate = (eventObj.pageY)?eventObj.pageY + yOffset:eventObj.y + yOffset + ((document.body.scrollTop)?document.body.scrollTop:0);
	moveObject(targetObjectId, newXCoordinate, newYCoordinate);
	if( changeObjectVisibility(targetObjectId, 'visible') ) {
	    window.currentlyVisiblePopup = targetObjectId;
	    return true;
	} else {
	    return false;
	}
    } else {
	return false;
    }
}
function hideCurrentPopup() {
    if(window.currentlyVisiblePopup) {
	changeObjectVisibility(window.currentlyVisiblePopup, 'hidden');
	window.currentlyVisiblePopup = false;
    }
}
function myshowPopup (targetObjectId, eventObj) {
    if(eventObj) {
	myhideCurrentPopup();
	eventObj.cancelBubble = true;
	if( changeObjectVisibility(targetObjectId, 'visible') ) {
	    window.formulePopup = targetObjectId;
	    return true;
	} else {
	    return false;
	}
    } else {
	return false;
    }
}
function myhideCurrentPopup() {
    if(window.formulePopup) {
	changeObjectVisibility(window.formulePopup, 'hidden');
	window.formulePopup = false;
    }
}