/* Ajax.Request.abort
 * Extends the prototype.js Ajax.Request object so that it supports an abort method*/

Ajax.Request.prototype.abort = function() {
	
	// prevent and state change callbacks from being issued
	this.transport.onreadystatechange = Prototype.emptyFunction;
	
	// abort the XHR
	this.transport.abort();
	
	// update the request counter
	Ajax.activeRequestCount--;
	
};

/* Object.escapeQuotesJavaScript()
 * Extends the prototype.js String object so that it supports escapeQuotesJavaScript and unescapeQuotesJavaScript methods -- these special methods are used to escape quotes prior to transferring data between ajax returns and functions, etc*/

String.prototype.escapeQuotesJavaScript = function() {
	
	return this.replace(/\\/g,'\\\\').replace(/\'/g,'\\\'').replace(/\"/g,'&quot;');
	
}

String.prototype.unescapeQuotesJavaScript = function() {
	
    return this.replace(/\\\\/g,'\\').replace(/\\\'/g,'\'').replace(/&quot;/g,'\"');
	
}

