var MXI_DEBUG=!0;!function(e){function t(){var e={};return function(){(function(s,y){"use strict";var a={};function n(e,t){var i,n=[];for(var r=0;r0){c(e,function(e,t){var i=d(a(e),["array","object"])!==-1;if(e===o||n&&s[t]===o){return true}if(i&&r){e=u(e)}if(a(s[t])===a(e)&&i){l(n,r,[s[t],e])}else{s[t]=e}})}});return s}function r(e,t){for(var i in t){if({}.hasOwnProperty.call(t,i)){e[i]=t[i]}}function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__parent__=t.prototype;return e}function c(e,t){var i,n,r,o;if(e){try{i=e.length}catch(e){i=o}if(i===o||typeof i!=="number"){for(n in e){if(e.hasOwnProperty(n)){if(t(e[n],n)===false){return}}}}else{for(r=0;r>16&255;r=c>>8&255;o=c&255;if(u==64){h[d++]=String.fromCharCode(n)}else if(l==64){h[d++]=String.fromCharCode(n,r)}else{h[d++]=String.fromCharCode(n,r,o)}}while(f>18&63;a=c>>12&63;u=c>>6&63;l=c&63;h[d++]=i.charAt(s)+i.charAt(a)+i.charAt(u)+i.charAt(l)}while(f0){if(o.length==2){if(typeof o[1]==d){e[o[0]]=o[1].call(this,a)}else{e[o[0]]=o[1]}}else if(o.length==3){if(typeof o[1]===d&&!(o[1].exec&&o[1].test)){e[o[0]]=a?o[1].call(this,a,o[2]):f}else{e[o[0]]=a?a.replace(o[1],o[2]):f}}else if(o.length==4){e[o[0]]=a?o[3].call(this,a.replace(o[1],o[2])):f}}else{e[o]=a?a:f}}break}}if(!!s)break}return e},str:function(e,t){for(var i in t){if(typeof t[i]===h&&t[i].length>0){for(var n=0;nt[n]){o=1;break}}if(!i){return o}switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return o<=0;case"==":case"=":case"eq":return o===0;case"<>":case"!=":case"ne":return o!==0;case"":case"<":case"lt":return o<0;default:return null}}var i=function(){var i={define_property:function(){return false}(),create_canvas:function(){var e=document.createElement("canvas");return!!(e.getContext&&e.getContext("2d"))}(),return_response_type:function(e){try{if(n.inArray(e,["","text","document"])!==-1){return true}else if(window.XMLHttpRequest){var t=new XMLHttpRequest;t.open("get","/");if("responseType"in t){t.responseType=e;if(t.responseType!==e){return false}return true}}}catch(e){}return false},use_data_uri:function(){var e=new Image;e.onload=function(){i.use_data_uri=e.width===1&&e.height===1};setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1);return false}(),use_data_uri_over32kb:function(){return i.use_data_uri&&(o.browser!=="IE"||o.version>=9)},use_data_uri_of:function(e){return i.use_data_uri&&e<33e3||i.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)){return false}var e=document.createElement("input");e.setAttribute("type","file");return!e.disabled}};return function(e){var t=[].slice.call(arguments);t.shift();return n.typeOf(i[e])==="function"?i[e].apply(this,t):!!i[e]}}();var r=(new e).getResult();var o={can:i,uaParser:e,browser:r.browser.name,version:r.browser.version,os:r.os.name,osVersion:r.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};o.OS=o.os;if(MXI_DEBUG){o.debug={runtime:true,events:false};o.log=function(){function e(e){i.appendChild(document.createTextNode(e+"\n"))}var t=arguments[0];if(n.typeOf(t)==="string"){t=n.sprintf.apply(this,arguments)}if(window&&window.console&&window.console.log){window.console.log(t)}else if(document){var i=document.getElementById("moxie-console");if(!i){i=document.createElement("pre");i.id="moxie-console";document.body.appendChild(i)}if(n.inArray(n.typeOf(t),["object","array"])!==-1){e(t)}else{i.appendChild(document.createTextNode(t+"\n"))}}}}return o});e("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(n){function r(e,t){var i;for(i in e){if(e[i]===t){return i}}return null}return{RuntimeError:function(){var i={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};function e(e,t){this.code=e;this.name=r(i,e);this.message=this.name+(t||": RuntimeError "+this.code)}n.extend(e,i);e.prototype=Error.prototype;return e}(),OperationNotAllowedException:function(){function e(e){this.code=e;this.name="OperationNotAllowedException"}n.extend(e,{NOT_ALLOWED_ERR:1});e.prototype=Error.prototype;return e}(),ImageError:function(){var t={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};function e(e){this.code=e;this.name=r(t,e);this.message=this.name+": ImageError "+this.code}n.extend(e,t);e.prototype=Error.prototype;return e}(),FileException:function(){var t={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};function e(e){this.code=e;this.name=r(t,e);this.message=this.name+": FileException "+this.code}n.extend(e,t);e.prototype=Error.prototype;return e}(),DOMException:function(){var t={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};function e(e){this.code=e;this.name=r(t,e);this.message=this.name+": DOMException "+this.code}n.extend(e,t);e.prototype=Error.prototype;return e}(),EventException:function(){function e(e){this.code=e;this.name="EventException"}n.extend(e,{UNSPECIFIED_EVENT_TYPE_ERR:0});e.prototype=Error.prototype;return e}()}});e("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(l){var e=function(e){if(typeof e!=="string"){return e}return document.getElementById(e)};var i=function(e,t){if(!e.className){return false}var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)};var t=function(e,t){if(!i(e,t)){e.className=!e.className?t:e.className.replace(/\s+$/,"")+" "+t}};var n=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return t===" "&&i===" "?" ":""})}};var r=function(e,t){if(e.currentStyle){return e.currentStyle[t]}else if(window.getComputedStyle){return window.getComputedStyle(e,null)[t]}};var o=function(e,t){var i=0,n=0,r,o=document,s,a;e=e;t=t||o.body;function u(e){var t,i,n=0,r=0;if(e){i=e.getBoundingClientRect();t=o.compatMode==="CSS1Compat"?o.documentElement:o.body;n=i.left+t.scrollLeft;r=i.top+t.scrollTop}return{x:n,y:r}}if(e&&e.getBoundingClientRect&&l.browser==="IE"&&(!o.documentMode||o.documentMode<8)){s=u(e);a=u(t);return{x:s.x-a.x,y:s.y-a.y}}r=e;while(r&&r!=t&&r.nodeType){i+=r.offsetLeft||0;n+=r.offsetTop||0;r=r.offsetParent}r=e.parentNode;while(r&&r!=t&&r.nodeType){i-=r.scrollLeft||0;n-=r.scrollTop||0;r=r.parentNode}return{x:i,y:n}};var s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:e,hasClass:i,addClass:t,removeClass:n,getStyle:r,getPos:o,getSize:s}});e("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(l,c,f){var d={};function e(){this.uid=f.guid()}f.extend(e.prototype,{init:function(){if(!this.uid){this.uid=f.guid("uid_")}},addEventListener:function(e,t,i,n){var r=this,o;if(!this.hasOwnProperty("uid")){this.uid=f.guid("uid_")}e=f.trim(e);if(/\s/.test(e)){f.each(e.split(/\s+/),function(e){r.addEventListener(e,t,i,n)});return}e=e.toLowerCase();i=parseInt(i,10)||0;o=d[this.uid]&&d[this.uid][e]||[];o.push({fn:t,priority:i,scope:n||this});if(!d[this.uid]){d[this.uid]={}}d[this.uid][e]=o},hasEventListener:function(e){var t;if(e){e=e.toLowerCase();t=d[this.uid]&&d[this.uid][e]}else{t=d[this.uid]}return t?t:false},removeEventListener:function(e,t){var i=this,n,r;e=e.toLowerCase();if(/\s/.test(e)){f.each(e.split(/\s+/),function(e){i.removeEventListener(e,t)});return}n=d[this.uid]&&d[this.uid][e];if(n){if(t){for(r=n.length-1;r>=0;r--){if(n[r].fn===t){n.splice(r,1);break}}}else{n=[]}if(!n.length){delete d[this.uid][e];if(f.isEmptyObj(d[this.uid])){delete d[this.uid]}}}},removeAllEventListeners:function(){if(d[this.uid]){delete d[this.uid]}},dispatchEvent:function(t){var i,e,n,r,o={},s=true,a;if(f.typeOf(t)!=="string"){r=t;if(f.typeOf(r.type)==="string"){t=r.type;if(r.total!==a&&r.loaded!==a){o.total=r.total;o.loaded=r.loaded}o.async=r.async||false}else{throw new c.EventException(c.EventException.UNSPECIFIED_EVENT_TYPE_ERR)}}if(t.indexOf("::")!==-1){(function(e){i=e[0];t=e[1]})(t.split("::"))}else{i=this.uid}t=t.toLowerCase();e=d[i]&&d[i][t];if(e){e.sort(function(e,t){return t.priority-e.priority});n=[].slice.call(arguments);n.shift();o.type=t;n.unshift(o);if(MXI_DEBUG&&l.debug.events){l.log("Event '%s' fired on %u",o.type,i)}var u=[];f.each(e,function(t){n[0].target=t.scope;if(o.async){u.push(function(e){setTimeout(function(){e(t.fn.apply(t.scope,n)===false)},1)})}else{u.push(function(e){e(t.fn.apply(t.scope,n)===false)})}});if(u.length){f.inSeries(u,function(e){s=!e})}}return s},bindOnce:function(t,i,e,n){var r=this;r.bind.call(this,t,function e(){r.unbind(t,e);return i.apply(this,arguments)},e,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();if(f.typeOf(this[t])==="function"){this[t].apply(this,arguments)}});f.each(e,function(e){e="on"+e.toLowerCase(e);if(f.typeOf(t[e])==="undefined"){t[e]=null}})}});e.instance=new e;return e});e("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(l,c,f,i){var n={},d={};function m(e,t,r,i,n){var o=this,s,a=c.guid(t+"_"),u=n||"browser";e=e||{};d[a]=this;r=c.extend({access_binary:false,access_image_binary:false,display_media:false,do_cors:false,drag_and_drop:false,filter_by_extension:true,resize_image:false,report_upload_progress:false,return_response_headers:false,return_response_type:false,return_status_code:true,send_custom_headers:false,select_file:false,select_folder:false,select_multiple:true,send_binary_string:false,send_browser_cookies:true,send_multipart:true,slice_blob:false,stream_upload:false,summon_file_dialog:false,upload_filesize:true,use_http_method:true},r);if(e.preferred_caps){u=m.getMode(i,e.preferred_caps,u)}if(MXI_DEBUG&&l.debug.runtime){l.log("\tdefault mode: %s",u)}s=function(){var r={};return{exec:function(e,t,i,n){if(s[t]){if(!r[e]){r[e]={context:this,instance:new s[t]}}if(r[e].instance[i]){return r[e].instance[i].apply(this,n)}}},removeInstance:function(e){delete r[e]},removeAllInstances:function(){var i=this;c.each(r,function(e,t){if(c.typeOf(e.instance.destroy)==="function"){e.instance.destroy.call(e.context)}i.removeInstance(t)})}}}();c.extend(this,{initialized:false,uid:a,type:t,mode:m.getMode(i,e.required_caps,u),shimid:a+"_container",clients:0,options:e,can:function(e,t){var i=arguments[2]||r;if(c.typeOf(e)==="string"&&c.typeOf(t)==="undefined"){e=m.parseCaps(e)}if(c.typeOf(e)==="object"){for(var n in e){if(!this.can(n,e[n],i)){return false}}return true}if(c.typeOf(i[e])==="function"){return i[e].call(this,t)}else{return t===i[e]}},getShimContainer:function(){var e,t=f.get(this.shimid);if(!t){e=f.get(this.options.container)||document.body;t=document.createElement("div");t.id=this.shimid;t.className="moxie-shim moxie-shim-"+this.type;c.extend(t.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"});e.appendChild(t);e=null}return t},getShim:function(){return s},shimExec:function(e,t){var i=[].slice.call(arguments,2);return o.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);if(o[e]&&o[e][t]){return o[e][t].apply(this,i)}return o.shimExec.apply(this,arguments)},destroy:function(){if(!o){return}var e=f.get(this.shimid);if(e){e.parentNode.removeChild(e)}if(s){s.removeAllInstances()}this.unbindAll();delete d[this.uid];this.uid=null;a=o=s=e=null}});if(this.mode&&e.required_caps&&!this.can(e.required_caps)){this.mode=false}}m.order="html5,flash,silverlight,html4";m.getRuntime=function(e){return d[e]?d[e]:false};m.addConstructor=function(e,t){t.prototype=i.instance;n[e]=t};m.getConstructor=function(e){return n[e]||null};m.getInfo=function(e){var t=m.getRuntime(e);if(t){return{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}}return null};m.parseCaps=function(e){var t={};if(c.typeOf(e)!=="string"){return e||{}}c.each(e.split(","),function(e){t[e]=true});return t};m.can=function(e,t){var i,n=m.getConstructor(e),r;if(n){i=new n({required_caps:t});r=i.mode;i.destroy();return!!r}return false};m.thatCan=function(e,t){var i=(t||m.order).split(/\s*,\s*/);for(var n in i){if(m.can(i[n],e)){return i[n]}}return null};m.getMode=function(n,e,t){var r=null;if(c.typeOf(t)==="undefined"){t="browser"}if(e&&!c.isEmptyObj(n)){c.each(e,function(e,t){if(n.hasOwnProperty(t)){var i=n[t](e);if(typeof i==="string"){i=[i]}if(!r){r=i}else if(!(r=c.arrayIntersect(r,i))){if(MXI_DEBUG&&l.debug.runtime){l.log("\t\t%c: %v (conflicting mode requested: %s)",t,e,i)}return r=false}}if(MXI_DEBUG&&l.debug.runtime){l.log("\t\t%c: %v (compatible modes: %s)",t,e,r)}});if(r){return c.inArray(t,r)!==-1?t:r[0]}else if(r===false){return false}}return t};m.capTrue=function(){return true};m.capFalse=function(){return false};m.capTest=function(e){return function(){return!!e}};return m});e("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(a,u,t,l){return function e(){var s;t.extend(this,{connectRuntime:function(n){var r=this,e;function o(e){var t,i;if(!e.length){r.trigger("RuntimeError",new u.RuntimeError(u.RuntimeError.NOT_INIT_ERR));s=null;return}t=e.shift().toLowerCase();i=l.getConstructor(t);if(!i){if(MXI_DEBUG&&a.debug.runtime){a.log("Constructor for '%s' runtime is not available.",t)}o(e);return}if(MXI_DEBUG&&a.debug.runtime){a.log("Trying runtime: %s",t);a.log(n)}s=new i(n);s.bind("Init",function(){s.initialized=true;if(MXI_DEBUG&&a.debug.runtime){a.log("Runtime '%s' initialized",s.type)}setTimeout(function(){s.clients++;r.ruid=s.uid;r.trigger("RuntimeInit",s)},1)});s.bind("Error",function(){if(MXI_DEBUG&&a.debug.runtime){a.log("Runtime '%s' failed to initialize",s.type)}s.destroy();o(e)});s.bind("Exception",function(e,t){var i=t.name+"(#"+t.code+")"+(t.message?", from: "+t.message:"");if(MXI_DEBUG&&a.debug.runtime){a.log("Runtime '%s' has thrown an exception: %s",this.type,i)}r.trigger("RuntimeError",new u.RuntimeError(u.RuntimeError.EXCEPTION_ERR,i))});if(MXI_DEBUG&&a.debug.runtime){a.log("\tselected mode: %s",s.mode)}if(!s.mode){s.trigger("Error");return}s.init()}if(t.typeOf(n)==="string"){e=n}else if(t.typeOf(n.ruid)==="string"){e=n.ruid}if(e){s=l.getRuntime(e);if(s){r.ruid=e;s.clients++;return s}else{throw new u.RuntimeError(u.RuntimeError.NOT_INIT_ERR)}}o((n.runtime_order||l.order).split(/\s*,\s*/))},disconnectRuntime:function(){if(s&&--s.clients<=0){s.destroy()}s=null},getRuntime:function(){if(s&&s.uid){return s}return s=null},exec:function(){return s?s.exec.apply(this,arguments):null},can:function(e){return s?s.can(e):false}})}});e("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(o,i,r){var s={};function a(e,t){function n(e,t,i){var n,r=s[this.uid];if(o.typeOf(r)!=="string"||!r.length){return null}n=new a(null,{type:i,size:t-e});n.detach(r.substr(e,n.size));return n}r.call(this);if(e){this.connectRuntime(e)}if(!t){t={}}else if(o.typeOf(t)==="string"){t={data:t}}o.extend(this,{uid:t.uid||o.guid("uid_"),ruid:e,size:t.size||0,type:t.type||"",slice:function(e,t,i){if(this.isDetached()){return n.apply(this,arguments)}return this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){if(!s[this.uid]){return null}return s[this.uid]},detach:function(e){if(this.ruid){this.getRuntime().exec.call(this,"Blob","destroy");this.disconnectRuntime();this.ruid=null}e=e||"";if(e.substr(0,5)=="data:"){var t=e.indexOf(";base64,");this.type=e.substring(5,t);e=i.atob(e.substring(t+8))}this.size=e.length;s[this.uid]=e},isDetached:function(){return!this.ruid&&o.typeOf(s[this.uid])==="string"},destroy:function(){this.detach();delete s[this.uid]}});if(t.data){this.detach(t.data)}else{s[this.uid]=t}}return a});e("moxie/core/I18n",["moxie/core/utils/Basic"],function(i){var t={};return{addI18n:function(e){return i.extend(t,e)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(e){var t=[].slice.call(arguments,1);return e.replace(/%[a-z]/g,function(){var e=t.shift();return i.typeOf(e)!=="undefined"?e:""})}}});e("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(u,n){var e=""+"application/msword,doc dot,"+"application/pdf,pdf,"+"application/pgp-signature,pgp,"+"application/postscript,ps ai eps,"+"application/rtf,rtf,"+"application/vnd.ms-excel,xls xlb,"+"application/vnd.ms-powerpoint,ppt pps pot,"+"application/zip,zip,"+"application/x-shockwave-flash,swf swfl,"+"application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,"+"application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,"+"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,"+"application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,"+"application/vnd.openxmlformats-officedocument.presentationml.template,potx,"+"application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,"+"application/x-javascript,js,"+"application/json,json,"+"audio/mpeg,mp3 mpga mpega mp2,"+"audio/x-wav,wav,"+"audio/x-m4a,m4a,"+"audio/ogg,oga ogg,"+"audio/aiff,aiff aif,"+"audio/flac,flac,"+"audio/aac,aac,"+"audio/ac3,ac3,"+"audio/x-ms-wma,wma,"+"image/bmp,bmp,"+"image/gif,gif,"+"image/jpeg,jpg jpeg jpe,"+"image/photoshop,psd,"+"image/png,png,"+"image/svg+xml,svg svgz,"+"image/tiff,tiff tif,"+"text/plain,asc txt text diff log,"+"text/html,htm html xhtml,"+"text/css,css,"+"text/csv,csv,"+"text/rtf,rtf,"+"video/mpeg,mpeg mpg mpe m2v,"+"video/quicktime,qt mov,"+"video/mp4,mp4,"+"video/x-m4v,m4v,"+"video/x-flv,flv,"+"video/x-ms-wmv,wmv,"+"video/avi,avi,"+"video/webm,webm,"+"video/3gpp,3gpp 3gp,"+"video/3gpp2,3g2,"+"video/vnd.rn-realvideo,rv,"+"video/ogg,ogv,"+"video/x-matroska,mkv,"+"application/vnd.oasis.opendocument.formula-template,otf,"+"application/octet-stream,exe";var t={mimes:{},extensions:{},addMimeType:function(e){var t=e.split(/,/),i,n,r;for(i=0;i0){if(p){i.upload.dispatchEvent(e)}i.dispatchEvent(e)}else{v=true;i.dispatchEvent("error")}n()});E.bind("Abort",function(e){i.dispatchEvent(e);n()});E.bind("Error",function(e){v=true;R("readyState",k.DONE);i.dispatchEvent("readystatechange");g=true;i.dispatchEvent(e);n()});t.exec.call(E,"XMLHttpRequest","send",{url:a,method:u,async:s,user:c,password:f,headers:l,mimeType:d,encoding:o,responseType:i.responseType,withCredentials:i.withCredentials,options:w},e)}if(typeof w.required_caps==="string"){w.required_caps=C.parseCaps(w.required_caps)}w.required_caps=T.extend({},w.required_caps,{return_response_type:i.responseType});if(e instanceof F){w.required_caps.send_multipart=true}if(!T.isEmptyObj(l)){w.required_caps.send_custom_headers=true}if(!x){w.required_caps.do_cors=true}if(w.ruid){r(E.connectRuntime(w))}else{E.bind("RuntimeInit",function(e,t){r(t)});E.bind("RuntimeError",function(e,t){i.dispatchEvent("RuntimeError",t)});E.connectRuntime(w)}}function A(){R("responseText","");R("responseXML",null);R("response",null);R("status",0);R("statusText","");t=e=null}}k.UNSENT=0;k.OPENED=1;k.HEADERS_RECEIVED=2;k.LOADING=3;k.DONE=4;k.prototype=e.instance;return k});e("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(d,m,e,t){function h(){var o,n,s,a,r,u;e.call(this);d.extend(this,{uid:d.guid("uid_"),state:h.IDLE,result:null,transport:function(e,i,t){var n=this;t=d.extend({chunk_size:204798},t);if(o=t.chunk_size%3){t.chunk_size+=3-o}u=t.chunk_size;l.call(this);s=e;a=e.length;if(d.typeOf(t)==="string"||t.ruid){c.call(n,i,this.connectRuntime(t))}else{var r=function(e,t){n.unbind("RuntimeInit",r);c.call(n,i,t)};this.bind("RuntimeInit",r);this.connectRuntime(t)}},abort:function(){var e=this;e.state=h.IDLE;if(n){n.exec.call(e,"Transporter","clear");e.trigger("TransportingAborted")}l.call(e)},destroy:function(){this.unbindAll();n=null;this.disconnectRuntime();l.call(this)}});function l(){a=r=0;s=this.result=null}function c(e,t){var i=this;n=t;i.bind("TransportingProgress",function(e){r=e.loaded;if(ri){u=i}t=m.btoa(s.substr(r,u));n.exec.call(e,"Transporter","receive",t,a)}}h.IDLE=0;h.BUSY=1;h.DONE=2;h.prototype=t.instance;return h});e("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(l,c,f,e,s,a,t,d,m,i,u,h,p){var g=["progress","load","error","resize","embedded"];function v(){t.call(this);l.extend(this,{uid:l.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){i.apply(this,arguments)},resize:function(e){var t=this;var i;var n;var r={x:0,y:0,width:t.width,height:t.height};var o=l.extendIf({width:t.width,height:t.height,type:t.type||"image/jpeg",quality:90,crop:false,fit:true,preserveHeaders:true,resample:"default",multipass:true},e);try{if(!t.size){throw new f.DOMException(f.DOMException.INVALID_STATE_ERR)}if(t.width>v.MAX_RESIZE_WIDTH||t.height>v.MAX_RESIZE_HEIGHT){throw new f.ImageError(f.ImageError.MAX_RESOLUTION_ERR)}i=t.meta&&t.meta.tiff&&t.meta.tiff.Orientation||1;if(l.inArray(i,[5,6,7,8])!==-1){var s=o.width;o.width=o.height;o.height=s}if(o.crop){n=Math.max(o.width/t.width,o.height/t.height);if(e.fit){r.width=Math.min(Math.ceil(o.width/n),t.width);r.height=Math.min(Math.ceil(o.height/n),t.height);n=o.width/r.width}else{r.width=Math.min(o.width,t.width);r.height=Math.min(o.height,t.height);n=1}if(typeof o.crop==="boolean"){o.crop="cc"}switch(o.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":r.x=t.width-r.width;r.y=t.height-r.height;break;case"cb":case"center-bottom":r.x=Math.floor((t.width-r.width)/2);r.y=t.height-r.height;break;case"lb":case"left-bottom":r.x=0;r.y=t.height-r.height;break;case"lt":case"left-top":r.x=0;r.y=0;break;case"ct":case"center-top":r.x=Math.floor((t.width-r.width)/2);r.y=0;break;case"rt":case"right-top":r.x=t.width-r.width;r.y=0;break;case"rc":case"right-center":case"right-middle":r.x=t.width-r.width;r.y=Math.floor((t.height-r.height)/2);break;case"lc":case"left-center":case"left-middle":r.x=0;r.y=Math.floor((t.height-r.height)/2);break;case"cc":case"center-center":case"center-middle":default:r.x=Math.floor((t.width-r.width)/2);r.y=Math.floor((t.height-r.height)/2)}r.x=Math.max(r.x,0);r.y=Math.max(r.y,0)}else{n=Math.min(1,o.width/t.width,o.height/t.height)}this.exec("Image","resize",r,n,o)}catch(e){t.trigger("error",e.code)}},downsize:function(e){var t={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:false,preserveHeaders:true,resample:"default"},i;if(typeof e==="object"){i=l.extend(t,e)}else{i=l.extend(t,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]})}this.resize(i)},crop:function(e,t,i){this.downsize(e,t,true,i)},getAsCanvas:function(){if(!m.can("create_canvas")){throw new f.RuntimeError(f.RuntimeError.NOT_SUPPORTED_ERR)}return this.exec("Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size){throw new f.DOMException(f.DOMException.INVALID_STATE_ERR)}return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size){throw new f.DOMException(f.DOMException.INVALID_STATE_ERR)}return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return p.atob(i.substring(i.indexOf("base64,")+7))},embed:function(s,e){var a=this,u;var t=l.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},e);function i(e,t){var i=this;if(m.can("create_canvas")){var n=i.getAsCanvas();if(n){s.appendChild(n);n=null;i.destroy();a.trigger("embedded");return}}var r=i.getAsDataURL(e,t);if(!r){throw new f.ImageError(f.ImageError.WRONG_FORMAT)}if(m.can("use_data_uri_of",r.length)){s.innerHTML='';i.destroy();a.trigger("embedded")}else{var o=new d;o.bind("TransportingComplete",function(){u=a.connectRuntime(this.result.ruid);a.bind("Embedded",function(){l.extend(u.getShimContainer().style,{top:"0px",left:"0px",width:i.width+"px",height:i.height+"px"});u=null},999);u.exec.call(a,"ImageView","display",this.result.uid,width,height);i.destroy()});o.transport(p.atob(r.substring(r.indexOf("base64,")+7)),e,{required_caps:{display_media:true},runtime_order:"flash,silverlight",container:s})}}try{if(!(s=c.get(s))){throw new f.DOMException(f.DOMException.INVALID_NODE_TYPE_ERR)}if(!this.size){throw new f.DOMException(f.DOMException.INVALID_STATE_ERR)}if(this.width>v.MAX_RESIZE_WIDTH||this.height>v.MAX_RESIZE_HEIGHT){}var n=new v;n.bind("Resize",function(){i.call(this,t.type,t.quality)});n.bind("Load",function(){this.downsize(t)});if(this.meta.thumb&&this.meta.thumb.width>=t.width&&this.meta.thumb.height>=t.height){n.load(this.meta.thumb.data)}else{n.clone(this,false)}return n}catch(e){this.trigger("error",e.code)}},destroy:function(){if(this.ruid){this.getRuntime().exec.call(this,"Image","destroy");this.disconnectRuntime()}if(this.meta&&this.meta.thumb){this.meta.thumb.data.destroy()}this.unbindAll()}});this.handleEventProps(g);this.bind("Load Resize",function(){return e.call(this)},999);function e(e){try{if(!e){e=this.exec("Image","getInfo")}this.size=e.size;this.width=e.width;this.height=e.height;this.type=e.type;this.meta=e.meta;if(this.name===""){this.name=e.name}return true}catch(e){this.trigger("error",e.code);return false}}function i(e){var t=l.typeOf(e);try{if(e instanceof v){if(!e.size){throw new f.DOMException(f.DOMException.INVALID_STATE_ERR)}n.apply(this,arguments)}else if(e instanceof u){if(!~l.inArray(e.type,["image/jpeg","image/png"])){throw new f.ImageError(f.ImageError.WRONG_FORMAT)}r.apply(this,arguments)}else if(l.inArray(t,["blob","file"])!==-1){i.call(this,new h(null,e),arguments[1])}else if(t==="string"){if(e.substr(0,5)==="data:"){i.call(this,new u(null,{data:e}),arguments[1])}else{o.apply(this,arguments)}}else if(t==="node"&&e.nodeName.toLowerCase()==="img"){i.call(this,e.src,arguments[1])}else{throw new f.DOMException(f.DOMException.TYPE_MISMATCH_ERR)}}catch(e){this.trigger("error",e.code)}}function n(e,t){var i=this.connectRuntime(e.ruid);this.ruid=i.uid;i.exec.call(this,"Image","loadFromImage",e,l.typeOf(t)==="undefined"?true:t)}function r(t,e){var i=this;i.name=t.name||"";function n(e){i.ruid=e.uid;e.exec.call(i,"Image","loadFromBlob",t)}if(t.isDetached()){this.bind("RuntimeInit",function(e,t){n(t)});if(e&&typeof e.required_caps==="string"){e.required_caps=a.parseCaps(e.required_caps)}this.connectRuntime(l.extend({required_caps:{access_image_binary:true,resize_image:true}},e))}else{n(this.connectRuntime(t.ruid))}}function o(e,t){var i=this,n;n=new s;n.open("get",e);n.responseType="blob";n.onprogress=function(e){i.trigger(e)};n.onload=function(){r.call(i,n.response,true)};n.onerror=function(e){i.trigger(e)};n.onloadend=function(){n.destroy()};n.bind("RuntimeError",function(e,t){i.trigger("RuntimeError",t)});n.send(null,t)}}v.MAX_RESIZE_WIDTH=8192;v.MAX_RESIZE_HEIGHT=8192;v.prototype=i.instance;return v});e("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(o,e,s,a){var u="html5",l={};function t(e){var t=this,i=s.capTest,n=s.capTrue;var r=o.extend({access_binary:i(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return t.can("access_binary")&&!!l.Image},display_media:i((a.can("create_canvas")||a.can("use_data_uri_over32kb"))&&d("moxie/image/Image")),do_cors:i(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:i(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&(a.browser!=="IE"||a.verComp(a.version,9,">"))}()),filter_by_extension:i(function(){return!(a.browser==="Chrome"&&a.verComp(a.version,28,"<")||a.browser==="IE"&&a.verComp(a.version,10,"<")||a.browser==="Safari"&&a.verComp(a.version,7,"<")||a.browser==="Firefox"&&a.verComp(a.version,37,"<"))}()),return_response_headers:n,return_response_type:function(e){if(e==="json"&&!!window.JSON){return true}return a.can("return_response_type",e)},return_status_code:n,report_upload_progress:i(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return t.can("access_binary")&&a.can("create_canvas")},select_file:function(){return a.can("use_fileinput")&&window.File},select_folder:function(){return t.can("select_file")&&(a.browser==="Chrome"&&a.verComp(a.version,21,">=")||a.browser==="Firefox"&&a.verComp(a.version,42,">="))},select_multiple:function(){return t.can("select_file")&&!(a.browser==="Safari"&&a.os==="Windows")&&!(a.os==="iOS"&&a.verComp(a.osVersion,"7.0.0",">")&&a.verComp(a.osVersion,"8.0.0","<"))},send_binary_string:i(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:i(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||t.can("send_binary_string")},slice_blob:i(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return t.can("slice_blob")&&t.can("send_multipart")},summon_file_dialog:function(){return t.can("select_file")&&(a.browser==="Firefox"&&a.verComp(a.version,4,">=")||a.browser==="Opera"&&a.verComp(a.version,12,">=")||a.browser==="IE"&&a.verComp(a.version,10,">=")||!!~o.inArray(a.browser,["Chrome","Safari","Edge"]))},upload_filesize:n,use_http_method:n},arguments[2]);s.call(this,e,arguments[1]||u,r);o.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(t);e=t=null}}(this.destroy)});o.extend(this.getShim(),l)}s.addConstructor(u,t);return l});e("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(t,i,n){var e;if(window.File.prototype.slice){try{t.slice();return t.slice(i,n)}catch(e){return t.slice(i,n-i)}}else if(e=window.File.prototype.webkitSlice||window.File.prototype.mozSlice){return e.call(t,i,n)}else{return null}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=i});e("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(s){var a={},u="moxie_"+s.guid();function l(){this.returnValue=false}function c(){this.cancelBubble=true}var e=function(e,t,i,n){var r,o;t=t.toLowerCase();if(e.addEventListener){r=i;e.addEventListener(t,r,false)}else if(e.attachEvent){r=function(){var e=window.event;if(!e.target){e.target=e.srcElement}e.preventDefault=l;e.stopPropagation=c;i(e)};e.attachEvent("on"+t,r)}if(!e[u]){e[u]=s.guid()}if(!a.hasOwnProperty(e[u])){a[e[u]]={}}o=a[e[u]];if(!o.hasOwnProperty(t)){o[t]=[]}o[t].push({func:r,orig:i,key:n})};var r=function(t,e,i){var n,r;e=e.toLowerCase();if(t[u]&&a[t[u]]&&a[t[u]][e]){n=a[t[u]][e]}else{return}for(var o=n.length-1;o>=0;o--){if(n[o].orig===i||n[o].key===i){if(t.removeEventListener){t.removeEventListener(e,n[o].func,false)}else if(t.detachEvent){t.detachEvent("on"+e,n[o].func)}n[o].orig=null;n[o].func=null;n.splice(o,1);if(i!==r){break}}}if(!n.length){delete a[t[u]][e]}if(s.isEmptyObj(a[t[u]])){delete a[t[u]];try{delete t[u]}catch(e){t[u]=r}}};var t=function(i,n){if(!i||!i[u]){return}s.each(a[i[u]],function(e,t){r(i,t,n)})};return{addEvent:e,removeEvent:r,removeAllEvents:t}});e("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,f,d,m,h,p,g){function t(){var l,c;d.extend(this,{init:function(e){var n=this,r=n.getRuntime(),t,i,o,s,a,u;l=e;o=l.accept.mimes||p.extList2mimes(l.accept,r.can("filter_by_extension"));i=r.getShimContainer();i.innerHTML='";t=m.get(r.uid);d.extend(t.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});s=m.get(l.browse_button);c=m.getStyle(s,"z-index")||"auto";if(r.can("summon_file_dialog")){if(m.getStyle(s,"position")==="static"){s.style.position="relative"}h.addEvent(s,"click",function(e){var t=m.get(r.uid);if(t&&!t.disabled){t.click()}e.preventDefault()},n.uid);n.bind("Refresh",function(){a=parseInt(c,10)||1;m.get(l.browse_button).style.zIndex=a;this.getRuntime().getShimContainer().style.zIndex=a-1})}u=r.can("summon_file_dialog")?s:i;h.addEvent(u,"mouseover",function(){n.trigger("mouseenter")},n.uid);h.addEvent(u,"mouseout",function(){n.trigger("mouseleave")},n.uid);h.addEvent(u,"mousedown",function(){n.trigger("mousedown")},n.uid);h.addEvent(m.get(l.container),"mouseup",function(){n.trigger("mouseup")},n.uid);t.onchange=function e(t){n.files=[];d.each(this.files,function(e){var t="";if(l.directory){if(e.name=="."){return true}}if(e.webkitRelativePath){t="/"+e.webkitRelativePath.replace(/^\//,"")}e=new f(r.uid,e);e.relativePath=t;n.files.push(e)});if(g.browser!=="IE"&&g.browser!=="IEMobile"){this.value=""}else{var i=this.cloneNode(true);this.parentNode.replaceChild(i,this);i.onchange=e}if(n.files.length){n.trigger("change")}};n.trigger({type:"ready",async:true});i=null},setOption:function(e,t){var i=this.getRuntime();var n=m.get(i.uid);switch(e){case"accept":if(t){var r=t.mimes||p.extList2mimes(t,i.can("filter_by_extension"));n.setAttribute("accept",r.join(","))}else{n.removeAttribute("accept")}break;case"directory":if(t&&i.can("select_folder")){n.setAttribute("directory","");n.setAttribute("webkitdirectory","")}else{n.removeAttribute("directory");n.removeAttribute("webkitdirectory")}break;case"multiple":if(t&&i.can("select_multiple")){n.setAttribute("multiple","")}else{n.removeAttribute("multiple")}}},disable:function(e){var t=this.getRuntime(),i;if(i=m.get(t.uid)){i.disabled=!!e}},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),n=l&&m.get(l.container),r=l&&m.get(l.browse_button);if(n){h.removeAllEvents(n,this.uid)}if(r){h.removeAllEvents(r,this.uid);r.style.zIndex=c}if(i){h.removeAllEvents(i,this.uid);i.innerHTML=""}t.removeInstance(this.uid);l=i=n=r=t=null}})}return e.FileInput=t});e("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,h,p,t,g,i){function n(){var n=[],r=[],o,s;p.extend(this,{init:function(e){var t=this,i;o=e;s=t.ruid;r=l(o.accept);i=o.container;g.addEvent(i,"dragover",function(e){if(!a(e)){return}e.preventDefault();e.dataTransfer.dropEffect="copy"},t.uid);g.addEvent(i,"drop",function(e){if(!a(e)){return}e.preventDefault();n=[];if(e.dataTransfer.items&&e.dataTransfer.items[0].webkitGetAsEntry){f(e.dataTransfer.items,function(){t.files=n;t.trigger("drop")})}else{p.each(e.dataTransfer.files,function(e){u(e)});t.files=n;t.trigger("drop")}},t.uid);g.addEvent(i,"dragenter",function(e){t.trigger("dragenter")},t.uid);g.addEvent(i,"dragleave",function(e){t.trigger("dragleave")},t.uid)},destroy:function(){g.removeAllEvents(o&&t.get(o.container),this.uid);s=n=r=o=null}});function a(e){if(!e.dataTransfer||!e.dataTransfer.types){return false}var t=p.toArray(e.dataTransfer.types||[]);return p.inArray("Files",t)!==-1||p.inArray("public.file-url",t)!==-1||p.inArray("application/x-moz-file",t)!==-1}function u(e,t){if(c(e)){var i=new h(s,e);i.relativePath=t||"";n.push(i)}}function l(e){var t=[];for(var i=0;i=")&&y.verComp(y.version,7,"<"),t=y.browser==="Android Browser",o=false;u=n.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase();a=c();a.open(n.method,n.url,n.async,n.user,n.password);if(i instanceof g){if(i.isDetached()){o=true}i=i.getSource()}else if(i instanceof v){if(i.hasBlob()){if(i.getBlob().isDetached()){i=f.call(r,i);o=true}else if((e||t)&&d.typeOf(i.getBlob().getSource())==="blob"&&window.FileReader){l.call(r,n,i);return}}if(i instanceof v){var s=new window.FormData;i.each(function(e,t){if(e instanceof g){s.append(t,e.getSource())}else{s.append(t,e)}});i=s}}if(a.upload){if(n.withCredentials){a.withCredentials=true}a.addEventListener("load",function(e){r.trigger(e)});a.addEventListener("error",function(e){r.trigger(e)});a.addEventListener("progress",function(e){r.trigger(e)});a.upload.addEventListener("progress",function(e){r.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})}else{a.onreadystatechange=function e(){switch(a.readyState){case 1:break;case 2:break;case 3:var t,i;try{if(h.hasSameOrigin(n.url)){t=a.getResponseHeader("Content-Length")||0}if(a.responseText){i=a.responseText.length}}catch(e){t=i=0}r.trigger({type:"progress",lengthComputable:!!t,total:parseInt(t,10),loaded:i});break;case 4:a.onreadystatechange=function(){};if(a.status===0){r.trigger("error")}else{r.trigger("load")}break}}}if(!d.isEmptyObj(n.headers)){d.each(n.headers,function(e,t){a.setRequestHeader(t,e)})}if(""!==n.responseType&&"responseType"in a){if("json"===n.responseType&&!y.can("return_response_type","json")){a.responseType="text"}else{a.responseType=n.responseType}}if(!o){a.send(i)}else{if(a.sendAsBinary){a.sendAsBinary(i)}else{(function(){var e=new Uint8Array(i.length);for(var t=0;tthis.length()){throw new Error("You are trying to read outside the source boundaries.")}n=this.littleEndian?0:-8*(t-1);for(r=0,i=0;rthis.length()){throw new Error("You are trying to write outside the source boundaries.")}n=this.littleEndian?0:-8*(i-1);for(r=0;r>Math.abs(n+r*8)&255)}},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){var n=[];for(var r=0;r0){n.set(new Uint8Array(r.slice(0,e)),0)}n.set(new Uint8Array(i),e);n.set(new Uint8Array(r.slice(e+t)),e+i.byteLength);this.clear();r=n.buffer;o=new DataView(r);break}default:return r}},length:function(){return r?r.byteLength:0},clear:function(){o=r=null}})}function n(n){e.extend(this,{readByteAt:function(e){return n.charCodeAt(e)},writeByteAt:function(e,t){r(String.fromCharCode(t),e,1)},SEGMENT:function(e,t,i){switch(arguments.length){case 1:return n.substr(e);case 2:return n.substr(e,t);case 3:r(i!==null?i:"",e,t);break;default:return n}},length:function(){return n?n.length:0},clear:function(){n=null}});function r(e,t,i){i=arguments.length===3?i:n.length-t-1;n=n.substr(0,t)+e+n.substr(i+t)}}return t});e("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(a,u){return function o(e){var s=[],t,r,i,n=0;t=new a(e);if(t.SHORT(0)!==65496){t.clear();throw new u.ImageError(u.ImageError.WRONG_FORMAT)}r=2;while(r<=t.length()){i=t.SHORT(r);if(i>=65488&&i<=65495){r+=2;continue}if(i===65498||i===65497){break}n=t.SHORT(r+2)+2;if(i>=65505&&i<=65519){s.push({hex:i,name:"APP"+(i&15),start:r,length:n,segment:t.SEGMENT(r,n)})}r+=n}t.clear();return{headers:s,restore:function(e){var t,i,n;n=new a(e);r=n.SHORT(2)==65504?4+n.SHORT(4):2;for(i=0,t=s.length;i=i.length){break}}},purge:function(){this.headers=s=[]}}}});e("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(v,a,x){function u(e){var t,c,p,g,i,n;a.call(this,e);c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}};p={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}};g={tiffHeader:10};i=g.tiffHeader;t={clear:this.clear};v.extend(this,{read:function(){try{return u.prototype.read.apply(this,arguments)}catch(e){throw new x.ImageError(x.ImageError.INVALID_META_ERR)}},write:function(){try{return u.prototype.write.apply(this,arguments)}catch(e){throw new x.ImageError(x.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return n||null},EXIF:function(){var e=null;if(g.exifIFD){try{e=o.call(this,g.exifIFD,c.exif)}catch(e){return null}if(e.ExifVersion&&v.typeOf(e.ExifVersion)==="array"){for(var t=0,i="";t4){l=i.LONG(l)+g.tiffHeader}if(l+u*a>=this.length()){throw new x.ImageError(x.ImageError.INVALID_META_ERR)}if(s==="ASCII"){d[o]=v.trim(i.STRING(l,a).replace(/\0$/,""));continue}else{f=i.asArray(s,l,a);c=a==1?f[0]:f;if(p.hasOwnProperty(o)&&typeof c!="object"){d[o]=p[o][c]}else{d[o]=c}}}return d}function s(e,t,i){var n,r,o,s=0;if(typeof t==="string"){var a=c[e.toLowerCase()];for(var u in a){if(a[u]===t){t=u;break}}}n=g[e.toLowerCase()+"IFD"];r=this.SHORT(n);for(var l=0;l=65472&&i<=65475){t+=5;return{height:e.SHORT(t),width:e.SHORT(t+=2)}}n=e.SHORT(t+=2);t+=n-2}return null}function s(){var e=n.thumb(),t,i;if(e){t=new f(e);i=o(t);t.clear();if(i){i.data=e;return i}}return null}function a(){if(!n||!i||!r){return}n.clear();i.purge();r.clear();t=i=n=r=null}}return e});e("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(u,l,c){function e(e){var o,t,i,n;o=new c(e);(function(){var e=0,t=0,i=[35152,20039,3338,6666];for(t=0;t2){t=t<.5?.5:2;r=true}var o=a(e,t);if(r){return s(o,n/o.width)}else{return o}}function a(e,t){var i=e.width;var n=e.height;var r=Math.floor(i*t);var o=Math.floor(n*t);var s=document.createElement("canvas");s.width=r;s.height=o;s.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o);e=null;return s}return{scale:s}});e("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,x,y,w,E,_,b,R,I,t){function i(){var n=this,i,r,s,o,a,u=false,l=true;x.extend(this,{loadFromBlob:function(e){var t=this.getRuntime(),i=arguments.length>1?arguments[1]:true;if(!t.can("access_binary")){throw new y.RuntimeError(y.RuntimeError.NOT_SUPPORTED_ERR)}a=e;if(e.isDetached()){o=e.getSource();h.call(this,o);return}else{p.call(this,e.getSource(),function(e){if(i){o=d(e)}h.call(this,e)})}},loadFromImage:function(e,t){this.meta=e.meta;a=new _(null,{name:e.name,size:e.size,type:e.type});h.call(this,t?o=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var e=this.getRuntime(),t;if(!r&&o&&e.can("access_image_binary")){r=new b(o)}t={width:c().width||0,height:c().height||0,type:a.type||I.getFileMime(a.name),size:o&&o.length||a.size||0,name:a.name||"",meta:null};if(l){t.meta=r&&r.meta||this.meta||{};if(t.meta&&t.meta.thumb&&!(t.meta.thumb.data instanceof E)){t.meta.thumb.data=new E(null,{type:"image/jpeg",data:t.meta.thumb.data})}}return t},resize:function(e,t,i){var n=document.createElement("canvas");n.width=e.width;n.height=e.height;n.getContext("2d").drawImage(c(),e.x,e.y,e.width,e.height,0,0,n.width,n.height);s=R.scale(n,t);l=i.preserveHeaders;var r=this.meta&&this.meta.exif&&this.meta.exif.PixelXDimension==e.height;if(!l||r){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;if(r){switch(o){case 6:o=8;break;case 8:o=6;break;case 5:o=7;break;case 7:o=5;break}}s=g(s,o)}this.width=s.width;this.height=s.height;u=true;this.trigger("Resize")},getAsCanvas:function(){if(!s){s=f()}s.id=this.uid+"_canvas";return s},getAsBlob:function(e,t){if(e!==this.type){u=true;return new _(null,{name:a.name||"",type:e,data:n.getAsDataURL(e,t)})}return new _(null,{name:a.name||"",type:e,data:n.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!u){return i.src}f();if("image/jpeg"!==e){return s.toDataURL("image/png")}else{try{return s.toDataURL("image/jpeg",t/100)}catch(e){return s.toDataURL("image/jpeg")}}},getAsBinaryString:function(e,t){if(!u){if(!o){o=d(n.getAsDataURL(e,t))}return o}if("image/jpeg"!==e){o=d(n.getAsDataURL(e,t))}else{var i;if(!t){t=90}f();try{i=s.toDataURL("image/jpeg",t/100)}catch(e){i=s.toDataURL("image/jpeg")}o=d(i);if(r){o=r.stripHeaders(o);if(l){if(r.meta&&r.meta.exif){r.setExif({PixelXDimension:this.width,PixelYDimension:this.height})}o=r.writeHeaders(o)}r.purge();r=null}}u=false;return o},destroy:function(){n=null;v.call(this);this.getRuntime().getShim().removeInstance(this.uid)}});function c(){if(!s&&!i){throw new y.ImageError(y.DOMException.INVALID_STATE_ERR)}return s||i}function f(){var e=c();if(e.nodeName.toLowerCase()=="canvas"){return e}s=document.createElement("canvas");s.width=e.width;s.height=e.height;s.getContext("2d").drawImage(e,0,0);return s}function d(e){return w.atob(e.substring(e.indexOf("base64,")+7))}function m(e,t){return"data:"+(t||"")+";base64,"+w.btoa(e)}function h(e){var t=this;i=new Image;i.onerror=function(){v.call(this);t.trigger("error",y.ImageError.WRONG_FORMAT)};i.onload=function(){t.trigger("load")};i.src=e.substr(0,5)=="data:"?e:m(e,a.type)}function p(e,t){var i=this,n;if(window.FileReader){n=new FileReader;n.onload=function(){t.call(i,this.result)};n.onerror=function(){i.trigger("error",y.ImageError.WRONG_FORMAT)};n.readAsDataURL(e)}else{return t.call(this,e.getAsDataURL())}}function g(e,t){var i=Math.PI/180;var n=document.createElement("canvas");var r=n.getContext("2d");var o=e.width;var s=e.height;if(x.inArray(t,[5,6,7,8])>-1){n.width=s;n.height=o}else{n.width=o;n.height=s}switch(t){case 2:r.translate(o,0);r.scale(-1,1);break;case 3:r.translate(o,s);r.rotate(180*i);break;case 4:r.translate(0,s);r.scale(1,-1);break;case 5:r.rotate(90*i);r.scale(1,-1);break;case 6:r.rotate(90*i);r.translate(0,-s);break;case 7:r.rotate(90*i);r.translate(o,-s);r.scale(-1,1);break;case 8:r.rotate(-90*i);r.translate(-o,0);break}r.drawImage(e,0,0,o,s);return n}function v(){if(r){r.purge();r=null}o=i=s=a=null;u=false}}return e.Image=i});e("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(s,a,u,l,e){var t="flash",i={};function c(){var t;try{t=navigator.plugins["Shockwave Flash"];t=t.description}catch(e){try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(e){t="0.0"}}t=t.match(/\d+/g);return parseFloat(t[0]+"."+t[1])}function f(t){var i=u.get(t);if(i&&i.nodeName=="OBJECT"){if(a.browser==="IE"){i.style.display="none";(function e(){if(i.readyState==4){n(t)}else{setTimeout(e,10)}})()}else{i.parentNode.removeChild(i)}}}function n(e){var t=u.get(e);if(t){for(var i in t){if(typeof t[i]=="function"){t[i]=null}}t.parentNode.removeChild(t)}}function r(n){var r=this,o;n=s.extend({swf_url:a.swf_url},n);e.call(this,n,t,{access_binary:function(e){return e&&r.mode==="browser"},access_image_binary:function(e){return e&&r.mode==="browser"},display_media:e.capTest(d("moxie/image/Image")),do_cors:e.capTrue,drag_and_drop:false,report_upload_progress:function(){return r.mode==="client"},resize_image:e.capTrue,return_response_headers:false,return_response_type:function(e){if(e==="json"&&!!window.JSON){return true}return!s.arrayDiff(e,["","text","document"])||r.mode==="browser"},return_status_code:function(e){return r.mode==="browser"||!s.arrayDiff(e,[200,404])},select_file:e.capTrue,select_multiple:e.capTrue,send_binary_string:function(e){return e&&r.mode==="browser"},send_browser_cookies:function(e){return e&&r.mode==="browser"},send_custom_headers:function(e){return e&&r.mode==="browser"},send_multipart:e.capTrue,slice_blob:function(e){return e&&r.mode==="browser"},stream_upload:function(e){return e&&r.mode==="browser"},summon_file_dialog:false,upload_filesize:function(e){return s.parseSizeStr(e)<=2097152||r.mode==="client"},use_http_method:function(e){return!s.arrayDiff(e,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(e){return s.arrayDiff(e,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(e){return s.arrayDiff(e,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(e){return s.parseSizeStr(e)>=2097152?"client":"browser"}},"client");if(c()<11.3){if(MXI_DEBUG&&a.debug.runtime){a.log("\tFlash didn't meet minimal version requirement (11.3).")}this.mode=false}s.extend(this,{getShim:function(){return u.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return r.getShim().exec(this.uid,e,t,i)},init:function(){var e,t,i;i=this.getShimContainer();s.extend(i.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"});e=''+''+''+''+"";if(a.browser==="IE"){t=document.createElement("div");i.appendChild(t);t.outerHTML=e;t=i=null}else{i.innerHTML=e}o=setTimeout(function(){if(r&&!r.initialized){r.trigger("Error",new l.RuntimeError(l.RuntimeError.NOT_INIT_ERR));if(MXI_DEBUG&&a.debug.runtime){a.log("\tFlash failed to initialize within a specified period of time (typically 5s).")}}},5e3)},destroy:function(e){return function(){f(r.uid);e.call(r);clearTimeout(o);n=o=e=r=null}}(this.destroy)},i)}e.addConstructor(t,r);return i});e("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,o){var t={slice:function(e,t,i,n){var r=this.getRuntime();if(t<0){t=Math.max(e.size+t,0)}else if(t>0){t=Math.min(t,e.size)}if(i<0){i=Math.max(e.size+i,0)}else if(i>0){i=Math.min(i,e.size)}e=r.shimExec.call(this,"Blob","slice",t,i,n||"");if(e){e=new o(r.uid,e)}return e}};return e.Blob=t});e("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(e,n,r){var t={init:function(e){var t=this,i=this.getRuntime();this.bind("Change",function(){var e=i.shimExec.call(t,"FileInput","getFiles");t.files=[];r.each(e,function(e){t.files.push(new n(i.uid,e))})},999);this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple});this.trigger("ready")}};return e.FileInput=t});e("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,i){function r(e,t){switch(t){case"readAsText":return i.atob(e,"utf8");case"readAsBinaryString":return i.atob(e);case"readAsDataURL":return e}return null}var t={read:function(i,e){var n=this;n.result="";if(i==="readAsDataURL"){n.result="data:"+(e.type||"")+";base64,"}n.bind("Progress",function(e,t){if(t){n.result+=r(t,i)}},999);return n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",e.uid)}};return e.FileReader=t});e("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,i){function r(e,t){switch(t){case"readAsText":return i.atob(e,"utf8");case"readAsBinaryString":return i.atob(e);case"readAsDataURL":return e}return null}var t={read:function(e,t){var i,n=this.getRuntime();i=n.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid);if(!i){return null}if(e==="readAsDataURL"){i="data:"+(t.type||"")+";base64,"+i}return r(i,e,t.type)}};return e.FileReaderSync=t});e("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,n){var t={getAsBlob:function(e){var t=this.getRuntime(),i=t.shimExec.call(this,"Transporter","getAsBlob",e);if(i){return new n(t.uid,i)}return null}};return e.Transporter=t});e("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,l,c,r,o,t,f,d,i){var n={send:function(e,i){var n=this,r=n.getRuntime();function o(){e.transport=r.mode;r.shimExec.call(n,"XMLHttpRequest","send",e,i)}function t(e,t){r.shimExec.call(n,"XMLHttpRequest","appendBlob",e,t.uid);i=null;o()}function s(e,t){var i=new d;i.bind("TransportingComplete",function(){t(this.result)});i.transport(e.getSource(),e.type,{ruid:r.uid})}if(!l.isEmptyObj(e.headers)){l.each(e.headers,function(e,t){r.shimExec.call(n,"XMLHttpRequest","setRequestHeader",t,e.toString())})}if(i instanceof f){var a;i.each(function(e,t){if(e instanceof c){a=t}else{r.shimExec.call(n,"XMLHttpRequest","append",t,e)}});if(!i.hasBlob()){i=null;o()}else{var u=i.getBlob();if(u.isDetached()){s(u,function(e){u.destroy();t(a,e)})}else{t(a,u)}}}else if(i instanceof c){if(i.isDetached()){s(i,function(e){i.destroy();i=e.uid;o()})}else{i=i.uid;o()}}else{o()}},getResponse:function(e){var t,i,n=this.getRuntime();i=n.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob");if(i){i=new r(n.uid,i);if("blob"===e){return i}try{t=new o;if(!!~l.inArray(e,["","text"])){return t.readAsText(i)}else if("json"===e&&!!window.JSON){return JSON.parse(t.readAsText(i))}}finally{i.destroy()}}return null},abort:function(e){var t=this.getRuntime();t.shimExec.call(this,"XMLHttpRequest","abort");this.dispatchEvent("readystatechange");this.dispatchEvent("abort")}};return e.XMLHttpRequest=n});e("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,o,r,n){var i={loadFromBlob:function(e){var t=this,i=t.getRuntime();function n(e){i.shimExec.call(t,"Image","loadFromBlob",e.uid);t=i=null}if(e.isDetached()){var r=new o;r.bind("TransportingComplete",function(){n(r.result.getSource())});r.transport(e.getSource(),e.type,{ruid:i.uid})}else{n(e.getSource())}},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");if(t.meta&&t.meta.thumb&&t.meta.thumb.data&&!(e.meta.thumb.data instanceof r)){t.meta.thumb.data=new r(e.uid,t.meta.thumb.data)}return t},getAsBlob:function(e,t){var i=this.getRuntime(),n=i.shimExec.call(this,"Image","getAsBlob",e,t);if(n){return new r(i.uid,n)}return null},getAsDataURL:function(){var e=this.getRuntime(),t=e.Image.getAsBlob.apply(this,arguments),i;if(!t){return null}i=new n;return i.readAsDataURL(t)}};return e.Image=i});e("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(r,o,e,s,a){var u="silverlight",l={};function c(t){var i=false,e=null,n,r,o,s,a,u=0;try{try{e=new ActiveXObject("AgControl.AgControl");if(e.IsVersionSupported(t)){i=true}e=null}catch(e){var l=navigator.plugins["Silverlight Plug-In"];if(l){n=l.description;if(n==="1.0.30226.2"){n="2.0.30226.2"}r=n.split(".");while(r.length>3){r.pop()}while(r.length<4){r.push(0)}o=t.split(".");while(o.length>4){o.pop()}do{s=parseInt(o[u],10);a=parseInt(r[u],10);u++}while(u'+''+''+''+''+''+"";i=setTimeout(function(){if(n&&!n.initialized){n.trigger("Error",new s.RuntimeError(s.RuntimeError.NOT_INIT_ERR));if(MXI_DEBUG&&o.debug.runtime){o.log("Silverlight failed to initialize within a specified period of time (5-10s).")}}},o.OS!=="Windows"?1e4:5e3)},destroy:function(e){return function(){e.call(n);clearTimeout(i);t=i=e=n=null}}(this.destroy)},l)}a.addConstructor(u,t);return l});e("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){return e.Blob=t.extend({},i)});e("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(e,n,r){function o(e){var t="";for(var i=0;i=")||s.browser==="Opera"&&s.verComp(s.version,12,">=")||s.browser==="IE"&&s.verComp(s.version,10,">=")||!!~r.inArray(s.browser,["Chrome","Safari"]))},upload_filesize:n,use_http_method:function(e){return!r.arrayDiff(e,["GET","POST"])}});r.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(t);e=t=null}}(this.destroy)});r.extend(this.getShim(),u)}o.addConstructor(a,t);return u});e("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,d,m,h,p,g,v){function t(){var u,l=[],c,a;function f(){var t=this,i=t.getRuntime(),e,n,r,o,s,a;a=m.guid("uid_");e=i.getShimContainer();if(u){r=h.get(u+"_form");if(r){m.extend(r.style,{top:"100%"})}}o=document.createElement("form");o.setAttribute("id",a+"_form");o.setAttribute("method","post");o.setAttribute("enctype","multipart/form-data");o.setAttribute("encoding","multipart/form-data");m.extend(o.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"});s=document.createElement("input");s.setAttribute("id",a);s.setAttribute("type","file");s.setAttribute("accept",l.join(","));m.extend(s.style,{fontSize:"999px",opacity:0});o.appendChild(s);e.appendChild(o);m.extend(s.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});if(v.browser==="IE"&&v.verComp(v.version,10,"<")){m.extend(s.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"})}s.onchange=function(){var e;if(!this.value){return}if(this.files){e=this.files[0];if(e.size===0){o.parentNode.removeChild(o);return}}else{e={name:this.value}}e=new d(i.uid,e);this.onchange=function(){};f.call(t);t.files=[e];s.setAttribute("id",e.uid);o.setAttribute("id",e.uid+"_form");t.trigger("change");s=o=null};if(i.can("summon_file_dialog")){n=h.get(c.browse_button);p.removeEvent(n,"click",t.uid);p.addEvent(n,"click",function(e){if(s&&!s.disabled){s.click()}e.preventDefault()},t.uid)}u=a;e=r=n=null}m.extend(this,{init:function(n){var r=this,o=r.getRuntime(),s;c=n;l=n.accept.mimes||g.extList2mimes(n.accept,o.can("filter_by_extension"));s=o.getShimContainer();(function(){var e,t,i;e=h.get(n.browse_button);a=h.getStyle(e,"z-index")||"auto";if(o.can("summon_file_dialog")){if(h.getStyle(e,"position")==="static"){e.style.position="relative"}r.bind("Refresh",function(){t=parseInt(a,10)||1;h.get(c.browse_button).style.zIndex=t;this.getRuntime().getShimContainer().style.zIndex=t-1})}i=o.can("summon_file_dialog")?e:s;p.addEvent(i,"mouseover",function(){r.trigger("mouseenter")},r.uid);p.addEvent(i,"mouseout",function(){r.trigger("mouseleave")},r.uid);p.addEvent(i,"mousedown",function(){r.trigger("mousedown")},r.uid);p.addEvent(h.get(n.container),"mouseup",function(){r.trigger("mouseup")},r.uid);e=null})();f.call(this);s=null;r.trigger({type:"ready",async:true})},setOption:function(e,t){var i=this.getRuntime();var n;if(e=="accept"){l=t.mimes||g.extList2mimes(t,i.can("filter_by_extension"))}n=h.get(u);if(n){n.setAttribute("accept",l.join(","))}},disable:function(e){var t;if(t=h.get(u)){t.disabled=!!e}},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),n=c&&h.get(c.container),r=c&&h.get(c.browse_button);if(n){p.removeAllEvents(n,this.uid)}if(r){p.removeAllEvents(r,this.uid);r.style.zIndex=a}if(i){p.removeAllEvents(i,this.uid);i.innerHTML=""}t.removeInstance(this.uid);u=l=c=i=n=r=t=null}})}return e.FileInput=t});e("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t});e("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,m,h,p,g,v,x,y){function t(){var l,c,f;function d(t){var i=this,e,n,r,o,s=false;if(!f){return}e=f.id.replace(/_iframe$/,"");n=h.get(e+"_form");if(n){r=n.getElementsByTagName("input");o=r.length;while(o--){switch(r[o].getAttribute("type")){case"hidden":r[o].parentNode.removeChild(r[o]);break;case"file":s=true;break}}r=[];if(!s){n.parentNode.removeChild(n)}n=null}setTimeout(function(){v.removeEvent(f,"load",i.uid);if(f.parentNode){f.parentNode.removeChild(f)}var e=i.getRuntime().getShimContainer();if(!e.children.length){e.parentNode.removeChild(e)}e=f=null;t()},1)}m.extend(this,{send:function(i,e){var n=this,r=n.getRuntime(),o,s,a,u;l=c=null;function t(){var e=r.getShimContainer()||document.body,t=document.createElement("div");t.innerHTML='';f=t.firstChild;e.appendChild(f);v.addEvent(f,"load",function(){var e;try{e=f.contentWindow.document||f.contentDocument||window.frames[f.id].document;if(/^4(0[0-9]|1[0-7]|2[2346])\s/.test(e.title)){l=e.title.replace(/^(\d+).*$/,"$1")}else{l=200;c=m.trim(e.body.innerHTML);n.trigger({type:"progress",loaded:c.length,total:c.length});if(u){n.trigger({type:"uploadprogress",loaded:u.size||1025,total:u.size||1025})}}}catch(e){if(p.hasSameOrigin(i.url)){l=404}else{d.call(n,function(){n.trigger("error")});return}}d.call(n,function(){n.trigger("load")})},n.uid)}if(e instanceof y&&e.hasBlob()){u=e.getBlob();o=u.uid;a=h.get(o);s=h.get(o+"_form");if(!s){throw new g.DOMException(g.DOMException.NOT_FOUND_ERR)}}else{o=m.guid("uid_");s=document.createElement("form");s.setAttribute("id",o+"_form");s.setAttribute("method",i.method);s.setAttribute("enctype","multipart/form-data");s.setAttribute("encoding","multipart/form-data");r.getShimContainer().appendChild(s)}s.setAttribute("target",o+"_iframe");if(e instanceof y){e.each(function(e,t){if(e instanceof x){if(a){a.setAttribute("name",t)}}else{var i=document.createElement("input");m.extend(i,{type:"hidden",name:t,value:e});if(a){s.insertBefore(i,a)}else{s.appendChild(i)}}})}s.setAttribute("action",i.url);t();s.submit();n.trigger("loadstart")},getStatus:function(){return l},getResponse:function(e){if("json"===e){if(m.typeOf(c)==="string"&&!!window.JSON){try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(e){return null}}}else if("document"===e){}return c},abort:function(){var e=this;if(f&&f.contentWindow){if(f.contentWindow.stop){f.contentWindow.stop()}else if(f.contentWindow.document.execCommand){f.contentWindow.document.execCommand("Stop")}else{f.src="about:blank"}}d.call(this,function(){e.dispatchEvent("abort")})}})}return e.XMLHttpRequest=t});e("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t});t(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])})(this)}.apply(e,arguments),e.moxie}"function"==typeof define&&define.amd?define("moxie",[],t):"object"==typeof module&&module.exports?module.exports=t():e.moxie=t()}(this||window),function(e){function t(){var e={};return function(e){(function(e,S,O){var D=window.setTimeout;var C={};var t=S.core.utils;var N=S.runtime.Runtime;function M(e){var t=e.required_features,r={};function i(e,t,i){var n={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};if(n[e]){r[n[e]]=t}else if(!i){r[e]=t}}if(typeof t==="string"){F.each(t.split(/\s*,\s*/),function(e){i(e,true)})}else if(typeof t==="object"){F.each(t,function(e,t){i(t,e)})}else if(t===true){if(e.chunk_size&&e.chunk_size>0){r.slice_blob=true}if(!F.isEmptyObj(e.resize)||e.multipart===false){r.send_binary_string=true}if(e.http_method){r.use_http_method=e.http_method}F.each(e,function(e,t){i(t,!!e,true)})}return r}var F={VERSION:"2.3.1",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:t.Mime.mimes,ua:t.Env,typeOf:t.Basic.typeOf,extend:t.Basic.extend,guid:t.Basic.guid,getAll:function e(t){var i=[],n;if(F.typeOf(t)!=="array"){t=[t]}var r=t.length;while(r--){n=F.get(t[r]);if(n){i.push(n)}}return i.length?i:null},get:t.Dom.get,each:t.Basic.each,getPos:t.Dom.getPos,getSize:t.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:t.Basic.toArray,inArray:t.Basic.inArray,inSeries:t.Basic.inSeries,addI18n:S.core.I18n.addI18n,translate:S.core.I18n.translate,sprintf:t.Basic.sprintf,isEmptyObj:t.Basic.isEmptyObj,hasClass:t.Dom.hasClass,addClass:t.Dom.addClass,removeClass:t.Dom.removeClass,getStyle:t.Dom.getStyle,addEvent:t.Events.addEvent,removeEvent:t.Events.removeEvent,removeAllEvents:t.Events.removeAllEvents,cleanName:function(e){var t,i;i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(t=0;t0?"&":"?")+i}return e},formatSize:function(e){if(e===O||/\D/.test(e)){return F.translate("N/A")}function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}var i=Math.pow(1024,4);if(e>i){return t(e/i,1)+" "+F.translate("tb")}if(e>(i/=1024)){return t(e/i,1)+" "+F.translate("gb")}if(e>(i/=1024)){return t(e/i,1)+" "+F.translate("mb")}if(e>1024){return Math.round(e/1024)+" "+F.translate("kb")}return e+" "+F.translate("b")},parseSize:t.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;i=new F.Uploader(e);n=N.thatCan(i.getOption().required_features,t||e.runtimes);i.destroy();return n},addFileFilter:function(e,t){C[e]=t}};F.addFileFilter("mime_types",function(e,t,i){if(e.length&&!e.regexp.test(t.name)){this.trigger("Error",{code:F.FILE_EXTENSION_ERROR,message:F.translate("File extension error."),file:t});i(false)}else{i(true)}});F.addFileFilter("max_file_size",function(e,t,i){var n;e=F.parseSize(e);if(t.size!==n&&e&&t.size>e){this.trigger("Error",{code:F.FILE_SIZE_ERROR,message:F.translate("File size error."),file:t});i(false)}else{i(true)}});F.addFileFilter("prevent_duplicates",function(e,t,i){if(e){var n=this.files.length;while(n--){if(t.name===this.files[n].name&&t.size===this.files[n].size){this.trigger("Error",{code:F.FILE_DUPLICATE_ERROR,message:F.translate("Duplicate file error."),file:t});i(false);return}}}i(true)});F.Uploader=function(e){var t=F.guid(),s,l=[],h={},a=[],u=[],r,o,c=false,p;function i(){var e,t=0,i;if(this.state==F.STARTED){for(i=0;i0?Math.ceil(e.loaded/e.size*100):100;f()}function f(){var e,t;var i;var n=0;o.reset();for(e=0;er){n+=i}o.loaded+=i}else{o.size=O}if(t.status==F.DONE){o.uploaded++}else if(t.status==F.FAILED){o.failed++}else{o.queued++}}if(o.size===O){o.percent=l.length>0?Math.ceil(o.uploaded/l.length*100):0}else{o.bytesPerSec=Math.ceil(n/((+new Date-r||1)/1e3));o.percent=o.size>0?Math.ceil(o.loaded/o.size*100):0}}function d(){var e=a[0]||u[0];if(e){return e.getRuntime().uid}return false}function g(e,t){if(e.ruid){var i=N.getInfo(e.ruid);if(i){return i.can(t)}}return false}function m(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged");e.refresh()});this.bind("CancelUpload",R);this.bind("BeforeUpload",w);this.bind("UploadFile",E);this.bind("UploadProgress",_);this.bind("StateChanged",b);this.bind("QueueChanged",f);this.bind("Error",A);this.bind("FileUploaded",I);this.bind("Destroy",T)}function v(n,e){var r=this,o=0,t=[];var s={runtime_order:n.runtimes,required_caps:n.required_features,preferred_caps:h,swf_url:n.flash_swf_url,xap_url:n.silverlight_xap_url};F.each(n.runtimes.split(/\s*,\s*/),function(e){if(n[e]){s[e]=n[e]}});if(n.browse_button){F.each(n.browse_button,function(i){t.push(function(t){var e=new S.file.FileInput(F.extend({},s,{accept:n.filters.mime_types,name:n.file_data_name,multiple:n.multi_selection,container:n.container,browse_button:i}));e.onready=function(){var e=N.getInfo(this.ruid);F.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")});o++;a.push(this);t()};e.onchange=function(){r.addFile(this.files)};e.bind("mouseenter mouseleave mousedown mouseup",function(e){if(!c){if(n.browse_button_hover){if("mouseenter"===e.type){F.addClass(i,n.browse_button_hover)}else if("mouseleave"===e.type){F.removeClass(i,n.browse_button_hover)}}if(n.browse_button_active){if("mousedown"===e.type){F.addClass(i,n.browse_button_active)}else if("mouseup"===e.type){F.removeClass(i,n.browse_button_active)}}}});e.bind("mousedown",function(){r.trigger("Browse")});e.bind("error runtimeerror",function(){e=null;t()});e.init()})})}if(n.drop_element){F.each(n.drop_element,function(i){t.push(function(t){var e=new S.file.FileDrop(F.extend({},s,{drop_zone:i}));e.onready=function(){var e=N.getInfo(this.ruid);F.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")});o++;u.push(this);t()};e.ondrop=function(){r.addFile(this.files)};e.bind("error runtimeerror",function(){e=null;t()});e.init()})})}F.inSeries(t,function(){if(typeof e==="function"){e(o)}})}function x(t,e,i){var n=new S.image.Image;try{n.onload=function(){if(e.width>this.width&&e.height>this.height&&e.quality===O&&e.preserve_headers&&!e.crop){this.destroy();return i(t)}n.downsize(e.width,e.height,e.crop,e.preserve_headers)};n.onresize=function(){i(this.getAsBlob(t.type,e.quality));this.destroy()};n.onerror=function(){i(t)};n.load(t)}catch(e){i(t)}}function y(e,t,i){var r=this,o=false;function n(e,t,i){var n=s[e];switch(e){case"max_file_size":if(e==="max_file_size"){s.max_file_size=s.filters.max_file_size=t}break;case"chunk_size":if(t=F.parseSize(t)){s[e]=t;s.send_file_name=true}break;case"multipart":s[e]=t;if(!t){s.send_file_name=true}break;case"http_method":s[e]=t.toUpperCase()==="PUT"?"PUT":"POST";break;case"unique_names":s[e]=t;if(t){s.send_file_name=true}break;case"filters":if(F.typeOf(t)==="array"){t={mime_types:t}}if(i){F.extend(s.filters,t)}else{s.filters=t}if(t.mime_types){if(F.typeOf(t.mime_types)==="string"){t.mime_types=S.core.utils.Mime.mimes2extList(t.mime_types)}t.mime_types.regexp=function(e){var t=[];F.each(e,function(e){F.each(e.extensions.split(/,/),function(e){if(/^\s*\*\s*$/.test(e)){t.push("\\.*")}else{t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))}})});return new RegExp("("+t.join("|")+")$","i")}(t.mime_types);s.filters.mime_types=t.mime_types}break;case"resize":if(t){s.resize=F.extend({preserve_headers:true,crop:false},t)}else{s.resize=false}break;case"prevent_duplicates":s.prevent_duplicates=s.filters.prevent_duplicates=!!t;break;case"container":case"browse_button":case"drop_element":t="container"===e?F.get(t):F.getAll(t);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":s[e]=t;if(!i){o=true}break;default:s[e]=t}if(!i){r.trigger("OptionChanged",e,t,n)}}if(typeof e==="object"){F.each(e,function(e,t){n(t,e,i)})}else{n(e,t,i)}if(i){s.required_features=M(F.extend({},s));h=M(F.extend({},s,{required_features:true}))}else if(o){r.trigger("Destroy");v.call(r,s,function(e){if(e){r.runtime=N.getInfo(d()).type;r.trigger("Init",{runtime:r.runtime});r.trigger("PostInit")}else{r.trigger("Error",{code:F.INIT_ERROR,message:F.translate("Init error.")})}})}}function w(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";if(i){n=i[1]}t.target_name=t.id+"."+n}}function E(r,o){var s=r.settings.url,n=r.settings.chunk_size,a=r.settings.max_retries,u=r.features,l=0,c;if(o.loaded){l=o.loaded=n?n*Math.floor(o.loaded/n):0}function f(){if(a-- >0){D(d,1e3)}else{o.loaded=l;r.trigger("Error",{code:F.HTTP_ERROR,message:F.translate("HTTP Error."),file:o,response:p.responseText,status:p.status,responseHeaders:p.getAllResponseHeaders()})}}function d(){var e,t={},i;if(o.status!==F.UPLOADING||r.state===F.STOPPED){return}if(r.settings.send_file_name){t.name=o.target_name||o.name}if(n&&u.chunks&&c.size>n){i=Math.min(n,c.size-l);e=c.slice(l,l+i)}else{i=c.size;e=c}if(n&&u.chunks){if(r.settings.send_chunk_number){t.chunk=Math.ceil(l/n);t.chunks=Math.ceil(c.size/n)}else{t.offset=l;t.total=c.size}}if(r.trigger("BeforeChunkUpload",o,t,e,l)){m(t,e,i)}}function m(e,t,i){var n;p=new S.xhr.XMLHttpRequest;if(p.upload){p.upload.onprogress=function(e){o.loaded=Math.min(o.size,l+e.loaded);r.trigger("UploadProgress",o)}}p.onload=function(){if(p.status>=400){f();return}a=r.settings.max_retries;if(i=c.size){if(o.size!=o.origSize){c.destroy();c=null}r.trigger("UploadProgress",o);o.status=F.DONE;o.completeTimestamp=+new Date;r.trigger("FileUploaded",o,{response:p.responseText,status:p.status,responseHeaders:p.getAllResponseHeaders()})}else{D(d,1)}};p.onerror=function(){f()};p.onloadend=function(){this.destroy();p=null};if(r.settings.multipart&&u.multipart){p.open(r.settings.http_method,s,true);F.each(r.settings.headers,function(e,t){p.setRequestHeader(t,e)});n=new S.xhr.FormData;F.each(F.extend(e,r.settings.multipart_params),function(e,t){n.append(t,e)});n.append(r.settings.file_data_name,t);p.send(n,{runtime_order:r.settings.runtimes,required_caps:r.settings.required_features,preferred_caps:h,swf_url:r.settings.flash_swf_url,xap_url:r.settings.silverlight_xap_url})}else{s=F.buildUrl(r.settings.url,F.extend(e,r.settings.multipart_params));p.open(r.settings.http_method,s,true);F.each(r.settings.headers,function(e,t){p.setRequestHeader(t,e)});if(!p.hasRequestHeader("Content-Type")){p.setRequestHeader("Content-Type","application/octet-stream")}p.send(t,{runtime_order:r.settings.runtimes,required_caps:r.settings.required_features,preferred_caps:h,swf_url:r.settings.flash_swf_url,xap_url:r.settings.silverlight_xap_url})}}c=o.getSource();if(!F.isEmptyObj(r.settings.resize)&&g(c,"send_binary_string")&&F.inArray(c.type,["image/jpeg","image/png"])!==-1){x.call(this,c,r.settings.resize,function(e){c=e;o.size=e.size;d()})}else{d()}}function _(e,t){n(t)}function b(e){if(e.state==F.STARTED){r=+new Date}else if(e.state==F.STOPPED){for(var t=e.files.length-1;t>=0;t--){if(e.files[t].status==F.UPLOADING){e.files[t].status=F.QUEUED;f()}}}}function R(){if(p){p.abort()}}function I(e){f();D(function(){i.call(e)},1)}function A(e,t){if(t.code===F.INIT_ERROR){e.destroy()}else if(t.code===F.HTTP_ERROR){t.file.status=F.FAILED;t.file.completeTimestamp=+new Date;n(t.file);if(e.state==F.STARTED){e.trigger("CancelUpload");D(function(){i.call(e)},1)}}}function T(e){e.stop();F.each(l,function(e){e.destroy()});l=[];if(a.length){F.each(a,function(e){e.destroy()});a=[]}if(u.length){F.each(u,function(e){e.destroy()});u=[]}h={};c=false;r=p=null;o.reset()}s={chunk_size:0,file_data_name:"file",filters:{mime_types:[],prevent_duplicates:false,max_file_size:0},flash_swf_url:"js/Moxie.swf",http_method:"POST",max_retries:0,multipart:true,multi_selection:true,resize:false,runtimes:N.order,send_file_name:true,send_chunk_number:true,silverlight_xap_url:"js/Moxie.xap"};y.call(this,e,null,true);o=new F.QueueProgress;F.extend(this,{id:t,uid:t,state:F.STOPPED,features:{},runtime:null,files:l,settings:s,total:o,init:function(){var i=this,e,t,n;t=i.getOption("preinit");if(typeof t=="function"){t(i)}else{F.each(t,function(e,t){i.bind(t,e)})}m.call(i);F.each(["container","browse_button","drop_element"],function(e){if(i.getOption(e)===null){n={code:F.INIT_ERROR,message:F.sprintf(F.translate("%s specified, but cannot be found."),e)};return false}});if(n){return i.trigger("Error",n)}if(!s.browse_button&&!s.drop_element){return i.trigger("Error",{code:F.INIT_ERROR,message:F.translate("You must specify either browse_button or drop_element.")})}v.call(i,s,function(e){var t=i.getOption("init");if(typeof t=="function"){t(i)}else{F.each(t,function(e,t){i.bind(t,e)})}if(e){i.runtime=N.getInfo(d()).type;i.trigger("Init",{runtime:i.runtime});i.trigger("PostInit")}else{i.trigger("Error",{code:F.INIT_ERROR,message:F.translate("Init error.")})}})},setOption:function(e,t){y.call(this,e,t,!this.runtime)},getOption:function(e){if(!e){return s}return s[e]},refresh:function(){if(a.length){F.each(a,function(e){e.trigger("Refresh")})}this.trigger("Refresh")},start:function(){if(this.state!=F.STARTED){this.state=F.STARTED;this.trigger("StateChanged");i.call(this)}},stop:function(){if(this.state!=F.STOPPED){this.state=F.STOPPED;this.trigger("StateChanged");this.trigger("CancelUpload")}},disableBrowse:function(){c=arguments[0]!==O?arguments[0]:true;if(a.length){F.each(a,function(e){e.disable(c)})}this.trigger("DisableBrowse",c)},getFile:function(e){var t;for(t=l.length-1;t>=0;t--){if(l[t].id===e){return l[t]}}},addFile:function(e,t){var r=this,n=[],o=[],s;function a(n,e){var t=[];F.each(r.settings.filters,function(e,i){if(C[i]){t.push(function(t){C[i].call(r,e,n,function(e){t(!e)})})}});F.inSeries(t,e)}function u(i){var e=F.typeOf(i);if(i instanceof S.file.File){if(!i.ruid&&!i.isDetached()){if(!s){return false}i.ruid=s;i.connectRuntime(s)}u(new F.File(i))}else if(i instanceof S.file.Blob){u(i.getSource());i.destroy()}else if(i instanceof F.File){if(t){i.name=t}n.push(function(t){a(i,function(e){if(!e){l.push(i);o.push(i);r.trigger("FileFiltered",i)}D(t,1)})})}else if(F.inArray(e,["file","blob"])!==-1){u(new S.file.File(null,i))}else if(e==="node"&&F.typeOf(i.files)==="filelist"){F.each(i.files,u)}else if(e==="array"){t=null;F.each(i,u)}}s=d();u(e);if(n.length){F.inSeries(n,function(){if(o.length){r.trigger("FilesAdded",o)}})}},removeFile:function(e){var t=typeof e==="string"?e:e.id;for(var i=l.length-1;i>=0;i--){if(l[i].id===t){return this.splice(i,1)[0]}}},splice:function(e,t){var i=l.splice(e===O?0:e,t===O?l.length:t);var n=false;if(this.state==F.STARTED){F.each(i,function(e){if(e.status===F.UPLOADING){n=true;return false}});if(n){this.stop()}}this.trigger("FilesRemoved",i);F.each(i,function(e){e.destroy()});if(n){this.start()}return i},dispatchEvent:function(e){var t,i,n;e=e.toLowerCase();t=this.hasEventListener(e);if(t){t.sort(function(e,t){return t.priority-e.priority});i=[].slice.call(arguments);i.shift();i.unshift(this);for(var r=0;r