if ((top.ServerCallInit == "undefined") || (top.ServerCallInit != true))
{

	/**
	 *
	 * ServerCall CLASS definition.
	 *
	 */
	 
	function ServerCall(_owner)
	{
		this.owner = _owner;
		this.resource = null;
		this.operation = null;
		this.parameterTable = new Array()	// used to send text - mapped as hidden fields on the channel IFRAME form
		this.fileParameterTable = new Array(); 	// used to send files - mapped as file fields on the channel IFRAME form
	 	this.callId = (new Date()).getTime(); // unique identifier of a server call
	 	this.callIdParameter = null;
	}
	
	ServerCall.prototype.getOwner = function()
	{
		return this.owner;
	}

	ServerCall.prototype.getChannelService = function ()
	{
		return top.channelService;
	}

	ServerCall.prototype.getResource = function()
	{
		return this.resource;
	}

	ServerCall.prototype.setResource = function(resourceArg)
	{
		this.resource = resourceArg;
	}

	ServerCall.prototype.getOperation = function()
	{
		return this.operation;
	}

	ServerCall.prototype.setOperation = function(operationArg)
	{
		this.operation = operationArg;
	}

	ServerCall.prototype.addParameter = function(key,value)
	{
		this.parameterTable[key]=value;
	}

	ServerCall.prototype.getParameter = function(key)
	{
		return this.parameterTable[key];
	}

	ServerCall.prototype.setParameterTable = function(parameterTableArg)
	{
		this.parameterTable = parameterTableArg;
	}
	
	ServerCall.prototype.addFileParameter = function(key,value)
	{
		this.fileParameterTable[key]=value;
	}

	ServerCall.prototype.getFileParameter = function(key)
	{
		return this.fileParameterTable[key];
	}

	ServerCall.prototype.setFileParameterTable = function(fileParameterTableArg)
	{
		this.fileParameterTable = fileParameterTableArg;
	}

	ServerCall.prototype.getCallId = function()
	{
		return this.callId;
	}

	ServerCall.prototype.getCallIdParameter = function()
	{
		return this.callIdparameter;
	}
	
	ServerCall.prototype.setCallIdParameter = function(callIdParameterArg)
	{
		this.callIdParameter = callIdParameterArg;
		// add it to the parameterTable
		this.addParameter(this.callIdParameter, this.callId);
	}
	
	ServerCall.prototype.clone = function()
	{
		// clone everything except callId
		sc = new ServerCall(this.owner);
		sc.setResource(this.resource);
		sc.setOperation(this.operation);
		sc.setParameterTable(this.parameterTable);
		sc.setFileParameterTable(this.fileParameterTable);
		sc.setCallIdParameter(this.callIdParameter);

		return sc;
	}
	
	//////////////////////////////////////

	top.ServerCallInit = true;
}
