var a,swfobject=function(){function b(){if(!E){try{var d=n.getElementsByTagName("body")[0].appendChild(z("span"));d.parentNode.removeChild(d)}catch(e){return}E=true;d=L.length;for(var g=0;g<d;g++)L[g]()}}function c(d){if(E)d();else L[L.length]=d}function f(d){if(typeof u.addEventListener!=p)u.addEventListener("load",d,false);else if(typeof n.addEventListener!=p)n.addEventListener("load",d,false);else if(typeof u.attachEvent!=p)fa(u,"onload",d);else if(typeof u.onload=="function"){var e=u.onload;u.onload=
function(){e();d()}}else u.onload=d}function k(){Z?o():s()}function o(){var d=n.getElementsByTagName("body")[0],e=z(w);e.setAttribute("type",M);var g=d.appendChild(e);if(g){var h=0;(function(){if(typeof g.GetVariable!=p){var i=g.GetVariable("$version");if(i){i=i.split(" ")[1].split(",");j.pv=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]}}else if(h<10){h++;setTimeout(arguments.callee,10);return}d.removeChild(e);g=null;s()})()}else s()}function s(){var d=A.length;if(d>0)for(var e=0;e<d;e++){var g=
A[e].id,h=A[e].callbackFn,i={success:false,id:g};if(j.pv[0]>0){var l=v(g);if(l)if(N(A[e].swfVersion)&&!(j.wk&&j.wk<312)){F(g,true);if(h){i.success=true;i.ref=t(g);h(i)}}else if(A[e].expressInstall&&B()){i={};i.data=A[e].expressInstall;i.width=l.getAttribute("width")||"0";i.height=l.getAttribute("height")||"0";if(l.getAttribute("class"))i.styleclass=l.getAttribute("class");if(l.getAttribute("align"))i.align=l.getAttribute("align");var m={};l=l.getElementsByTagName("param");for(var q=l.length,r=0;r<
q;r++)if(l[r].getAttribute("name").toLowerCase()!="movie")m[l[r].getAttribute("name")]=l[r].getAttribute("value");O(i,m,g,h)}else{P(l);h&&h(i)}}else{F(g,true);if(h){if((g=t(g))&&typeof g.SetVariable!=p){i.success=true;i.ref=g}h(i)}}}}function t(d){var e=null;if((d=v(d))&&d.nodeName=="OBJECT")if(typeof d.SetVariable!=p)e=d;else if(d=d.getElementsByTagName(w)[0])e=d;return e}function B(){return!Q&&N("6.0.65")&&(j.win||j.mac)&&!(j.wk&&j.wk<312)}function O(d,e,g,h){Q=true;W=h||null;$={success:false,id:g};
var i=v(g);if(i){if(i.nodeName=="OBJECT"){I=J(i);R=null}else{I=i;R=g}d.id=aa;if(typeof d.width==p||!/%$/.test(d.width)&&parseInt(d.width,10)<310)d.width="310";if(typeof d.height==p||!/%$/.test(d.height)&&parseInt(d.height,10)<137)d.height="137";n.title=n.title.slice(0,47)+" - Flash Player Installation";h=j.ie&&j.win?"ActiveX":"PlugIn";h="MMredirectURL="+u.location.toString().replace(/&/g,"%26")+"&MMplayerType="+h+"&MMdoctitle="+n.title;if(typeof e.flashvars!=p)e.flashvars+="&"+h;else e.flashvars=
h;if(j.ie&&j.win&&i.readyState!=4){h=z("div");g+="SWFObjectNew";h.setAttribute("id",g);i.parentNode.insertBefore(h,i);i.style.display="none";(function(){i.readyState==4?i.parentNode.removeChild(i):setTimeout(arguments.callee,10)})()}G(d,e,g)}}function P(d){if(j.ie&&j.win&&d.readyState!=4){var e=z("div");d.parentNode.insertBefore(e,d);e.parentNode.replaceChild(J(d),e);d.style.display="none";(function(){d.readyState==4?d.parentNode.removeChild(d):setTimeout(arguments.callee,10)})()}else d.parentNode.replaceChild(J(d),
d)}function J(d){var e=z("div");if(j.win&&j.ie)e.innerHTML=d.innerHTML;else if(d=d.getElementsByTagName(w)[0])if(d=d.childNodes)for(var g=d.length,h=0;h<g;h++)!(d[h].nodeType==1&&d[h].nodeName=="PARAM")&&d[h].nodeType!=8&&e.appendChild(d[h].cloneNode(true));return e}function G(d,e,g){var h,i=v(g);if(j.wk&&j.wk<312)return h;if(i){if(typeof d.id==p)d.id=g;if(j.ie&&j.win){var l="";for(var m in d)if(d[m]!=Object.prototype[m])if(m.toLowerCase()=="data")e.movie=d[m];else if(m.toLowerCase()=="styleclass")l+=
' class="'+d[m]+'"';else if(m.toLowerCase()!="classid")l+=" "+m+'="'+d[m]+'"';m="";for(var q in e)if(e[q]!=Object.prototype[q])m+='<param name="'+q+'" value="'+e[q]+'" />';i.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+l+">"+m+"</object>";S[S.length]=d.id;h=v(d.id)}else{q=z(w);q.setAttribute("type",M);for(l in d)if(d[l]!=Object.prototype[l])if(l.toLowerCase()=="styleclass")q.setAttribute("class",d[l]);else l.toLowerCase()!="classid"&&q.setAttribute(l,d[l]);for(var r in e)e[r]!=
Object.prototype[r]&&r.toLowerCase()!="movie"&&X(q,r,e[r]);i.parentNode.replaceChild(q,i);h=q}}return h}function X(d,e,g){var h=z("param");h.setAttribute("name",e);h.setAttribute("value",g);d.appendChild(h)}function ba(d){var e=v(d);if(e&&e.nodeName=="OBJECT")if(j.ie&&j.win){e.style.display="none";(function(){e.readyState==4?ga(d):setTimeout(arguments.callee,10)})()}else e.parentNode.removeChild(e)}function ga(d){if(d=v(d)){for(var e in d)if(typeof d[e]=="function")d[e]=null;d.parentNode.removeChild(d)}}
function v(d){var e=null;try{e=n.getElementById(d)}catch(g){}return e}function z(d){return n.createElement(d)}function fa(d,e,g){d.attachEvent(e,g);H[H.length]=[d,e,g]}function N(d){var e=j.pv;d=d.split(".");d[0]=parseInt(d[0],10);d[1]=parseInt(d[1],10)||0;d[2]=parseInt(d[2],10)||0;return e[0]>d[0]||e[0]==d[0]&&e[1]>d[1]||e[0]==d[0]&&e[1]==d[1]&&e[2]>=d[2]?true:false}function ca(d,e,g,h){if(!(j.ie&&j.mac)){var i=n.getElementsByTagName("head")[0];if(i){g=g&&typeof g=="string"?g:"screen";if(h)Y=x=null;
if(!x||Y!=g){h=z("style");h.setAttribute("type","text/css");h.setAttribute("media",g);x=i.appendChild(h);if(j.ie&&j.win&&typeof n.styleSheets!=p&&n.styleSheets.length>0)x=n.styleSheets[n.styleSheets.length-1];Y=g}if(j.ie&&j.win)x&&typeof x.addRule==w&&x.addRule(d,e);else x&&typeof n.createTextNode!=p&&x.appendChild(n.createTextNode(d+" {"+e+"}"))}}}function F(d,e){if(da){e=e?"visible":"hidden";if(E&&v(d))v(d).style.visibility=e;else ca("#"+d,"visibility:"+e)}}function ea(d){return/[\"<>.;]/.exec(d)!=
null&&typeof encodeURIComponent!=p?encodeURIComponent(d):d}var p="undefined",w="object",M="application/x-shockwave-flash",aa="SWFObjectExprInst",u=window,n=document,C=navigator,Z=false,L=[k],A=[],S=[],H=[],I,R,W,$,E=false,Q=false,x,Y,da=true,j=function(){var d=typeof n.getElementById!=p&&typeof n.getElementsByTagName!=p&&typeof n.createElement!=p,e=C.userAgent.toLowerCase(),g=C.platform.toLowerCase(),h=g?/win/.test(g):/win/.test(e);g=g?/mac/.test(g):/mac/.test(e);e=/webkit/.test(e)?parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,
"$1")):false;var i=!+"\u000b1",l=[0,0,0],m=null;if(typeof C.plugins!=p&&typeof C.plugins["Shockwave Flash"]==w){if((m=C.plugins["Shockwave Flash"].description)&&!(typeof C.mimeTypes!=p&&C.mimeTypes[M]&&!C.mimeTypes[M].enabledPlugin)){Z=true;i=false;m=m.replace(/^.*\s+(\S+\s+\S+$)/,"$1");l[0]=parseInt(m.replace(/^(.*)\..*$/,"$1"),10);l[1]=parseInt(m.replace(/^.*\.(.*)\s.*$/,"$1"),10);l[2]=/[a-zA-Z]/.test(m)?parseInt(m.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof u.ActiveXObject!=p)try{var q=
new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(q)if(m=q.GetVariable("$version")){i=true;m=m.split(" ")[1].split(",");l=[parseInt(m[0],10),parseInt(m[1],10),parseInt(m[2],10)]}}catch(r){}return{w3:d,pv:l,wk:e,ie:i,win:h,mac:g}}();(function(){if(j.w3){if(typeof n.readyState!=p&&n.readyState=="complete"||typeof n.readyState==p&&(n.getElementsByTagName("body")[0]||n.body))b();if(!E){typeof n.addEventListener!=p&&n.addEventListener("DOMContentLoaded",b,false);if(j.ie&&j.win){n.attachEvent("onreadystatechange",
function(){if(n.readyState=="complete"){n.detachEvent("onreadystatechange",arguments.callee);b()}});u==top&&function(){if(!E){try{n.documentElement.doScroll("left")}catch(d){setTimeout(arguments.callee,0);return}b()}}()}j.wk&&function(){E||(/loaded|complete/.test(n.readyState)?b():setTimeout(arguments.callee,0))}();f(b)}}})();(function(){j.ie&&j.win&&window.attachEvent("onunload",function(){for(var d=H.length,e=0;e<d;e++)H[e][0].detachEvent(H[e][1],H[e][2]);d=S.length;for(e=0;e<d;e++)ba(S[e]);for(var g in j)j[g]=
null;j=null;for(var h in swfobject)swfobject[h]=null;swfobject=null})})();return{registerObject:function(d,e,g,h){if(j.w3&&d&&e){var i={};i.id=d;i.swfVersion=e;i.expressInstall=g;i.callbackFn=h;A[A.length]=i;F(d,false)}else h&&h({success:false,id:d})},getObjectById:function(d){if(j.w3)return t(d)},embedSWF:function(d,e,g,h,i,l,m,q,r,K){var T={success:false,id:e};if(j.w3&&!(j.wk&&j.wk<312)&&d&&e&&g&&h&&i){F(e,false);c(function(){g+="";h+="";var D={};if(r&&typeof r===w)for(var y in r)D[y]=r[y];D.data=
d;D.width=g;D.height=h;y={};if(q&&typeof q===w)for(var U in q)y[U]=q[U];if(m&&typeof m===w)for(var V in m)if(typeof y.flashvars!=p)y.flashvars+="&"+V+"="+m[V];else y.flashvars=V+"="+m[V];if(N(i)){U=G(D,y,e);D.id==e&&F(e,true);T.success=true;T.ref=U}else if(l&&B()){D.data=l;O(D,y,e,K);return}else F(e,true);K&&K(T)})}else K&&K(T)},switchOffAutoHideShow:function(){da=false},ua:j,getFlashPlayerVersion:function(){return{major:j.pv[0],minor:j.pv[1],release:j.pv[2]}},hasFlashPlayerVersion:N,createSWF:function(d,
e,g){if(j.w3)return G(d,e,g)},showExpressInstall:function(d,e,g,h){j.w3&&B()&&O(d,e,g,h)},removeSWF:function(d){j.w3&&ba(d)},createCSS:function(d,e,g,h){j.w3&&ca(d,e,g,h)},addDomLoadEvent:c,addLoadEvent:f,getQueryParamValue:function(d){var e=n.location.search||n.location.hash;if(e){if(/\?/.test(e))e=e.split("?")[1];if(d==null)return ea(e);e=e.split("&");for(var g=0;g<e.length;g++)if(e[g].substring(0,e[g].indexOf("="))==d)return ea(e[g].substring(e[g].indexOf("=")+1))}return""},expressInstallCallback:function(){if(Q){var d=
v(aa);if(d&&I){d.parentNode.replaceChild(I,d);if(R){F(R,true);if(j.ie&&j.win)I.style.display="block"}W&&W($)}Q=false}}}}(),SWFUpload;if(SWFUpload==undefined)SWFUpload=function(b){this.initSWFUpload(b)};
SWFUpload.prototype.initSWFUpload=function(b){try{this.customSettings={};this.settings=b;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(c){delete SWFUpload.instances[this.movieName];throw c;}};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(b){if(typeof b!=="string"||b.match(/^https?:\/\//i)||b.match(/^\//))return b;var c=window.location.pathname.lastIndexOf("/");path=c<=0?"/":window.location.pathname.substr(0,c)+"/";return path+b};a=SWFUpload.prototype;
a.initSettings=function(){this.ensureDefault=function(b,c){this.settings[b]=this.settings[b]==undefined?c:this.settings[b]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);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",true);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",false);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",false);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;if(this.settings.prevent_swf_caching)this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+(new Date).getTime();if(!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};
a.loadFlash=function(){var b,c;if(document.getElementById(this.movieName)!==null)throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";b=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(b==undefined)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;c=document.createElement("div");c.innerHTML=this.getFlashHTML();b.parentNode.replaceChild(c.firstChild,b);if(window[this.movieName]==undefined)window[this.movieName]=
this.getMovieElement()};
a.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("")};
a.getFlashVars=function(){var b=this.buildParamString(),c=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(c),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",
encodeURIComponent(b),"&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("")};a.getMovieElement=function(){if(this.movieElement==undefined)this.movieElement=document.getElementById(this.movieName);if(this.movieElement===null)throw"Could not find Flash element";return this.movieElement};
a.buildParamString=function(){var b=this.settings.post_params,c=[];if(typeof b==="object")for(var f in b)b.hasOwnProperty(f)&&c.push(encodeURIComponent(f.toString())+"="+encodeURIComponent(b[f].toString()));return c.join("&amp;")};
a.destroy=function(){try{this.cancelUpload(null,false);var b=null;if((b=this.getMovieElement())&&typeof b.CallFunction==="unknown"){for(var c in b)try{if(typeof b[c]==="function")b[c]=null}catch(f){}try{b.parentNode.removeChild(b)}catch(k){}}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 true}catch(o){return false}};
a.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:  ",
(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n\tfile_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n\tfile_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n\tfile_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n\tupload_start_handler assigned:      ",(typeof this.settings.upload_start_handler===
"function").toString(),"\n\tupload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n\tupload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n\tupload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n\tupload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n\tdebug_handler assigned:             ",
(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};a.addSetting=function(b,c,f){return c==undefined?(this.settings[b]=f):(this.settings[b]=c)};a.getSetting=function(b){if(this.settings[b]!=undefined)return this.settings[b];return""};
a.callFlash=function(b,c){c=c||[];var f=this.getMovieElement(),k,o;try{o=f.CallFunction('<invoke name="'+b+'" returntype="javascript">'+__flash__argumentsToXML(c,0)+"</invoke>");k=eval(o)}catch(s){throw"Call to "+b+" failed";}if(k!=undefined&&typeof k.post==="object")k=this.unescapeFilePostParams(k);return k};a.selectFile=function(){this.callFlash("SelectFile")};a.selectFiles=function(){this.callFlash("SelectFiles")};a.startUpload=function(b){this.callFlash("StartUpload",[b])};
a.cancelUpload=function(b,c){if(c!==false)c=true;this.callFlash("CancelUpload",[b,c])};a.stopUpload=function(){this.callFlash("StopUpload")};a.getStats=function(){return this.callFlash("GetStats")};a.setStats=function(b){this.callFlash("SetStats",[b])};a.getFile=function(b){return typeof b==="number"?this.callFlash("GetFileByIndex",[b]):this.callFlash("GetFile",[b])};a.addFileParam=function(b,c,f){return this.callFlash("AddFileParam",[b,c,f])};
a.removeFileParam=function(b,c){this.callFlash("RemoveFileParam",[b,c])};a.setUploadURL=function(b){this.settings.upload_url=b.toString();this.callFlash("SetUploadURL",[b])};a.setPostParams=function(b){this.settings.post_params=b;this.callFlash("SetPostParams",[b])};a.addPostParam=function(b,c){this.settings.post_params[b]=c;this.callFlash("SetPostParams",[this.settings.post_params])};a.removePostParam=function(b){delete this.settings.post_params[b];this.callFlash("SetPostParams",[this.settings.post_params])};
a.setFileTypes=function(b,c){this.settings.file_types=b;this.settings.file_types_description=c;this.callFlash("SetFileTypes",[b,c])};a.setFileSizeLimit=function(b){this.settings.file_size_limit=b;this.callFlash("SetFileSizeLimit",[b])};a.setFileUploadLimit=function(b){this.settings.file_upload_limit=b;this.callFlash("SetFileUploadLimit",[b])};a.setFileQueueLimit=function(b){this.settings.file_queue_limit=b;this.callFlash("SetFileQueueLimit",[b])};
a.setFilePostName=function(b){this.settings.file_post_name=b;this.callFlash("SetFilePostName",[b])};a.setUseQueryString=function(b){this.settings.use_query_string=b;this.callFlash("SetUseQueryString",[b])};a.setRequeueOnError=function(b){this.settings.requeue_on_error=b;this.callFlash("SetRequeueOnError",[b])};a.setHTTPSuccess=function(b){if(typeof b==="string")b=b.replace(" ","").split(",");this.settings.http_success=b;this.callFlash("SetHTTPSuccess",[b])};
a.setAssumeSuccessTimeout=function(b){this.settings.assume_success_timeout=b;this.callFlash("SetAssumeSuccessTimeout",[b])};a.setDebugEnabled=function(b){this.settings.debug_enabled=b;this.callFlash("SetDebugEnabled",[b])};a.setButtonImageURL=function(b){if(b==undefined)b="";this.settings.button_image_url=b;this.callFlash("SetButtonImageURL",[b])};
a.setButtonDimensions=function(b,c){this.settings.button_width=b;this.settings.button_height=c;var f=this.getMovieElement();if(f!=undefined){f.style.width=b+"px";f.style.height=c+"px"}this.callFlash("SetButtonDimensions",[b,c])};a.setButtonText=function(b){this.settings.button_text=b;this.callFlash("SetButtonText",[b])};a.setButtonTextPadding=function(b,c){this.settings.button_text_top_padding=c;this.settings.button_text_left_padding=b;this.callFlash("SetButtonTextPadding",[b,c])};
a.setButtonTextStyle=function(b){this.settings.button_text_style=b;this.callFlash("SetButtonTextStyle",[b])};a.setButtonDisabled=function(b){this.settings.button_disabled=b;this.callFlash("SetButtonDisabled",[b])};a.setButtonAction=function(b){this.settings.button_action=b;this.callFlash("SetButtonAction",[b])};a.setButtonCursor=function(b){this.settings.button_cursor=b;this.callFlash("SetButtonCursor",[b])};
a.queueEvent=function(b,c){if(c==undefined)c=[];else c instanceof Array||(c=[c]);var f=this;if(typeof this.settings[b]==="function"){this.eventQueue.push(function(){this.settings[b].apply(this,c)});setTimeout(function(){f.executeNextEvent()},0)}else if(this.settings[b]!==null)throw"Event handler "+b+" is unknown or is not a function";};a.executeNextEvent=function(){var b=this.eventQueue?this.eventQueue.shift():null;typeof b==="function"&&b.apply(this)};
a.unescapeFilePostParams=function(b){var c=/[$]([0-9a-f]{4})/i,f={},k;if(b!=undefined){for(var o in b.post)if(b.post.hasOwnProperty(o)){k=o;for(var s;(s=c.exec(k))!==null;)k=k.replace(s[0],String.fromCharCode(parseInt("0x"+s[1],16)));f[k]=b.post[o]}b.post=f}return b};a.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(b){return false}};a.flashReady=function(){var b=this.getMovieElement();if(b){this.cleanUp(b);this.queueEvent("swfupload_loaded_handler")}else this.debug("Flash called back ready but the flash movie can't be found.")};
a.cleanUp=function(b){try{if(this.movieElement&&typeof b.CallFunction==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var c in b)try{if(typeof b[c]==="function")b[c]=null}catch(f){}}}catch(k){}window.__flash__removeCallback=function(o,s){try{if(o)o[s]=null}catch(t){}}};a.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};
a.fileQueued=function(b){b=this.unescapeFilePostParams(b);this.queueEvent("file_queued_handler",b)};a.fileQueueError=function(b,c,f){b=this.unescapeFilePostParams(b);this.queueEvent("file_queue_error_handler",[b,c,f])};a.fileDialogComplete=function(b,c,f){this.queueEvent("file_dialog_complete_handler",[b,c,f])};a.uploadStart=function(b){b=this.unescapeFilePostParams(b);this.queueEvent("return_upload_start_handler",b)};
a.returnUploadStart=function(b){var c;if(typeof this.settings.upload_start_handler==="function"){b=this.unescapeFilePostParams(b);c=this.settings.upload_start_handler.call(this,b)}else if(this.settings.upload_start_handler!=undefined)throw"upload_start_handler must be a function";if(c===undefined)c=true;c=!!c;this.callFlash("ReturnUploadStart",[c])};a.uploadProgress=function(b,c,f){b=this.unescapeFilePostParams(b);this.queueEvent("upload_progress_handler",[b,c,f])};
a.uploadError=function(b,c,f){b=this.unescapeFilePostParams(b);this.queueEvent("upload_error_handler",[b,c,f])};a.uploadSuccess=function(b,c,f){b=this.unescapeFilePostParams(b);this.queueEvent("upload_success_handler",[b,c,f])};a.uploadComplete=function(b){b=this.unescapeFilePostParams(b);this.queueEvent("upload_complete_handler",b)};a.debug=function(b){this.queueEvent("debug_handler",b)};
a.debugMessage=function(b){if(this.settings.debug){var c=[];if(typeof b==="object"&&typeof b.name==="string"&&typeof b.message==="string"){for(var f in b)b.hasOwnProperty(f)&&c.push(f+": "+b[f]);b=c.join("\n")||"";c=b.split("\n");b="EXCEPTION: "+c.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(b)}else SWFUpload.Console.writeLine(b)}};SWFUpload.Console={};
SWFUpload.Console.writeLine=function(b){var c,f;try{c=document.getElementById("SWFUpload_Console");if(!c){f=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(f);c=document.createElement("textarea");c.id="SWFUpload_Console";c.style.fontFamily="monospace";c.setAttribute("wrap","off");c.wrap="off";c.style.overflow="auto";c.style.width="700px";c.style.height="350px";c.style.margin="5px";f.appendChild(c)}c.value+=b+"\n";c.scrollTop=c.scrollHeight-c.clientHeight}catch(k){alert("Exception: "+
k.name+" Message: "+k.message)}};
(function(b){var c=["swfupload_loaded_handler","file_queued_handler","file_queue_error_handler","file_dialog_start_handler","file_dialog_complete_handler","upload_start_handler","upload_progress_handler","upload_error_handler","upload_success_handler","upload_complete_handler","queue_complete_handler"],f=[];b.fn.swfupload=function(){var k=b.makeArray(arguments);return this.each(function(){var o;if(k.length==1&&typeof k[0]=="object"){o=b(this).data("__swfu");if(!o){var s=k[0],t=b(this);o=[];b.merge(o,
c);b.merge(o,f);b.each(o,function(O,P){var J=P.replace(/_handler$/,"").replace(/_([a-z])/g,function(G,X){return X.toUpperCase()});s[P]=function(){var G=b.Event(J);t.trigger(G,b.makeArray(arguments));return!G.isDefaultPrevented()}});b(this).data("__swfu",new SWFUpload(s))}}else if(k.length>0&&typeof k[0]=="string"){var B=k.shift();(o=b(this).data("__swfu"))&&o[B]&&o[B].apply(o,k)}})};b.swfupload={additionalHandlers:function(){if(arguments.length===0)return f.slice();else b(arguments).each(function(k,
o){b.merge(f,b.makeArray(o))})},defaultHandlers:function(){return c.slice()},getInstance:function(k){return b(k).data("__swfu")}}})(jQuery);function PandaUploader(){}PandaUploader.getHttpStatusText=function(b){return{400:"Bad Request",401:"Unauthorized",404:"Not Found",412:"Precondition Failed",415:"Unsupported Media Type",500:"Internal Server Error"}[b*1]};
PandaUploader.getPandaError=function(b){return{400:"BadRequest",401:"NotAuthorized",404:"RecordNotFound",412:"CannotDelete",415:"FormatNotRecognised",500:"PandaError"}[b*1]};PandaUploader.supportFileAPI=function(){var b=document.createElement("INPUT");b.type="file";return"files"in b};PandaUploader.supportAjaxUploadProgressEvents=function(){var b=PandaUploader.createXHRObject();return!!(b&&"upload"in b&&"onprogress"in b.upload)};
PandaUploader.supportCORS=function(){return typeof XDomainRequest!="undefined"?true:typeof XMLHttpRequest!="undefined"?"withCredentials"in new XMLHttpRequest:null};PandaUploader.supportHTML5Widget=function(){return PandaUploader.supportFileAPI()&&PandaUploader.supportAjaxUploadProgressEvents()&&PandaUploader.supportCORS()};
PandaUploader.createXHRObject=function(){if(typeof this.XMLHttpFactories=="undefined")this.XMLHttpFactories=[function(){return new XDomainRequest},function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];for(var b=null,c=0;c<this.XMLHttpFactories.length;c++){try{b=this.XMLHttpFactories[c]()}catch(f){continue}break}return b};
PandaUploader.bind=function(b,c){return function(){var f=b[c];if(f)return f.apply(b,arguments)}};PandaUploader.alert=function(b){return alert(b)};PandaUploader.parseJSON=function(b){return jQuery&&jQuery.parseJSON?jQuery.parseJSON(b):eval("("+b+")")};PandaUploader.toJSON=function(b){function c(k){return k.replace(new RegExp('"',"g"),'\\"')}var f=[];jQuery.each(b,function(k,o){f.push('"'+c(k)+'":"'+c(o)+'"')});return"{"+f.join(",")+"}"};PandaUploader.BaseWidget=function(){};
PandaUploader.BaseWidget.prototype={init:function(b,c,f){this.query=b;this.signed_params=c;this.options=f;this.upload_strategy=this.options.upload_strategy;this.upload_strategy.init()},triggerEvent:function(b,c){var f=this.upload_strategy[b];if(f){c||(c=[]);f.apply(this.upload_strategy,c)}this.triggerUserEvent(b,c)},triggerUserEvent:function(b,c){(b=this.options[b])&&b.apply(window,c)},boundHandler:function(b){var c=PandaUploader.bind(this,"triggerEvent");return function(){c(b,arguments)}},getSignedParams:function(){return this.signed_params.call?
this.signed_params():this.signed_params},start:function(){throw"Unimplemented method start()";},disable:function(){throw"Unimplemented method disable()";},enable:function(){throw"Unimplemented method enable()";},cancel:function(){throw"Unimplemented method cancel()";},setValue:function(){throw"Unimplemented method setValue()";},getValue:function(){throw"Unimplemented method getValue()";}};
PandaUploader.SmartWidget=function(b,c){return PandaUploader.supportHTML5Widget()?new PandaUploader.HTML5Widget(b):new PandaUploader.FlashWidget(c)};PandaUploader.FlashWidget=function(b){b=typeof b=="undefined"?{}:b;this.add_filename_field=true;if(typeof b.add_filename_field!="undefined")this.add_filename_field=b.add_filename_field;this.swfupload_options=b===undefined?{}:b};PandaUploader.FlashWidget.prototype=new PandaUploader.BaseWidget;a=PandaUploader.FlashWidget.prototype;a.constructor=PandaUploader.FlashWidget;
a.init=function(){PandaUploader.BaseWidget.prototype.init.apply(this,arguments);var b=this.query.attr("id"),c=b+"_pandauploader-flashwidget-placeholder";this.filename_field_id=b+"_orig-filename";this.query.after('<span id="'+c+'"></span>');this.add_filename_field&&jQuery("#"+c).after('<input type="text" style="position: relative; top: -8px; margin-left: .5em;" disabled="disabled" id="'+this.filename_field_id+'" />');this.swfupload=this.query.swfupload(jQuery.extend({upload_url:this.options.api_url+
"/videos.json",file_size_limit:0,file_types:this.allowedFileTypes(),file_types_description:"All Files",file_upload_limit:0,flash_url:this.options.uploader_dir+"/swfupload.swf",button_image_url:this.options.uploader_dir+"/choose_file_button.png",button_width:87,button_height:27,button_placeholder_id:c,file_post_name:"file",debug:false},this.swfupload_options));this.swfupload.bind("swfuploadLoaded",this.boundHandler("onwidgetload"));this.swfupload.bind("fileQueued",PandaUploader.bind(this,"fileQueued"));
this.swfupload.bind("uploadStart",PandaUploader.bind(this,"uploadStart"));this.swfupload.bind("uploadProgress",PandaUploader.bind(this,"uploadProgress"));this.swfupload.bind("uploadSuccess",PandaUploader.bind(this,"uploadSuccess"));this.swfupload.bind("uploadError",PandaUploader.bind(this,"uploadError"))};a.fileQueued=function(b,c){this.file=c;jQuery("#"+this.filename_field_id).val(c.name);this.triggerEvent("onchange")};
a.uploadStart=function(){this.swfupload.data("__swfu").setPostParams(this.getSignedParams());this.triggerEvent("onloadstart")};a.uploadProgress=function(b,c,f,k){b.loaded=f;b.total=k;this.triggerEvent("onprogress",[b])};a.uploadSuccess=function(b,c,f){this.setValue(PandaUploader.parseJSON(f).id);b={target:{status:"200",responseText:f}};this.triggerEvent("onreadystatechange",[b]);this.triggerEvent("onsuccess",[b])};
a.uploadError=function(b,c,f,k){function o(){var t=PandaUploader.getHttpStatusText(k),B=PandaUploader.getPandaError(k);return{target:{status:k,statusText:t,responseText:'{"message":"'+t+'",error:"'+B+'"}'}}}function s(t){return{name:t.name,size:t.size,type:t.type}}this.triggerEvent("onerror",[o(b,k),s(c)])};a.getFile=function(){return this.file};a.start=function(){return this.swfupload.swfupload("startUpload")};a.disable=function(){return this.swfupload.swfupload("setButtonDisabled",true)};
a.enable=function(){return this.swfupload.swfupload("setButtonDisabled",false)};a.abort=function(){this.swfupload.swfupload("cancelUpload","",false);this.triggerEvent("onabort")};a.setValue=function(b){return this.swfupload.val(b)};a.getValue=function(){return this.swfupload.val()};a.allowedFileTypes=function(){if(!this.options.allowed_extensions)return"*.*";return jQuery.map(this.options.allowed_extensions,function(b){return"*."+b}).join(";")};PandaUploader.HTML5Widget=function(){};
PandaUploader.HTML5Widget.prototype=new PandaUploader.BaseWidget;a=PandaUploader.HTML5Widget.prototype;a.constructor=PandaUploader.HTML5Widget;
a.init=function(){PandaUploader.BaseWidget.prototype.init.apply(this,arguments);this.xhr=PandaUploader.createXHRObject();this.xhr.upload.addEventListener("loadstart",this.boundHandler("onloadstart"),false);this.xhr.upload.addEventListener("progress",this.boundHandler("onprogress"),false);this.xhr.upload.addEventListener("load",this.boundHandler("onload"),false);this.xhr.upload.addEventListener("error",PandaUploader.bind(this,"onerror"),false);this.xhr.upload.addEventListener("abort",this.boundHandler("onabort"),
false);this.createField();this.triggerEvent("onwidgetload")};
a.start=function(){var b=this.getFile(),c=PandaUploader.toJSON(this.getSignedParams());this.xhr.open("POST",this.options.api_url+"/videos.json",true);this.xhr.setRequestHeader("Cache-Control","no-cache");this.xhr.setRequestHeader("Content-Type","application/octet-stream");this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xhr.setRequestHeader("X-File-Name",b.name||b.fileName);this.xhr.setRequestHeader("X-Query-Params",c);this.bindRSCEvent();this.errorCalled=false;"name"in b?this.xhr.send(b):
this.xhr.sendAsBinary(b.getAsBinary())};a.abort=function(){this.xhr.abort()};a.getFile=function(){return jQuery(this.getField()).get(0).files[0]};a.setValue=function(b){return this.query.val(b)};a.disable=function(){jQuery(this.getField()).attr("disabled",true)};a.enable=function(){jQuery(this.getField()).removeAttr("disabled")};a.createField=function(){this.query.after('<input type="file" />');jQuery(this.getField()).change(PandaUploader.bind(this,"onchange"))};a.getField=function(){return this.query.next().get(0)};
a.onerror=function(b){this.notifyError(b)};a.notifyError=function(b){if(!this.errorCalled){this.errorCalled=true;this.triggerEvent("onerror",[b,this.getFile()])}};a.onreadystatechange=function(b){this.triggerEvent("onreadystatechange",arguments);var c=null;try{c=b.target.status}catch(f){this.bindRSCEvent();return}if(c=="200"&&b.target.responseText){this.setValue(PandaUploader.parseJSON(b.target.responseText).id);this.triggerEvent("onsuccess",[b])}else{c!="200"&&this.notifyError(b);this.bindRSCEvent()}};
a.bindRSCEvent=function(){jQuery(this.xhr).one("readystatechange",PandaUploader.bind(this,"onreadystatechange"))};a.onchange=function(){if(this.validateFileExtension()&&this.validateFileSize())this.triggerEvent("onchange");else{this.query.next("[type=file]").remove();this.createField()}};
a.validateFileExtension=function(){var b=false,c=this;jQuery.each(this.options.allowed_extensions,function(f,k){if((new RegExp("\\."+k+"$")).test(c.getFile().fileName))b=true});b||PandaUploader.alert("You did not select a video file. Please select a valid file.");return b};a.validateFileSize=function(){var b=(this.getFile().size||this.getFile().fileSize)<5368709120;b||PandaUploader.alert("The file you are trying to upload is too large. The limit is 5GB");return b};PandaUploader.BaseStrategy=function(){};
PandaUploader.BaseStrategy.prototype={setUploadWidget:function(b){this.widget=b},init:function(){return true},onwidgetload:function(){},onchange:function(){},onloadstart:function(){},onprogress:function(b){try{this.widget.options.progress_handler&&this.widget.options.progress_handler.setProgress(this.widget.getFile(),b.loaded,b.total)}catch(c){}},onload:function(){},onerror:function(){},onabort:function(){}};
PandaUploader.UploadOnSubmit=function(){var b=arguments[0];this.disable_submit_button=true;if(b)if(typeof b.disable_submit_button!="undefined")this.disable_submit_button=b.disable_submit_button;PandaUploader.BaseStrategy.apply(this,arguments)};PandaUploader.UploadOnSubmit.prototype=new PandaUploader.BaseStrategy;a=PandaUploader.UploadOnSubmit.prototype;a.constructor=PandaUploader.UploadOnSubmit;
a.init=function(){var b=this.widget.query.parents("form")[0];if(!b){PandaUploader.alert("Could not find a suitable form. Please place the call to pandaUploader() after the form, or to be executed onload().");return false}if(jQuery(b).find("[name=submit], #submit").length!=0){PandaUploader.alert('An element of your video upload form is incorrect (most probably the submit button). Neither NAME nor ID can be set to "submit" on any field.');return false}return PandaUploader.BaseStrategy.prototype.init.apply(this,
arguments)};a.disableSubmitButton=function(){jQuery(this.getSubmitButton()).attr("disabled",true)};a.enableSubmitButton=function(){return jQuery(this.getSubmitButton()).removeAttr("disabled")};a.getSubmitButton=function(){return jQuery(this.getForm()).find("input[type=submit]")};a.getForm=function(){return this.widget.query.parents("form").get(0)};a.onchange=function(){this.enableSubmitButton()};
a.onwidgetload=function(){if(this.widget){var b=this.getForm();if(b){jQuery(b).submit(PandaUploader.bind(this,"onsubmit"));this.disable_submit_button&&this.disableSubmitButton()}}};a.onloadstart=function(){this.widget.disable();this.widget.options.progress_handler.reset();this.disableSubmitButton();this.widget.options.progress_handler&&this.widget.options.progress_handler.start(this.widget.getFile())};a.onsuccess=function(){this.getForm().submit()};a.onerror=function(){this.widget.options.progress_handler.reset()};
a.onabort=function(){this.widget.enable();this.widget.options.progress_handler.reset();this.widget.options.disableSubmitButton&&this.disableSubmitButton()};a.onsubmit=function(){this.widget.start();return false};PandaUploader.UploadOnSelect=function(){PandaUploader.BaseStrategy.apply(this,arguments)};PandaUploader.UploadOnSelect.prototype=new PandaUploader.BaseStrategy;a=PandaUploader.UploadOnSelect.prototype;a.constructor=PandaUploader.UploadOnSelect;a.onchange=function(){this.widget.start()};
a.onloadstart=function(){this.widget.options.progress_handler.reset();this.widget.options.progress_handler&&this.widget.options.progress_handler.start(this.widget.getFile())};a.onabort=function(){this.widget.enable();this.widget.options.progress_handler.reset()};a.onerror=function(){this.widget.options.progress_handler.reset()};
(function(){function b(c){this.options=c;this.$p=jQuery("#"+this.options.upload_progress_id);this.$p.css({display:"none",width:"250px",height:"26px",border:"1px solid #0c3c7e",background:"url("+this.options.uploader_dir+"/progress_bg.gif) repeat scroll left top"});this.fileSize=this.count=0}jQuery.fn.checkPandaUploaderOptions=function(c){if(c===undefined){PandaUploader.alert("There was an error setting up the upload form. (The upload parameters were not specified).");return false}if(this.size()==
0){PandaUploader.alert("The jQuery element is empty. Method pandaUploader() cannot be executed");return false}return true};jQuery.fn.pandaUploader=function(c,f){f=f===undefined?{}:f;if(!this.checkPandaUploaderOptions(c,f))return false;f=jQuery.extend({upload_progress_id:null,api_host:"api.pandastream.com",progress_handler:null,uploader_dir:"/panda_uploader",upload_strategy:null,widget:null,allowed_extensions:["3g2","3gp","asf","asx","avi","bdm","bsf","cpi","divx","dmsm","dream","dvdmedia","dvr-ms",
"f4v","fbr","flv","hdmov","m2p","m4v","mkv","mod","moi","mov","mp4","mpeg","mpg","mts","mxf","ogm","psh","rm","rmvb","scm","smil","srt","stx","swf","tix","trp","ts","vob","vro","wmv","wtv","xvid","yuv"]},f);f.api_url=f.api_url||"http://"+f.api_host+"/v2";if(!f.progress_handler)f.progress_handler=new b(f);var k=f.widget;k||(k=new PandaUploader.SmartWidget);if(!f.upload_strategy)f.upload_strategy=new PandaUploader.UploadOnSubmit;f.upload_strategy.setUploadWidget(k);k.init(this,c,f);(c=jQuery("#"+f.upload_cancel_button_id))&&
c.click(PandaUploader.bind(this.upload_strategy,"onCancel"));return this};b.prototype={start:function(c){this.count=0;if(this.$p.size()!=0){this.$p.find(".progress-inside").size()==0&&this.$p.append('<div class="progress-inside"></div>');this.progress=this.$p.find(".progress-inside");this.progress.css({height:"100%",backgroundImage:"url("+this.options.uploader_dir+"/progress_fg.gif)"});this.fileSize=c.size;this.setProgress(c,0,this.fileSize);this.$p.css("display","block");var f=this;this.timer=setInterval(function(){f.animateBarBg()},
20)}},setProgress:function(c,f){if(this.progress){c=Math.ceil(f*100/this.fileSize);if(c>100)c=100;jQuery(this.progress).css("width",c+"%")}},animateBarBg:function(){this.count++;var c=this.$p.css("background-position");c=c?c.split(" "):0;if(this.count==37){this.count=0;this.$p.css("background-position",c+36+"px 0px")}else this.$p.css("background-position",c-1+"px 0px")},reset:function(){clearInterval(this.timer);jQuery(this.progress).css("width","0%");this.$p.css("display","none")}}})();

