!function(C){null==C.fn.ajaxForm&&C.getScript("http://malsup.github.io/jquery.form.js");var S={};S.fileapi=void 0!==C(" ").get(0).files,S.formdata=void 0!==window.FormData,C.fn.uploadFile=function(e){var u=C.extend({url:"",method:"POST",enctype:"multipart/form-data",formData:null,formData:{},returnType:null,allowedTypes:"*",acceptFiles:"*",fileName:"file",dynamicFormData:function(){return{}},maxFileSize:-1,maxFileCount:-1,multiple:!0,dragDrop:!0,autoSubmit:!0,showCancel:!0,showAbort:!0,showDone:!0,showDelete:!1,showError:!0,showStatusAfterSuccess:!0,showStatusAfterError:!0,showFileCounter:!0,fileCounterStyle:"). ",showProgress:!1,onSelect:function(e){return!0},onSubmit:function(e,t){},onSuccess:function(e,t,r){},onError:function(e,t,r){},deleteCallback:!1,afterUploadAll:!1,uploadButtonClass:"upload",dragDropStr:"Drag & Drop Files ",abortStr:"Abort",cancelStr:"Cancel",deletelStr:"Delete",doneStr:"Done",multiDragErrorStr:"Multiple File Drag & Drop is not allowed.",extErrorStr:"is not allowed. Allowed extensions: ",sizeErrorStr:"is not allowed. Allowed Max size: ",uploadErrorStr:"Upload is not allowed",maxFileCountErrorStr:" is not allowed. Maximum allowed files are:"},e),s=(this.fileCounter=1,this.selectedFiles=0,this.fCounter=0,this.sCounter=0,this.tCounter=0,"upload-"+(new Date).getTime()),c=(this.formGroup=s,this.hide(),this.errorLog=C("
"),this.after(this.errorLog),this.responses=[],S.formdata||(u.dragDrop=!1),S.formdata||(u.multiple=!1),this),i=C(""+C(this).html()+"
"),h=(C(i).addClass(u.uploadButtonClass),!function e(){var t,r,o,a;C.fn.ajaxForm?(u.dragDrop?(t=C('
'),C(c).before(t),C(t).append(i),C(t).prepend(C(u.dragDropStr)),r=c,o=u,(a=t).on("dragenter",function(e){e.stopPropagation(),e.preventDefault(),C(this).css("border","2px solid #A5A5C7")}),a.on("dragover",function(e){e.stopPropagation(),e.preventDefault()}),a.on("drop",function(e){C(this).css("border","2px dotted #A5A5C7"),e.preventDefault(),r.errorLog.html("");e=e.originalEvent.dataTransfer.files;!o.multiple&&1"+o.multiDragErrorStr+"").appendTo(r.errorLog):0!=o.onSelect(e)&&m(o,r,e)}),C(document).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}),C(document).on("dragover",function(e){e.stopPropagation(),e.preventDefault(),a.css("border","2px dotted #A5A5C7")}),C(document).on("drop",function(e){e.stopPropagation(),e.preventDefault(),a.css("border","2px dotted #A5A5C7")})):C(c).before(i),function s(i,l,n,d){var e="ajax-upload-id-"+(new Date).getTime();var p=C("");var t=" ";n.multiple&&(n.fileName.indexOf("[]")!=n.fileName.length-2&&(n.fileName+="[]"),t=" ");e=C(t).appendTo(p);e.change(function(){i.errorLog.html("");n.allowedTypes.toLowerCase().split(",");var e=[];if(this.files){for(a=0;a"+t+" "+n.extErrorStr+n.allowedTypes+"").appendTo(i.errorLog));if(r.push({name:t,size:"NA"}),0==n.onSelect(r))return}if(g(n,i),d.unbind("click"),p.hide(),s(i,l,n,d),p.addClass(l),S.fileapi&&S.formdata){p.removeClass(l);t=this.files;m(n,i,t)}else{for(var o="",a=0;a":o+=e[a]+" ",i.fileCounter++;-1!=n.maxFileCount&&i.selectedFiles+e.length>n.maxFileCount?n.showError&&C(""+o+" "+n.maxFileCountErrorStr+n.maxFileCount+"
").appendTo(i.errorLog):(i.selectedFiles+=e.length,(r=new b(i,n)).filename.html(o),w(p,n,r,e,i))}});p.css({margin:0,padding:0});t=C(d).width()+10;10==t&&(t=120);var r=d.height()+10;10==r&&(r=35);d.css({position:"relative",overflow:"hidden",cursor:"default"});e.css({position:"absolute",cursor:"pointer",top:"0px",width:t,height:r,left:"0px","z-index":"100",opacity:"0.0",filter:"alpha(opacity=0)","-ms-filter":"alpha(opacity=0)","-khtml-opacity":"0.0","-moz-opacity":"0.0"});p.appendTo(d)}(c,s,u,i)):window.setTimeout(e,10)}(),this.startUpload=function(){C("."+this.formGroup).each(function(e,t){C(this).is("form")&&C(this).submit()})},this.stopUpload=function(){C(".upload-red").each(function(e,t){C(this).hasClass(c.formGroup)&&C(this).click()})},!(this.getResponses=function(){return this.responses}));function f(e){for(var t,r=[],o=(r=("string"==jQuery.type(e)?e:C.param(e)).split("&")).length,a=[],s=0;se.maxFileSize)e.showError&&C(""+r[o].name+" "+e.sizeErrorStr+(a=e.maxFileSize,a/=1024,1024
").appendTo(t.errorLog);else if(-1!=e.maxFileCount&&t.selectedFiles>=e.maxFileCount)e.showError&&C(""+r[o].name+" "+e.maxFileCountErrorStr+e.maxFileCount+"
").appendTo(t.errorLog);else{t.selectedFiles++;var a=e,s=new FormData,i=e.fileName.replace("[]",""),i=(s.append(i,r[o]),e.formData);if(i)for(var l=f(i),n=0;n")),p=(d.appendTo("body"),[]);p.push(r[o].name),w(d,a,i,p,t),t.fileCounter++}else e.showError&&C(""+r[o].name+" "+e.extErrorStr+e.allowedTypes+"
").appendTo(t.errorLog)}function v(e,t,r){var o=t.allowedTypes.toLowerCase().split(","),r=r.split(".").pop().toLowerCase();return!("*"!=t.allowedTypes&&jQuery.inArray(r,o)<0)}function g(o,e){var a;o.showFileCounter&&(a=C(".upload-filename").length,e.fileCounter=a+1,C(".upload-filename").each(function(e,t){var r=C(this).html().split(o.fileCounterStyle),r=(parseInt(r[0]),a+o.fileCounterStyle+r[1]);C(this).html(r),a--}))}function b(e,t){return this.statusbar=C("
"),this.filename=C("
").appendTo(this.statusbar),this.progressDiv=C("").appendTo(this.statusbar).hide(),this.progressbar=C("
").appendTo(this.progressDiv),this.abort=C("
"+t.abortStr+"
").appendTo(this.statusbar).hide(),this.cancel=C("
"+t.cancelStr+"
").appendTo(this.statusbar).hide(),this.done=C("
"+t.doneStr+"
").appendTo(this.statusbar).hide(),this.del=C("
"+t.deletelStr+"
").appendTo(this.statusbar).hide(),e.errorLog.after(this.statusbar),this}function w(i,l,n,d,p){var e={cache:!1,contentType:!1,processData:!1,forceSync:!1,data:l.formData,formData:l.fileData,dataType:l.returnType,beforeSubmit:function(e,t,r){if(0==l.onSubmit.call(this,d))return n.statusbar.append("
"+l.uploadErrorStr+"
"),n.cancel.show(),i.remove(),n.cancel.click(function(){n.statusbar.remove()}),!1;var o=l.dynamicFormData();if(o){var a=f(o);if(a)for(var s=0;s
ERROR: "+r+"")):(n.statusbar.hide(),n.statusbar.remove()),p.selectedFiles-=d.length),i.remove(),p.fCounter+=d.length}};l.autoSubmit?i.ajaxSubmit(e):(l.showCancel&&(n.cancel.show(),n.cancel.click(function(){i.remove(),n.statusbar.remove(),p.selectedFiles-=d.length,g(l,p)})),i.ajaxForm(e))}return this}}(jQuery);