	window.currentlyVisiblePopup = false;     
    
function showPopup(targetObjectId, eventObj){
	obj = document.getElementById(targetObjectId);
    obj.style.display = 'block';
    eventObj.cancelBubble = true;
    if (eventObj){
     window.currentlyVisiblePopup = obj; 
    }
      
}

function hidePopup(obj){
	obj = document.getElementById(obj);
	obj.style.display = 'none';
	window.currentlyVisiblePopup = false;     
}

function xhidePopup(){
    if(window.currentlyVisiblePopup) {
    	window.currentlyVisiblePopup.style.display = 'none';
    	window.currentlyVisiblePopup = false;
    }
}
  document.onclick = xhidePopup;
  document.onmouseover = xhidePopup;
