/**
* Javascript Debug Box
* J Zelos 2005
*
* Usage: <script src="Debug.js"></script>
* Syntax: debug(message)
*
**/

function debug(msg) {

	if (!debug.box) { 
		//create div and add to bottom of page
		debug.box = document.createElement("div")
		debug.box.setAttribute("style",
			"background-color:white; " +
			"font-family:monospace; " +
			"border: solid black 3px; " +
			"padding: 10px;");
		document.body.appendChild(debug.box);
		
		// set title 'debug' in box
		var t = document.createElement("h1")
		t.setAttribute("style",
			"color:blue; " +
			"text-align:center; ");	
		t.appendChild(document.createTextNode("Debug"));
		
		debug.box.appendChild(t);
		}
		
	// add debug text
	var p = document.createElement("p");
	p.appendChild(document.createTextNode(msg));
	debug.box.appendChild(p);
}