	
	Application.debug = {
		
		windowVisible: false,
		windowObject: null,
		
		init: function()
		{
			this.windowObject = document.createElement( "div" );
			this.windowObject.setAttribute( "id", "debugWindow" );
			
			document.body.appendChild( this.windowObject );
			
			this.hide();
		},
		
		hide: function()
		{
			this.windowObject.className = 'hidden';
			
			this.windowVisible = false;
		},
		
		show: function()
		{
			this.windowObject.className = 'visible';
			
			this.windowVisible = true;
		},
		
		addRow: function( args )
		{
			if(Application.debug.windowVisible == false)
			{
				Application.debug.show();
			}
			
			var d = new Date();
			
			var textContainer = document.createElement( "div" );
			textContainer.className = 'row';
			
			textContainer.innerHTML = '<span class="date">' + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds() + '</span>' + args.text;
			
			this.windowObject.appendChild(
									textContainer
								);
			
			this.windowObject.scrollTop = this.windowObject.scrollHeight;
		}
		
	}
	