function PageComponentProcessor()
{
	
	
	this.builderObj = null;


	this.setBuilder = function(builderObj)
	{
		this.builderObj = builderObj;
	}

	this.getCallbackGroup = function(div)
	{
		var sCallback = function(methodOutput, methodResult)
		{
			div.innerHTML = methodOutput;
		};

		return new CallbackStandardization().getStandardGroup(sCallback);
	}

	this.instantiateCaller = function(div)
	{
		var caller = new RPCaller(this.getCallbackGroup(div), this.builderObj);
		caller.cachingMechanism = cacheMechanism;
	
		return caller;
	}

	this.displayLeftMenu = function()
	{
		
		var caller = this.instantiateCaller(document.getElementById("menu"));
		caller.cachingMechanism = null;		
		caller.callableObj.build_leftmenu_contents(caller);
	}

	this.displayUserSection = function()
	{
		var caller = this.instantiateCaller(document.getElementById("userSection"));

		var cg = this.getCallbackGroup(document.getElementById("userSection"));
		var old = cg.successCallback;

		cg.successCallback = function(mo, mr){ old(mo, mr);   ContentActionProcessor.getSingleton().displayContentPanel(ContentActionProcessor.getSingleton().activeContent); } ;
		
		caller.setCallbackGroup(cg);
		caller.cachingMechanism = null;
		caller.callableObj.build_user_section(caller);	
	}
	

	PageComponentProcessor.singleton = this;

	PageComponentProcessor.getSingleton = function()
	{
		if (PageComponentProcessor.singleton == null)
		{
			return new PageComponentProcessor();
		}
		else
		{
			return PageComponentProcessor.singleton;
		}
	}
}

