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;ej.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")); d.getAttribute("align")&&(h.align=d.getAttribute("align"));for(var k={},d=d.getElementsByTagName("param"),m=d.length,E=0;Ej.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="+ 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== 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;bj.wk)return e;if(g)if(typeof a.id==n&&(a.id=b),j.ie&&j.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+='');g.outerHTML='"+h+"";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"== 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); 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|| 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\.;]/.exec(a)&& 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++; 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"]== 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(","), 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, 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;cj.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= !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|| 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=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['','',""].join("")}; SWFUpload.prototype.getFlashVars=function(){var a=this.buildParamString(),b=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&uploadURL=",encodeURIComponent(this.settings.upload_url),"&useQueryString=",encodeURIComponent(this.settings.use_query_string),"&requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&httpSuccess=",encodeURIComponent(b),"&assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&params=", encodeURIComponent(a),"&filePostName=",encodeURIComponent(this.settings.file_post_name),"&fileTypes=",encodeURIComponent(this.settings.file_types),"&fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&debugEnabled=",encodeURIComponent(this.settings.debug_enabled), "&buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&buttonWidth=",encodeURIComponent(this.settings.button_width),"&buttonHeight=",encodeURIComponent(this.settings.button_height),"&buttonText=",encodeURIComponent(this.settings.button_text),"&buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&buttonTextStyle=",encodeURIComponent(this.settings.button_text_style), "&buttonAction=",encodeURIComponent(this.settings.button_action),"&buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&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("&")}; 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){b=b||[];var d=this.getMovieElement(),c,e;try{e=d.CallFunction(''+__flash__argumentsToXML(b,0)+""),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),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, 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 m=a("
", {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("
",{id:f.id+"-button","class":"uploadify-button "+f.buttonClass});f.buttonImage&&q.css({"background-image":"url('"+f.buttonImage+"')","text-indent":"-9999px"});q.html(''+f.buttonText+"").css({height:f.height+"px","line-height":f.height+"px",width:f.width+"px"});m.append(q);a("#"+h.movieName).css({position:"absolute", "z-index":1});if(!f.queueID){var p=a("
",{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, 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, function(){a(this).remove()})});b.queueData.queueSize=0;b.queueData.queueLength=0;e.onClearQueue&&e.onClearQueue.call(c,q)}else for(c=0;ca.inArray("onDialogClose",d.overrideEvents)&&0\t\t\t\t\t
\t\t\t\t\t\tX\t\t\t\t\t
\t\t\t\t\t${fileName} (${fileSize})\t\t\t\t\t
\t\t\t\t\t\t
\x3c!--Progress Bar--\x3e
\t\t\t\t\t
\t\t\t\t
'); 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,l=this.getStats();this.queueData.queueLength=l.files_queued;"*"==this.queueData.uploadQueue[0]?0a.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 l=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;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"), 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;500a.inArray("onUploadProgress",l.overrideEvents)&&("percentage"==l.progressData?a("#"+b.id).find(".data").html(" - "+q+"%"):"speed"==l.progressData&&500a.inArray("onUploadSuccess",l.overrideEvents)&&a("#"+b.id).find(".data").html(" - Complete"); 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")}})($);