var swfobject=function(){function a(){if(!w){try{var a=j.getElementsByTagName("body")[0].appendChild(j.createElement("span"));a.parentNode.removeChild(a)}catch(c){return}w=!0;for(var a=G.length,e=0;e<a;e++)G[e]()}}function b(a){w?a():G[G.length]=a}function d(a){if(typeof r.addEventListener!=m)r.addEventListener("load",a,!1);else if(typeof j.addEventListener!=m)j.addEventListener("load",a,!1);else if(typeof r.attachEvent!=m){var c=r;c.attachEvent("onload",a);A[A.length]=[c,"onload",a]}else if("function"==
typeof r.onload){var e=r.onload;r.onload=function(){e();a()}}else r.onload=a}function c(){var a=t.length;if(0<a)for(var c=0;c<a;c++){var b=t[c].id,x=t[c].callbackFn,h={success:!1,id:b};if(0<i.pv[0]){var d=n(b);if(d)if(y(t[c].swfVersion)&&!(i.wk&&312>i.wk))z(b,!0),x&&(h.success=!0,h.ref=e(b),x(h));else if(t[c].expressInstall&&g()){h={};h.data=t[c].expressInstall;h.width=d.getAttribute("width")||"0";h.height=d.getAttribute("height")||"0";d.getAttribute("class")&&(h.styleclass=d.getAttribute("class"));
d.getAttribute("align")&&(h.align=d.getAttribute("align"));for(var j={},d=d.getElementsByTagName("param"),l=d.length,D=0;D<l;D++)"movie"!=d[D].getAttribute("name").toLowerCase()&&(j[d[D].getAttribute("name")]=d[D].getAttribute("value"));k(h,j,b,x)}else f(d),x&&x(h)}else if(z(b,!0),x){if((b=e(b))&&typeof b.SetVariable!=m)h.success=!0,h.ref=b;x(h)}}}function e(a){var c=null;if((a=n(a))&&"OBJECT"==a.nodeName)typeof a.SetVariable!=m?c=a:(a=a.getElementsByTagName(u)[0])&&(c=a);return c}function g(){return!H&&
y("6.0.65")&&(i.win||i.mac)&&!(i.wk&&312>i.wk)}function k(a,c,e,b){H=!0;L=b||null;O={success:!1,id:e};var g=n(e);if(g){"OBJECT"==g.nodeName?(E=h(g),I=null):(E=g,I=e);a.id=P;if(typeof a.width==m||!/%$/.test(a.width)&&310>parseInt(a.width,10))a.width="310";if(typeof a.height==m||!/%$/.test(a.height)&&137>parseInt(a.height,10))a.height="137";j.title=j.title.slice(0,47)+" - Flash Player Installation";b=i.ie&&i.win?"ActiveX":"PlugIn";b="MMredirectURL="+r.location.toString().replace(/&/g,"%26")+"&MMplayerType="+
b+"&MMdoctitle="+j.title;c.flashvars=typeof c.flashvars!=m?c.flashvars+("&"+b):b;i.ie&&(i.win&&4!=g.readyState)&&(b=j.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)}());l(a,c,e)}}function f(a){if(i.ie&&i.win&&4!=a.readyState){var c=j.createElement("div");a.parentNode.insertBefore(c,a);c.parentNode.replaceChild(h(a),c);a.style.display="none";(function(){4==
a.readyState?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)})()}else a.parentNode.replaceChild(h(a),a)}function h(a){var c=j.createElement("div");if(i.win&&i.ie)c.innerHTML=a.innerHTML;else if(a=a.getElementsByTagName(u)[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 l(a,c,b){var e,g=n(b);if(i.wk&&312>i.wk)return e;if(g)if(typeof a.id==m&&(a.id=b),i.ie&&i.win){var f=
"",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>";J[J.length]=a.id;e=n(a.id)}else{d=j.createElement(u);d.setAttribute("type",K);for(var k in a)a[k]!=Object.prototype[k]&&("styleclass"==
k.toLowerCase()?d.setAttribute("class",a[k]):"classid"!=k.toLowerCase()&&d.setAttribute(k,a[k]));for(f in c)c[f]!=Object.prototype[f]&&"movie"!=f.toLowerCase()&&(a=d,h=f,k=c[f],b=j.createElement("param"),b.setAttribute("name",h),b.setAttribute("value",k),a.appendChild(b));g.parentNode.replaceChild(d,g);e=d}return e}function p(a){var c=n(a);c&&"OBJECT"==c.nodeName&&(i.ie&&i.win?(c.style.display="none",function(){if(4==c.readyState){var b=n(a);if(b){for(var e in b)"function"==typeof b[e]&&(b[e]=null);
b.parentNode.removeChild(b)}}else setTimeout(arguments.callee,10)}()):c.parentNode.removeChild(c))}function n(a){var c=null;try{c=j.getElementById(a)}catch(b){}return c}function y(a){var c=i.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 Q(a,c,b,e){if(!i.ie||!i.mac){var g=j.getElementsByTagName("head")[0];if(g){b=b&&"string"==typeof b?b:"screen";e&&(M=s=null);if(!s||
M!=b)e=j.createElement("style"),e.setAttribute("type","text/css"),e.setAttribute("media",b),s=g.appendChild(e),i.ie&&(i.win&&typeof j.styleSheets!=m&&0<j.styleSheets.length)&&(s=j.styleSheets[j.styleSheets.length-1]),M=b;i.ie&&i.win?s&&typeof s.addRule==u&&s.addRule(a,c):s&&typeof j.createTextNode!=m&&s.appendChild(j.createTextNode(a+" {"+c+"}"))}}}function z(a,c){if(R){var b=c?"visible":"hidden";w&&n(a)?n(a).style.visibility=b:Q("#"+a,"visibility:"+b)}}function S(a){return null!=/[\\\"<>\.;]/.exec(a)&&
typeof encodeURIComponent!=m?encodeURIComponent(a):a}var m="undefined",u="object",K="application/x-shockwave-flash",P="SWFObjectExprInst",r=window,j=document,v=navigator,T=!1,G=[function(){if(T){var a=j.getElementsByTagName("body")[0],b=j.createElement(u);b.setAttribute("type",K);var e=a.appendChild(b);if(e){var g=0;(function(){if(typeof e.GetVariable!=m){var f=e.GetVariable("$version");f&&(f=f.split(" ")[1].split(","),i.pv=[parseInt(f[0],10),parseInt(f[1],10),parseInt(f[2],10)])}else if(10>g){g++;
setTimeout(arguments.callee,10);return}a.removeChild(b);e=null;c()})()}else c()}else c()}],t=[],J=[],A=[],E,I,L,O,w=!1,H=!1,s,M,R=!0,i,V=typeof j.getElementById!=m&&typeof j.getElementsByTagName!=m&&typeof j.createElement!=m,B=v.userAgent.toLowerCase(),C=v.platform.toLowerCase(),W=C?/win/.test(C):/win/.test(B),C=C?/mac/.test(C):/mac/.test(B),B=/webkit/.test(B)?parseFloat(B.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,N=!+"\v1",F=[0,0,0],q=null;if(typeof v.plugins!=m&&typeof v.plugins["Shockwave Flash"]==
u){if((q=v.plugins["Shockwave Flash"].description)&&!(typeof v.mimeTypes!=m&&v.mimeTypes[K]&&!v.mimeTypes[K].enabledPlugin))T=!0,N=!1,q=q.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),F[0]=parseInt(q.replace(/^(.*)\..*$/,"$1"),10),F[1]=parseInt(q.replace(/^.*\.(.*)\s.*$/,"$1"),10),F[2]=/[a-zA-Z]/.test(q)?parseInt(q.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof r.ActiveXObject!=m)try{var U=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(U&&(q=U.GetVariable("$version")))N=!0,q=q.split(" ")[1].split(","),
F=[parseInt(q[0],10),parseInt(q[1],10),parseInt(q[2],10)]}catch(X){}i={w3:V,pv:F,wk:B,ie:N,win:W,mac:C};i.w3&&((typeof j.readyState!=m&&"complete"==j.readyState||typeof j.readyState==m&&(j.getElementsByTagName("body")[0]||j.body))&&a(),w||(typeof j.addEventListener!=m&&j.addEventListener("DOMContentLoaded",a,!1),i.ie&&i.win&&(j.attachEvent("onreadystatechange",function(){"complete"==j.readyState&&(j.detachEvent("onreadystatechange",arguments.callee),a())}),r==top&&function(){if(!w){try{j.documentElement.doScroll("left")}catch(c){setTimeout(arguments.callee,
0);return}a()}}()),i.wk&&function(){w||(/loaded|complete/.test(j.readyState)?a():setTimeout(arguments.callee,0))}(),d(a)));i.ie&&i.win&&window.attachEvent("onunload",function(){for(var a=A.length,c=0;c<a;c++)A[c][0].detachEvent(A[c][1],A[c][2]);a=J.length;for(c=0;c<a;c++)p(J[c]);for(var b in i)i[b]=null;i=null;for(var e in swfobject)swfobject[e]=null;swfobject=null});return{registerObject:function(a,c,b,e){if(i.w3&&a&&c){var g={};g.id=a;g.swfVersion=c;g.expressInstall=b;g.callbackFn=e;t[t.length]=
g;z(a,!1)}else e&&e({success:!1,id:a})},getObjectById:function(a){if(i.w3)return e(a)},embedSWF:function(a,c,e,f,h,d,j,n,p,q){var r={success:!1,id:c};i.w3&&!(i.wk&&312>i.wk)&&a&&c&&e&&f&&h?(z(c,!1),b(function(){e+="";f+="";var b={};if(p&&typeof p===u)for(var i in p)b[i]=p[i];b.data=a;b.width=e;b.height=f;i={};if(n&&typeof n===u)for(var s in n)i[s]=n[s];if(j&&typeof j===u)for(var t in j)i.flashvars=typeof i.flashvars!=m?i.flashvars+("&"+t+"="+j[t]):t+"="+j[t];if(y(h))s=l(b,i,c),b.id==c&&z(c,!0),r.success=
!0,r.ref=s;else{if(d&&g()){b.data=d;k(b,i,c,q);return}z(c,!0)}q&&q(r)})):q&&q(r)},switchOffAutoHideShow:function(){R=!1},ua:i,getFlashPlayerVersion:function(){return{major:i.pv[0],minor:i.pv[1],release:i.pv[2]}},hasFlashPlayerVersion:y,createSWF:function(a,c,b){if(i.w3)return l(a,c,b)},showExpressInstall:function(a,c,b,e){i.w3&&g()&&k(a,c,b,e)},removeSWF:function(a){i.w3&&p(a)},createCSS:function(a,c,b,e){i.w3&&Q(a,c,b,e)},addDomLoadEvent:b,addLoadEvent:d,getQueryParamValue:function(a){var c=j.location.search||
j.location.hash;if(c){/\?/.test(c)&&(c=c.split("?")[1]);if(null==a)return S(c);for(var c=c.split("&"),b=0;b<c.length;b++)if(c[b].substring(0,c[b].indexOf("="))==a)return S(c[b].substring(c[b].indexOf("=")+1))}return""},expressInstallCallback:function(){if(H){var a=n(P);a&&E&&(a.parentNode.replaceChild(E,a),I&&(z(I,!0),i.ie&&i.win&&(E.style.display="block")),L&&L(O));H=!1}}}}(),SWFUpload;void 0==SWFUpload&&(SWFUpload=function(a){this.initSWFUpload(a)});
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";
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};
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};
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",
"*.*");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;");
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;
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",
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=
SWFUpload.completeURL(this.settings.button_image_url));delete this.ensureDefault};
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]&&
(window[this.movieName]=this.getMovieElement())};
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="always" />','<param name="flashvars" value="'+
this.getFlashVars()+'" />',"</object>"].join("")};
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=",
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),
"&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),
"&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};
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;")};
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}};
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:   ",
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:                    ",
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:              ",
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:  ",
("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(),
"\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"===
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]:""};
SWFUpload.prototype.callFlash=function(a,b){var b=b||[],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")};
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])};
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])};
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])};
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])};
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])};
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])};
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])};
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])};
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])};
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)};
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}};
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.")};
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")};
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)};
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])};
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)};
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={};
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: "+
c.name+" Message: "+c.message)}};
(function(a){var b={init:function(c,b){return this.each(function(){var g=a(this),k=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,
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,
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,
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 l=a("<div />",
{id:f.id,"class":"uploadify",css:{height:f.height+"px",width:f.width+"px"}});a("#"+h.movieName).wrap(l);l=a("#"+f.id);l.data("uploadify",h);var p=a("<div />",{id:f.id+"-button","class":"uploadify-button "+f.buttonClass});f.buttonImage&&p.css({"background-image":"url('"+f.buttonImage+"')","text-indent":"-9999px"});p.html('<span class="uploadify-button-text">'+f.buttonText+"</span>").css({height:f.height+"px","line-height":f.height+"px",width:f.width+"px"});l.append(p);a("#"+h.movieName).css({position:"absolute",
"z-index":1});if(!f.queueID){var n=a("<div />",{id:f.id+"-queue","class":"uploadify-queue"});l.after(n);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=k;h.wrapper=l;h.button=p;h.queue=n;f.onInit&&f.onInit.call(g,
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 p=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,
function(){a(this).remove()})});b.queueData.queueSize=0;b.queueData.queueLength=0;e.onClearQueue&&e.onClearQueue.call(c,p)}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"),
$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"),
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"),l=h.settings;if("object"==typeof d[0])for(var p in b)setData(p,b[p]);if(1===d.length)f=l[c];else{switch(c){case "uploader":h.setUploadURL(b);break;case "formData":g||(b=a.extend(l.formData,b));h.setPostParams(l.formData);break;case "method":"get"==b?h.setUseQueryString(!0):h.setUseQueryString(!1);break;case "fileObjName":h.setFilePostName(b);
break;case "fileTypeExts":h.setFileTypes(b,l.fileTypeDesc);break;case "fileTypeDesc":h.setFileTypes(l.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("#"+l.id+"-button").find(".uploadify-button-text").html(b);
break;case "width":h.setButtonDimensions(b,l.height);break;case "height":h.setButtonDimensions(l.width,b);break;case "multi":b?h.setButtonAction(SWFUpload.BUTTON_ACTION.SELECT_FILES):h.setButtonAction(SWFUpload.BUTTON_ACTION.SELECT_FILE)}l[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;
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=
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&&
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/
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"><\!--Progress Bar--\></div>\t\t\t\t\t</div>\t\t\t\t</div>');
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?
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+=
'\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,k=this.getStats();this.queueData.queueLength=k.files_queued;"*"==this.queueData.uploadQueue[0]?0<this.queueData.queueLength?
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-=
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 k=this.settings,f="Error";switch(e){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:f=
"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=
"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;k.onCancel&&k.onCancel.call(this,b);delete this.queueData.files[b.id];break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:f="Stopped"}0>a.inArray("onUploadError",k.overrideEvents)&&(e!=SWFUpload.UPLOAD_ERROR.FILE_CANCELLED&&e!=SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED&&a("#"+b.id).addClass("uploadify-error"),
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;k.onUploadError&&k.onUploadError.call(this,b,e,d,f)},onUploadProgress:function(b,d,g){var k=this.settings,f=(new Date).getTime(),h=f-this.timer;500<h&&(this.timer=f);var l=d-this.bytesLoaded;this.bytesLoaded=d;var f=this.queueData.queueBytesUploaded+
d,p=Math.round(100*(d/g)),n="KB/s",y=0,l=Math.floor(10*(l/1024/(h/1E3)))/10;this.queueData.averageSpeed=0<this.queueData.averageSpeed?Math.floor((this.queueData.averageSpeed+l)/2):Math.floor(l);1E3<l&&(y=0.0010*l,this.queueData.averageSpeed=Math.floor(y),n="MB/s");0>a.inArray("onUploadProgress",k.overrideEvents)&&("percentage"==k.progressData?a("#"+b.id).find(".data").html(" - "+p+"%"):"speed"==k.progressData&&500<h&&a("#"+b.id).find(".data").html(" - "+this.queueData.averageSpeed+n),a("#"+b.id).find(".uploadify-progress-bar").css("width",
p+"%"));k.onUploadProgress&&k.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?')&&
(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 k=this.settings,f=this.getStats();this.queueData.uploadsSuccessful=f.successful_uploads;this.queueData.queueBytesUploaded+=b.size;0>a.inArray("onUploadSuccess",k.overrideEvents)&&a("#"+b.id).find(".data").html(" - \u4e0a\u4f20\u6210\u529f");
k.onUploadSuccess&&k.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")}})($);
