// Requires utility.txt
//
function showSwapDiv (targetObjectId, eventObj) {
    if(eventObj) {
	// hide any currently-visible popups
	hideSwapDiv();
	// stop event from bubbling up any farther
	eventObj.cancelBubble = true;
	if( changeObjectDisplay(targetObjectId, 'block') ) {
	    // if we successfully showed the popup
	    // store its Id on a globally-accessible object
	    window.currentlyVisibleSwapDiv = targetObjectId;
	    return true;
	} else {
	    // we couldn't show the popup, boo hoo!
	    return false;
	}
    } else {
	// there was no event object, so we won't be able to position anything, so give up
	return false;
    }
} // showSwapDiv

function hideSwapDiv() {
    // note: we've stored the currently-visible popup on the global object window.currentlyVisibleSwapDiv
    if(window.currentlyVisibleSwapDiv) {
	changeObjectDisplay(window.currentlyVisibleSwapDiv, 'none');
	window.currentlyVisibleSwapDiv = false;
    }
} // hideSwapDiv


