
var xOffset = 30;
var yOffset = -5;

function showPopup (targetObjectId, eventObj) {

    if(eventObj) {
	hideCurrentPopup();
	eventObj.cancelBubble = true;
	var newXCoordinate = 160;
	var newYCoordinate = 12;
	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;
    }
}

window.onload = initializeHacks;
document.onclick = hideCurrentPopup;

function initializeHacks() {

    if ((navigator.appVersion.indexOf('MSIE 5') != -1) 
	&& (navigator.platform.indexOf('Mac') != -1)
	&& getStyleObject('blankDiv')) {
	window.onresize = explorerMacResizeFix;
    }
    resizeBlankDiv();
    createFakeEventObj();
}

function createFakeEventObj() {

    if (!window.event) {
	window.event = false;
    }
}

function resizeBlankDiv() {

    if ((navigator.appVersion.indexOf('MSIE 5') != -1) 
	&& (navigator.platform.indexOf('Mac') != -1)
	&& getStyleObject('blankDiv')) {
	getStyleObject('blankDiv').width = document.body.clientWidth - 20;
	getStyleObject('blankDiv').height = document.body.clientHeight - 20;
    }
}

function explorerMacResizeFix () {
    location.reload(false);
}
