/**
 * uiUpload: unobtrusive file uploads using Flash and jQuery.
 * Largely based on SWFUpload <http://profandesign.se/swfupload/>
 *
 * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is
 * released under the MIT License.
 *
 * uiUpload is (c) 2007 Gilles van den Hoven (http://webunity.nl) and is dual
 * licensed under the MIT and GPL licenses.
 *
 * Documentation:
 * Please refer to the wiki on <http://docs.jquery.com> for up to date
 * documentation and Frequently Asked Questions.
 *
 * Licensing information:
 * MIT license <http://www.opensource.org/licenses/mit-license.php>
 * GPL license <http://www.opensource.org/licenses/gpl-license.php>
 */
(function($){$.ui=$.ui||{};$.ui.uploader={locker:new Array(),callback:function(cType,movieID,arg1,arg2,arg3){var uploader=$.ui.uploader.locker[movieID];var cb=uploader.callback[cType];if($.isFunction(cb)){var o={event:cType,options:uploader};if((cType=='UploaderInitialized')||(cType=='dialogPostShow'))o.success=arg1;else if(cType=='fileErrorHTTP')o.errorCode=arg3;else if(cType=='fileErrorSecurity')o.errorString=arg3;if(typeof arg1=='object')o.file=arg1;if(typeof arg2=='object')o.progress=arg2;cb(o)}},formatSize:function(b){if(b<1048576)return Math.ceil(b/1024)+"kb";else return(Math.round((b/1048576)*100)/100)+"mb"},formatTime:function(i){var t,s,m,h;s=Math.round(i%60);m=Math.round((i/60)%60);h=Math.round(i/3600);t='';if(h>0)t+=((h<10)?'0'+h:h)+':';t+=((m<10)?'0'+m:m)+':';t+=((s<10)?'0'+s:s);return t},build:function(o){this.options={container:'flash',name:'uploader'+($.ui.uploader.locker.length+1),fileFilters:['All files (*.*)|*.*'],maxFileSize:61440,maxQueueCount:-1,maxQueueSize:102400,backendScript:'',movie:'ui.uploader.swf',version:'8.0.0',width:'1',height:'1',wmode:'transparent',menu:'false',installer:'expressInstall.swf',callback:{UploaderInitialized:'',dialogPreShow:'',dialogPostShow:'',queueEmpty:'',queueErrorCount:'',queueErrorSize:'',queueStarted:'',queueCancelled:'',queueCompleted:'',fileAdded:'',fileRemoved:'',fileStarted:'',fileProgress:'',fileCancelled:'',fileCompleted:'',fileErrorSize:'',fileErrorIO:'',fileErrorSecurity:'',fileErrorHTTP:''}};if(o)$.extend(this.options,o);this.options.fileFilters=this.options.fileFilters.join('||');$.ui.uploader.locker[this.options.name]=this.options;swfobject.embedSWF(this.options.movie,this.options.container,this.options.width,this.options.height,this.options.version,this.options.installer,{movieID:this.options.name,backendScript:escape(this.options.backendScript),fileFilters:escape(this.options.fileFilters),maxFilesize:this.options.maxFileSize,maxQueueCount:this.options.maxQueueCount,maxQueueSize:this.options.maxQueueSize},{wmode:this.options.wmode,menu:this.options.menu},{id:this.options.name});return this}};$.fn.uploader=function(o){return new $.ui.uploader.build(o)}})($);