Swiff.Uploader=new Class({Extends:Swiff,Implements:Events,options:{path:"swiff.uploader.swf",multiple:true,queued:true,typeFilter:null,url:null,method:"post",data:null,fieldName:"Filedata",target:null,height:"100%",width:"100%",callBacks:null},initialize:function(E){if(Browser.Plugins.Flash.version<9){return false}this.setOptions(E);this.loaded=false;var B=this.options.callBacks||this;if(B.onLoad){this.addEvent("onLoad",B.onLoad)}if(!B.onBrowse){B.onBrowse=function(){return this.options.typeFilter}}var D={},C=this;["onBrowse","onSelect","onAllSelect","onCancel","onBeforeOpen","onOpen","onProgress","onComplete","onError","onAllComplete"].each(function(G){var H=B[G]||$empty;D[G]=function(){C.fireEvent(G,arguments,10);return H.apply(C,arguments)}});D.onLoad=this.load.create({delay:10,bind:this});this.options.callBacks=D;var F=this.options.path;if(!F.contains("?")){F+="?nocache="+$time()}this.parent(F);var A=window.getScroll();this.box=new Element("div",{styles:{position:"absolute",visibility:"visible",zIndex:9999,overflow:"hidden",height:15,width:15,top:A.y,left:A.x}});this.inject(this.box);this.box.inject($(this.options.container)||document.body);return this},load:function(){this.remote("register",this.instance,this.options.multiple,this.options.queued);this.fireEvent("onLoad");this.target=$(this.options.target);if(this.target){this.reposition();window.addEvent("resize",this.reposition.bind(this))}this.loaded=true},reposition:function(){if(this.target){var A=this.target.getCoordinates(this.box.getOffsetParent());this.box.setStyles(A)}},browse:function(A){if(this.loaded){this.options.typeFilter=$pick(A,this.options.typeFilter);return this.remote("browse")}else{return false}},upload:function(A){if(this.loaded){var B=this.options;A=$extend({data:B.data,url:B.url,method:B.method,fieldName:B.fieldName},A);if($type(A.data)=="element"){A.data=$(A.data).toQueryString()}return this.remote("upload",A)}else{return false}},removeFile:function(A){if(A){A={name:A.name,size:A.size}}return this.remote("removeFile",A)},getFileList:function(){return this.remote("getFileList")}});