/** public class SneezeGuards : Encapsulates collection of all guarded content in the page. */
var SneezeGuards = {};
/** public void add : adds a new SneezeGuard object to the collection. */
SneezeGuards.add = function(guardId) { this[guardId] = new SneezeGuard(guardId); }

/** public class SneezeGuard : Encapsulates the pieces of a sneezeguard, which is
  * basically a DHTML screen protecting an area of content from user clicks.
  * @param String id Unique id of the content area
  */
SneezeGuard = function(id) {
	this.id = id;
	this.element = document.getElementById(id);
	this.guard = document.getElementById(id.replace(/_wrapper$/, "_sneezeguard"));
	this.guard.style.height = this.element.offsetHeight + "px";
	this.guard.style.position = "absolute";
	this.guard.style.display = "block";
	this.tip = document.getElementById(id.replace(/_wrapper$/, "_tiptext"));
}
/** public static void over : Initializes the sneezeguard the 1st time content area
  * is moused over. Starts the countdown for displaying the tooltip, if necessary.
  * @param Event e Mouseover event triggering the method call
  * @param String id Unique id of the moused over content area
  */
SneezeGuard.over = function(e, id) {
	e.cancelBubble = true;
	if (!SneezeGuards[id]) SneezeGuards.add(id);
	if (SneezeGuards[id].tip) {
		window.tipTimeout = setTimeout("SneezeGuards['" + id + "'].tip.style.display = 'inline';", 500);
	}
}
/** public static void out : Cancels the countdown for displaying the tooltip.
  * @param Event e Mouseout event triggering the method call
  * @param String id Unique id of the moused over content area
  */
SneezeGuard.out = function(e, id) {
	e.cancelBubble = true;
	SneezeGuards[id].tip.style.display = "none";
	clearTimeout(tipTimeout);
}

/** public static class EditedPage: wrapper for any actions needed to prepare
  * a page when it edit mode.
  */
EditedPage = {
	/** public static void init : execute actions on page load. */
	init : function() {
		// disable all select objects in a page, to compensate for the IE bug
		for (var i=0; i<document.getElementsByTagName("SELECT").length; i++) document.getElementsByTagName("SELECT")[i].disabled = true;
	}
}
