/**
	 * HttpClient
	 *
	 *
	 *
	 * Dependencies: none
	 */

	function HttpClient()
	{
		var itsHttpRequest;
		var itsCallBack;
		var self = this;

		if (window.XMLHttpRequest)
		{
			itsHttpRequest = new XMLHttpRequest();
		}
		else if (window.ActiveXObject)
		{
			try
			{
				itsHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				try
				{
					itsHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e)
				{}
			}
		}

		if (!itsHttpRequest)
		{
			alert( "noHttpRequest");
			return false;
		}

		this.handleChangedState = function()
		{
			if (itsHttpRequest.readyState == 4)
			{
//				if (itsHttpRequest.status == 200)
//				{
					if (itsCallBack)
					{
						itsCallBack(itsHttpRequest);
					}
//				}
			}
		};

		this.get = function(theUrl,theCallBack)
		{
			itsCallBack = theCallBack;
			itsHttpRequest.open("GET",theUrl,true);
			itsHttpRequest.onreadystatechange = this.handleChangedState;
			itsHttpRequest.send(null);
		};

		this.put = function(theUrl,theData,theCallBack)
		{
			itsCallBack = theCallBack;
			itsHttpRequest.open("PUT",theUrl,true);
			itsHttpRequest.onreadystatechange = this.handleChangedState;
			itsHttpRequest.send(theData);
		};

		this.del = function(theUrl,theCallBack)
		{
			itsCallBack = theCallBack;
			itsHttpRequest.open("DELETE",theUrl,true);
			itsHttpRequest.onreadystatechange = this.handleChangedState;
			itsHttpRequest.send(null);
		};

		this.post = function(theUrl,theData,theCallBack)
		{
			itsCallBack = theCallBack;
			itsHttpRequest.open("POST",theUrl,true);
			itsHttpRequest.onreadystatechange = this.handleChangedState;
			itsHttpRequest.send(theData);
		};
	};
