var _dynacom_debug = false;
function debug(msg){
	if(_dynacom_debug == true){
		var dbg = document.getElementById('_dynacom_dbg');
		if(dbg == null){
			
			dbg = document.createElement("div");
			dbg.id = "_dynacom_dbg";
				
			var windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
			var windowWidth = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
			
			dbg.style.top = (windowHeight - 105) + "px";
			dbg.style.left = "0px";
			dbg.style.width = (windowWidth - 5) + "px";
			dbg.style.height = "100px";
			dbg.style.padding = "2px";
			dbg.style.position = "absolute";
			dbg.style.backgroundColor = "#c0c0c0";
			dbg.style.color = "#000000";
			dbg.style.overflow = "scroll";
			dbg.style.fontFamily = "Courier New, Courier, Monospace";
			dbg.style.fontSize = "12px";
			document.body.appendChild(dbg);
		}
		dbg.style.display = "block";
		dbg.style.visibility = "visible";
		dbg.innerHTML = msg + "<br/>" + dbg.innerHTML;
	}
}