(function(b,g){var d={};function c(m,n){var l,j=[];for(var k=0;k0){p(x,function(A,z){if(A!==v){if(r(w[z])===r(A)&&!!~u(r(A),["array","object"])){n(w[z],A)}else{w[z]=A}}})}});return w};var p=function(A,B){var z,x,w,y;if(A){try{z=A.length}catch(v){z=y}if(z===y){for(x in A){if(A.hasOwnProperty(x)){if(B(A[x],x)===false){return}}}}else{for(w=0;w0){if(I.length==2){if(typeof(I[1])==B){S[I[0]]=I[1].call(this,O)}else{S[I[0]]=I[1]}}else{if(I.length==3){if(typeof(I[1])===B&&!(I[1].exec&&I[1].test)){S[I[0]]=O?I[1].call(this,O,I[2]):r}else{S[I[0]]=O?O.replace(I[1],I[2]):r}}else{if(I.length==4){S[I[0]]=O?I[3].call(this,O.replace(I[1],I[2])):r}}}}else{S[I]=O?O:r}}break}}if(!!N){break}}return S},str:function(L,K){for(var J in K){if(typeof(K[J])===p&&K[J].length>0){for(var I=0;It[s]){n=1;break}}}if(!o){return n}switch(o){case">":case"gt":return(n>0);case">=":case"ge":return(n>=0);case"<=":case"le":return(n<=0);case"==":case"=":case"eq":return(n===0);case"<>":case"!=":case"ne":return(n!==0);case"":case"<":case"lt":return(n<0);default:return null}}var l=(function(){var n={define_property:(function(){return false}()),create_canvas:(function(){var o=document.createElement("canvas");return !!(o.getContext&&o.getContext("2d"))}()),return_response_type:function(o){try{if(m.inArray(o,["","text","document"])!==-1){return true}else{if(window.XMLHttpRequest){var q=new XMLHttpRequest();q.open("get","/");if("responseType" in q){q.responseType=o;if(q.responseType!==o){return false}return true}}}}catch(p){}return false},use_data_uri:(function(){var o=new Image();o.onload=function(){n.use_data_uri=(o.width===1&&o.height===1)};setTimeout(function(){o.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1);return false}()),use_data_uri_over32kb:function(){return n.use_data_uri&&(i.browser!=="IE"||i.version>=9)},use_data_uri_of:function(o){return(n.use_data_uri&&o<33000||n.use_data_uri_over32kb())},use_fileinput:function(){var o=document.createElement("input");o.setAttribute("type","file");return !o.disabled}};return function(p){var o=[].slice.call(arguments);o.shift();return m.typeOf(n[p])==="function"?n[p].apply(this,o):!!n[p]}}());var i={can:l,browser:k.browser.name,version:parseFloat(k.browser.major),os:k.os.name,osVersion:k.os.version,verComp:j,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};i.OS=i.os;return i});h("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(j){var k=function(q){if(typeof q!=="string"){return q}return document.getElementById(q)};var l=function(s,r){if(!s.className){return false}var q=new RegExp("(^|\\s+)"+r+"(\\s+|$)");return q.test(s.className)};var m=function(r,q){if(!l(r,q)){r.className=!r.className?q:r.className.replace(/\s+$/,"")+" "+q}};var p=function(s,r){if(s.className){var q=new RegExp("(^|\\s+)"+r+"(\\s+|$)");s.className=s.className.replace(q,function(u,t,v){return t===" "&&v===" "?" ":""})}};var i=function(r,q){if(r.currentStyle){return r.currentStyle[q]}else{if(window.getComputedStyle){return window.getComputedStyle(r,null)[q]}}};var o=function(r,v){var w=0,u=0,A,z=document,s,t;r=r;v=v||z.body;function q(E){var C,D,B=0,F=0;if(E){D=E.getBoundingClientRect();C=z.compatMode==="CSS1Compat"?z.documentElement:z.body;B=D.left+C.scrollLeft;F=D.top+C.scrollTop}return{x:B,y:F}}if(r&&r.getBoundingClientRect&&j.browser==="IE"&&(!z.documentMode||z.documentMode<8)){s=q(r);t=q(v);return{x:s.x-t.x,y:s.y-t.y}}A=r;while(A&&A!=v&&A.nodeType){w+=A.offsetLeft||0;u+=A.offsetTop||0;A=A.offsetParent}A=r.parentNode;while(A&&A!=v&&A.nodeType){w-=A.scrollLeft||0;u-=A.scrollTop||0;A=A.parentNode}return{x:w,y:u}};var n=function(q){return{w:q.offsetWidth||q.clientWidth,h:q.offsetHeight||q.clientHeight}};return{get:k,hasClass:l,addClass:m,removeClass:p,getStyle:i,getPos:o,getSize:n}});h("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(j){function i(m,l){var k;for(k in m){if(m[k]===l){return k}}return null}return{RuntimeError:(function(){var k={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};function l(m){this.code=m;this.name=i(k,m);this.message=this.name+": RuntimeError "+this.code}j.extend(l,k);l.prototype=Error.prototype;return l}()),OperationNotAllowedException:(function(){function k(l){this.code=l;this.name="OperationNotAllowedException"}j.extend(k,{NOT_ALLOWED_ERR:1});k.prototype=Error.prototype;return k}()),ImageError:(function(){var k={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2};function l(m){this.code=m;this.name=i(k,m);this.message=this.name+": ImageError "+this.code}j.extend(l,k);l.prototype=Error.prototype;return l}()),FileException:(function(){var k={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 l(m){this.code=m;this.name=i(k,m);this.message=this.name+": FileException "+this.code}j.extend(l,k);l.prototype=Error.prototype;return l}()),DOMException:(function(){var k={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 l(m){this.code=m;this.name=i(k,m);this.message=this.name+": DOMException "+this.code}j.extend(l,k);l.prototype=Error.prototype;return l}()),EventException:(function(){function k(l){this.code=l;this.name="EventException"}j.extend(k,{UNSPECIFIED_EVENT_TYPE_ERR:0});k.prototype=Error.prototype;return k}())}});h("moxie/core/EventTarget",["moxie/core/Exceptions","moxie/core/utils/Basic"],function(i,j){function k(){var l={};j.extend(this,{uid:null,init:function(){if(!this.uid){this.uid=j.guid("uid_")}},addEventListener:function(q,p,n,o){var m=this,r;q=j.trim(q);if(/\s/.test(q)){j.each(q.split(/\s+/),function(s){m.addEventListener(s,p,n,o)});return}q=q.toLowerCase();n=parseInt(n,10)||0;r=l[this.uid]&&l[this.uid][q]||[];r.push({fn:p,priority:n,scope:o||this});if(!l[this.uid]){l[this.uid]={}}l[this.uid][q]=r},hasEventListener:function(m){return m?!!(l[this.uid]&&l[this.uid][m]):!!l[this.uid]},removeEventListener:function(o,n){o=o.toLowerCase();var p=l[this.uid]&&l[this.uid][o],m;if(p){if(n){for(m=p.length-1;m>=0;m--){if(p[m].fn===n){p.splice(m,1);break}}}else{p=[]}if(!p.length){delete l[this.uid][o];if(j.isEmptyObj(l[this.uid])){delete l[this.uid]}}}},removeAllEventListeners:function(){if(l[this.uid]){delete l[this.uid]}},dispatchEvent:function(r){var o,p,q,s,t={},u=true,m;if(j.typeOf(r)!=="string"){s=r;if(j.typeOf(s.type)==="string"){r=s.type;if(s.total!==m&&s.loaded!==m){t.total=s.total;t.loaded=s.loaded}t.async=s.async||false}else{throw new i.EventException(i.EventException.UNSPECIFIED_EVENT_TYPE_ERR)}}if(r.indexOf("::")!==-1){(function(v){o=v[0];r=v[1]}(r.split("::")))}else{o=this.uid}r=r.toLowerCase();p=l[o]&&l[o][r];if(p){p.sort(function(w,v){return v.priority-w.priority});q=[].slice.call(arguments);q.shift();t.type=r;q.unshift(t);var n=[];j.each(p,function(v){q[0].target=v.scope;if(t.async){n.push(function(w){setTimeout(function(){w(v.fn.apply(v.scope,q)===false)},1)})}else{n.push(function(w){w(v.fn.apply(v.scope,q)===false)})}});if(n.length){j.inSeries(n,function(v){u=!v})}}return u},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)},convertEventPropsToHandlers:function(m){var o;if(j.typeOf(m)!=="array"){m=[m]}for(var n=0;n>16&255;n=z>>8&255;m=z&255;if(v==64){r[A++]=String.fromCharCode(o)}else{if(u==64){r[A++]=String.fromCharCode(o,n)}else{r[A++]=String.fromCharCode(o,n,m)}}}while(s>18&63;y=B>>12&63;x=B>>6&63;w=B&63;s[C++]=q.charAt(z)+q.charAt(y)+q.charAt(x)+q.charAt(w)}while(u0){if(x){ac.upload.dispatchEvent(ag)}ac.dispatchEvent(ag)}else{D=true;ac.dispatchEvent("error")}ad()});O.bind("Abort",function(ag){ac.dispatchEvent(ag);ad()});O.bind("Error",function(ag){D=true;Z("readyState",v.DONE);ac.dispatchEvent("readystatechange");L=true;ac.dispatchEvent(ag);ad()});af.exec.call(O,"XMLHttpRequest","send",{url:J,method:P,async:X,user:S,password:G,headers:Q,mimeType:K,encoding:I,responseType:ac.responseType,withCredentials:ac.withCredentials,options:T},ae)}if(typeof(T.required_caps)==="string"){T.required_caps=o.parseCaps(T.required_caps)}T.required_caps=q.extend({},T.required_caps,{return_response_type:ac.responseType});if(ae instanceof z){T.required_caps.send_multipart=true}if(!H){T.required_caps.do_cors=true}if(T.ruid){ab(O.connectRuntime(T))}else{O.bind("RuntimeInit",function(ag,af){ab(af)});O.bind("RuntimeError",function(ag,af){ac.dispatchEvent("RuntimeError",af)});O.connectRuntime(T)}}function M(){Z("responseText","");Z("responseXML",null);Z("response",null);Z("status",0);Z("statusText","");N=W=null}}v.UNSENT=0;v.OPENED=1;v.HEADERS_RECEIVED=2;v.LOADING=3;v.DONE=4;v.prototype=p.instance;return v});h("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(l,i,j,m){function k(){var r,p,n,s,v,u;j.call(this);l.extend(this,{uid:l.guid("uid_"),state:k.IDLE,result:null,transport:function(A,z,y){var x=this;y=l.extend({chunk_size:204798},y);if((r=y.chunk_size%3)){y.chunk_size+=3-r}u=y.chunk_size;t.call(this);n=A;s=A.length;if(l.typeOf(y)==="string"||y.ruid){q.call(x,z,this.connectRuntime(y))}else{var w=function(C,B){x.unbind("RuntimeInit",w);q.call(x,z,B)};this.bind("RuntimeInit",w);this.connectRuntime(y)}},abort:function(){var w=this;w.state=k.IDLE;if(p){p.exec.call(w,"Transporter","clear");w.trigger("TransportingAborted")}t.call(w)},destroy:function(){this.unbindAll();p=null;this.disconnectRuntime();t.call(this)}});function t(){s=v=0;n=this.result=null}function q(x,y){var w=this;p=y;w.bind("TransportingProgress",function(z){v=z.loaded;if(vy){u=y}x=i.btoa(n.substr(v,u));p.exec.call(w,"Transporter","receive",x,s)}}k.IDLE=0;k.BUSY=1;k.DONE=2;k.prototype=m.instance;return k});h("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(k,n,t,r,u,j,s,m,q,w,l,p,o){var v=["progress","load","error","resize","embedded"];function i(){s.call(this);k.extend(this,{uid:k.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){this.bind("Load Resize",function(){y.call(this)},999);this.convertEventPropsToHandlers(v);z.apply(this,arguments)},downsize:function(G,C,F,D){try{if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}if(this.width>i.MAX_RESIZE_WIDTH||this.height>i.MAX_RESIZE_HEIGHT){throw new t.ImageError(t.ImageError.MAX_RESOLUTION_ERR)}if(!G&&!C||k.typeOf(F)==="undefined"){F=false}G=G||this.width;C=C||this.height;D=(k.typeOf(D)==="undefined"?true:!!D);this.getRuntime().exec.call(this,"Image","downsize",G,C,F,D)}catch(E){this.trigger("error",E)}},crop:function(E,C,D){this.downsize(E,C,true,D)},getAsCanvas:function(){if(!q.can("create_canvas")){throw new t.RuntimeError(t.RuntimeError.NOT_SUPPORTED_ERR)}var C=this.connectRuntime(this.ruid);return C.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(C,D){if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}if(!C){C="image/jpeg"}if(C==="image/jpeg"&&!D){D=90}return this.getRuntime().exec.call(this,"Image","getAsBlob",C,D)},getAsDataURL:function(C,D){if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}return this.getRuntime().exec.call(this,"Image","getAsDataURL",C,D)},getAsBinaryString:function(C,E){var D=this.getAsDataURL(C,E);return o.atob(D.substring(D.indexOf("base64,")+7))},embed:function(F){var N=this,K,J,L,H,O=arguments[1]||{},E=this.width,M=this.height,G;function D(){if(q.can("create_canvas")){var P=K.getAsCanvas();if(P){F.appendChild(P);P=null;K.destroy();N.trigger("embedded");return}}var R=K.getAsDataURL(J,L);if(!R){throw new t.ImageError(t.ImageError.WRONG_FORMAT)}if(q.can("use_data_uri_of",R.length)){F.innerHTML='';K.destroy();N.trigger("embedded")}else{var Q=new m();Q.bind("TransportingComplete",function(){G=N.connectRuntime(this.result.ruid);N.bind("Embedded",function(){k.extend(G.getShimContainer().style,{top:"0px",left:"0px",width:K.width+"px",height:K.height+"px"});G=null},999);G.exec.call(N,"ImageView","display",this.result.uid,E,M);K.destroy()});Q.transport(o.atob(R.substring(R.indexOf("base64,")+7)),J,k.extend({},O,{required_caps:{display_media:true},runtime_order:"flash,silverlight",container:F}))}}try{if(!(F=n.get(F))){throw new t.DOMException(t.DOMException.INVALID_NODE_TYPE_ERR)}if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}if(this.width>i.MAX_RESIZE_WIDTH||this.height>i.MAX_RESIZE_HEIGHT){throw new t.ImageError(t.ImageError.MAX_RESOLUTION_ERR)}J=O.type||this.type||"image/jpeg";L=O.quality||90;H=k.typeOf(O.crop)!=="undefined"?O.crop:false;if(O.width){E=O.width;M=O.height||E}else{var C=n.getSize(F);if(C.w&&C.h){E=C.w;M=C.h}}K=new i();K.bind("Resize",function(){D.call(N)});K.bind("Load",function(){K.downsize(E,M,H,false)});K.clone(this,false);return K}catch(I){this.trigger("error",I)}},destroy:function(){if(this.ruid){this.getRuntime().exec.call(this,"Image","destroy");this.disconnectRuntime()}this.unbindAll()}});function y(C){if(!C){C=this.getRuntime().exec.call(this,"Image","getInfo")}this.size=C.size;this.width=C.width;this.height=C.height;this.type=C.type;this.meta=C.meta;if(this.name===""){this.name=C.name}}function z(E){var D=k.typeOf(E);try{if(E instanceof i){if(!E.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}x.apply(this,arguments)}else{if(E instanceof l){if(!~k.inArray(E.type,["image/jpeg","image/png"])){throw new t.ImageError(t.ImageError.WRONG_FORMAT)}A.apply(this,arguments)}else{if(k.inArray(D,["blob","file"])!==-1){z.call(this,new p(null,E),arguments[1])}else{if(D==="string"){if(/^data:[^;]*;base64,/.test(E)){z.call(this,new l(null,{data:E}),arguments[1])}else{B.apply(this,arguments)}}else{if(D==="node"&&E.nodeName.toLowerCase()==="img"){z.call(this,E.src,arguments[1])}else{throw new t.DOMException(t.DOMException.TYPE_MISMATCH_ERR)}}}}}}catch(C){this.trigger("error",C)}}function x(C,D){var E=this.connectRuntime(C.ruid);this.ruid=E.uid;E.exec.call(this,"Image","loadFromImage",C,(k.typeOf(D)==="undefined"?true:D))}function A(E,F){var D=this;D.name=E.name||"";function C(G){D.ruid=G.uid;G.exec.call(D,"Image","loadFromBlob",E)}if(E.isDetached()){this.bind("RuntimeInit",function(H,G){C(G)});if(F&&typeof(F.required_caps)==="string"){F.required_caps=j.parseCaps(F.required_caps)}this.connectRuntime(k.extend({required_caps:{access_image_binary:true,resize_image:true}},F))}else{C(this.connectRuntime(E.ruid))}}function B(E,D){var C=this,F;F=new u();F.open("get",E);F.responseType="blob";F.onprogress=function(G){C.trigger(G)};F.onload=function(){A.call(C,F.response,true)};F.onerror=function(G){C.trigger(G)};F.onloadend=function(){F.destroy()};F.bind("RuntimeError",function(H,G){C.trigger("RuntimeError",G)});F.send(null,D)}}i.MAX_RESIZE_WIDTH=6500;i.MAX_RESIZE_HEIGHT=6500;i.prototype=w.instance;return i});h("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(n,i,k,j){var m="html5",l={};function o(q){var p=this,t=k.capTest,s=k.capTrue;var r=n.extend({access_binary:t(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return p.can("access_binary")&&!!l.Image},display_media:t(j.can("create_canvas")||j.can("use_data_uri_over32kb")),do_cors:t(window.XMLHttpRequest&&"withCredentials" in new XMLHttpRequest()),drag_and_drop:t(function(){var u=document.createElement("div");return(("draggable" in u)||("ondragstart" in u&&"ondrop" in u))&&(j.browser!=="IE"||j.version>9)}()),filter_by_extension:t(function(){return(j.browser==="Chrome"&&j.version>=28)||(j.browser==="IE"&&j.version>=10)}()),return_response_headers:s,return_response_type:function(u){if(u==="json"&&!!window.JSON){return true}return j.can("return_response_type",u)},return_status_code:s,report_upload_progress:t(window.XMLHttpRequest&&new XMLHttpRequest().upload),resize_image:function(){return p.can("access_binary")&&j.can("create_canvas")},select_file:function(){return j.can("use_fileinput")&&window.File},select_folder:function(){return p.can("select_file")&&j.browser==="Chrome"&&j.version>=21},select_multiple:function(){return p.can("select_file")&&!(j.browser==="Safari"&&j.os==="Windows")&&!(j.os==="iOS"&&j.verComp(j.osVersion,"7.0.4","<"))},send_binary_string:t(window.XMLHttpRequest&&(new XMLHttpRequest().sendAsBinary||(window.Uint8Array&&window.ArrayBuffer))),send_custom_headers:t(window.XMLHttpRequest),send_multipart:function(){return !!(window.XMLHttpRequest&&new XMLHttpRequest().upload&&window.FormData)||p.can("send_binary_string")},slice_blob:t(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return p.can("slice_blob")&&p.can("send_multipart")},summon_file_dialog:t(function(){return(j.browser==="Firefox"&&j.version>=4)||(j.browser==="Opera"&&j.version>=12)||(j.browser==="IE"&&j.version>=10)||!!~n.inArray(j.browser,["Chrome","Safari"])}()),upload_filesize:s},arguments[2]);k.call(this,q,(arguments[1]||m),r);n.extend(this,{init:function(){this.trigger("Init")},destroy:(function(u){return function(){u.call(p);u=p=null}}(this.destroy))});n.extend(this.getShim(),l)}k.addConstructor(m,o);return l});h("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(j,k){function i(){function l(n,q,m){var o;if(window.File.prototype.slice){try{n.slice();return n.slice(q,m)}catch(p){return n.slice(q,m-q)}}else{if((o=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)){return o.call(n,q,m)}else{return null}}}this.slice=function(){return new k(this.getRuntime().uid,l.apply(this,arguments))}}return(j.Blob=i)});h("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(o){var p={},l="moxie_"+o.guid();function k(){this.returnValue=false}function j(){this.cancelBubble=true}var m=function(u,q,v,s){var t,r;q=q.toLowerCase();if(u.addEventListener){t=v;u.addEventListener(q,t,false)}else{if(u.attachEvent){t=function(){var w=window.event;if(!w.target){w.target=w.srcElement}w.preventDefault=k;w.stopPropagation=j;v(w)};u.attachEvent("on"+q,t)}}if(!u[l]){u[l]=o.guid()}if(!p.hasOwnProperty(u[l])){p[u[l]]={}}r=p[u[l]];if(!r.hasOwnProperty(q)){r[q]=[]}r[q].push({func:t,orig:v,key:s})};var n=function(v,q,w){var t,s;q=q.toLowerCase();if(v[l]&&p[v[l]]&&p[v[l]][q]){t=p[v[l]][q]}else{return}for(var r=t.length-1;r>=0;r--){if(t[r].orig===w||t[r].key===w){if(v.removeEventListener){v.removeEventListener(q,t[r].func,false)}else{if(v.detachEvent){v.detachEvent("on"+q,t[r].func)}}t[r].orig=null;t[r].func=null;t.splice(r,1);if(w!==s){break}}}if(!t.length){delete p[v[l]][q]}if(o.isEmptyObj(p[v[l]])){delete p[v[l]];try{delete v[l]}catch(u){v[l]=s}}};var i=function(r,q){if(!r||!r[l]){return}o.each(p[r[l]],function(t,s){n(r,s,q)})};return{addEvent:m,removeEvent:n,removeAllEvents:i}});h("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(m,o,l,j,k,i){function n(){var q=[],p;o.extend(this,{init:function(A){var r=this,y=r.getRuntime(),x,t,u,z,w,v;p=A;q=[];u=p.accept.mimes||k.extList2mimes(p.accept,y.can("filter_by_extension"));t=y.getShimContainer();t.innerHTML='";x=l.get(y.uid);o.extend(x.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});z=l.get(p.browse_button);if(y.can("summon_file_dialog")){if(l.getStyle(z,"position")==="static"){z.style.position="relative"}w=parseInt(l.getStyle(z,"z-index"),10)||1;z.style.zIndex=w;t.style.zIndex=w-1;j.addEvent(z,"click",function(C){var B=l.get(y.uid);if(B&&!B.disabled){B.click()}C.preventDefault()},r.uid)}v=y.can("summon_file_dialog")?z:t;j.addEvent(v,"mouseover",function(){r.trigger("mouseenter")},r.uid);j.addEvent(v,"mouseout",function(){r.trigger("mouseleave")},r.uid);j.addEvent(v,"mousedown",function(){r.trigger("mousedown")},r.uid);j.addEvent(l.get(p.container),"mouseup",function(){r.trigger("mouseup")},r.uid);x.onchange=function s(){q=[];if(p.directory){o.each(this.files,function(C){if(C.name!=="."){q.push(C)}})}else{q=[].slice.call(this.files)}if(i.browser!=="IE"){this.value=""}else{var B=this.cloneNode(true);this.parentNode.replaceChild(B,this);B.onchange=s}r.trigger("change")};r.trigger({type:"ready",async:true});t=null},getFiles:function(){return q},disable:function(t){var s=this.getRuntime(),r;if((r=l.get(s.uid))){r.disabled=!!t}},destroy:function(){var s=this.getRuntime(),t=s.getShim(),r=s.getShimContainer();j.removeAllEvents(r,this.uid);j.removeAllEvents(p&&l.get(p.container),this.uid);j.removeAllEvents(p&&l.get(p.browse_button),this.uid);if(r){r.innerHTML=""}t.removeInstance(this.uid);q=p=r=t=null}})}return(m.FileInput=n)});h("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(l,m,k,i,j){function n(){var p=[],r=[],v;m.extend(this,{init:function(y){var x=this,z;v=y;r=q(v.accept);z=v.container;i.addEvent(z,"dragover",function(A){A.preventDefault();A.stopPropagation();A.dataTransfer.dropEffect="copy"},x.uid);i.addEvent(z,"drop",function(A){A.preventDefault();A.stopPropagation();p=[];if(A.dataTransfer.items&&A.dataTransfer.items[0].webkitGetAsEntry){u(A.dataTransfer.items,function(){x.trigger("drop")})}else{m.each(A.dataTransfer.files,function(B){if(t(B)){p.push(B)}});x.trigger("drop")}},x.uid);i.addEvent(z,"dragenter",function(A){A.preventDefault();A.stopPropagation();x.trigger("dragenter")},x.uid);i.addEvent(z,"dragleave",function(A){A.preventDefault();A.stopPropagation();x.trigger("dragleave")},x.uid)},getFiles:function(){return p},destroy:function(){i.removeAllEvents(v&&k.get(v.container),this.uid);p=r=v=null}});function q(z){var y=[];for(var x=0;x=4&&m.version<7),z=m.browser==="Android Browser",E=false;w=G.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase();y=x();y.open(G.method,G.url,G.async,G.user,G.password);if(D instanceof k){if(D.isDetached()){E=true}D=D.getSource()}else{if(D instanceof r){if(D.hasBlob()){if(D.getBlob().isDetached()){D=v.call(F,D);E=true}else{if((C||z)&&j.typeOf(D.getBlob().getSource())==="blob"&&window.FileReader){s.call(F,G,D);return}}}if(D instanceof r){var B=new window.FormData();D.each(function(I,H){if(I instanceof k){B.append(H,I.getSource())}else{B.append(H,I)}});D=B}}}if(y.upload){if(G.withCredentials){y.withCredentials=true}y.addEventListener("load",function(H){F.trigger(H)});y.addEventListener("error",function(H){F.trigger(H)});y.addEventListener("progress",function(H){F.trigger(H)});y.upload.addEventListener("progress",function(H){F.trigger({type:"UploadProgress",loaded:H.loaded,total:H.total})})}else{y.onreadystatechange=function A(){switch(y.readyState){case 1:break;case 2:break;case 3:var J,H;try{if(i.hasSameOrigin(G.url)){J=y.getResponseHeader("Content-Length")||0}if(y.responseText){H=y.responseText.length}}catch(I){J=H=0}F.trigger({type:"progress",lengthComputable:!!J,total:parseInt(J,10),loaded:H});break;case 4:y.onreadystatechange=function(){};if(y.status===0){F.trigger("error")}else{F.trigger("load")}break}}}if(!j.isEmptyObj(G.headers)){j.each(G.headers,function(H,I){y.setRequestHeader(I,H)})}if(""!==G.responseType&&"responseType" in y){if("json"===G.responseType&&!m.can("return_response_type","json")){y.responseType="text"}else{y.responseType=G.responseType}}if(!E){y.send(D)}else{if(y.sendAsBinary){y.sendAsBinary(D)}else{(function(){var H=new Uint8Array(D.length);for(var I=0;I>Math.abs(n+q*8))&255)}i(s,o,r)}return{II:function(n){if(n===g){return l}else{l=n}},init:function(n){l=false;j=n},SEGMENT:function(n,p,o){switch(arguments.length){case 1:return j.substr(n,j.length-n-1);case 2:return j.substr(n,p);case 3:i(o,n,p);break;default:return j}},BYTE:function(n){return m(n,1)},SHORT:function(n){return m(n,2)},LONG:function(n,o){if(o===g){return m(n,4)}else{k(n,o,4)}},SLONG:function(n){var o=m(n,4);return(o>2147483647?o-4294967296:o)},STRING:function(n,o){var p="";for(o+=n;n=65488&&l<=65495){k+=2;continue}if(l===65498||l===65497){break}m=n.SHORT(k+2)+2;if(l>=65505&&l<=65519){p.push({hex:l,name:"APP"+(l&15),start:k,length:m,segment:n.SEGMENT(k,m)})}k+=m}n.init(null);return{headers:p,restore:function(s){var q,r;n.init(s);k=n.SHORT(2)==65504?4+n.SHORT(4):2;for(r=0,q=p.length;r=v.length){break}}},purge:function(){p=[];n.init(null);n=null}}}});h("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(k,j){return function i(){var p,m,l,n={},s;p=new j();m={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"}};s={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"}};function o(t,B){var v=p.SHORT(t),y,E,F,A,z,u,w,C,D=[],x={};for(y=0;y4){w=p.LONG(w)+n.tiffHeader}for(E=0;E4){w=p.LONG(w)+n.tiffHeader}x[F]=p.STRING(w,z-1);continue;case 3:if(z>2){w=p.LONG(w)+n.tiffHeader}for(E=0;E1){w=p.LONG(w)+n.tiffHeader}for(E=0;E=65472&&y<=65475){x+=5;return{height:r.SHORT(x),width:r.SHORT(x+=2)}}z=r.SHORT(x+=2);x+=z-2}return null}p=w;r=new m();r.init(p);if(r.SHORT(0)!==65496){throw new i.ImageError(i.ImageError.WRONG_FORMAT)}t=new k(w);s=new j();o=!!s.init(t.get("app1")[0]);v=u.call(this);n.extend(this,{type:"image/jpeg",size:p.length,width:v&&v.width||0,height:v&&v.height||0,setExif:function(x,y){if(!o){return false}if(n.typeOf(x)==="object"){n.each(x,function(A,z){s.setExif(z,A)})}else{s.setExif(x,y)}t.set("app1",s.getBinary())},writeHeaders:function(){if(!arguments.length){return(p=t.restore(p))}return t.restore(arguments[0])},stripHeaders:function(x){return t.strip(x)},purge:function(){q.call(this)}});if(o){this.meta={tiff:s.TIFF(),exif:s.EXIF(),gps:s.GPS()}}function q(){if(!s||!t||!r){return}s.purge();t.purge();r.init(null);p=v=t=s=r=null}}return l});h("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(i,l,k){function j(u){var n,p,r,q,t;n=u;p=new k();p.init(n);(function(){var v=0,x=0,w=[35152,20039,3338,6666];for(x=0;xv?v-w:G;var A=0;while(Ap?p-A:G;o.clearRect(0,0,G,G);o.drawImage(I,-A,-w);var t=(A*C/p+r)<<0;var u=Math.ceil(B*C/p);var s=(w*z/v/E+q)<<0;var F=Math.ceil(H*z/v/E);D.drawImage(l,0,0,B,H,t,s,u,F);A+=G}w+=G}l=o=null}function j(n){var m=n.naturalWidth,p=n.naturalHeight;if(m*p>1024*1024){var o=document.createElement("canvas");o.width=o.height=1;var l=o.getContext("2d");l.drawImage(n,-m+1,0);return l.getImageData(0,0,1,1).data[3]===0}else{return false}}function k(p,m,u){var l=document.createElement("canvas");l.width=1;l.height=u;var v=l.getContext("2d");v.drawImage(p,0,0);var o=v.getImageData(0,0,1,u).data;var s=0;var q=u;var t=u;while(t>s){var n=o[(t-1)*4+3];if(n===0){q=t}else{s=t}t=(q+s)>>1}l=null;var r=(t/u);return(r===0)?1:r}return{isSubsampled:j,renderTo:i}});h("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/MegaPixel","moxie/core/utils/Mime","moxie/core/utils/Env"],function(o,i,p,k,m,r,q,j,l){function n(){var C=this,B,G,A,w,E,I=false,t=true;i.extend(this,{loadFromBlob:function(L){var K=this,M=K.getRuntime(),J=arguments.length>1?arguments[1]:true;if(!M.can("access_binary")){throw new p.RuntimeError(p.RuntimeError.NOT_SUPPORTED_ERR)}E=L;if(L.isDetached()){w=L.getSource();z.call(this,w);return}else{F.call(this,L.getSource(),function(N){if(J){w=H(N)}z.call(K,N)})}},loadFromImage:function(J,K){this.meta=J.meta;E=new m(null,{name:J.name,size:J.size,type:J.type});z.call(this,K?(w=J.getAsBinaryString()):J.getAsDataURL())},getInfo:function(){var J=this.getRuntime(),K;if(!G&&w&&J.can("access_image_binary")){G=new r(w)}K={width:x().width||0,height:x().height||0,type:E.type||j.getFileMime(E.name),size:w&&w.length||E.size||0,name:E.name||"",meta:G&&G.meta||this.meta||{}};return K},downsize:function(){s.apply(this,arguments)},getAsCanvas:function(){if(A){A.id=this.uid+"_canvas"}return A},getAsBlob:function(J,K){if(J!==this.type){s.call(this,this.width,this.height,false)}return new m(null,{name:E.name||"",type:J,data:C.getAsBinaryString.call(this,J,K)})},getAsDataURL:function(K){var L=arguments[1]||90;if(!I){return B.src}if("image/jpeg"!==K){return A.toDataURL("image/png")}else{try{return A.toDataURL("image/jpeg",L/100)}catch(J){return A.toDataURL("image/jpeg")}}},getAsBinaryString:function(K,M){if(!I){if(!w){w=H(C.getAsDataURL(K,M))}return w}if("image/jpeg"!==K){w=H(C.getAsDataURL(K,M))}else{var L;if(!M){M=90}try{L=A.toDataURL("image/jpeg",M/100)}catch(J){L=A.toDataURL("image/jpeg")}w=H(L);if(G){w=G.stripHeaders(w);if(t){if(G.meta&&G.meta.exif){G.setExif({PixelXDimension:this.width,PixelYDimension:this.height})}w=G.writeHeaders(w)}G.purge();G=null}}I=false;return w},destroy:function(){C=null;u.call(this);this.getRuntime().getShim().removeInstance(this.uid)}});function x(){if(!A&&!B){throw new p.ImageError(p.DOMException.INVALID_STATE_ERR)}return A||B}function H(J){return k.atob(J.substring(J.indexOf("base64,")+7))}function D(K,J){return"data:"+(J||"")+";base64,"+k.btoa(K)}function z(K){var J=this;B=new Image();B.onerror=function(){u.call(this);J.trigger("error",new p.ImageError(p.ImageError.WRONG_FORMAT))};B.onload=function(){J.trigger("load")};B.src=/^data:[^;]*;base64,/.test(K)?K:D(K,E.type)}function F(L,M){var K=this,J;if(window.FileReader){J=new FileReader();J.onload=function(){M(this.result)};J.onerror=function(){K.trigger("error",new p.FileException(p.FileException.NOT_READABLE_ERR))};J.readAsDataURL(L)}else{return M(L.getAsDataURL())}}function s(K,V,Q,S){var W=this,N,M,T=0,R=0,P,U,L,J;t=S;J=(this.meta&&this.meta.tiff&&this.meta.tiff.Orientation)||1;if(i.inArray(J,[5,6,7,8])!==-1){var O=K;K=V;V=O}P=x();M=!Q?Math.min:Math.max;N=M(K/P.width,V/P.height);if(N>1&&(!Q||S)){this.trigger("Resize");return}if(!A){A=document.createElement("canvas")}U=Math.round(P.width*N);L=Math.round(P.height*N);if(Q){A.width=K;A.height=V;if(U>K){T=Math.round((U-K)/2)}if(L>V){R=Math.round((L-V)/2)}}else{A.width=U;A.height=L}if(!t){y(A.width,A.height,J)}v.call(this,P,A,-T,-R,U,L);this.width=A.width;this.height=A.height;I=true;W.trigger("Resize")}function v(M,N,J,P,L,O){if(l.OS==="iOS"){q.renderTo(M,N,{width:L,height:O,x:J,y:P})}else{var K=N.getContext("2d");K.drawImage(M,J,P,L,O)}}function y(M,J,L){switch(L){case 5:case 6:case 7:case 8:A.width=J;A.height=M;break;default:A.width=M;A.height=J}var K=A.getContext("2d");switch(L){case 2:K.translate(M,0);K.scale(-1,1);break;case 3:K.translate(M,J);K.rotate(Math.PI);break;case 4:K.translate(0,J);K.scale(1,-1);break;case 5:K.rotate(0.5*Math.PI);K.scale(1,-1);break;case 6:K.rotate(0.5*Math.PI);K.translate(0,-J);break;case 7:K.rotate(0.5*Math.PI);K.translate(M,-J);K.scale(-1,1);break;case 8:K.rotate(-0.5*Math.PI);K.translate(-M,0);break}}function u(){if(G){G.purge();G=null}w=B=A=E=null;I=false}}return(o.Image=n)});h("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(j,m,k,p,i){var n="flash",o={};function l(){var r;try{r=navigator.plugins["Shockwave Flash"];r=r.description}catch(t){try{r=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(s){r="0.0"}}r=r.match(/\d+/g);return parseFloat(r[0]+"."+r[1])}function q(s){var r=this,t;s=j.extend({swf_url:m.swf_url},s);i.call(this,s,n,{access_binary:function(u){return u&&r.mode==="browser"},access_image_binary:function(u){return u&&r.mode==="browser"},display_media:i.capTrue,do_cors:i.capTrue,drag_and_drop:false,report_upload_progress:function(){return r.mode==="client"},resize_image:i.capTrue,return_response_headers:false,return_response_type:function(u){if(u==="json"&&!!window.JSON){return true}return !j.arrayDiff(u,["","text","document"])||r.mode==="browser"},return_status_code:function(u){return r.mode==="browser"||!j.arrayDiff(u,[200,404])},select_file:i.capTrue,select_multiple:i.capTrue,send_binary_string:function(u){return u&&r.mode==="browser"},send_browser_cookies:function(u){return u&&r.mode==="browser"},send_custom_headers:function(u){return u&&r.mode==="browser"},send_multipart:i.capTrue,slice_blob:i.capTrue,stream_upload:function(u){return u&&r.mode==="browser"},summon_file_dialog:false,upload_filesize:function(u){return j.parseSizeStr(u)<=2097152||r.mode==="client"},use_http_method:function(u){return !j.arrayDiff(u,["GET","POST"])}},{access_binary:function(u){return u?"browser":"client"},access_image_binary:function(u){return u?"browser":"client"},report_upload_progress:function(u){return u?"browser":"client"},return_response_type:function(u){return j.arrayDiff(u,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(u){return j.arrayDiff(u,[200,404])?"browser":["client","browser"]},send_binary_string:function(u){return u?"browser":"client"},send_browser_cookies:function(u){return u?"browser":"client"},send_custom_headers:function(u){return u?"browser":"client"},stream_upload:function(u){return u?"client":"browser"},upload_filesize:function(u){return j.parseSizeStr(u)>=2097152?"client":"browser"}},"client");if(l()<10){this.mode=false}j.extend(this,{getShim:function(){return k.get(this.uid)},shimExec:function(v,w){var u=[].slice.call(arguments,2);return r.getShim().exec(this.uid,v,w,u)},init:function(){var v,w,u;u=this.getShimContainer();j.extend(u.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"});v='';if(m.browser==="IE"){w=document.createElement("div");u.appendChild(w);w.outerHTML=v;w=u=null}else{u.innerHTML=v}t=setTimeout(function(){if(r&&!r.initialized){r.trigger("Error",new p.RuntimeError(p.RuntimeError.NOT_INIT_ERR))}},5000)},destroy:(function(u){return function(){u.call(r);clearTimeout(t);s=t=u=r=null}}(this.destroy))},o)}i.addConstructor(n,q);return o});h("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(j,k){var i={slice:function(n,p,l,o){var m=this.getRuntime();if(p<0){p=Math.max(n.size+p,0)}else{if(p>0){p=Math.min(p,n.size)}}if(l<0){l=Math.max(n.size+l,0)}else{if(l>0){l=Math.min(l,n.size)}}n=m.shimExec.call(this,"Blob","slice",p,l,o||"");if(n){n=new k(m.uid,n)}return n}};return(j.Blob=i)});h("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime"],function(i){var j={init:function(k){this.getRuntime().shimExec.call(this,"FileInput","init",{name:k.name,accept:k.accept,multiple:k.multiple});this.trigger("ready")}};return(i.FileInput=j)});h("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(l,i){var j="";function k(n,o){switch(o){case"readAsText":return i.atob(n,"utf8");case"readAsBinaryString":return i.atob(n);case"readAsDataURL":return n}return null}var m={read:function(q,o){var p=this,n=p.getRuntime();if(q==="readAsDataURL"){j="data:"+(o.type||"")+";base64,"}p.bind("Progress",function(s,r){if(r){j+=k(r,q)}});return n.shimExec.call(this,"FileReader","readAsBase64",o.uid)},getResult:function(){return j},destroy:function(){j=null}};return(l.FileReader=m)});h("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(k,i){function j(m,n){switch(n){case"readAsText":return i.atob(m,"utf8");case"readAsBinaryString":return i.atob(m);case"readAsDataURL":return m}return null}var l={read:function(p,o){var m,n=this.getRuntime();m=n.shimExec.call(this,"FileReaderSync","readAsBase64",o.uid);if(!m){return null}if(p==="readAsDataURL"){m="data:"+(o.type||"")+";base64,"+m}return j(m,p,o.type)}};return(k.FileReaderSync=l)});h("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter"],function(j,m,p,i,o,n,l){var k={send:function(x,s){var u=this,y=u.getRuntime();function r(){x.transport=y.mode;y.shimExec.call(u,"XMLHttpRequest","send",x,s)}function t(A,z){y.shimExec.call(u,"XMLHttpRequest","appendBlob",A,z.uid);s=null;r()}function v(A,z){var B=new l();B.bind("TransportingComplete",function(){z(this.result)});B.transport(A.getSource(),A.type,{ruid:y.uid})}if(!m.isEmptyObj(x.headers)){m.each(x.headers,function(z,A){y.shimExec.call(u,"XMLHttpRequest","setRequestHeader",A,z.toString())})}if(s instanceof n){var w;s.each(function(A,z){if(A instanceof p){w=z}else{y.shimExec.call(u,"XMLHttpRequest","append",z,A)}});if(!s.hasBlob()){s=null;r()}else{var q=s.getBlob();if(q.isDetached()){v(q,function(z){q.destroy();t(w,z)})}else{t(w,q)}}}else{if(s instanceof p){if(s.isDetached()){v(s,function(z){s.destroy();s=z.uid;r()})}else{s=s.uid;r()}}else{r()}}},getResponse:function(t){var q,s,r=this.getRuntime();s=r.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob");if(s){s=new i(r.uid,s);if("blob"===t){return s}try{q=new o();if(!!~m.inArray(t,["","text"])){return q.readAsText(s)}else{if("json"===t&&!!window.JSON){return JSON.parse(q.readAsText(s))}}}finally{s.destroy()}}return null},abort:function(r){var q=this.getRuntime();q.shimExec.call(this,"XMLHttpRequest","abort");this.dispatchEvent("readystatechange");this.dispatchEvent("abort")}};return(j.XMLHttpRequest=k)});h("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(i,k){var j={getAsBlob:function(n){var m=this.getRuntime(),l=m.shimExec.call(this,"Transporter","getAsBlob",n);if(l){return new k(m.uid,l)}return null}};return(i.Transporter=j)});h("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(j,l,k,n,m){var i={loadFromBlob:function(r){var q=this,p=q.getRuntime();function o(t){p.shimExec.call(q,"Image","loadFromBlob",t.uid);q=p=null}if(r.isDetached()){var s=new k();s.bind("TransportingComplete",function(){o(s.result.getSource())});s.transport(r.getSource(),r.type,{ruid:p.uid})}else{o(r.getSource())}},loadFromImage:function(p){var o=this.getRuntime();return o.shimExec.call(this,"Image","loadFromImage",p.uid)},getAsBlob:function(q,r){var p=this.getRuntime(),o=p.shimExec.call(this,"Image","getAsBlob",q,r);if(o){return new n(p.uid,o)}return null},getAsDataURL:function(){var q=this.getRuntime(),p=q.Image.getAsBlob.apply(this,arguments),o;if(!p){return null}o=new m();return o.readAsDataURL(p)}};return(j.Image=i)});h("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(j,m,l,p,i){var n="silverlight",o={};function q(z){var C=false,v=null,r,s,t,B,u,x=0;try{try{v=new ActiveXObject("AgControl.AgControl");if(v.IsVersionSupported(z)){C=true}v=null}catch(y){var w=navigator.plugins["Silverlight Plug-In"];if(w){r=w.description;if(r==="1.0.30226.2"){r="2.0.30226.2"}s=r.split(".");while(s.length>3){s.pop()}while(s.length<4){s.push(0)}t=z.split(".");while(t.length>4){t.pop()}do{B=parseInt(t[x],10);u=parseInt(s[x],10);x++}while(x';t=setTimeout(function(){if(r&&!r.initialized){r.trigger("Error",new p.RuntimeError(p.RuntimeError.NOT_INIT_ERR))}},m.OS!=="Windows"?10000:5000)},destroy:(function(u){return function(){u.call(r);clearTimeout(t);s=t=u=r=null}}(this.destroy))},o)}i.addConstructor(n,k);return o});h("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(i,j,k){return(i.Blob=j.extend({},k))});h("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime"],function(i){var j={init:function(l){function k(n){var o="";for(var m=0;m=28)||(k.browser==="IE"&&k.version>=10)}()),resize_image:function(){return m.Image&&p.can("access_binary")&&k.can("create_canvas")},report_upload_progress:false,return_response_headers:false,return_response_type:function(t){if(t==="json"&&!!window.JSON){return true}return !!~o.inArray(t,["text","document",""])},return_status_code:function(t){return !o.arrayDiff(t,[200,404])},select_file:function(){return k.can("use_fileinput")},select_multiple:false,send_binary_string:false,send_custom_headers:false,send_multipart:true,slice_blob:false,stream_upload:function(){return p.can("select_file")},summon_file_dialog:s(function(){return(k.browser==="Firefox"&&k.version>=4)||(k.browser==="Opera"&&k.version>=12)||!!~o.inArray(k.browser,["Chrome","Safari"])}()),upload_filesize:r,use_http_method:function(t){return !o.arrayDiff(t,["GET","POST"])}});o.extend(this,{init:function(){this.trigger("Init")},destroy:(function(t){return function(){t.call(p);t=p=null}}(this.destroy))});o.extend(this.getShim(),m)}l.addConstructor(n,j);return m});h("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(m,o,l,j,k,i){function n(){var s,q=[],t=[],p;function r(){var w=this,z=w.getRuntime(),y,x,u,B,v,A;A=o.guid("uid_");y=z.getShimContainer();if(s){u=l.get(s+"_form");if(u){o.extend(u.style,{top:"100%"})}}B=document.createElement("form");B.setAttribute("id",A+"_form");B.setAttribute("method","post");B.setAttribute("enctype","multipart/form-data");B.setAttribute("encoding","multipart/form-data");o.extend(B.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"});v=document.createElement("input");v.setAttribute("id",A);v.setAttribute("type","file");v.setAttribute("name",p.name||"Filedata");v.setAttribute("accept",t.join(","));o.extend(v.style,{fontSize:"999px",opacity:0});B.appendChild(v);y.appendChild(B);o.extend(v.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});if(i.browser==="IE"&&i.version<10){o.extend(v.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"})}v.onchange=function(){var D;if(!this.value){return}if(this.files){D=this.files[0]}else{D={name:this.value}}q=[D];this.onchange=function(){};r.call(w);w.bind("change",function C(){var E=l.get(A),G=l.get(A+"_form"),F;w.unbind("change",C);if(w.files.length&&E&&G){F=w.files[0];E.setAttribute("id",F.uid);G.setAttribute("id",F.uid+"_form");G.setAttribute("target",F.uid+"_iframe")}E=G=null},998);v=B=null;w.trigger("change")};if(z.can("summon_file_dialog")){x=l.get(p.browse_button);j.removeEvent(x,"click",w.uid);j.addEvent(x,"click",function(C){if(v&&!v.disabled){v.click()}C.preventDefault()},w.uid)}s=A;y=u=x=null}o.extend(this,{init:function(x){var u=this,w=u.getRuntime(),v;p=x;t=x.accept.mimes||k.extList2mimes(x.accept,w.can("filter_by_extension"));v=w.getShimContainer();(function(){var y,A,z;y=l.get(x.browse_button);if(w.can("summon_file_dialog")){if(l.getStyle(y,"position")==="static"){y.style.position="relative"}A=parseInt(l.getStyle(y,"z-index"),10)||1;y.style.zIndex=A;v.style.zIndex=A-1}z=w.can("summon_file_dialog")?y:v;j.addEvent(z,"mouseover",function(){u.trigger("mouseenter")},u.uid);j.addEvent(z,"mouseout",function(){u.trigger("mouseleave")},u.uid);j.addEvent(z,"mousedown",function(){u.trigger("mousedown")},u.uid);j.addEvent(l.get(x.container),"mouseup",function(){u.trigger("mouseup")},u.uid);y=null}());r.call(this);v=null;u.trigger({type:"ready",async:true})},getFiles:function(){return q},disable:function(v){var u;if((u=l.get(s))){u.disabled=!!v}},destroy:function(){var v=this.getRuntime(),w=v.getShim(),u=v.getShimContainer();j.removeAllEvents(u,this.uid);j.removeAllEvents(p&&l.get(p.container),this.uid);j.removeAllEvents(p&&l.get(p.browse_button),this.uid);if(u){u.innerHTML=""}w.removeInstance(this.uid);s=q=t=p=u=w=null}})}return(m.FileInput=n)});h("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(i,j){return(i.FileReader=j)});h("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(m,j,l,i,n,p,k,q){function o(){var t,r,u;function s(v){var A=this,y,z,w,x,B=false;if(!u){return}y=u.id.replace(/_iframe$/,"");z=l.get(y+"_form");if(z){w=z.getElementsByTagName("input");x=w.length;while(x--){switch(w[x].getAttribute("type")){case"hidden":w[x].parentNode.removeChild(w[x]);break;case"file":B=true;break}}w=[];if(!B){z.parentNode.removeChild(z)}z=null}setTimeout(function(){p.removeEvent(u,"load",A.uid);if(u.parentNode){u.parentNode.removeChild(u)}var C=A.getRuntime().getShimContainer();if(!C.children.length){C.parentNode.removeChild(C)}C=u=null;v()},1)}j.extend(this,{send:function(D,x){var z=this,C=z.getRuntime(),y,w,B,v;t=r=null;function A(){var E=C.getShimContainer()||document.body,F=document.createElement("div");F.innerHTML='';u=F.firstChild;E.appendChild(u);p.addEvent(u,"load",function(){var H;try{H=u.contentWindow.document||u.contentDocument||window.frames[u.id].document;if(/^4(0[0-9]|1[0-7]|2[2346])\s/.test(H.title)){t=H.title.replace(/^(\d+).*$/,"$1")}else{t=200;r=j.trim(H.body.innerHTML);z.trigger({type:"progress",loaded:r.length,total:r.length});if(v){z.trigger({type:"uploadprogress",loaded:v.size||1025,total:v.size||1025})}}}catch(G){if(i.hasSameOrigin(D.url)){t=404}else{s.call(z,function(){z.trigger("error")});return}}s.call(z,function(){z.trigger("load")})},z.uid)}if(x instanceof q&&x.hasBlob()){v=x.getBlob();y=v.uid;B=l.get(y);w=l.get(y+"_form");if(!w){throw new n.DOMException(n.DOMException.NOT_FOUND_ERR)}}else{y=j.guid("uid_");w=document.createElement("form");w.setAttribute("id",y+"_form");w.setAttribute("method",D.method);w.setAttribute("enctype","multipart/form-data");w.setAttribute("encoding","multipart/form-data");w.setAttribute("target",y+"_iframe");C.getShimContainer().appendChild(w)}if(x instanceof q){x.each(function(G,E){if(G instanceof k){if(B){B.setAttribute("name",E)}}else{var F=document.createElement("input");j.extend(F,{type:"hidden",name:E,value:G});if(B){w.insertBefore(F,B)}else{w.appendChild(F)}}})}w.setAttribute("action",D.url);A();w.submit();z.trigger("loadstart")},getStatus:function(){return t},getResponse:function(v){if("json"===v){if(j.typeOf(r)==="string"&&!!window.JSON){try{return JSON.parse(r.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(w){return null}}}else{if("document"===v){}}return r},abort:function(){var v=this;if(u&&u.contentWindow){if(u.contentWindow.stop){u.contentWindow.stop()}else{if(u.contentWindow.document.execCommand){u.contentWindow.document.execCommand("Stop")}else{u.src="about:blank"}}}s.call(this,function(){v.dispatchEvent("abort")})}})}return(m.XMLHttpRequest=o)});h("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(j,i){return(j.Image=i)});a(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/file/FileDrop","moxie/runtime/RuntimeTarget","moxie/file/FileReader","moxie/core/utils/Url","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events"])})(this);(function(){var c={},b=moxie.core.utils.Basic.inArray;(function a(e){var d,f;for(d in e){f=typeof(e[d]);if(f==="object"&&!~b(d,["Exceptions","Env","Mime"])){a(e[d])}else{if(f==="function"){c[d]=e[d]}}}})(window.moxie);c.Env=window.moxie.core.utils.Env;c.Mime=window.moxie.core.utils.Mime;c.Exceptions=window.moxie.core.Exceptions;window.mOxie=c;if(!window.o){window.o=c}return c})();