if(typeof(CHTTP_REQUEST_INCLUDE) != "boolean") {
	CHTTP_REQUEST_INCLUDE = true;
    
    function CHttp()
	{    
	  this.Ip = "127.0.0.1";
	  this.Port = 18181;
	  this.Response = "";
	  this.lock = false;
	  this.plugin = null;
    };
    
    CHttp.prototype.SetIp = function (ip){
        this.Ip = ip;
    };
    
	CHttp.prototype.SetPort = function(port)
	{
		this.Port = port;
	}

	CHttp.prototype.SetPlugin = function(pluginObj)
	{
		this.plugin = pluginObj;
	}

    CHttp.prototype.post = function (path, payload) {
		try {
			var fileListOnServer = "http://" + this.Ip + ":" + this.Port + "/" + path;
			var result;
			if (this.plugin) {
				result = this.plugin.post(fileListOnServer, payload);
			} else {
				if (!document.getElementById("rpcform")) {
					/*addHTML(postElementsHTML);*/
					alert("Error to perform cross-domain POST");
					return false;
				}
				var frm = document.getElementById("rpcform");
				var ifr = document.getElementById("rpcframe");
				if (!frm || !ifr) {
					alert("Error posting data to " + url);	
					return false;
				}
				frm.action = url;
				frm.payload.value = data;
				/*ifr.onload = onload;*/
				frm.submit();
				result = "";
			}
			return result;
		} catch (e) {
			dumpMsg(e);
			return null;
		}
		return null;
    };
	
	CHttp.prototype.get = function (path) {
		try {
			var pathServer = "http://" + this.Ip + ":" + this.Port + "/" + path;
			var result;
			if (this.plugin) {
				result = this.plugin.httpGet(pathServer);
			} else {
				alert("Plugin not loaded");
			}
			return result;
		} catch (e) {
			alert(e);
			return null;
		}
		return null;
    };
}
