var json_url,json_nosessionurl,Session_ID;function AJAX_New(){var b=null;window.XMLHttpRequest?b=new XMLHttpRequest:window.ActiveXObject&&(b=new ActiveXObject("Microsoft.XMLHTTP"));return b}
function AJAX_Initialize(){var b,a;if("string"!=typeof json_nosessionurl||"string"!=typeof Session_ID)-1==(b=json_url.toLowerCase().indexOf("session_id="))?(json_nosessionurl=json_url,a=""):(-1==(session_end=json_url.indexOf("&",b+11))&&(session_end=json_url.length),a=json_url.substring(b+11,session_end),json_nosessionurl=json_url.slice(0,b)+json_url.slice(session_end+1)),"undefined"==typeof Session_ID&&(Session_ID=a)}
function AJAX_Append_SessionParameters(b,a){var c;c="Session_Type="+encodeURIComponent(a);"admin"==a&&"undefined"!=typeof Session_ID&&(c+="&Session_ID="+encodeURIComponent(Session_ID));return"string"!=typeof b||0==b.length?c:b+"&"+c}function AJAX_Append_SessionParameters_JSON(b,a){b||(b={});b.Session_Type=a;"admin"==a&&"undefined"!=typeof Session_ID&&(b.Session_ID=Session_ID);return b}
function AJAX_Call_Module(b,a,c,d,f,g){if(g)return g.AJAX_Call_Module(b,a,c,d,f);AJAX_Initialize();return AJAX_Call_LowLevel(null,b,"application/x-www-form-urlencoded",AJAX_Append_SessionParameters(f,a),"Store_Code="+AJAX_CharsetEncodeAttribute(Store_Code)+"&Function=Module&Module_Code="+AJAX_CharsetEncodeAttribute(c)+"&Module_Function="+AJAX_CharsetEncodeAttribute(d),function(b){var a;a={success:0,error_code:"MER-AJX-00002"};a.error_message="Miva Merchant returned an invalid response.\nModule: "+
c+"\nFunction: "+d+"\nResponse: "+b.responseText;return a})}
function AJAX_Call_Module_JSON(b,a,c,d,f,g){if(g)return g.AJAX_Call_Module_JSON(b,a,c,d,f);AJAX_Initialize();return AJAX_Call_LowLevel(null,b,"application/json",JSON.stringify(AJAX_Append_SessionParameters_JSON(f,a)),"Store_Code="+AJAX_CharsetEncodeAttribute(Store_Code)+"&Function=Module&Module_Code="+AJAX_CharsetEncodeAttribute(c)+"&Module_Function="+AJAX_CharsetEncodeAttribute(d),function(b){var a;a={success:0,error_code:"MER-AJX-00013"};a.error_message="Miva Merchant returned an invalid response.\nFunction: "+
d+"\nResponse: "+b.responseText;return a})}function AJAX_Call_Module_FieldList(b,a,c,d,f,g,h){var k;for(k=0;k<g.length;k++)f+=(f.length?"&":"")+encodeURIComponent(g[k].name)+"="+(g[k].hasOwnProperty("encoded_value")?g[k].encoded_value:encodeURIComponent(g[k].value));return AJAX_Call_Module(b,a,c,d,f,h)}
function AJAX_Call_Module_WithFile(b,a,c,d,f,g,h,k,l){if(l)return l.AJAX_Call_Module_WithFile(b,a,c,d,f,g,h,k);AJAX_Initialize();if(k&&window.FormData)return AJAX_Call_Module_WithFile_FormData(b,a,c,d,f,g,k);if(k&&window.FileReader&&XMLHttpRequest.prototype.sendAsBinary)return AJAX_Call_Module_WithFile_sendAsBinary(b,a,c,d,f,g,k);b.Complete({success:0,error_code:"MER-AJX-00009",error_message:"This browser does not support file upload with the provided parameters"});window.Modal_Resize&&Modal_Resize()}
function AJAX_Call_Module_WithFile_FormData(b,a,c,d,f,g,h){var k,l;k=new FormData;for(l in f)k.append(l,f[l]);k.append("Session_Type",a);"admin"===a&&"undefined"!=typeof Session_ID&&k.append("Session_ID",Session_ID);k.append(g,h);if(null==(a=AJAX_New()))return null;b.Initialize(a,!0);a.upload.addEventListener("progress",function(a){b.Progress((a.loaded/a.total*100).toFixed(0))},!1);a.upload.addEventListener("load",function(a){b.Progress(100)},!1);return AJAX_Call_LowLevel(a,function(a){b.Complete(a)},
null,k,"Store_Code="+AJAX_CharsetEncodeAttribute(Store_Code)+"&Function=Module&Module_Code="+AJAX_CharsetEncodeAttribute(c)+"&Module_Function="+AJAX_CharsetEncodeAttribute(d),function(b){var a;a={success:0,error_code:"MER-AJX-00010"};a.error_message="Miva Merchant returned an invalid response.\nFunction: "+d+"\nResponse: "+b.responseText;return a})}
function AJAX_Call_Module_WithFile_sendAsBinary(b,a,c,d,f,g,h){var k,l,n,m,p;p="--------miva_boundary_"+(new Date).getTime();m="";l=new FileReader;l.onloadend=function(){for(n in f)m+="--"+p+'\r\nContent-Disposition: form-data; name="'+n+'"\r\n\r\n'+f[n]+"\r\n";m+="--"+p+'\r\nContent-Disposition: form-data; name="Session_Type"\r\n\r\n'+a+"\r\n";"admin"===a&&"undefined"!=typeof Session_ID&&(m+="--"+p+'\r\nContent-Disposition: form-data; name="Session_ID"\r\n\r\n'+Session_ID+"\r\n");m+="--"+p+'\r\nContent-Disposition: form-data; name="'+
g+'"; filename="'+h.name+'"\r\nContent-Type: '+h.type+"\r\n\r\n"+this.result+"\r\n";m+="--"+p+"--";null!=(k=AJAX_New())&&(b.Initialize(k,!0),k.upload.addEventListener("progress",function(a){b.Progress((a.loaded/a.total*100).toFixed(0))},!1),k.upload.addEventListener("load",function(a){b.Progress(100)},!1),AJAX_Call_LowLevel(k,function(a){b.Complete(a)},"multipart/form-data; boundary="+p,m,"Store_Code="+AJAX_CharsetEncodeAttribute(Store_Code)+"&Function=Module&Module_Code="+AJAX_CharsetEncodeAttribute(c)+
"&Module_Function="+AJAX_CharsetEncodeAttribute(d),function(b){var a;a={success:0,error_code:"MER-AJX-00011"};a.error_message="Miva Merchant returned an invalid response.\nFunction: "+d+"\nResponse: "+b.responseText;return a}))};l.readAsBinaryString(h)}
function AJAX_Call_Domain(b,a,c,d,f){if(f)return f.AJAX_Call_Domain(b,a,c,d);AJAX_Initialize();return AJAX_Call_LowLevel(null,b,"application/x-www-form-urlencoded",AJAX_Append_SessionParameters(d,a),"Function="+AJAX_CharsetEncodeAttribute(c),function(b){var a;a={success:0,error_code:"MER-AJX-00008"};a.error_message="Miva Merchant returned an invalid response.\nFunction: "+c+"\nResponse: "+b.responseText;return a})}
function AJAX_Call_Domain_JSON(b,a,c,d,f){if(f)return f.AJAX_Call_Domain_JSON(b,a,c,d);AJAX_Initialize();return AJAX_Call_LowLevel(null,b,"application/json",JSON.stringify(AJAX_Append_SessionParameters_JSON(d,a)),"Function="+AJAX_CharsetEncodeAttribute(c),function(b){var a;a={success:0,error_code:"MER-AJX-00014"};a.error_message="Miva Merchant returned an invalid response.\nFunction: "+c+"\nResponse: "+b.responseText;return a})}
function AJAX_Call_Domain_FieldList(b,a,c,d,f,g){var h;for(h=0;h<f.length;h++)d+=(d.length?"&":"")+encodeURIComponent(f[h].name)+"="+(f[h].hasOwnProperty("encoded_value")?f[h].encoded_value:encodeURIComponent(f[h].value));return AJAX_Call_Domain(b,a,c,d,g)}function AJAX_Call(b,a,c,d,f){return f?f.AJAX_Call(b,a,c,d):AJAX_Call_WithStoreCode(b,a,Store_Code,c,d,f)}
function AJAX_Call_WithStoreCode(b,a,c,d,f,g){if(g)return g.AJAX_Call_WithStoreCode(b,a,c,d,f);AJAX_Initialize();return AJAX_Call_LowLevel(null,b,"application/x-www-form-urlencoded",AJAX_Append_SessionParameters(f,a),"Store_Code="+AJAX_CharsetEncodeAttribute(c)+"&Function="+AJAX_CharsetEncodeAttribute(d),function(b){var a;a={success:0,error_code:"MER-AJX-00012"};a.error_message="Miva Merchant returned an invalid response.\nFunction: "+d+"\nResponse: "+b.responseText;return a})}
function AJAX_Call_JSON(b,a,c,d,f){if(f)return f.AJAX_Call_JSON(b,a,c,d);AJAX_Initialize();return AJAX_Call_LowLevel(null,b,"application/json",JSON.stringify(AJAX_Append_SessionParameters_JSON(d,a)),"Store_Code="+AJAX_CharsetEncodeAttribute(Store_Code)+"&Function="+AJAX_CharsetEncodeAttribute(c),function(b){var a;a={success:0,error_code:"MER-AJX-00015"};a.error_message="Miva Merchant returned an invalid response.\nFunction: "+c+"\nResponse: "+b.responseText;return a})}
function AJAX_Call_FieldList(b,a,c,d,f,g){var h;for(h=0;h<f.length;h++)d+=(d.length?"&":"")+encodeURIComponent(f[h].name)+"="+(f[h].hasOwnProperty("encoded_value")?f[h].encoded_value:encodeURIComponent(f[h].value));return AJAX_Call(b,a,c,d,g)}function AJAX_Call_JSON_FieldList(b,a,c,d,f,g){var h,k;d||(d={});h=0;for(k=f.length;h<k;h++)d[f[h].name]=f[h].value;return AJAX_Call_JSON(b,a,c,d,g)}
function AJAX_Call_WithFile(b,a,c,d,f,g,h,k){if(k)return k.AJAX_Call_WithFile(b,a,c,d,f,g,h);AJAX_Initialize();if(h&&window.FormData)return AJAX_Call_WithFile_FormData(b,a,c,d,f,h);if(h&&window.FileReader&&XMLHttpRequest.prototype.sendAsBinary)return AJAX_Call_WithFile_sendAsBinary(b,a,c,d,f,h);if(g)return AJAX_Call_WithFile_IFRAME(b,a,c,d,f,g);b.Complete({success:0,error_code:"MER-AJX-00006",error_message:"This browser does not support file upload with the provided parameters"});window.Modal_Resize&&
Modal_Resize()}
function AJAX_Call_WithFile_FormData(b,a,c,d,f,g){var h,k;h=new FormData;for(k in d)h.append(k,d[k]);h.append("Session_Type",a);"admin"===a&&"undefined"!=typeof Session_ID&&h.append("Session_ID",Session_ID);h.append(f,g);if(null==(a=AJAX_New()))return null;b.Initialize(a,!0);a.upload.addEventListener("progress",function(a){b.Progress((a.loaded/a.total*100).toFixed(0))},!1);a.upload.addEventListener("load",function(a){b.Progress(100)},!1);return AJAX_Call_LowLevel(a,function(a){b.Complete(a)},null,
h,"Store_Code="+AJAX_CharsetEncodeAttribute(Store_Code)+"&Function="+AJAX_CharsetEncodeAttribute(c),function(b){var a;a={success:0,error_code:"MER-AJX-00003"};a.error_message="Miva Merchant returned an invalid response.\nFunction: "+c+"\nResponse: "+b.responseText;return a})}
function AJAX_Call_WithFile_sendAsBinary(b,a,c,d,f,g){var h,k,l,n,m;m="--------miva_boundary_"+(new Date).getTime();n="";k=new FileReader;k.onloadend=function(){for(l in d)n+="--"+m+'\r\nContent-Disposition: form-data; name="'+l+'"\r\n\r\n'+d[l]+"\r\n";n+="--"+m+'\r\nContent-Disposition: form-data; name="Session_Type"\r\n\r\n'+a+"\r\n";"admin"===a&&"undefined"!=typeof Session_ID&&(n+="--"+m+'\r\nContent-Disposition: form-data; name="Session_ID"\r\n\r\n'+Session_ID+"\r\n");n+="--"+m+'\r\nContent-Disposition: form-data; name="'+
f+'"; filename="'+g.name+'"\r\nContent-Type: '+g.type+"\r\n\r\n"+this.result+"\r\n";n+="--"+m+"--";null!=(h=AJAX_New())&&(b.Initialize(h,!0),h.upload.addEventListener("progress",function(a){b.Progress((a.loaded/a.total*100).toFixed(0))},!1),h.upload.addEventListener("load",function(a){b.Progress(100)},!1),AJAX_Call_LowLevel(h,function(a){b.Complete(a)},"multipart/form-data; boundary="+m,n,"Store_Code="+AJAX_CharsetEncodeAttribute(Store_Code)+"&Function="+AJAX_CharsetEncodeAttribute(c),function(b){var a;
a={success:0,error_code:"MER-AJX-00004"};a.error_message="Miva Merchant returned an invalid response.\nFunction: "+c+"\nResponse: "+b.responseText;return a}))};k.readAsBinaryString(g)}var AJAX_Call_WithFile_IFRAME_Count=0;
function AJAX_Call_WithFile_IFRAME(b,a,c,d,f,g){var h,k,l,n,m,p,q,r,t;if(!g.IFRAME_Submitted){g.IFRAME_Submitted=!0;l="AJAX_Call_WithFile_IFRAME_"+ ++AJAX_Call_WithFile_IFRAME_Count;m=newElement("div",null,{display:"none"},document.body);m.innerHTML='<iframe name="'+AJAX_CharsetEncodeAttribute(l)+'" id="'+AJAX_CharsetEncodeAttribute(l)+'"></iframe>';n=document.getElementById(l);p=newElement("form",{method:"POST",action:json_nosessionurl+"Store_Code="+AJAX_CharsetEncodeAttribute(Store_Code)+"&Function="+
AJAX_CharsetEncodeAttribute(c),target:l,encoding:"multipart/form-data",enctype:"multipart/form-data",acceptCharset:"UTF-8"},null,m);for(h in d)newElement("input",{type:"hidden",name:h,value:d[h]},null,p);newElement("input",{type:"hidden",name:"Session_Type",value:a},null,p);"admin"===a&&"undefined"!=typeof Session_ID&&newElement("input",{type:"hidden",name:"Session_ID",value:Session_ID},null,p);q=g.name;r=g.disabled;t=g.parentNode;p.appendChild(g);g.name=f;g.disabled=!1;AddEvent(n,"load",function(){g.IFRAME_Submitted=
!1;g.name=q;g.disabled=r;t.appendChild(g);try{k="undefined"!==typeof JSON&&"undefined"!==typeof JSON.parse?JSON.parse(window.frames[l].document.body.innerHTML):eval("("+window.frames[l].document.body.innerHTML+")")}catch(a){k={success:0,error_code:"MER-AJX-00005"},k.error_message="Miva Merchant returned an invalid response.\nFunction: "+c+"\nResponse: "+window.frames[l].document.body.innerHTML}m.parentNode.removeChild(m);"session_timeout"==k.error_code||"too_many_sessions"==k.error_code?parent.location.reload():
(b.Complete(k),window.Modal_Resize&&Modal_Resize())});b.Initialize(null,!1);p.submit()}}function AJAX_Call_LowLevel(b,a,c,d,f,g){if(null==b&&null==(b=AJAX_New()))return null;AJAX_Call_Initialize(b,a,c,f,g);d&&"undefined"!=typeof d.constructor&&"undefined"!=typeof window.FormData&&d.constructor==window.FormData?b.send(d):b.sendAsBinary?b.sendAsBinary(d):b.send(d);return b}
function AJAX_Call_Initialize(b,a,c,d,f){b.open("POST",json_nosessionurl+d,!0);b.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");c&&b.setRequestHeader("Content-Type",c);b.onreadystatechange=function(){var c=null,d=null,k=null;if(4==b.readyState){if(200==b.status){"undefined"!=typeof b.getResponseHeader&&(d=b.getResponseHeader("Content-Length"),k=b.getResponseHeader("Content-Encoding"));if(d&&d!=b.responseText.length&&(null==k||"identity"==k))return;try{c="undefined"!==typeof JSON&&
"undefined"!==typeof JSON.parse?JSON.parse(b.responseText):eval("("+b.responseText+")")}catch(l){c=f(b)}if("session_timeout"==c.error_code||"too_many_sessions"==c.error_code){location.reload();return}a(c);window.Modal_Resize&&Modal_Resize()}b=null}}}
function AJAX_AutoComplete_Initialize(b,a,c,d,f){AJAX_Initialize();AJAX_Call_Initialize(b,a,"application/x-www-form-urlencoded","Store_Code="+AJAX_CharsetEncodeAttribute(Store_Code)+"&Function="+AJAX_CharsetEncodeAttribute(d),function(b){var a;a={success:0,error_code:"MER-AJX-00007"};a.error_message="Miva Merchant returned an invalid response.\nFunction: "+d+"\nResponse: "+b.responseText;return a});b.autocomplete_content=AJAX_Append_SessionParameters(f,c)}
function AJAX_AutoComplete_Execute(b){b.send(b.autocomplete_content)}function PackArray(b){var a,c="";if(null==b||0==b.length)return"";for(a=0;a<b.length-1;a++)c+=encodeURIComponent(b[a])+"|";return c+=encodeURIComponent(b[a])}function EncodeArray(b){return encodeURIComponent(PackArray(b))}
function PackTwoDimensionalArray(b){var a,c,d="";if(null==b||0==b.length)return"";for(a=0;a<b.length;a++){for(c=0;c<b[a].length;c++)d+=encodeURIComponent(b[a][c]),c<b[a].length-1&&(d+="%7C");a<b.length-1&&(d+="|")}return d}function EncodeTwoDimensionalArray(b){return encodeURIComponent(PackTwoDimensionalArray(b))}function Base64ToArrayBuffer(b){var a,c,d;c=atob(b);a=c.length;d=new Uint8Array(a);for(b=0;b<a;b++)d[b]=c.charCodeAt(b);return d.buffer}
function ArrayBufferToBase64(b){var a,c,d;c=[];d=new Uint8Array(b);b=0;for(a=d.byteLength;b<a;b++)c[b]=String.fromCharCode(d[b]);return btoa(c.join(""))}function AddEvent(b,a,c){return b.addEventListener?(b.addEventListener(a,c,!1),!0):b.attachEvent?b.attachEvent("on"+a,c):!1}function RemoveEvent(b,a,c){return b.removeEventListener?(b.removeEventListener(a,c,!1),!0):b.detachEvent?b.detachEvent("on"+a,c):!1}
function FireEvent(b,a){document.createEvent?(e=document.createEvent("HTMLEvents"),e.initEvent(a,!0,!0),e.eventName=a,window.dispatchEvent(e)):(e=document.createEventObject(),e.eventType=a,e.eventName=a,window.fireEvent("on"+a,e))}function AJAX_CharsetEncodeAttribute(b){if(AJAX_isUnicode())return encodeURIComponent(b);"function"===typeof escape&&(b=escape(b),b=b.replace("+","%2B"),b=b.replace("/","%2F"),b=b.replace("@","%40"));return b}
function AJAX_isUnicode(){return 0==(document.characterSet||document.charset||"").search("UTF")?!0:!1}function AJAX_ThreadPool(b){this.threads=b;this.active_count=0;this.running=!1;this.queue=[];this.running_queue=[]}AJAX_ThreadPool.prototype.AJAX_Call_Module=function(b,a,c,d,f){var g=this,h,k;k=function(a){b(a);g.ThreadComplete();a=arrayIndexOf(g.running_queue,h);-1!=a&&g.running_queue.splice(a,1)};h=function(){g.running_queue.push(h);h.http_request=AJAX_Call_Module(k,a,c,d,f)};this.queue.push(h)};
AJAX_ThreadPool.prototype.AJAX_Call_Module_JSON=function(b,a,c,d,f){var g=this,h,k;k=function(a){b(a);g.ThreadComplete();a=arrayIndexOf(g.running_queue,h);-1!=a&&g.running_queue.splice(a,1)};h=function(){g.running_queue.push(h);h.http_request=AJAX_Call_Module_JSON(k,a,c,d,f)};this.queue.push(h)};
AJAX_ThreadPool.prototype.AJAX_Call_Module_WithFile=function(b,a,c,d,f,g,h,k){var l=this,n;b.AJAX_ThreadPool_OriginalComplete=b.Complete;b.Complete=function(a){b.AJAX_ThreadPool_OriginalComplete(a);l.ThreadComplete();a=arrayIndexOf(l.running_queue,n);-1!=a&&l.running_queue.splice(a,1);b.Complete=b.AJAX_ThreadPool_OriginalComplete;b.AJAX_ThreadPool_OriginalComplete=null};n=function(){l.running_queue.push(n);n.http_request=AJAX_Call_Module_WithFile(b,a,c,d,f,g,h,k)};this.queue.push(n)};
AJAX_ThreadPool.prototype.AJAX_Call_Domain=function(b,a,c,d){var f=this,g,h;h=function(a){b(a);f.ThreadComplete();a=arrayIndexOf(f.running_queue,g);-1!=a&&f.running_queue.splice(a,1)};g=function(){f.running_queue.push(g);g.http_request=AJAX_Call_Domain(h,a,c,d)};this.queue.push(g)};
AJAX_ThreadPool.prototype.AJAX_Call_Domain_JSON=function(b,a,c,d){var f=this,g,h;h=function(a){b(a);f.ThreadComplete();a=arrayIndexOf(f.running_queue,g);-1!=a&&f.running_queue.splice(a,1)};g=function(){f.running_queue.push(g);g.http_request=AJAX_Call_Domain_JSON(h,a,c,d)};this.queue.push(g)};
AJAX_ThreadPool.prototype.AJAX_Call=function(b,a,c,d){var f=this,g,h;h=function(a){b(a);f.ThreadComplete();a=arrayIndexOf(f.running_queue,g);-1!=a&&f.running_queue.splice(a,1)};g=function(){f.running_queue.push(g);g.http_request=AJAX_Call(h,a,c,d)};this.queue.push(g)};
AJAX_ThreadPool.prototype.AJAX_Call_WithStoreCode=function(b,a,c,d,f){var g=this,h,k;k=function(a){b(a);g.ThreadComplete();a=arrayIndexOf(g.running_queue,h);-1!=a&&g.running_queue.splice(a,1)};h=function(){g.running_queue.push(h);h.http_request=AJAX_Call_WithStoreCode(k,a,c,d,f)};this.queue.push(h)};
AJAX_ThreadPool.prototype.AJAX_Call_JSON=function(b,a,c,d){var f=this,g,h;h=function(a){b(a);f.ThreadComplete();a=arrayIndexOf(f.running_queue,g);-1!=a&&f.running_queue.splice(a,1)};g=function(){f.running_queue.push(g);g.http_request=AJAX_Call_JSON(h,a,c,d)};this.queue.push(g)};
AJAX_ThreadPool.prototype.AJAX_Call_WithFile=function(b,a,c,d,f,g,h){var k=this,l;b.AJAX_ThreadPool_OriginalComplete=b.Complete;b.Complete=function(a){b.AJAX_ThreadPool_OriginalComplete(a);k.ThreadComplete();a=arrayIndexOf(k.running_queue,l);-1!=a&&k.running_queue.splice(a,1);b.Complete=b.AJAX_ThreadPool_OriginalComplete;b.AJAX_ThreadPool_OriginalComplete=null};l=function(){k.running_queue.push(l);l.http_request=AJAX_Call_WithFile(b,a,c,d,f,g,h)};this.queue.push(l)};
AJAX_ThreadPool.prototype.Run=function(){var b,a;if(this.running){if(this.active_count<this.threads)for(b=this.active_count;b<=this.threads;b++)this.ThreadStart()}else{this.onStart();this.running=!0;if(0==this.queue.length)return this.Finished();b=0;for(a=this.threads;b<a&&0<this.queue.length;b++)this.ThreadStart()}};
AJAX_ThreadPool.prototype.Cancel=function(){var b,a;b=this.running_queue;this.active_count=0;this.running=!1;this.queue=[];for(this.running_queue=[];b.length;)(a=b.pop())&&a.http_request&&(a.http_request.onreadystatechange=function(){},a.http_request.abort());this.onComplete()};AJAX_ThreadPool.prototype.Queue_Count=function(){return this.queue.length};AJAX_ThreadPool.prototype.DequeueFromStart=function(b){for(b||(b=1);this.queue.length&&b--;)this.queue.splice(0,1)};
AJAX_ThreadPool.prototype.LimitQueueToCount=function(b){if(b)for(;this.queue.length>b;)this.queue.splice(0,1)};AJAX_ThreadPool.prototype.SetThreadCount=function(b){this.threads=b};AJAX_ThreadPool.prototype.ThreadStart=function(){0==this.queue.length?0==this.active_count&&this.Finished():(this.active_count++,this.queue.splice(0,1)[0]())};AJAX_ThreadPool.prototype.ThreadComplete=function(){this.active_count--;this.ThreadStart()};
AJAX_ThreadPool.prototype.Finished=function(){0==this.active_count&&(this.running=!1,this.onComplete())};AJAX_ThreadPool.prototype.Running=function(){return this.running?!0:!1};AJAX_ThreadPool.prototype.onStart=function(){};AJAX_ThreadPool.prototype.onComplete=function(){};
