jquery.uploadify-min.js 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. var swfobject=function(){function a(){if(!x){try{var a=k.getElementsByTagName("body")[0].appendChild(k.createElement("span"));a.parentNode.removeChild(a)}catch(c){return}x=!0;for(var a=H.length,e=0;e<a;e++)H[e]()}}function b(a){x?a():H[H.length]=a}function d(a){if(typeof s.addEventListener!=n)s.addEventListener("load",a,!1);else if(typeof k.addEventListener!=n)k.addEventListener("load",a,!1);else if(typeof s.attachEvent!=n){var c=s;c.attachEvent("onload",a);B[B.length]=[c,"onload",a]}else if("function"==
  2. typeof s.onload){var e=s.onload;s.onload=function(){e();a()}}else s.onload=a}function c(){var a=u.length;if(0<a)for(var c=0;c<a;c++){var b=u[c].id,y=u[c].callbackFn,h={success:!1,id:b};if(0<j.pv[0]){var d=p(b);if(d)if(z(u[c].swfVersion)&&!(j.wk&&312>j.wk))A(b,!0),y&&(h.success=!0,h.ref=e(b),y(h));else if(u[c].expressInstall&&g()){h={};h.data=u[c].expressInstall;h.width=d.getAttribute("width")||"0";h.height=d.getAttribute("height")||"0";d.getAttribute("class")&&(h.styleclass=d.getAttribute("class"));
  3. d.getAttribute("align")&&(h.align=d.getAttribute("align"));for(var k={},d=d.getElementsByTagName("param"),m=d.length,E=0;E<m;E++)"movie"!=d[E].getAttribute("name").toLowerCase()&&(k[d[E].getAttribute("name")]=d[E].getAttribute("value"));l(h,k,b,y)}else f(d),y&&y(h)}else if(A(b,!0),y){if((b=e(b))&&typeof b.SetVariable!=n)h.success=!0,h.ref=b;y(h)}}}function e(a){var c=null;if((a=p(a))&&"OBJECT"==a.nodeName)typeof a.SetVariable!=n?c=a:(a=a.getElementsByTagName(v)[0])&&(c=a);return c}function g(){return!I&&
  4. z("6.0.65")&&(j.win||j.mac)&&!(j.wk&&312>j.wk)}function l(a,c,e,b){I=!0;M=b||null;P={success:!1,id:e};var g=p(e);if(g){"OBJECT"==g.nodeName?(F=h(g),J=null):(F=g,J=e);a.id=Q;if(typeof a.width==n||!/%$/.test(a.width)&&310>parseInt(a.width,10))a.width="310";if(typeof a.height==n||!/%$/.test(a.height)&&137>parseInt(a.height,10))a.height="137";k.title=k.title.slice(0,47)+" - Flash Player Installation";b=j.ie&&j.win?"ActiveX":"PlugIn";b="MMredirectURL="+s.location.toString().replace(/&/g,"%26")+"&MMplayerType="+
  5. b+"&MMdoctitle="+k.title;c.flashvars=typeof c.flashvars!=n?c.flashvars+("&"+b):b;j.ie&&(j.win&&4!=g.readyState)&&(b=k.createElement("div"),e+="SWFObjectNew",b.setAttribute("id",e),g.parentNode.insertBefore(b,g),g.style.display="none",function(){4==g.readyState?g.parentNode.removeChild(g):setTimeout(arguments.callee,10)}());m(a,c,e)}}function f(a){if(j.ie&&j.win&&4!=a.readyState){var c=k.createElement("div");a.parentNode.insertBefore(c,a);c.parentNode.replaceChild(h(a),c);a.style.display="none";(function(){4==
  6. a.readyState?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)})()}else a.parentNode.replaceChild(h(a),a)}function h(a){var c=k.createElement("div");if(j.win&&j.ie)c.innerHTML=a.innerHTML;else if(a=a.getElementsByTagName(v)[0])if(a=a.childNodes)for(var e=a.length,b=0;b<e;b++)!(1==a[b].nodeType&&"PARAM"==a[b].nodeName)&&8!=a[b].nodeType&&c.appendChild(a[b].cloneNode(!0));return c}function m(a,c,b){var e,g=p(b);if(j.wk&&312>j.wk)return e;if(g)if(typeof a.id==n&&(a.id=b),j.ie&&j.win){var f=
  7. "",h;for(h in a)a[h]!=Object.prototype[h]&&("data"==h.toLowerCase()?c.movie=a[h]:"styleclass"==h.toLowerCase()?f+=' class="'+a[h]+'"':"classid"!=h.toLowerCase()&&(f+=" "+h+'="'+a[h]+'"'));h="";for(var d in c)c[d]!=Object.prototype[d]&&(h+='<param name="'+d+'" value="'+c[d]+'" />');g.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+f+">"+h+"</object>";K[K.length]=a.id;e=p(a.id)}else{d=k.createElement(v);d.setAttribute("type",L);for(var l in a)a[l]!=Object.prototype[l]&&("styleclass"==
  8. l.toLowerCase()?d.setAttribute("class",a[l]):"classid"!=l.toLowerCase()&&d.setAttribute(l,a[l]));for(f in c)c[f]!=Object.prototype[f]&&"movie"!=f.toLowerCase()&&(a=d,h=f,l=c[f],b=k.createElement("param"),b.setAttribute("name",h),b.setAttribute("value",l),a.appendChild(b));g.parentNode.replaceChild(d,g);e=d}return e}function q(a){var c=p(a);c&&"OBJECT"==c.nodeName&&(j.ie&&j.win?(c.style.display="none",function(){if(4==c.readyState){var b=p(a);if(b){for(var e in b)"function"==typeof b[e]&&(b[e]=null);
  9. b.parentNode.removeChild(b)}}else setTimeout(arguments.callee,10)}()):c.parentNode.removeChild(c))}function p(a){var c=null;try{c=k.getElementById(a)}catch(b){}return c}function z(a){var c=j.pv;a=a.split(".");a[0]=parseInt(a[0],10);a[1]=parseInt(a[1],10)||0;a[2]=parseInt(a[2],10)||0;return c[0]>a[0]||c[0]==a[0]&&c[1]>a[1]||c[0]==a[0]&&c[1]==a[1]&&c[2]>=a[2]?!0:!1}function R(a,c,b,e){if(!j.ie||!j.mac){var g=k.getElementsByTagName("head")[0];if(g){b=b&&"string"==typeof b?b:"screen";e&&(N=t=null);if(!t||
  10. N!=b)e=k.createElement("style"),e.setAttribute("type","text/css"),e.setAttribute("media",b),t=g.appendChild(e),j.ie&&(j.win&&typeof k.styleSheets!=n&&0<k.styleSheets.length)&&(t=k.styleSheets[k.styleSheets.length-1]),N=b;j.ie&&j.win?t&&typeof t.addRule==v&&t.addRule(a,c):t&&typeof k.createTextNode!=n&&t.appendChild(k.createTextNode(a+" {"+c+"}"))}}}function A(a,c){if(S){var b=c?"visible":"hidden";x&&p(a)?p(a).style.visibility=b:R("#"+a,"visibility:"+b)}}function T(a){return null!=/[\\\"<>\.;]/.exec(a)&&
  11. typeof encodeURIComponent!=n?encodeURIComponent(a):a}var n="undefined",v="object",L="application/x-shockwave-flash",Q="SWFObjectExprInst",s=window,k=document,w=navigator,U=!1,H=[function(){if(U){var a=k.getElementsByTagName("body")[0],b=k.createElement(v);b.setAttribute("type",L);var e=a.appendChild(b);if(e){var g=0;(function(){if(typeof e.GetVariable!=n){var f=e.GetVariable("$version");f&&(f=f.split(" ")[1].split(","),j.pv=[parseInt(f[0],10),parseInt(f[1],10),parseInt(f[2],10)])}else if(10>g){g++;
  12. setTimeout(arguments.callee,10);return}a.removeChild(b);e=null;c()})()}else c()}else c()}],u=[],K=[],B=[],F,J,M,P,x=!1,I=!1,t,N,S=!0,j,W=typeof k.getElementById!=n&&typeof k.getElementsByTagName!=n&&typeof k.createElement!=n,C=w.userAgent.toLowerCase(),D=w.platform.toLowerCase(),X=D?/win/.test(D):/win/.test(C),D=D?/mac/.test(D):/mac/.test(C),C=/webkit/.test(C)?parseFloat(C.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,O=!+"\v1",G=[0,0,0],r=null;if(typeof w.plugins!=n&&typeof w.plugins["Shockwave Flash"]==
  13. v){if((r=w.plugins["Shockwave Flash"].description)&&!(typeof w.mimeTypes!=n&&w.mimeTypes[L]&&!w.mimeTypes[L].enabledPlugin))U=!0,O=!1,r=r.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),G[0]=parseInt(r.replace(/^(.*)\..*$/,"$1"),10),G[1]=parseInt(r.replace(/^.*\.(.*)\s.*$/,"$1"),10),G[2]=/[a-zA-Z]/.test(r)?parseInt(r.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof s.ActiveXObject!=n)try{var V=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(V&&(r=V.GetVariable("$version")))O=!0,r=r.split(" ")[1].split(","),
  14. G=[parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10)]}catch(Y){}j={w3:W,pv:G,wk:C,ie:O,win:X,mac:D};j.w3&&((typeof k.readyState!=n&&"complete"==k.readyState||typeof k.readyState==n&&(k.getElementsByTagName("body")[0]||k.body))&&a(),x||(typeof k.addEventListener!=n&&k.addEventListener("DOMContentLoaded",a,!1),j.ie&&j.win&&(k.attachEvent("onreadystatechange",function(){"complete"==k.readyState&&(k.detachEvent("onreadystatechange",arguments.callee),a())}),s==top&&function(){if(!x){try{k.documentElement.doScroll("left")}catch(c){setTimeout(arguments.callee,
  15. 0);return}a()}}()),j.wk&&function(){x||(/loaded|complete/.test(k.readyState)?a():setTimeout(arguments.callee,0))}(),d(a)));j.ie&&j.win&&window.attachEvent("onunload",function(){for(var a=B.length,c=0;c<a;c++)B[c][0].detachEvent(B[c][1],B[c][2]);a=K.length;for(c=0;c<a;c++)q(K[c]);for(var b in j)j[b]=null;j=null;for(var e in swfobject)swfobject[e]=null;swfobject=null});return{registerObject:function(a,c,b,e){if(j.w3&&a&&c){var g={};g.id=a;g.swfVersion=c;g.expressInstall=b;g.callbackFn=e;u[u.length]=
  16. g;A(a,!1)}else e&&e({success:!1,id:a})},getObjectById:function(a){if(j.w3)return e(a)},embedSWF:function(a,c,e,f,h,d,k,p,q,r){var s={success:!1,id:c};j.w3&&!(j.wk&&312>j.wk)&&a&&c&&e&&f&&h?(A(c,!1),b(function(){e+="";f+="";var b={};if(q&&typeof q===v)for(var j in q)b[j]=q[j];b.data=a;b.width=e;b.height=f;j={};if(p&&typeof p===v)for(var t in p)j[t]=p[t];if(k&&typeof k===v)for(var u in k)j.flashvars=typeof j.flashvars!=n?j.flashvars+("&"+u+"="+k[u]):u+"="+k[u];if(z(h))t=m(b,j,c),b.id==c&&A(c,!0),s.success=
  17. !0,s.ref=t;else{if(d&&g()){b.data=d;l(b,j,c,r);return}A(c,!0)}r&&r(s)})):r&&r(s)},switchOffAutoHideShow:function(){S=!1},ua:j,getFlashPlayerVersion:function(){return{major:j.pv[0],minor:j.pv[1],release:j.pv[2]}},hasFlashPlayerVersion:z,createSWF:function(a,c,b){if(j.w3)return m(a,c,b)},showExpressInstall:function(a,c,b,e){j.w3&&g()&&l(a,c,b,e)},removeSWF:function(a){j.w3&&q(a)},createCSS:function(a,c,b,e){j.w3&&R(a,c,b,e)},addDomLoadEvent:b,addLoadEvent:d,getQueryParamValue:function(a){var c=k.location.search||
  18. k.location.hash;if(c){/\?/.test(c)&&(c=c.split("?")[1]);if(null==a)return T(c);for(var c=c.split("&"),b=0;b<c.length;b++)if(c[b].substring(0,c[b].indexOf("="))==a)return T(c[b].substring(c[b].indexOf("=")+1))}return""},expressInstallCallback:function(){if(I){var a=p(Q);a&&F&&(a.parentNode.replaceChild(F,a),J&&(A(J,!0),j.ie&&j.win&&(F.style.display="block")),M&&M(P));I=!1}}}}(),SWFUpload;void 0==SWFUpload&&(SWFUpload=function(a){this.initSWFUpload(a)});
  19. SWFUpload.prototype.initSWFUpload=function(a){try{this.customSettings={},this.settings=a,this.eventQueue=[],this.movieName="SWFUpload_"+SWFUpload.movieCount++,this.movieElement=null,SWFUpload.instances[this.movieName]=this,this.initSettings(),this.loadFlash(),this.displayDebugInfo()}catch(b){throw delete SWFUpload.instances[this.movieName],b;}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 2009-03-25";
  20. SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};
  21. SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(a){if("string"!==typeof a||a.match(/^https?:\/\//i)||a.match(/^\//))return a;var b=window.location.pathname.lastIndexOf("/");path=0>=b?"/":window.location.pathname.substr(0,b)+"/";return path+a};
  22. SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(a,b){this.settings[a]=void 0==this.settings[a]?b:this.settings[a]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",!1);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",!1);this.ensureDefault("requeue_on_error",!1);this.ensureDefault("http_success",[]);this.ensureDefault("assume_success_timeout",0);this.ensureDefault("file_types",
  23. "*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",!0);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");
  24. this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",!1);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_placeholder",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",!1);this.settings.debug_enabled=this.settings.debug;
  25. this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",
  26. null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;this.settings.prevent_swf_caching&&(this.settings.flash_url=this.settings.flash_url+(0>this.settings.flash_url.indexOf("?")?"?":"&")+"preventswfcaching="+(new Date).getTime());this.settings.preserve_relative_urls||(this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url),this.settings.button_image_url=
  27. SWFUpload.completeURL(this.settings.button_image_url));delete this.ensureDefault};
  28. SWFUpload.prototype.loadFlash=function(){var a,b;if(null!==document.getElementById(this.movieName))throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";a=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(void 0==a)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;b=document.createElement("div");b.innerHTML=this.getFlashHTML();a.parentNode.replaceChild(b.firstChild,a);void 0==window[this.movieName]&&
  29. (window[this.movieName]=this.getMovieElement())};
  30. SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload"><param name="wmode" value="',this.settings.button_window_mode,'" /><param name="movie" value="',this.settings.flash_url,'" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="allowScriptAccess" value="sameDomain" />','<param name="flashvars" value="'+
  31. this.getFlashVars()+'" />',"</object>"].join("")};
  32. SWFUpload.prototype.getFlashVars=function(){var a=this.buildParamString(),b=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(b),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",
  33. encodeURIComponent(a),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),
  34. "&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),
  35. "&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){void 0==this.movieElement&&(this.movieElement=document.getElementById(this.movieName));if(null===this.movieElement)throw"Could not find Flash element";return this.movieElement};
  36. SWFUpload.prototype.buildParamString=function(){var a=this.settings.post_params,b=[];if("object"===typeof a)for(var d in a)a.hasOwnProperty(d)&&b.push(encodeURIComponent(d.toString())+"="+encodeURIComponent(a[d].toString()));return b.join("&amp;")};
  37. SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,!1);var a=null;if((a=this.getMovieElement())&&"unknown"===typeof a.CallFunction){for(var b in a)try{"function"===typeof a[b]&&(a[b]=null)}catch(d){}try{a.parentNode.removeChild(a)}catch(c){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieName=this.eventQueue=this.customSettings=this.settings=this.movieElement=null;return!0}catch(e){return!1}};
  38. SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\nVersion: ",SWFUpload.version,"\nMovie Name: ",this.movieName,"\nSettings:\n\tupload_url: ",this.settings.upload_url,"\n\tflash_url: ",this.settings.flash_url,"\n\tuse_query_string: ",this.settings.use_query_string.toString(),"\n\trequeue_on_error: ",this.settings.requeue_on_error.toString(),"\n\thttp_success: ",this.settings.http_success.join(", "),"\n\tassume_success_timeout: ",
  39. this.settings.assume_success_timeout,"\n\tfile_post_name: ",this.settings.file_post_name,"\n\tpost_params: ",this.settings.post_params.toString(),"\n\tfile_types: ",this.settings.file_types,"\n\tfile_types_description: ",this.settings.file_types_description,"\n\tfile_size_limit: ",this.settings.file_size_limit,"\n\tfile_upload_limit: ",this.settings.file_upload_limit,"\n\tfile_queue_limit: ",this.settings.file_queue_limit,"\n\tdebug: ",
  40. this.settings.debug.toString(),"\n\tprevent_swf_caching: ",this.settings.prevent_swf_caching.toString(),"\n\tbutton_placeholder_id: ",this.settings.button_placeholder_id.toString(),"\n\tbutton_placeholder: ",this.settings.button_placeholder?"Set":"Not Set","\n\tbutton_image_url: ",this.settings.button_image_url.toString(),"\n\tbutton_width: ",this.settings.button_width.toString(),"\n\tbutton_height: ",this.settings.button_height.toString(),"\n\tbutton_text: ",
  41. this.settings.button_text.toString(),"\n\tbutton_text_style: ",this.settings.button_text_style.toString(),"\n\tbutton_text_top_padding: ",this.settings.button_text_top_padding.toString(),"\n\tbutton_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n\tbutton_action: ",this.settings.button_action.toString(),"\n\tbutton_disabled: ",this.settings.button_disabled.toString(),"\n\tcustom_settings: ",this.settings.custom_settings.toString(),"\nEvent Handlers:\n\tswfupload_loaded_handler assigned: ",
  42. ("function"===typeof this.settings.swfupload_loaded_handler).toString(),"\n\tfile_dialog_start_handler assigned: ",("function"===typeof this.settings.file_dialog_start_handler).toString(),"\n\tfile_queued_handler assigned: ",("function"===typeof this.settings.file_queued_handler).toString(),"\n\tfile_queue_error_handler assigned: ",("function"===typeof this.settings.file_queue_error_handler).toString(),"\n\tupload_start_handler assigned: ",("function"===typeof this.settings.upload_start_handler).toString(),
  43. "\n\tupload_progress_handler assigned: ",("function"===typeof this.settings.upload_progress_handler).toString(),"\n\tupload_error_handler assigned: ",("function"===typeof this.settings.upload_error_handler).toString(),"\n\tupload_success_handler assigned: ",("function"===typeof this.settings.upload_success_handler).toString(),"\n\tupload_complete_handler assigned: ",("function"===typeof this.settings.upload_complete_handler).toString(),"\n\tdebug_handler assigned: ",("function"===
  44. typeof this.settings.debug_handler).toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(a,b,d){return void 0==b?this.settings[a]=d:this.settings[a]=b};SWFUpload.prototype.getSetting=function(a){return void 0!=this.settings[a]?this.settings[a]:""};
  45. SWFUpload.prototype.callFlash=function(a,b){b=b||[];var d=this.getMovieElement(),c,e;try{e=d.CallFunction('<invoke name="'+a+'" returntype="javascript">'+__flash__argumentsToXML(b,0)+"</invoke>"),c=eval(e)}catch(g){throw"Call to "+a+" failed";}void 0!=c&&"object"===typeof c.post&&(c=this.unescapeFilePostParams(c));return c};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};
  46. SWFUpload.prototype.startUpload=function(a){this.callFlash("StartUpload",[a])};SWFUpload.prototype.cancelUpload=function(a,b){!1!==b&&(b=!0);this.callFlash("CancelUpload",[a,b])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(a){this.callFlash("SetStats",[a])};
  47. SWFUpload.prototype.getFile=function(a){return"number"===typeof a?this.callFlash("GetFileByIndex",[a]):this.callFlash("GetFile",[a])};SWFUpload.prototype.addFileParam=function(a,b,d){return this.callFlash("AddFileParam",[a,b,d])};SWFUpload.prototype.removeFileParam=function(a,b){this.callFlash("RemoveFileParam",[a,b])};SWFUpload.prototype.setUploadURL=function(a){this.settings.upload_url=a.toString();this.callFlash("SetUploadURL",[a])};
  48. SWFUpload.prototype.setPostParams=function(a){this.settings.post_params=a;this.callFlash("SetPostParams",[a])};SWFUpload.prototype.addPostParam=function(a,b){this.settings.post_params[a]=b;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(a){delete this.settings.post_params[a];this.callFlash("SetPostParams",[this.settings.post_params])};
  49. SWFUpload.prototype.setFileTypes=function(a,b){this.settings.file_types=a;this.settings.file_types_description=b;this.callFlash("SetFileTypes",[a,b])};SWFUpload.prototype.setFileSizeLimit=function(a){this.settings.file_size_limit=a;this.callFlash("SetFileSizeLimit",[a])};SWFUpload.prototype.setFileUploadLimit=function(a){this.settings.file_upload_limit=a;this.callFlash("SetFileUploadLimit",[a])};
  50. SWFUpload.prototype.setFileQueueLimit=function(a){this.settings.file_queue_limit=a;this.callFlash("SetFileQueueLimit",[a])};SWFUpload.prototype.setFilePostName=function(a){this.settings.file_post_name=a;this.callFlash("SetFilePostName",[a])};SWFUpload.prototype.setUseQueryString=function(a){this.settings.use_query_string=a;this.callFlash("SetUseQueryString",[a])};SWFUpload.prototype.setRequeueOnError=function(a){this.settings.requeue_on_error=a;this.callFlash("SetRequeueOnError",[a])};
  51. SWFUpload.prototype.setHTTPSuccess=function(a){"string"===typeof a&&(a=a.replace(" ","").split(","));this.settings.http_success=a;this.callFlash("SetHTTPSuccess",[a])};SWFUpload.prototype.setAssumeSuccessTimeout=function(a){this.settings.assume_success_timeout=a;this.callFlash("SetAssumeSuccessTimeout",[a])};SWFUpload.prototype.setDebugEnabled=function(a){this.settings.debug_enabled=a;this.callFlash("SetDebugEnabled",[a])};
  52. SWFUpload.prototype.setButtonImageURL=function(a){void 0==a&&(a="");this.settings.button_image_url=a;this.callFlash("SetButtonImageURL",[a])};SWFUpload.prototype.setButtonDimensions=function(a,b){this.settings.button_width=a;this.settings.button_height=b;var d=this.getMovieElement();void 0!=d&&(d.style.width=a+"px",d.style.height=b+"px");this.callFlash("SetButtonDimensions",[a,b])};SWFUpload.prototype.setButtonText=function(a){this.settings.button_text=a;this.callFlash("SetButtonText",[a])};
  53. SWFUpload.prototype.setButtonTextPadding=function(a,b){this.settings.button_text_top_padding=b;this.settings.button_text_left_padding=a;this.callFlash("SetButtonTextPadding",[a,b])};SWFUpload.prototype.setButtonTextStyle=function(a){this.settings.button_text_style=a;this.callFlash("SetButtonTextStyle",[a])};SWFUpload.prototype.setButtonDisabled=function(a){this.settings.button_disabled=a;this.callFlash("SetButtonDisabled",[a])};
  54. SWFUpload.prototype.setButtonAction=function(a){this.settings.button_action=a;this.callFlash("SetButtonAction",[a])};SWFUpload.prototype.setButtonCursor=function(a){this.settings.button_cursor=a;this.callFlash("SetButtonCursor",[a])};
  55. SWFUpload.prototype.queueEvent=function(a,b){void 0==b?b=[]:b instanceof Array||(b=[b]);var d=this;if("function"===typeof this.settings[a])this.eventQueue.push(function(){this.settings[a].apply(this,b)}),setTimeout(function(){d.executeNextEvent()},0);else if(null!==this.settings[a])throw"Event handler "+a+" is unknown or is not a function";};SWFUpload.prototype.executeNextEvent=function(){var a=this.eventQueue?this.eventQueue.shift():null;"function"===typeof a&&a.apply(this)};
  56. SWFUpload.prototype.unescapeFilePostParams=function(a){var b=/[$]([0-9a-f]{4})/i,d={},c;if(void 0!=a){for(var e in a.post)if(a.post.hasOwnProperty(e)){c=e;for(var g;null!==(g=b.exec(c));)c=c.replace(g[0],String.fromCharCode(parseInt("0x"+g[1],16)));d[c]=a.post[e]}a.post=d}return a};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(a){return!1}};
  57. SWFUpload.prototype.flashReady=function(){var a=this.getMovieElement();a?(this.cleanUp(a),this.queueEvent("swfupload_loaded_handler")):this.debug("Flash called back ready but the flash movie can't be found.")};
  58. SWFUpload.prototype.cleanUp=function(a){try{if(this.movieElement&&"unknown"===typeof a.CallFunction){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var b in a)try{"function"===typeof a[b]&&(a[b]=null)}catch(d){}}}catch(c){}window.__flash__removeCallback=function(a,c){try{a&&(a[c]=null)}catch(b){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};
  59. SWFUpload.prototype.fileQueued=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("file_queued_handler",a)};SWFUpload.prototype.fileQueueError=function(a,b,d){a=this.unescapeFilePostParams(a);this.queueEvent("file_queue_error_handler",[a,b,d])};SWFUpload.prototype.fileDialogComplete=function(a,b,d){this.queueEvent("file_dialog_complete_handler",[a,b,d])};SWFUpload.prototype.uploadStart=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("return_upload_start_handler",a)};
  60. SWFUpload.prototype.returnUploadStart=function(a){var b;if("function"===typeof this.settings.upload_start_handler)a=this.unescapeFilePostParams(a),b=this.settings.upload_start_handler.call(this,a);else if(void 0!=this.settings.upload_start_handler)throw"upload_start_handler must be a function";void 0===b&&(b=!0);this.callFlash("ReturnUploadStart",[!!b])};SWFUpload.prototype.uploadProgress=function(a,b,d){a=this.unescapeFilePostParams(a);this.queueEvent("upload_progress_handler",[a,b,d])};
  61. SWFUpload.prototype.uploadError=function(a,b,d){a=this.unescapeFilePostParams(a);this.queueEvent("upload_error_handler",[a,b,d])};SWFUpload.prototype.uploadSuccess=function(a,b,d){a=this.unescapeFilePostParams(a);this.queueEvent("upload_success_handler",[a,b,d])};SWFUpload.prototype.uploadComplete=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("upload_complete_handler",a)};SWFUpload.prototype.debug=function(a){this.queueEvent("debug_handler",a)};
  62. SWFUpload.prototype.debugMessage=function(a){if(this.settings.debug){var b=[];if("object"===typeof a&&"string"===typeof a.name&&"string"===typeof a.message){for(var d in a)a.hasOwnProperty(d)&&b.push(d+": "+a[d]);a=b.join("\n")||"";b=a.split("\n");a="EXCEPTION: "+b.join("\nEXCEPTION: ")}SWFUpload.Console.writeLine(a)}};SWFUpload.Console={};
  63. SWFUpload.Console.writeLine=function(a){var b,d;try{b=document.getElementById("SWFUpload_Console"),b||(d=document.createElement("form"),document.getElementsByTagName("body")[0].appendChild(d),b=document.createElement("textarea"),b.id="SWFUpload_Console",b.style.fontFamily="monospace",b.setAttribute("wrap","off"),b.wrap="off",b.style.overflow="auto",b.style.width="700px",b.style.height="350px",b.style.margin="5px",d.appendChild(b)),b.value+=a+"\n",b.scrollTop=b.scrollHeight-b.clientHeight}catch(c){alert("Exception: "+
  64. c.name+" Message: "+c.message)}};
  65. (function(a){var b={init:function(c,b){return this.each(function(){var g=a(this),l=g.clone(),f=a.extend({id:g.attr("id"),swf:"uploadify.swf",uploader:"uploadify.php",auto:!0,buttonClass:"",buttonCursor:"hand",buttonImage:null,buttonText:"SELECT FILES",checkExisting:!1,debug:!1,fileObjName:"Filedata",fileSizeLimit:0,fileTypeDesc:"All Files",fileTypeExts:"*.*",height:30,itemTemplate:!1,method:"post",multi:!0,formData:{},preventCaching:!0,progressData:"percentage",queueID:!1,queueSizeLimit:999,removeCompleted:!0,
  66. removeTimeout:3,requeueErrors:!1,successTimeout:30,uploadLimit:0,width:120,overrideEvents:[]},c),h={assume_success_timeout:f.successTimeout,button_placeholder_id:f.id,button_width:f.width,button_height:f.height,button_text:null,button_text_style:null,button_text_top_padding:0,button_text_left_padding:0,button_action:f.multi?SWFUpload.BUTTON_ACTION.SELECT_FILES:SWFUpload.BUTTON_ACTION.SELECT_FILE,button_disabled:!1,button_cursor:"arrow"==f.buttonCursor?SWFUpload.CURSOR.ARROW:SWFUpload.CURSOR.HAND,
  67. button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,debug:f.debug,requeue_on_error:f.requeueErrors,file_post_name:f.fileObjName,file_size_limit:f.fileSizeLimit,file_types:f.fileTypeExts,file_types_description:f.fileTypeDesc,file_queue_limit:f.queueSizeLimit,file_upload_limit:f.uploadLimit,flash_url:f.swf,prevent_swf_caching:f.preventCaching,post_params:f.formData,upload_url:f.uploader,use_query_string:"get"==f.method,file_dialog_complete_handler:d.onDialogClose,file_dialog_start_handler:d.onDialogOpen,
  68. file_queued_handler:d.onSelect,file_queue_error_handler:d.onSelectError,swfupload_loaded_handler:f.onSWFReady,upload_complete_handler:d.onUploadComplete,upload_error_handler:d.onUploadError,upload_progress_handler:d.onUploadProgress,upload_start_handler:d.onUploadStart,upload_success_handler:d.onUploadSuccess};b&&(h=a.extend(h,b));h=a.extend(h,f);if(9<=swfobject.getFlashPlayerVersion().major){window["uploadify_"+f.id]=new SWFUpload(h);h=window["uploadify_"+f.id];g.data("uploadify",h);var m=a("<div />",
  69. {id:f.id,"class":"uploadify",css:{height:f.height+"px",width:f.width+"px"}});a("#"+h.movieName).wrap(m);m=a("#"+f.id);m.data("uploadify",h);var q=a("<div />",{id:f.id+"-button","class":"uploadify-button "+f.buttonClass});f.buttonImage&&q.css({"background-image":"url('"+f.buttonImage+"')","text-indent":"-9999px"});q.html('<span class="uploadify-button-text">'+f.buttonText+"</span>").css({height:f.height+"px","line-height":f.height+"px",width:f.width+"px"});m.append(q);a("#"+h.movieName).css({position:"absolute",
  70. "z-index":1});if(!f.queueID){var p=a("<div />",{id:f.id+"-queue","class":"uploadify-queue"});m.after(p);h.settings.queueID=f.id+"-queue";h.settings.defaultQueue=!0}h.queueData={files:{},filesSelected:0,filesQueued:0,filesReplaced:0,filesCancelled:0,filesErrored:0,uploadsSuccessful:0,uploadsErrored:0,averageSpeed:0,queueLength:0,queueSize:0,uploadSize:0,queueBytesUploaded:0,uploadQueue:[],errorMsg:"Some files were not added to the queue:"};h.original=l;h.wrapper=m;h.button=q;h.queue=p;f.onInit&&f.onInit.call(g,
  71. h)}else f.onFallback&&f.onFallback.call(g)})},cancel:function(c,b){var g=arguments;this.each(function(){var c=a(this),b=c.data("uploadify"),e=b.settings,d=-1;if(g[0])if("*"==g[0]){var q=b.queueData.queueLength;a("#"+e.queueID).find(".uploadify-queue-item").each(function(){d++;!0===g[1]?b.cancelUpload(a(this).attr("id"),!1):b.cancelUpload(a(this).attr("id"));a(this).find(".data").removeClass("data").html(" - Cancelled");a(this).find(".uploadify-progress-bar").remove();a(this).delay(1E3+100*d).fadeOut(500,
  72. function(){a(this).remove()})});b.queueData.queueSize=0;b.queueData.queueLength=0;e.onClearQueue&&e.onClearQueue.call(c,q)}else for(c=0;c<g.length;c++)b.cancelUpload(g[c]),a("#"+g[c]).find(".data").removeClass("data").html(" - Cancelled"),a("#"+g[c]).find(".uploadify-progress-bar").remove(),a("#"+g[c]).delay(1E3+100*c).fadeOut(500,function(){a(this).remove()});else c=a("#"+e.queueID).find(".uploadify-queue-item").get(0),$item=a(c),b.cancelUpload($item.attr("id")),$item.find(".data").removeClass("data").html(" - Cancelled"),
  73. $item.find(".uploadify-progress-bar").remove(),$item.delay(1E3).fadeOut(500,function(){a(this).remove()})})},destroy:function(){this.each(function(){var c=a(this).data("uploadify"),b=c.settings;c.destroy();b.defaultQueue&&a("#"+b.queueID).remove();a("#"+b.id).replaceWith(c.original);b.onDestroy&&b.onDestroy.call(this);delete c})},disable:function(c){this.each(function(){var b=a(this).data("uploadify"),g=b.settings;c?(b.button.addClass("disabled"),g.onDisable&&g.onDisable.call(this)):(b.button.removeClass("disabled"),
  74. g.onEnable&&g.onEnable.call(this));b.setButtonDisabled(c)})},settings:function(c,b,g){var d=arguments,f=b;this.each(function(){var h=a(this).data("uploadify"),m=h.settings;if("object"==typeof d[0])for(var q in b)setData(q,b[q]);if(1===d.length)f=m[c];else{switch(c){case "uploader":h.setUploadURL(b);break;case "formData":g||(b=a.extend(m.formData,b));h.setPostParams(m.formData);break;case "method":"get"==b?h.setUseQueryString(!0):h.setUseQueryString(!1);break;case "fileObjName":h.setFilePostName(b);
  75. break;case "fileTypeExts":h.setFileTypes(b,m.fileTypeDesc);break;case "fileTypeDesc":h.setFileTypes(m.fileTypeExts,b);break;case "fileSizeLimit":h.setFileSizeLimit(b);break;case "uploadLimit":h.setFileUploadLimit(b);break;case "queueSizeLimit":h.setFileQueueLimit(b);break;case "buttonImage":h.button.css("background-image",settingValue);break;case "buttonCursor":"arrow"==b?h.setButtonCursor(SWFUpload.CURSOR.ARROW):h.setButtonCursor(SWFUpload.CURSOR.HAND);break;case "buttonText":a("#"+m.id+"-button").find(".uploadify-button-text").html(b);
  76. break;case "width":h.setButtonDimensions(b,m.height);break;case "height":h.setButtonDimensions(m.width,b);break;case "multi":b?h.setButtonAction(SWFUpload.BUTTON_ACTION.SELECT_FILES):h.setButtonAction(SWFUpload.BUTTON_ACTION.SELECT_FILE)}m[c]=b}});if(1===d.length)return f},stop:function(){this.each(function(){var b=a(this).data("uploadify");b.queueData.averageSpeed=0;b.queueData.uploadSize=0;b.queueData.bytesUploaded=0;b.queueData.uploadQueue=[];b.stopUpload()})},upload:function(){var b=arguments;
  77. this.each(function(){var e=a(this).data("uploadify");e.queueData.averageSpeed=0;e.queueData.uploadSize=0;e.queueData.bytesUploaded=0;e.queueData.uploadQueue=[];if(b[0])if("*"==b[0])e.queueData.uploadSize=e.queueData.queueSize,e.queueData.uploadQueue.push("*"),e.startUpload();else{for(var g=0;g<b.length;g++)e.queueData.uploadSize+=e.queueData.files[b[g]].size,e.queueData.uploadQueue.push(b[g]);e.startUpload(e.queueData.uploadQueue.shift())}else e.startUpload()})}},d={onDialogOpen:function(){var a=
  78. this.settings;this.queueData.errorMsg="Some files were not added to the queue:";this.queueData.filesReplaced=0;this.queueData.filesCancelled=0;a.onDialogOpen&&a.onDialogOpen.call(this)},onDialogClose:function(b,e,g){var d=this.settings;this.queueData.filesErrored=b-e;this.queueData.filesSelected=b;this.queueData.filesQueued=e-this.queueData.filesCancelled;this.queueData.queueLength=g;0>a.inArray("onDialogClose",d.overrideEvents)&&0<this.queueData.filesErrored&&alert(this.queueData.errorMsg);d.onDialogClose&&
  79. d.onDialogClose.call(this,this.queueData);d.auto&&a("#"+d.id).uploadify("upload","*")},onSelect:function(b){var e=this.settings,g={},d;for(d in this.queueData.files)if(g=this.queueData.files[d],!0!=g.uploaded&&g.name==b.name)if(confirm('The file named "'+b.name+'" is already in the queue.\nDo you want to replace the existing item in the queue?'))a("#"+g.id).remove(),this.cancelUpload(g.id),this.queueData.filesReplaced++;else return this.cancelUpload(b.id),this.queueData.filesCancelled++,!1;g=Math.round(b.size/
  80. 1024);d="KB";1E3<g&&(g=Math.round(g/1E3),d="MB");var f=g.toString().split("."),g=f[0];1<f.length&&(g+="."+f[1].substr(0,2));g+=d;d=b.name;25<d.length&&(d=d.substr(0,25)+"...");itemData={fileID:b.id,instanceID:e.id,fileName:d,fileSize:g};!1==e.itemTemplate&&(e.itemTemplate='<div id="${fileID}" class="uploadify-queue-item">\t\t\t\t\t<div class="cancel">\t\t\t\t\t\t<a href="javascript:$(\'#${instanceID}\').uploadify(\'cancel\', \'${fileID}\')">X</a>\t\t\t\t\t</div>\t\t\t\t\t<span class="fileName">${fileName} (${fileSize})</span><span class="data"></span>\t\t\t\t\t<div class="uploadify-progress">\t\t\t\t\t\t<div class="uploadify-progress-bar">\x3c!--Progress Bar--\x3e</div>\t\t\t\t\t</div>\t\t\t\t</div>');
  81. if(0>a.inArray("onSelect",e.overrideEvents)){itemHTML=e.itemTemplate;for(var h in itemData)itemHTML=itemHTML.replace(RegExp("\\$\\{"+h+"\\}","g"),itemData[h]);a("#"+e.queueID).append(itemHTML)}this.queueData.queueSize+=b.size;this.queueData.files[b.id]=b;e.onSelect&&e.onSelect.apply(this,arguments)},onSelectError:function(b,e,g){var d=this.settings;if(0>a.inArray("onSelectError",d.overrideEvents))switch(e){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:this.queueData.errorMsg=d.queueSizeLimit>g?
  82. this.queueData.errorMsg+("\nThe number of files selected exceeds the remaining upload limit ("+g+")."):this.queueData.errorMsg+("\nThe number of files selected exceeds the queue size limit ("+d.queueSizeLimit+").");break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:this.queueData.errorMsg+='\nThe file "'+b.name+'" exceeds the size limit ('+d.fileSizeLimit+").";break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:this.queueData.errorMsg+='\nThe file "'+b.name+'" is empty.';break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:this.queueData.errorMsg+=
  83. '\nThe file "'+b.name+'" is not an accepted file type ('+d.fileTypeDesc+")."}e!=SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED&&delete this.queueData.files[b.id];d.onSelectError&&d.onSelectError.apply(this,arguments)},onQueueComplete:function(){this.settings.onQueueComplete&&this.settings.onQueueComplete.call(this,this.settings.queueData)},onUploadComplete:function(b){var e=this.settings,d=this,l=this.getStats();this.queueData.queueLength=l.files_queued;"*"==this.queueData.uploadQueue[0]?0<this.queueData.queueLength?
  84. this.startUpload():(this.queueData.uploadQueue=[],e.onQueueComplete&&e.onQueueComplete.call(this,this.queueData)):0<this.queueData.uploadQueue.length?this.startUpload(this.queueData.uploadQueue.shift()):(this.queueData.uploadQueue=[],e.onQueueComplete&&e.onQueueComplete.call(this,this.queueData));if(0>a.inArray("onUploadComplete",e.overrideEvents))if(e.removeCompleted)switch(b.filestatus){case SWFUpload.FILE_STATUS.COMPLETE:setTimeout(function(){a("#"+b.id)&&(d.queueData.queueSize-=b.size,d.queueData.queueLength-=
  85. 1,delete d.queueData.files[b.id],a("#"+b.id).fadeOut(500,function(){a(this).remove()}))},1E3*e.removeTimeout);break;case SWFUpload.FILE_STATUS.ERROR:e.requeueErrors||setTimeout(function(){a("#"+b.id)&&(d.queueData.queueSize-=b.size,d.queueData.queueLength-=1,delete d.queueData.files[b.id],a("#"+b.id).fadeOut(500,function(){a(this).remove()}))},1E3*e.removeTimeout)}else b.uploaded=!0;e.onUploadComplete&&e.onUploadComplete.call(this,b)},onUploadError:function(b,e,d){var l=this.settings,f="Error";switch(e){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:f=
  86. "HTTP Error ("+d+")";break;case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:f="Missing Upload URL";break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:f="IO Error";break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:f="Security Error";break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:alert("The upload limit has been reached ("+d+").");f="Exceeds Upload Limit";break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:f="Failed";break;case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:f="Validation Error";break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:f=
  87. "Cancelled";this.queueData.queueSize-=b.size;this.queueData.queueLength-=1;if(b.status==SWFUpload.FILE_STATUS.IN_PROGRESS||0<=a.inArray(b.id,this.queueData.uploadQueue))this.queueData.uploadSize-=b.size;l.onCancel&&l.onCancel.call(this,b);delete this.queueData.files[b.id];break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:f="Stopped"}0>a.inArray("onUploadError",l.overrideEvents)&&(e!=SWFUpload.UPLOAD_ERROR.FILE_CANCELLED&&e!=SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED&&a("#"+b.id).addClass("uploadify-error"),
  88. a("#"+b.id).find(".uploadify-progress-bar").css("width","1px"),e!=SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND&&b.status!=SWFUpload.FILE_STATUS.COMPLETE&&a("#"+b.id).find(".data").html(" - "+f));var h=this.getStats();this.queueData.uploadsErrored=h.upload_errors;l.onUploadError&&l.onUploadError.call(this,b,e,d,f)},onUploadProgress:function(b,d,g){var l=this.settings,f=(new Date).getTime(),h=f-this.timer;500<h&&(this.timer=f);var m=d-this.bytesLoaded;this.bytesLoaded=d;var f=this.queueData.queueBytesUploaded+
  89. d,q=Math.round(100*(d/g)),p="KB/s",z=0,m=Math.floor(10*(m/1024/(h/1E3)))/10;this.queueData.averageSpeed=0<this.queueData.averageSpeed?Math.floor((this.queueData.averageSpeed+m)/2):Math.floor(m);1E3<m&&(z=0.001*m,this.queueData.averageSpeed=Math.floor(z),p="MB/s");0>a.inArray("onUploadProgress",l.overrideEvents)&&("percentage"==l.progressData?a("#"+b.id).find(".data").html(" - "+q+"%"):"speed"==l.progressData&&500<h&&a("#"+b.id).find(".data").html(" - "+this.queueData.averageSpeed+p),a("#"+b.id).find(".uploadify-progress-bar").css("width",
  90. q+"%"));l.onUploadProgress&&l.onUploadProgress.call(this,b,d,g,f,this.queueData.uploadSize)},onUploadStart:function(b){var d=this.settings;this.timer=(new Date).getTime();this.bytesLoaded=0;0==this.queueData.uploadQueue.length&&(this.queueData.uploadSize=b.size);d.checkExisting&&a.ajax({type:"POST",async:!1,url:d.checkExisting,data:{filename:b.name},success:function(d){1==d&&!confirm('A file with the name "'+b.name+'" already exists on the server.\nWould you like to replace the existing file?')&&
  91. (this.cancelUpload(b.id),a("#"+b.id).remove(),0<this.queueData.uploadQueue.length&&0<this.queueData.queueLength&&("*"==this.queueData.uploadQueue[0]?this.startUpload():this.startUpload(this.queueData.uploadQueue.shift())))}});d.onUploadStart&&d.onUploadStart.call(this,b)},onUploadSuccess:function(b,d,g){var l=this.settings,f=this.getStats();this.queueData.uploadsSuccessful=f.successful_uploads;this.queueData.queueBytesUploaded+=b.size;0>a.inArray("onUploadSuccess",l.overrideEvents)&&a("#"+b.id).find(".data").html(" - Complete");
  92. l.onUploadSuccess&&l.onUploadSuccess.call(this,b,d,g)}};a.fn.uploadify=function(c){if(b[c])return b[c].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof c||!c)return b.init.apply(this,arguments);a.error("The method "+c+" does not exist in $.uploadify")}})($);