function SJAXHandler(pRequestURL, pResponseProcessor) 
{
    this.requestMethod     = "POST";
    this.requestURL        = pRequestURL;
    this.responseProcessor = pResponseProcessor;  
    this.debug             = false;
    
    this._requestObject     = null;
    this._paramValue        = null;
}

SJAXHandler.prototype.requestMethod;
SJAXHandler.prototype.requestURL;
SJAXHandler.prototype.responseProcessor;
SJAXHandler.prototype.debug;

SJAXHandler.prototype._requestObject;
SJAXHandler.prototype._paramValue;


SJAXHandler.prototype.call = function(pParam) 
{        
    this._paramValue = encodeURIComponent(pParam);
    this._sendRequest();
}

SJAXHandler.prototype._initRequestObject = function() 
{    
    if (this._requestObject == null)
    {            
        if (window.XMLHttpRequest)
        {                    
            this._requestObject = new XMLHttpRequest();            
        }
        else if (window.ActiveXObject)
        {
            this._requestObject = new ActiveXObject("Microsoft.XMLHTTP");
        }                
    }
}

SJAXHandler.prototype._sendRequest = function() 
{
    this._initRequestObject();
    
    this._requestObject.open(this.requestMethod, this.requestURL, false);       
    
    this._requestObject.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    this._requestObject.send("param=" + this._paramValue);       

    if ((this._requestObject.status == 200) || this.debug) // Status = ok
    {        
        this.responseProcessor(this._requestObject.responseText);        
    }    
    else
    {
        alert("Unable to process request.");
    }       
}
