Debug = {
	isDevelopmentEnvironment:null,
	Obj:null,
	Initialize: function()
	{
		if(Debug.Obj == null)
		{
			Debug.Obj = document.createElement('DIV');
			var b = document.getElementsByTagName('BODY')[0];
			b.insertBefore(Debug.Obj, b.firstChild);
			//
			Debug.Obj.style.position = 'absolute';
			Debug.Obj.style.top = '0';
			Debug.Obj.style.overflow = 'visible';
			Debug.Obj.style.backgroundColor = '#FFF';
			Debug.Obj.style.padding = '6px';
			Debug.Obj.style.color = '#000';
			Debug.Obj.style.fontFamily = 'Courier New';
			Debug.Obj.style.fontSize='11px';
			Debug.Obj.style.opacity = '.60';
			//
			var close = document.createElement('DIV');
			Debug.Obj.appendChild(close);
			close.style.cursor = 'pointer';
			close.appendChild(document.createTextNode('[X]'));
			close.onclick = function()
			{
				Debug.Clear();
			};
		}
	},
	Show: function(msg)
	{
		//
		if(!Debug.IsDevelopmentEnvironment()) return;
		//
		Debug.Initialize();
		var newDiv = document.createElement('DIV');
		Debug.Obj.appendChild(newDiv);
		newDiv.appendChild(document.createTextNode(msg));
	},
	Clear: function()
	{
		if(Debug.Obj != null)
		{
			Debug.Obj.parentNode.removeChild(Debug.Obj);
			Debug.Obj = null;
		}
	},
	IsDevelopmentEnvironment: function()
	{
		if(!Debug.isDevelopmentEnvironment)
			Debug.isDevelopmentEnvironment = (document.URL.toLowerCase().indexOf('http://localhost/') == 0);
		return Debug.isDevelopmentEnvironment;
	}
};

