(function($){"use strict";var managed={},cache={};$.manageAjax=(function(){function create(name,opts){managed[name]=new $.manageAjax._manager(name,opts);return managed[name];} function destroy(name){if(managed[name]){managed[name].clear(true);delete managed[name];}} var publicFns={create:create,destroy:destroy};return publicFns;})();$.manageAjax._manager=function(name,opts){this.requests={};this.inProgress=0;this.name=name;this.qName=name;this.opts=$.extend({},$.manageAjax.defaults,opts);if(opts&&opts.queue&&opts.queue!==true&&typeof opts.queue==='string'&&opts.queue!=='clear'){this.qName=opts.queue;}};$.manageAjax._manager.prototype={add:function(url,o){if(typeof url=='object'){o=url;}else if(typeof url=='string'){o=$.extend(o||{},{url:url});} o=$.extend({},this.opts,o);var origCom=o.complete||$.noop,origSuc=o.success||$.noop,beforeSend=o.beforeSend||$.noop,origError=o.error||$.noop,strData=(typeof o.data=='string')?o.data:$.param(o.data||{}),xhrID=o.type+o.url+strData,that=this,ajaxFn=this._createAjax(xhrID,o,origSuc,origCom);if(o.preventDoubleRequests&&o.queueDuplicateRequests){if(o.preventDoubleRequests){o.queueDuplicateRequests=false;} setTimeout(function(){throw("preventDoubleRequests and queueDuplicateRequests can't be both true");},0);} if(this.requests[xhrID]&&o.preventDoubleRequests){return;} ajaxFn.xhrID=xhrID;o.xhrID=xhrID;o.beforeSend=function(xhr,opts){var ret=beforeSend.call(this,xhr,opts);if(ret===false){that._removeXHR(xhrID);} xhr=null;return ret;};o.complete=function(xhr,status){that._complete.call(that,this,origCom,xhr,status,xhrID,o);xhr=null;};o.success=function(data,status,xhr){that._success.call(that,this,origSuc,data,status,xhr,o);xhr=null;};o.error=function(ahr,status,errorStr){var httpStatus='',content='';if(status!=='timeout'&&ahr){httpStatus=ahr.status;content=ahr.responseXML||ahr.responseText;} if(origError){origError.call(this,ahr,status,errorStr,o);}else{setTimeout(function(){throw status+'| status: '+httpStatus+' | URL: '+o.url+' | data: '+strData+' | thrown: '+errorStr+' | response: '+content;},0);} ahr=null;};if(o.queue==='clear'){$(document).clearQueue(this.qName);} if(o.queue||(o.queueDuplicateRequests&&this.requests[xhrID])){$.queue(document,this.qName,ajaxFn);if(this.inProgress