(function(c){function d(){var b;try{b=navigator.plugins["Shockwave Flash"];b=b.description}catch(a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(a){b="0.0"}}b=b.match(/\d+/g);return parseFloat(b[0]+"."+b[1])}if(!c.multiUpload.initialized&&d()>=10){c.multiUpload.initialized=1;c.multiUpload.runtime="flash";c.multiUpload.instances=[];c.multiUpload._fireEvent=function(j,a,b,h,i){window.setTimeout(function(){c(c.multiUpload.instances).each(function(e,f){c(f).trigger("multiUpload:"+j,[a,b,h,i]);f.repaint()})},0)};c.extend(c.multiUpload.prototype,{getFlash:function(){return c("#flashuploader")[0]},repaint:function(){var f=this,b=c(f.settings.flash_browse_button),a=b.offset();f.flashContainer.css({position:"absolute",top:a.top,left:a.left,width:b.width(),height:b.height(),backgr2ound:"red"})},init:function(){var h=this,g=h.settings,a,b;c.multiUpload.instances.push(h);c(h).bind("multiUpload:flashInit",function(e){c(h).trigger("multiUpload:init")});c(document.body).append('<div id="flashUploaderContainer"></div>');a=new SWFObject("js/jquery/jquery.multiupload.flash.swf","flashuploader","100%","100%","10.0");a.addVariable("file_filter",c.map(h.settings.filter,function(e){return"*."+e}).join(";"));a.addParam("wmode","transparent");a.write("flashUploaderContainer");h.flashContainer=c("#flashUploaderContainer");c(function(e){h.repaint()});h.repaint();c(h).bind("multiUpload:flashSelectFiles",function(e,f){c(f).each(function(i,l){h.files.push(l)});c(h).trigger("multiUpload:filesSelected",[{files:f}]);c(h).trigger("multiUpload:filesChanged")});c(h).bind("multiUpload:flashUploadComplete",function(f,e){var j;if(j=h.getFile(e.id)){if(!j.status){j.status="completed";c(h).trigger("multiUpload:fileUploaded",[{file:j,response:e.text}])}}c(h).trigger("multiUpload:filesChanged");h.uploadNext()});c(h).bind("multiUpload:flashUploadProcess",function(f,e){var j=h.getFile(e.id);if(!j.status){j.loaded=e.loaded;c(h).trigger("multiUpload:fileUploadProgress",[{file:j,loaded:j.loaded,total:j.size}])}});c(h).bind("multiUpload:flashIOError",function(f,e){var j;if(j=h.getFile(e.id)){if(!j.status){j.status="failed";c(h).trigger("multiUpload:uploadChunkError",[{file:j,error:e.message}])}}});c(h).bind("multiUpload:stopUpload",function(e){h.getFlash().cancelUpload()});c(h).bind("multiUpload:removeFile",function(e,f){h.getFlash().removeFile(f.id)});c(h).bind("multiUpload:clearFiles",function(e){h.getFlash().clearFiles()});c(h).bind("multiUpload:uploadFile",function(e,j){var f=document.location.href.replace(/\/[^\/]+$/g,"/");h.getFlash().uploadFile(j.id,{upload_url:f+h.settings.upload_url+"&path="+escape(h.settings.path)+"&name="+escape(j.name),chunk_size:h.settings.chunk_size,file_field:"file0",post_args:{name0:j.name}})});c(h).bind("multiUpload:flashUploadChunkComplete",function(f,e){var k=h.getFile(e.id),l;l={file:k,chunk:e.chunk,chunks:e.chunks,response:e.text};if(!k.status){c(h).trigger("multiUpload:chunkUploaded",[l])}if(l.cancel){k.status="failed";h.getFlash().cancelUpload()}})}})}})(jQuery);