
function CJSONResponse(aObj,no_auto_parse)
{
	var Obj = aObj;
	this.mainNode = null;
	
	if ( aObj && aObj.responseXML ) this.mainNode = aObj.responseXML.getElementsByTagName("response").item(0);
	
	// ==========================================================================================
	// parseResponse function
	// ==========================================================================================
	this.parseResponse = function()
	{
		var jsonNode = this.mainNode.getElementsByTagName("json").item(0);
		var varNodes = jsonNode.getElementsByTagName("variable");
		
		for(var I=0;I<varNodes.length;I++)
		{
			var varNode = varNodes[I];
			var varValue = eval(varNode.textContent);
			this[varNode.getAttribute("name")] = varValue;
		}
	}
	
	// ==========================================================================================
	// getMessage function
	// ==========================================================================================
	this.getMessage = function() {
		return this.message;
	}

	// ############################################
	if ( !no_auto_parse ) this.parseResponse();
}