/**  Simple Ajax Uploader v2.0 Copyright 2012-2015 LPology, LLC  MIT license https://github.com/LPology/Simple-Ajax-Uploader */
(function(g,i,a){var n=g.ss||{},m=/^\s+/,j=/\s+$/,c=/[xy]/g,d=/.*(\/|\\)/,f=/.*[.]/,e=/[\t\r\n]/g,h=Object.prototype.toString.call(g.HTMLElement).indexOf("Constructor")>0,b=(navigator.userAgent.indexOf("MSIE 7")!==-1),k=i.createElement("input"),l;k.type="file";l=("multiple" in k&&typeof File!=="undefined"&&typeof(new XMLHttpRequest()).upload!=="undefined");n.obj2string=function(r,q){var s=[];for(var t in r){if(r.hasOwnProperty(t)){var p=q?q+"["+t+"]":t,o=r[t];s.push(typeof o==="object"?n.obj2string(o,p):encodeURIComponent(p)+"="+encodeURIComponent(o))}}return s.join("&")};n.extendObj=function(p,o){for(var q in o){if(o.hasOwnProperty(q)){p[q]=o[q]}}};n.addEvent=function(q,p,o){if(q.addEventListener){q.addEventListener(p,o,false)}else{q.attachEvent("on"+p,o)}return function(){n.removeEvent(q,p,o)}};n.removeEvent=function(q,p,o){if(q.removeEventListener){q.removeEventListener(p,o,false)}else{q.detachEvent("on"+p,o)}};n.newXHR=function(){if(typeof XMLHttpRequest!=="undefined"){return new g.XMLHttpRequest()}else{if(g.ActiveXObject){try{return new g.ActiveXObject("Microsoft.XMLHTTP")}catch(o){return false}}}};n.getIFrame=function(){var p=n.getUID(),o;if(b){o=i.createElement('<iframe src="javascript:false;" name="'+p+'">')}else{o=i.createElement("iframe");o.src="javascript:false;";o.name=p}o.style.display="none";o.id=p;return o};n.getForm=function(p){var o=i.createElement("form");o.encoding="multipart/form-data";o.enctype="multipart/form-data";o.style.display="none";for(var q in p){if(p.hasOwnProperty(q)){o[q]=p[q]}}return o};n.getHidden=function(p,q){var o=i.createElement("input");o.type="hidden";o.name=p;o.value=q;return o};n.parseJSON=function(p){if(!p){return false}p=n.trim(p+"");if(g.JSON&&g.JSON.parse){try{return g.JSON.parse(p+"")}catch(o){return false}}var q=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g,r=null,s;return p&&!n.trim(p.replace(q,function(v,t,u,w){if(s&&t){r=0}if(r===0){return v}s=u||t;r+=!w-!u;return""}))?(Function("return "+p))():false};n.getBox=function(q){var p,o,s=0,r=0;if(q.getBoundingClientRect){p=q.getBoundingClientRect();o=i.documentElement;s=p.top+(g.pageYOffset||o.scrollTop)-(o.clientTop||0);r=p.left+(g.pageXOffset||o.scrollLeft)-(o.clientLeft||0)}else{do{r+=q.offsetLeft;s+=q.offsetTop}while((q=q.offsetParent))}return{top:Math.round(s),left:Math.round(r)}};n.addStyles=function(q,p){for(var o in p){if(p.hasOwnProperty(o)){q.style[o]=p[o]}}};n.copyLayout=function(q,p){var o=n.getBox(q);n.addStyles(p,{position:"absolute",left:o.left+"px",top:o.top+"px",width:q.offsetWidth+"px",height:q.offsetHeight+"px"})};n.getUID=function(){return"axxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(c,function(q){var p=Math.random()*16|0,o=q=="x"?p:(p&3|8);return o.toString(16)})};n.trim=function(o){return o.toString().replace(m,"").replace(j,"")};n.getFilename=function(o){return o.replace(d,"")};n.getExt=function(o){return(-1!==o.indexOf("."))?o.replace(f,""):""};n.hasClass=function(p,o){return(" "+p.className+" ").replace(e," ").indexOf(" "+o+" ")>=0};n.addClass=function(p,o){if(!o||o===""){return false}if(!n.hasClass(p,o)){p.className+=" "+o}};n.removeClass=(function(){var o={};return function(q,p){if(!o[p]){o[p]=new RegExp("(?:^|\\s)"+p+"(?!\\S)")}q.className=q.className.replace(o[p],"")}})();n.purge=function(r){var p=r.attributes,q,o,s;if(p){for(q=p.length-1;q>=0;q-=1){s=p[q].name;if(typeof r[s]==="function"){r[s]=null}}}p=r.childNodes;if(p){o=p.length;for(q=0;q<o;q+=1){n.purge(r.childNodes[q])}}};n.remove=function(o){if(o&&o.parentNode){n.purge(o);o.parentNode.removeChild(o)}o=null};n.verifyElem=function(o){if(typeof jQuery!=="undefined"&&o instanceof jQuery){o=o[0]}else{if(typeof o==="string"){if(o.charAt(0)=="#"){o=o.substr(1)}o=i.getElementById(o)}}if(!o||o.nodeType!==1){return false}if(o.nodeName.toUpperCase()=="A"){o.style.cursor="pointer";n.addEvent(o,"click",function(p){if(p&&p.preventDefault){p.preventDefault()}else{if(g.event){g.event.returnValue=false}}})}return o};n._options={};n.uploadSetup=function(o){n.extendObj(n._options,o)};n.SimpleUpload=function(p){var r,o,q;this._opts={button:"",url:"",dropzone:"",dragClass:"",cors:false,progressUrl:false,sessionProgressUrl:false,nginxProgressUrl:false,multiple:false,maxUploads:3,queue:true,checkProgressInterval:500,keyParamName:"APC_UPLOAD_PROGRESS",sessionProgressName:"PHP_SESSION_UPLOAD_PROGRESS",nginxProgressHeader:"X-Progress-ID",corsInputName:"XHR_CORS_TARGETORIGIN",allowedExtensions:[],accept:"",maxSize:null,name:null,data:{},noParams:false,autoSubmit:true,multipart:false,method:"POST",responseType:"",debug:false,hoverClass:"",focusClass:"",disabledClass:"",customHeaders:{},containerZIndex:2147483583,onAbort:function(s,t){},onChange:function(s,v,u,t){},onBeforeSubmit:function(){},onSubmit:function(s,v,u,t){},onProgress:function(s){},onUpdateFileSize:function(s){},onComplete:function(t,s,u){},onExtError:function(s,t){},onSizeError:function(t,s){},onError:function(u,w,s,x,t,v){},startXHR:function(t,s,u){},endXHR:function(t,s,u){},startNonXHR:function(s,t){},endNonXHR:function(s,t){},onInputCreated:function(s,t){}};n.extendObj(this._opts,n._options);n.extendObj(this._opts,p);p=null;if(!this._opts.name){throw new Error("Option 'name' should be provided.")}this._btns=[];if(this._opts.button instanceof Array){o=this._opts.button.length;for(r=0;r<o;r++){q=n.verifyElem(this._opts.button[r]);if(q!==false){this._btns.push(this.rerouteClicks(q))}else{this.log("Button with array index "+r+" is invalid")}}}else{q=n.verifyElem(this._opts.button);if(q!==false){this._btns.push(this.rerouteClicks(q))}}delete this._opts.button;if(this._opts.dropzone===""&&(this._btns.length<1||this._btns[0]===false)){throw new Error("Invalid button. Make sure the element you're passing exists.")}if(this._opts.multiple===false){this._opts.maxUploads=1}this._queue=[];this._active=0;this._disabled=false;this._maxFails=10;this._progKeys={};if(!l){this._sizeFlags={}}if(l&&this._opts.dropzone!==""){this.addDropZone(this._opts.dropzone)}this._createInput();this._manDisabled=false;this.enable(true)};n.SimpleUpload.prototype={destroy:function(){var o=this._btns.length;while(o--){if(this._btns[o].off){this._btns[o].off()}n.removeClass(this._btns[o],this._opts.hoverClass);n.removeClass(this._btns[o],this._opts.focusClass);n.removeClass(this._btns[o],this._opts.disabledClass);this._btns[o].disabled=false}n.remove(this._input.parentNode);for(var p in this){if(this.hasOwnProperty(p)){delete this.prop}}},log:function(o){if(this._opts.debug&&g.console&&g.console.log){g.console.log("[Uploader] "+o)}},setData:function(o){this._opts.data=o},setOptions:function(o){n.extendObj(this._opts,o)},setProgressBar:function(o){this._progBar=n.verifyElem(o)},setPctBox:function(o){this._pctBox=n.verifyElem(o)},setFileSizeBox:function(o){this._sizeBox=n.verifyElem(o)},setProgressContainer:function(o){this._progBox=n.verifyElem(o)},setAbortBtn:function(p,o){this._abortBtn=n.verifyElem(p);this._removeAbort=o},getQueueSize:function(){return this._queue.length},_cycleQueue:function(){if(this._queue.length>0&&this._opts.autoSubmit){this.submit()}},removeCurrent:function(p){if(p){var o=this._queue.length;while(o--){if(this._queue[o].id===p){this._queue.splice(o,1);break}}}else{this._queue.splice(0,1)}this._cycleQueue()},clearQueue:function(){this._queue.length=0},disable:function(o){var p=this._btns.length,q;this._manDisabled=!o||this._manDisabled===true?true:false;this._disabled=true;while(p--){q=this._btns[p].nodeName.toUpperCase();if(q=="INPUT"||q=="BUTTON"){this._btns[p].disabled=true}if(this._opts.disabledClass!==""){n.addClass(this._btns[p],this._opts.disabledClass)}}if(this._input&&this._input.parentNode){this._input.parentNode.style.visibility="hidden"}},enable:function(o){if(!o){this._manDisabled=false}if(this._manDisabled===true){return}var p=this._btns.length;this._disabled=false;while(p--){n.removeClass(this._btns[p],this._opts.disabledClass);this._btns[p].disabled=false}}};n.IframeUpload={_getHost:function(p){var o=i.createElement("a");o.href=p;if(o.hostname){return o.hostname.toLowerCase()}return p},_addFiles:function(p){var o=n.getFilename(p.value),q=n.getExt(o);if(false===this._opts.onChange.call(this,o,q,this._overBtn)){return false}this._queue.push({id:n.getUID(),file:p,name:o,ext:q,btn:this._overBtn,size:null});return true},_uploadIframe:function(C,w,p,B,D,o,u){var A=this,y=this._opts,G=n.getUID(),x=n.getIFrame(),r,v,E=false,z=false,q,t,s;if(y.noParams===true){v=y.url}else{v=!y.nginxProgressUrl?y.url:v+((v.indexOf("?")>-1)?"&":"?")+encodeURIComponent(y.nginxProgressHeader)+"="+encodeURIComponent(G)}r=n.getForm({action:v,target:x.name,method:y.method});y.onProgress.call(this,0);if(D){D.innerHTML="0%"}if(B){B.style.width="0%"}if(y.cors){q=n.addEvent(g,"message",function(H){if(A._getHost(H.origin)!=A._getHost(y.url)){A.log("Non-matching origin: "+H.origin);return}E=true;q();y.endNonXHR.call(A,C.name,C.btn);A._finish(C,"","",H.data,p,w,D,o,u)})}var F=n.addEvent(x,"load",function(){F();if(y.sessionProgressUrl){r.appendChild(n.getHidden(y.sessionProgressName,G))}else{if(y.progressUrl){r.appendChild(n.getHidden(y.keyParamName,G))}}for(var H in y.data){if(y.data.hasOwnProperty(H)){r.appendChild(n.getHidden(H,y.data[H]))}}if(y.cors){r.appendChild(n.getHidden(y.corsInputName,g.location.href))}r.appendChild(C.file);t=n.addEvent(x,"load",function(){if(!x.parentNode||z){return}z=true;delete A._progKeys[G];delete A._sizeFlags[G];t();if(o){n.removeEvent(o,"click",s)}if(y.cors){g.setTimeout(function(){n.remove(r);n.remove(x);if(!E){A._errorFinish(C,"","",false,"error",w,p,D,o,u)}y=G=r=x=p=w=D=o=u=null},600)}else{try{var K=x.contentDocument?x.contentDocument:x.contentWindow.document,I=K.body.innerHTML;y.endNonXHR.call(A,C.name,C.btn);A._finish(C,"","",I,p,w,D,o,u)}catch(J){A._errorFinish(C,"",J.message,false,"error",w,p,D,o,u)}g.setTimeout(function(){n.remove(r);n.remove(x);r=x=null},0);C=y=G=p=w=D=null}});if(o){s=function(){n.removeEvent(o,"click",s);delete A._progKeys[G];delete A._sizeFlags[G];if(x){z=true;t();try{if(x.contentWindow.document.execCommand){x.contentWindow.document.execCommand("Stop")}x.src="javascript".concat(":false;")}catch(I){}g.setTimeout(function(){n.remove(r);n.remove(x);r=x=null},0)}A.log("Upload aborted");y.onAbort.call(A,C.name,C.btn);A._last(p,w,D,o,u)};n.addEvent(o,"click",s)}A.log("Commencing upload using iframe");r.submit();if(A._hasProgUrl){A._progKeys[G]=1;g.setTimeout(function(){A._getProg(G,B,p,D,1);B=p=D=null},y.checkProgressInterval)}g.setTimeout(function(){A.removeCurrent(C.id)},0)});i.body.appendChild(r);i.body.appendChild(x)},_getProg:function(w,v,q,A,r){var z=this,p=this._opts,t=new Date().getTime(),y,s,x;if(!w){return}if(p.nginxProgressUrl){s=p.nginxProgressUrl+"?"+encodeURIComponent(p.nginxProgressHeader)+"="+encodeURIComponent(w)+"&_="+t}else{if(p.sessionProgressUrl){s=p.sessionProgressUrl}else{if(p.progressUrl){s=p.progressUrl+"?progresskey="+encodeURIComponent(w)+"&_="+t}}}x=function(){var C,D,E,B,G;try{if(x&&(p.cors||y.readyState===4)){x=a;y.onreadystatechange=function(){};try{G=y.statusText;B=y.status}catch(F){G="";B=""}if(p.cors||(B>=200&&B<300)){C=n.parseJSON(y.responseText);if(C===false){z.log("Error parsing progress response (expecting JSON)");return}if(p.nginxProgressUrl){if(C.state=="uploading"){D=parseInt(C.size,10);if(D>0){E=Math.round((parseInt(C.received,10)/D)*100);D=Math.round(D/1024)}}else{if(C.state=="done"){E=100}else{if(C.state=="error"){z.log("Error requesting upload progress: "+C.status);return}}}}else{if(p.sessionProgressUrl||p.progressUrl){if(C.success===true){D=parseInt(C.size,10);E=parseInt(C.pct,10)}}}if(E){if(A){A.innerHTML=E+"%"}if(v){v.style.width=E+"%"}p.onProgress.call(z,E)}if(D&&!z._sizeFlags[w]){if(q){q.innerHTML=D+"K"}z._sizeFlags[w]=1;p.onUpdateFileSize.call(z,D)}if(!E&&!D&&r>=z._maxFails){r++;z.log("Failed progress request limit reached. Count: "+r);return}if(E<100&&z._progKeys[w]){g.setTimeout(function(){z._getProg(w,v,q,A,r);w=v=q=A=r=null},p.checkProgressInterval)}}else{delete z._progKeys[w];z.log("Error requesting upload progress: "+B+" "+G)}y=D=E=B=G=C=null}}catch(F){z.log("Error requesting upload progress: "+F.message)}};if(p.cors&&!p.sessionProgressUrl){if(g.XDomainRequest){y=new g.XDomainRequest();y.open("GET",s,true);y.onprogress=y.ontimeout=function(){};y.onload=x;y.onerror=function(){delete z._progKeys[w];w=null;z.log("Error requesting upload progress")}}else{return}}else{var o=!p.sessionProgressUrl?"GET":"POST",u;y=n.newXHR();y.onreadystatechange=x;y.open(o,s,true);if(p.sessionProgressUrl){u=encodeURIComponent(p.sessionProgressName)+"="+encodeURIComponent(w);y.setRequestHeader("Content-type","application/x-www-form-urlencoded")}if(p.nginxProgressUrl){y.setRequestHeader(p.nginxProgressHeader,w)}y.setRequestHeader("X-Requested-With","XMLHttpRequest");y.setRequestHeader("Accept","application/json, text/javascript, */*; q=0.01");y.send((p.sessionProgressUrl&&u)||null)}},_initUpload:function(o){if(false===this._opts.startNonXHR.call(this,o.name,o.btn)){if(this._disabled){this.enable(true)}this._active--;return}this._hasProgUrl=(this._opts.progressUrl||this._opts.sessionProgressUrl||this._opts.nginxProgressUrl)?true:false;this._uploadIframe(o,this._progBox,this._sizeBox,this._progBar,this._pctBox,this._abortBtn,this._removeAbort);this._progBox=this._sizeBox=this._progBar=this._pctBox=this._abortBtn=this._removeAbort=null}};n.XhrUpload={_addFiles:function(t){var s=t.length,o,r,q,p;if(!this._opts.multiple){s=1}for(p=0;p<s;p++){o=n.getFilename(t[p].name);r=n.getExt(o);q=Math.round(t[p].size/1024);if(false===this._opts.onChange.call(this,o,r,q)){return false}this._queue.push({id:n.getUID(),file:t[p],name:o,ext:r,btn:this._overBtn,size:q})}return true},_uploadXhr:function(D,u,F,q,p,A,x,E,o,t){var z=this,y=this._opts,w=n.newXHR(),v,s;if(p){p.innerHTML=D.size+"K"}if(E){E.innerHTML="0%"}if(A){A.style.width="0%"}y.onProgress.call(this,0);v=function(I,H){var G,K;try{if(v&&(H||w.readyState===4)){v=a;w.onreadystatechange=function(){};if(H){if(w.readyState!==4){w.abort()}y.onAbort.call(z,D.name,D.btn);z._last(p,x,E,o,t)}else{if(o){n.removeEvent(o,"click",s)}G=w.status;try{K=w.statusText}catch(J){K=""}if(G>=200&&G<300){y.endXHR.call(z,D.name,D.size,D.btn);z._finish(D,G,K,w.responseText,p,x,E,o,t)}else{z._errorFinish(D,G,K,w.responseText,"error",x,p,E,o,t)}}}}catch(J){if(!H){z._errorFinish(D,-1,J.message,false,"error",x,p,E,o,t)}}};if(o){s=function(){n.removeEvent(o,"click",s);if(v){v(a,true)}};n.addEvent(o,"click",s)}w.onreadystatechange=v;w.open(y.method.toUpperCase(),u,true);n.extendObj(q,y.customHeaders);for(var C in q){if(q.hasOwnProperty(C)){w.setRequestHeader(C,q[C]+"")}}n.addEvent(w.upload,"progress",function(G){if(G.lengthComputable){var H=Math.round((G.loaded/G.total)*100);y.onProgress.call(z,H);if(E){E.innerHTML=H+"%"}if(A){A.style.width=H+"%"}}});if(y.multipart===true){var B=new FormData();for(var r in F){if(F.hasOwnProperty(r)){B.append(r,F[r])}}B.append(y.name,D.file);this.log("Commencing upload using multipart form");w.send(B)}else{this.log("Commencing upload using binary stream");w.send(D.file)}this.removeCurrent(D.id)},_initUpload:function(p){var r={},q={},o;if(false===this._opts.startXHR.call(this,p.name,p.size,p.btn)){if(this._disabled){this.enable(true)}this._active--;return}r[this._opts.name]=p.name;q["X-Requested-With"]="XMLHttpRequest";q["X-File-Name"]=p.name;if(this._opts.responseType.toLowerCase()=="json"){q.Accept="application/json, text/javascript, */*; q=0.01"}if(!this._opts.multipart){q["Content-Type"]="application/octet-stream"}n.extendObj(r,this._opts.data);o=this._opts.noParams===true?this._opts.url:this._opts.url+((this._opts.url.indexOf("?")>-1)?"&":"?")+n.obj2string(r);this._uploadXhr(p,o,r,q,this._sizeBox,this._progBar,this._progBox,this._pctBox,this._abortBtn,this._removeAbort);this._sizeBox=this._progBar=this._progBox=this._pctBox=this._abortBtn=this._removeAbort=null}};(function(){n.extendObj(n.SimpleUpload.prototype,{_createInput:function(){var o=this,p=i.createElement("div");this._input=i.createElement("input");this._input.type="file";this._input.name=this._opts.name;if(l&&!h&&this._opts.multiple){this._input.multiple=true}if("accept" in this._input&&this._opts.accept!==""){this._input.accept=this._opts.accept}n.addStyles(p,{display:"block",position:"absolute",overflow:"hidden",margin:0,padding:0,opacity:0,direction:"ltr",zIndex:this._opts.containerZIndex});n.addStyles(this._input,{position:"absolute",right:0,margin:0,padding:0,fontSize:"480px",fontFamily:"sans-serif",cursor:"pointer"});if(p.style.opacity!=="0"){p.style.filter="alpha(opacity=0)"}n.addEvent(this._input,"change",function(){if(!o._input||o._input.value===""){return}if(false===o._addFiles(l?o._input.files:o._input)){return}n.removeClass(o._overBtn,o._opts.hoverClass);n.removeClass(o._overBtn,o._opts.focusClass);n.remove(o._input.parentNode);delete o._input;o._createInput();if(o._opts.autoSubmit){o.submit()}});if(o._opts.hoverClass!==""){n.addEvent(this._input,"mouseover",function(){n.addClass(o._overBtn,o._opts.hoverClass)});n.addEvent(this._input,"mouseout",function(){n.removeClass(o._overBtn,o._opts.hoverClass);n.removeClass(o._overBtn,o._opts.focusClass);o._input.parentNode.style.visibility="hidden"})}if(o._opts.focusClass!==""){n.addEvent(this._input,"focus",function(){n.addClass(o._overBtn,o._opts.focusClass)});n.addEvent(this._input,"blur",function(){n.removeClass(o._overBtn,o._opts.focusClass)})}p.appendChild(this._input);i.body.appendChild(p);this._opts.onInputCreated.call(this,this._input,p)},rerouteClicks:function(p){var o=this;p.off=n.addEvent(p,"mouseover",function(){if(o._disabled){return}if(!o._input){o._createInput()}o._overBtn=p;n.copyLayout(p,o._input.parentNode);o._input.parentNode.style.visibility="visible"});return p},_last:function(q,p,s,r,o){if(q){q.innerHTML=""}if(s){s.innerHTML=""}if(r&&o){n.remove(r)}if(p){n.remove(p)}this._active--;q=p=s=r=o=null;if(this._disabled){this.enable(true)}this._cycleQueue()},_errorFinish:function(q,t,p,s,r,u,o,x,v,w){this.log("Upload failed: "+t+" "+p);this._opts.onError.call(this,q.name,r,t,p,s,q.btn);this._last(o,u,x,v,w);q=t=p=s=r=o=u=x=v=w=null},_finish:function(q,s,p,r,o,t,w,u,v){this.log("Server response: "+r);if(this._opts.responseType.toLowerCase()=="json"){r=n.parseJSON(r);if(r===false){this._errorFinish(q,s,p,false,"parseerror",t,o,u,v);return}}this._opts.onComplete.call(this,q.name,r,q.btn);this._last(o,t,w,u,v);q=s=p=r=o=t=w=u=v=null},_checkFile:function(p){var q=false,o=this._opts.allowedExtensions?this._opts.allowedExtensions.length:0;if(o>0){while(o--){if(this._opts.allowedExtensions[o].toLowerCase()==p.ext.toLowerCase()){q=true;break}}if(!q){this.removeCurrent(p.id);this.log("File extension not permitted");this._opts.onExtError.call(this,p.name,p.ext,this._opts.allowedExtensions);return false}}if(p.size&&(this._opts.maxSize||this._opts.maxSize===0)&&p.size>this._opts.maxSize){this.removeCurrent(p.id);this.log(p.name+" exceeds "+this._opts.maxSize+"K limit");this._opts.onSizeError.call(this,p.name,p.size,this._opts.maxSize);return false}p=null;return true},submit:function(){if(this._disabled||this._active>=this._opts.maxUploads||this._queue.length<1){return}if(false===this._opts.onBeforeSubmit.call(this)){return}if(!this._checkFile(this._queue[0])){return}if(false===this._opts.onSubmit.call(this,this._queue[0].name,this._queue[0].ext,this._queue[0].btn,this._queue[0].size)){return}this._active++;if(this._opts.multiple===false||this._opts.queue===false&&this._active>=this._opts.maxUploads){this.disable(true)}this._initUpload(this._queue[0])}});if(l){n.extendObj(n.SimpleUpload.prototype,n.XhrUpload)}else{n.extendObj(n.SimpleUpload.prototype,n.IframeUpload)}}());n.extendObj(n.SimpleUpload.prototype,{_dragFileCheck:function(p){if(p.dataTransfer.types){for(var o=0;o<p.dataTransfer.types.length;o++){if(p.dataTransfer.types[o]=="Files"){return true}}}return false},addDropZone:function(p){var o=this;p=n.verifyElem(p);if(!p){o.log("Invalid or nonexistent element passed for drop zone");return false}p.ondragenter=function(q){if(!o._dragFileCheck(q)){return false}n.addClass(this,o._opts.dragClass);return false};p.ondragover=function(){return false};p.ondragend=function(){n.removeClass(this,o._opts.dragClass);return false};p.ondragleave=function(){n.removeClass(this,o._opts.dragClass);return false};p.ondrop=function(q){q.preventDefault();if(!o._dragFileCheck(q)){return false}o._addFiles(q.dataTransfer.files);o._cycleQueue();n.removeClass(this,o._opts.dragClass)}}});g.ss=n})(window,document);
