

Loading = {
	StartLoading : function()
	{
		if(document.getElementById('Loading'))
			Loading.EndLoading();
		var d = document.createElement("div");
		d.setAttribute("id", "Loading");
		d.className = "Loading";

		d.style.left = document.body.scrollWidth / 2 - 70 + "px";
		d.style.top = (document.documentElement.scrollTop || document.body.scrollTop) + 200 + 'px';

		var text = document.createTextNode("Loading...");
		d.appendChild(text);

		document.body.appendChild(d);
		document.body.style.cursor = "wait";
	},
	EndLoading : function()
	{
		if(document.getElementById('Loading'))
		{
			var d = document.getElementById('Loading');
			document.body.removeChild(d);
			document.body.style.cursor = "default";
		}
	},
	errors : function(s)
	{
		alert(s);
	},
	ErrorView : function(t)
	{
		alert('Error ' + t.status + ' -- ' + t.statusText);
	},
	processRequest : function(url, param, callback)
	{
		if(url != '')
		{
			$.post(url, param, callback);
		}
	},
	processResponse : function(req)
	{
		var i;
		if($('innerblock'))
			i = $('innerblock');
		else if($('inner'))
			i = $('inner');
		if(req.responseText)
		{
			if(i)
			{
				i.innerHTML = '';
				i.innerHTML = req.responseText;
			}
			/*else
				alert(req.responseText);*/
		}
		Loading.EndLoading();
	},
	close: function(name)
	{
		if($(name))
		{
			//Effect.Shrink($(name));
			document.body.removeChild($(name));
		}

		if($("MaskBody"))
		{
			document.body.removeChild($("MaskBody"));
		}
	}
}

