
	
	var debugging = false;
	var isIE = Prototype.Browser.IE;
	var initFunctions = [];
	var dev = document.getElementById("dev");
	var formTimer = null;
	
	/* 
		debug
		The debugging function; it adds the given text to div#dev, and appends a <br> unless you specify otherwise.  Future functionality could extend this to various levels of debugging.
	*/
	
	function debug(text, sameLine){
		if (debugging == false)
			return;
		
		if (!dev){
			dev = $("dev");
			if (!dev){
				debugging = false;
				return
			}
		}
		
		//assumes there's a variable called dev which points to an HTML element
		dev.innerHTML += text;
		if (sameLine != true)
			dev.innerHTML += "<br>";
	}
	
	/*
		initialize
		Standard function called at onload for every page.  It loops through the initFunctions array and evals each statement, allowing page designers to set up page-specific initialization needs using a common structure.
	*/
	
	function initialize(){
		for (var i = 0; i < initFunctions.length; i++){
			eval(initFunctions[i]);
		}
	}


	

	function fixTextHeight(){
		// tweak the text window's height
		debug("editing height");
		
		if (isIE) {
			$("text").style.height = ($("reviewControls").clientHeight - $("textNodeControls").offsetHeight + 6) + "px";
		}
		else {
			$("text").style.height = ($("textreader").clientHeight - $("textNodeControls").clientHeight - 2) + "px";
			//$("reviewControls").style.height = ($("reviewwrapper").clientHeight - 20) + "px"; // why were you here?
		}		
	 }
	 
	function process_tooltips() {
		var tooltip_home = document.getElementById("tooltip_texts");
		if (tooltip_home) {
			// for each tooltip text we define, get the node that gets it, and set it up
			for (var i = 0; i < tooltip_home.childNodes.length; i++) {
				var tooltip_text = tooltip_home.childNodes[i];
				if (tooltip_text.id){
					var tooltip_haver = document.getElementById(tooltip_text.id.replace("_text", ""));
					
					// if the element to get it is properly set up, make its mouseover so that it'll appear
					if (tooltip_haver) {
						var mouseover = "tooltip_haver.onmouseover = function() { makeTooltip('" + tooltip_haver.id + "'); }";
						eval(mouseover);
						debug("Creating tooltip for " + tooltip_haver.id + ", mouseover: " + mouseover);
					}
				}
			}
		}
	}
	

