/**
 * Show the popup box with given id.
 * 
 * @author R.J.T. de Vries <rdevries@thirdwave.nl>
 * @param		string		box		id of box to show - should be able to be fetched
 *													using document.getElementById()
 * @return 	boolean					true on success, false on failure
 * @access public
 */
function popup(box) {

	// first, kill any open popups.

	kill_popups();

	var oBox = document.getElementById(box);
	
	if ( typeof(oBox) == 'undefined' || !oBox || oBox == null ) {
	
		return false;
		
	}
	
	oBox.style.visibility = "visible";
	
} // popup()

/**
 * Kill all popup boxes.
 * 
 * @author R.J.T. de Vries <rdevries@thirdwave.nl>
 * @return 	boolean					true
 * @access public
 */
function kill_popups() {
	
	for ( var i = 1; i < 50; i++ ) {
	
		var sBoxId = 'box' + i;
		
		var oBox = document.getElementById(sBoxId);
		
		if ( typeof(oBox) == 'undefined' || !oBox || oBox == null ) {
		
			break;
			
		}
		
		oBox.style.visibility = "hidden";
	
	} // while()
	
} // kill_popups()


 
