You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
105 KiB

var MXI_DEBUG=true;(function(b,g){var d={};function c(m,n){var l,j=[];for(var k=0;k<m.length;++k){l=d[m[k]]||e(m[k]);if(!l){throw"module definition dependecy not found: "+m[k]}j.push(l)}n.apply(null,j)}function h(k,j,i){if(typeof k!=="string"){throw"invalid module definition, module id must be defined and be a string"}if(j===g){throw"invalid module definition, dependencies must be specified"}if(i===g){throw"invalid module definition, definition function must be specified"}c(j,function(){d[k]=i.apply(null,arguments)})}function f(i){return !!d[i]}function e(l){var j=b;var i=l.split(/[.\/]/);for(var k=0;k<i.length;++k){if(!j[i[k]]){return}j=j[i[k]]}return j}function a(l){for(var k=0;k<l.length;k++){var m=b;var o=l[k];var j=o.split(/[.\/]/);for(var n=0;n<j.length-1;++n){if(m[j[n]]===g){m[j[n]]={}}m=m[j[n]]}m[j[j.length-1]]=d[o]}}h("moxie/core/utils/Basic",[],function(){var s=function(x){var w;if(x===w){return"undefined"}else{if(x===null){return"null"}else{if(x.nodeType){return"node"}}}return({}).toString.call(x).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};var n=function(x){var w;q(arguments,function(y,z){if(z>0){q(y,function(B,A){if(B!==w){if(s(x[A])===s(B)&&!!~v(s(B),["array","object"])){n(x[A],B)}else{x[A]=B}}})}});return x};var q=function(A,B){var z,x,w,y;if(A){if(s(A.length)==="number"){for(w=0,z=A.length;w<z;w++){if(B(A[w],w)===false){return}}}else{if(s(A)==="object"){for(x in A){if(A.hasOwnProperty(x)){if(B(A[x],x)===false){return}}}}}}};var t=function(w){var x;if(!w||s(w)!=="object"){return true}for(x in w){return false}return true};var l=function(x,w){var y=0,z=x.length;if(s(w)!=="function"){w=function(){}}if(!x||!x.length){w()}function A(B){if(s(x[B])==="function"){x[B](function(C){++B<z&&!C?A(B):w(C)})}}A(y)};var i=function(x,w){var z=0,y=x.length,A=new Array(y);q(x,function(C,B){C(function(E){if(E){return w(E)}var D=[].slice.call(arguments);D.shift();A[B]=D;z++;if(z===y){A.unshift(null);w.apply(this,A)}})})};var v=function(y,z){if(z){if(Array.prototype.indexOf){return Array.prototype.indexOf.call(z,y)}for(var w=0,x=z.length;w<x;w++){if(z[w]===y){return w}}}return -1};var r=function(x,z){var y=[];if(s(x)!=="array"){x=[x]}if(s(z)!=="array"){z=[z]}for(var w in x){if(v(x[w],z)===-1){y.push(x[w])}}return y.length?y:false};var u=function(y,x){var w=[];q(y,function(z){if(v(z,x)!==-1){w.push(z)}});return w.length?w:null};var m=function(y){var x,w=[];for(x=0;x<y.length;x++){w[x]=y[x]}return w};var p=(function(){var w=0;return function(z){var x=new Date().getTime().toString(32),y;for(y=0;y<5;y++){x+=Math.floor(Math.random()*65535).toString(32)}return(z||"o_")+x+(w++).toString(32)}}());var j=function(w){if(!w){return w}return String.prototype.trim?String.prototype.trim.call(w):w.toString().replace(/^\s*/,"").replace(/\s*$/,"")};var k=function(w){if(typeof(w)!=="string"){return w}var y={t:1099511627776,g:1073741824,m:1048576,k:1024},x;w=/^([0-9\.]+)([tmgk]?)$/.exec(w.toLowerCase().replace(/[^0-9\.tmkg]/g,""));x=w[2];w=+w[1];if(y.hasOwnProperty(x)){w*=y[x]}return Math.floor(w)};var o=function(x){var w=[].slice.call(arguments,1);return x.replace(/%[a-z]/g,function(){var y=w.shift();return s(y)!=="undefined"?y:""})};return{guid:p,typeOf:s,extend:n,each:q,isEmptyObj:t,inSeries:l,inParallel:i,inArray:v,arrayDiff:r,arrayIntersect:u,toArray:m,trim:j,sprintf:o,parseSizeStr:k}});h("moxie/core/utils/Env",["moxie/core/utils/Basic"],function(m){var k=(function(s){var I="",H="?",C="function",u="undefined",q="object",r="major",D="model",t="name",z="type",x="vendor",F="version",o="architecture",v="console",B="mobile",G="tablet";var p={has:function(K,J){return J.toLowerCase().indexOf(K.toLowerCase())!==-1},lowerize:function(J){return J.toLowerCase()}};var E={rgx:function(){for(var T,N=0,M,L,K,J,O,P,Q=arguments;N<Q.length;N+=2){var S=Q[N],R=Q[N+1];if(typeof(T)===u){T={};for(K in R){J=R[K];if(typeof(J)===q){T[J[0]]=s}else{T[J]=s}}}for(M=L=0;M<S.length;M++){O=S[M].exec(this.getUA());if(!!O){for(K=0;K<R.length;K++){P=O[++L];J=R[K];if(typeof(J)===q&&J.length>0){if(J.length==2){if(typeof(J[1])==C){T[J[0]]=J[1].call(this,P)}else{T[J[0]]=J[1]}}else{if(J.length==3){if(typeof(J[1])===C&&!(J[1].exec&&J[1].test)){T[J[0]]=P?J[1].call(this,P,J[2]):s}else{T[J[0]]=P?P.replace(J[1],J[2]):s}}else{if(J.length==4){T[J[0]]=P?J[3].call(this,P.replace(J[1],J[2])):s}}}}else{T[J]=P?P:s}}break}}if(!!O){break}}return T},str:function(M,L){for(var K in L){if(typeof(L[K])===q&&L[K].length>0){for(var J=0;J<L[K].length;J++){if(p.has(L[K][J],M)){return(K===H)?s:K}}}else{if(p.has(L[K],M)){return(K===H)?s:K}}}return M}};var A={browser:{oldsafari:{major:{"1":["/8","/1","/3"],"2":"/4","?":"/"},version:{"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0","2000":"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0","7":"NT 6.1","8":"NT 6.2","8.1":"NT 6.3",RT:"ARM"}}}};var y={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[t,F],[/\s(opr)\/([\w\.]+)/i],[[t,"Opera"],F],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],[t,F],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[t,"IE"],F],[/(edge)\/((\d+)?[\w\.]+)/i],[t,F],[/(yabrowser)\/([\w\.]+)/i],[[t,"Yandex"],F],[/(comodo_dragon)\/([\w\.]+)/i],[[t,/_/g," "],F],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],[t,F],[/(dolfin)\/([\w\.]+)/i],[[t,"Dolphin"],F],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[t,"Chrome"],F],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[F,[t,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[F,[t,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[F,[t,"Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[F,[t,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[F,t],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[t,[F,E.str,A.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[t,F],[/(navigator|netscape)\/([\w\.-]+)/i],[[t,"Netscape"],F],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[t,F]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[F,[t,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[t,F],[/rv\:([\w\.]+).*(gecko)/i],[F,t]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[t,F],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[t,[F,E.str,A.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[t,"Windows"],[F,E.str,A.os.windows.version]],[/\((bb)(10);/i],[[t,"BlackBerry"],F],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[t,F],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[t,"Symbian"],F],[/\((series40);/i],[t],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[t,"Firefox OS"],F],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[t,F],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[t,"Chromium OS"],F],[/(sunos)\s?([\w\.]+\d)*/i],[[t,"Solaris"],F],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[t,F],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[t,"iOS"],[F,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[t,"Mac OS"],[F,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[t,F]]};var w=function(J){var K=J||((window&&window.navigator&&window.navigator.userAgent)?window.navigator.userAgent:I);this.getBrowser=function(){return E.rgx.apply(this,y.browser)};this.getEngine=function(){return E.rgx.apply(this,y.engine)};this.getOS=function(){return E.rgx.apply(this,y.os)};this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}};this.getUA=function(){return K};this.setUA=function(L){K=L;return this};this.setUA(K)};return w})();function j(w,u,p){var t=0,v=0,o=0,q={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},r=function(x){x=(""+x).replace(/[_\-+]/g,".");x=x.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".");return(!x.length?[-8]:x.split("."))},s=function(x){return !x?0:(isNaN(x)?q[x]||-7:parseInt(x,10))};w=r(w);u=r(u);v=Math.max(w.length,u.length);for(t=0;t<v;t++){if(w[t]==u[t]){continue}w[t]=s(w[t]);u[t]=s(u[t]);if(w[t]<u[t]){o=-1;break}else{if(w[t]>u[t]){o=1;break}}}if(!p){return o}switch(p){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 l=(function(){var o={define_property:(function(){return false}()),create_canvas:(function(){var p=document.createElement("canvas");return !!(p.getContext&&p.getContext("2d"))}()),return_response_type:function(p){try{if(m.inArray(p,["","text","document"])!==-1){return true}else{if(window.XMLHttpRequest){var r=new XMLHttpRequest();r.open("get","/");if("responseType" in r){r.responseType=p;if(r.responseType!==p){return false}return true}}}}catch(q){}return false},use_data_uri:(function(){var p=new Image();p.onload=function(){o.use_data_uri=(p.width===1&&p.height===1)};setTimeout(function(){p.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1);return false}()),use_data_uri_over32kb:function(){return o.use_data_uri&&(i.browser!=="IE"||i.version>=9)},use_data_uri_of:function(p){return(o.use_data_uri&&p<33000||o.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 p=document.createElement("input");p.setAttribute("type","file");return !p.disabled}};return function(q){var p=[].slice.call(arguments);p.shift();return m.typeOf(o[q])==="function"?o[q].apply(this,p):!!o[q]}}());var n=new k().getResult();var i={can:l,uaParser:k,browser:n.browser.name,version:n.browser.version,os:n.os.name,osVersion:n.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;if(MXI_DEBUG){i.debug={runtime:true,events:false};i.log=function(){function p(r){o.appendChild(document.createTextNode(r+"\n"))}var q=arguments[0];if(m.typeOf(q)==="string"){q=m.sprintf.apply(this,arguments)}if(window&&window.console&&window.console.log){window.console.log(q)}else{if(document){var o=document.getElementById("moxie-console");if(!o){o=document.createElement("pre");o.id="moxie-console";document.body.appendChild(o)}if(m.inArray(m.typeOf(q),["object","array"])!==-1){p(q)}else{o.appendChild(document.createTextNode(q+"\n"))}}}}}return i});h("moxie/core/I18n",["moxie/core/utils/Basic"],function(j){var i={};return{addI18n:function(k){return j.extend(i,k)},translate:function(k){return i[k]||k},_:function(k){return this.translate(k)},sprintf:function(l){var k=[].slice.call(arguments,1);return l.replace(/%[a-z]/g,function(){var m=k.shift();return j.typeOf(m)!=="undefined"?m:""})}}});h("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(l,k){var i="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 j={mimes:{},extensions:{},addMimeType:function(m){var n=m.split(/,/),o,q,p;for(o=0;o<n.length;o+=2){p=n[o+1].split(/ /);for(q=0;q<p.length;q++){this.mimes[p[q]]=n[o]}this.extensions[n[o]]=p}},extList2mimes:function(s,t){var n=this,r,o,q,p,m=[];for(o=0;o<s.length;o++){r=s[o].extensions.split(/\s*,\s*/);for(q=0;q<r.length;q++){if(r[q]==="*"){return[]}p=n.mimes[r[q]];if(p&&l.inArray(p,m)===-1){m.push(p)}if(t&&/^\w+$/.test(r[q])){m.push("."+r[q])}else{if(!p){return[]}}}}return m},mimes2exts:function(m){var n=this,o=[];l.each(m,function(q){if(q==="*"){o=[];return false}var p=q.match(/^(\w+)\/(\*|\w+)$/);if(p){if(p[2]==="*"){l.each(n.extensions,function(r,s){if((new RegExp("^"+p[1]+"/")).test(s)){[].push.apply(o,n.extensions[s])}})}else{if(n.extensions[q]){[].push.apply(o,n.extensions[q])}}}});return o},mimes2extList:function(m){var o=[],n=[];if(l.typeOf(m)==="string"){m=l.trim(m).split(/\s*,\s*/)}n=this.mimes2exts(m);o.push({title:k.translate("Files"),extensions:n.length?n.join(","):"*"});o.mimes=m;return o},getFileExtension:function(n){var m=n&&n.match(/\.([^.]+)$/);if(m){return m[1].toLowerCase()}return""},getFileMime:function(m){return this.mimes[this.getFileExtension(m)]||""}};j.addMimeType(i);return j});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,INVALID_META_ERR:3};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/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(j,i,k){function l(){var m={};k.extend(this,{uid:null,init:function(){if(!this.uid){this.uid=k.guid("uid_")}},addEventListener:function(r,q,o,p){var n=this,s;if(!this.hasOwnProperty("uid")){this.uid=k.guid("uid_")}r=k.trim(r);if(/\s/.test(r)){k.each(r.split(/\s+/),function(t){n.addEventListener(t,q,o,p)});return}r=r.toLowerCase();o=parseInt(o,10)||0;s=m[this.uid]&&m[this.uid][r]||[];s.push({fn:q,priority:o,scope:p||this});if(!m[this.uid]){m[this.uid]={}}m[this.uid][r]=s},hasEventListener:function(n){var o=n?m[this.uid]&&m[this.uid][n]:m[this.uid];return o?o:false},removeEventListener:function(p,o){p=p.toLowerCase();var q=m[this.uid]&&m[this.uid][p],n;if(q){if(o){for(n=q.length-1;n>=0;n--){if(q[n].fn===o){q.splice(n,1);break}}}else{q=[]}if(!q.length){delete m[this.uid][p];if(k.isEmptyObj(m[this.uid])){delete m[this.uid]}}}},removeAllEventListeners:function(){if(m[this.uid]){delete m[this.uid]}},dispatchEvent:function(s){var p,q,r,t,u={},v=true,n;if(k.typeOf(s)!=="string"){t=s;if(k.typeOf(t.type)==="string"){s=t.type;if(t.total!==n&&t.loaded!==n){u.total=t.total;u.loaded=t.loaded}u.async=t.async||false}else{throw new i.EventException(i.EventException.UNSPECIFIED_EVENT_TYPE_ERR)}}if(s.indexOf("::")!==-1){(function(w){p=w[0];s=w[1]}(s.split("::")))}else{p=this.uid}s=s.toLowerCase();q=m[p]&&m[p][s];if(q){q.sort(function(x,w){return w.priority-x.priority});r=[].slice.call(arguments);r.shift();u.type=s;r.unshift(u);if(MXI_DEBUG&&j.debug.events){j.log("Event '%s' fired on %u",u.type,p)}var o=[];k.each(q,function(w){r[0].target=w.scope;if(u.async){o.push(function(x){setTimeout(function(){x(w.fn.apply(w.scope,r)===false)},1)})}else{o.push(function(x){x(w.fn.apply(w.scope,r)===false)})}});if(o.length){k.inSeries(o,function(w){v=!w})}}return v},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(o){var n=this;this.bind(o.join(" "),function(p){var q="on"+p.type.toLowerCase();if(k.typeOf(this[q])==="function"){this[q].apply(this,arguments)}});k.each(o,function(p){p="on"+p.toLowerCase(p);if(k.typeOf(n[p])==="undefined"){n[p]=null}})}})}l.instance=new l();return l});h("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(j,n,m,o){var i={},k={};function l(x,u,s,r,q){var w=this,p,v=n.guid(u+"_"),t=q||"browser";x=x||{};k[v]=this;s=n.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},s);if(x.preferred_caps){t=l.getMode(r,x.preferred_caps,t)}if(MXI_DEBUG&&j.debug.runtime){j.log("\tdefault mode: %s",t)}p=(function(){var y={};return{exec:function(B,z,C,A){if(p[z]){if(!y[B]){y[B]={context:this,instance:new p[z]()}}if(y[B].instance[C]){return y[B].instance[C].apply(this,A)}}},removeInstance:function(z){delete y[z]},removeAllInstances:function(){var z=this;n.each(y,function(B,A){if(n.typeOf(B.instance.destroy)==="function"){B.instance.destroy.call(B.context)}z.removeInstance(A)})}}}());n.extend(this,{initialized:false,uid:v,type:u,mode:l.getMode(r,(x.required_caps),t),shimid:v+"_container",clients:0,options:x,can:function(A,B){var y=arguments[2]||s;if(n.typeOf(A)==="string"&&n.typeOf(B)==="undefined"){A=l.parseCaps(A)}if(n.typeOf(A)==="object"){for(var z in A){if(!this.can(z,A[z],y)){return false}}return true}if(n.typeOf(y[A])==="function"){return y[A].call(this,B)}else{return(B===y[A])}},getShimContainer:function(){var y,z=m.get(this.shimid);if(!z){y=this.options.container?m.get(this.options.container):document.body;z=document.createElement("div");z.id=this.shimid;z.className="moxie-shim moxie-shim-"+this.type;n.extend(z.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"});y.appendChild(z);y=null}return z},getShim:function(){return p},shimExec:function(z,A){var y=[].slice.call(arguments,2);return w.getShim().exec.call(this,this.uid,z,A,y)},exec:function(z,A){var y=[].slice.call(arguments,2);if(w[z]&&w[z][A]){return w[z][A].apply(this,y)}return w.shimExec.apply(this,arguments)},destroy:function(){if(!w){return}var y=m.get(this.shimid);if(y){y.parentNode.removeChild(y)}if(p){p.removeAllInstances()}this.unbindAll();delete k[this.uid];this.uid=null;v=w=p=y=null}});if(this.mode&&x.required_caps&&!this.can(x.required_caps)){this.mode=false}}l.order="html5,flash,silverlight,html4";l.getRuntime=function(p){return k[p]?k[p]:false};l.addConstructor=function(q,p){p.prototype=o.instance;i[q]=p};l.getConstructor=function(p){return i[p]||null};l.getInfo=function(p){var q=l.getRuntime(p);if(q){return{uid:q.uid,type:q.type,mode:q.mode,can:function(){return q.can.apply(q,arguments)}}}return null};l.parseCaps=function(p){var q={};if(n.typeOf(p)!=="string"){return p||{}}n.each(p.split(","),function(r){q[r]=true});return q};l.can=function(q,s){var r,p=l.getConstructor(q),t;if(p){r=new p({required_caps:s});t=r.mode;r.destroy();return !!t}return false};l.thatCan=function(r,s){var q=(s||l.order).split(/\s*,\s*/);for(var p in q){if(l.can(q[p],r)){return q[p]}}return null};l.getMode=function(p,s,q){var r=null;if(n.typeOf(q)==="undefined"){q="browser"}if(s&&!n.isEmptyObj(p)){n.each(s,function(v,t){if(p.hasOwnProperty(t)){var u=p[t](v);if(typeof(u)==="string"){u=[u]}if(!r){r=u}else{if(!(r=n.arrayIntersect(r,u))){if(MXI_DEBUG&&j.debug.runtime){j.log("\t\t%c: %v (conflicting mode requested: %s)",t,v,u)}return(r=false)}}}if(MXI_DEBUG&&j.debug.runtime){j.log("\t\t%c: %v (compatible modes: %s)",t,v,r)}});if(r){return n.inArray(q,r)!==-1?q:r[0]}else{if(r===false){return false}}}return q};l.capTrue=function(){return true};l.capFalse=function(){return false};l.capTest=function(p){return function(){return !!p}};return l});h("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(j,i,m,l){return function k(){var n;m.extend(this,{connectRuntime:function(r){var p=this,q;function o(s){var u,t;if(!s.length){p.trigger("RuntimeError",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR));n=null;return}u=s.shift().toLowerCase();t=l.getConstructor(u);if(!t){o(s);return}if(MXI_DEBUG&&j.debug.runtime){j.log("Trying runtime: %s",u);j.log(r)}n=new t(r);n.bind("Init",function(){n.initialized=true;if(MXI_DEBUG&&j.debug.runtime){j.log("Runtime '%s' initialized",n.type)}setTimeout(function(){n.clients++;p.trigger("RuntimeInit",n)},1)});n.bind("Error",function(){if(MXI_DEBUG&&j.debug.runtime){j.log("Runtime '%s' failed to initialize",n.type)}n.destroy();o(s)});if(MXI_DEBUG&&j.debug.runtime){j.log("\tselected mode: %s",n.mode)}if(!n.mode){n.trigger("Error");return}n.init()}if(m.typeOf(r)==="string"){q=r}else{if(m.typeOf(r.ruid)==="string"){q=r.ruid}}if(q){n=l.getRuntime(q);if(n){n.clients++;return n}else{throw new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR)}}o((r.runtime_order||l.order).split(/\s*,\s*/))},disconnectRuntime:function(){if(n&&--n.clients<=0){n.destroy()}n=null},getRuntime:function(){if(n&&n.uid){return n}return n=null},exec:function(){if(n){return n.exec.apply(this,arguments)}return null}})}});h("moxie/file/FileInput",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/I18n","moxie/runtime/Runtime","moxie/runtime/RuntimeClient"],function(j,o,m,l,q,s,k,i,p){var r=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];function n(w){if(MXI_DEBUG){o.log("Instantiating FileInput...")}var u=this,t,v,x;if(j.inArray(j.typeOf(w),["string","node"])!==-1){w={browse_button:w}}v=l.get(w.browse_button);if(!v){throw new q.DOMException(q.DOMException.NOT_FOUND_ERR)}x={accept:[{title:k.translate("All Files"),extensions:"*"}],name:"file",multiple:false,required_caps:false,container:v.parentNode||document.body};w=j.extend({},x,w);if(typeof(w.required_caps)==="string"){w.required_caps=i.parseCaps(w.required_caps)}if(typeof(w.accept)==="string"){w.accept=m.mimes2extList(w.accept)}t=l.get(w.container);if(!t){t=document.body}if(l.getStyle(t,"position")==="static"){t.style.position="relative"}t=v=null;p.call(u);j.extend(u,{uid:j.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){u.bind("RuntimeInit",function(z,y){u.ruid=y.uid;u.shimid=y.shimid;u.bind("Ready",function(){u.trigger("Refresh")},999);u.bind("Refresh",function(){var D,C,B,A;B=l.get(w.browse_button);A=l.get(y.shimid);if(B){D=l.getPos(B,l.get(w.container));C=l.getSize(B);if(A){j.extend(A.style,{top:D.y+"px",left:D.x+"px",width:C.w+"px",height:C.h+"px"})}}A=B=null});y.exec.call(u,"FileInput","init",w)});u.connectRuntime(j.extend({},w,{required_caps:{select_file:true}}))},disable:function(z){var y=this.getRuntime();if(y){y.exec.call(this,"FileInput","disable",j.typeOf(z)==="undefined"?true:z)}},refresh:function(){u.trigger("Refresh")},destroy:function(){var y=this.getRuntime();if(y){y.exec.call(this,"FileInput","destroy");this.disconnectRuntime()}if(j.typeOf(this.files)==="array"){j.each(this.files,function(z){z.destroy()})}this.files=null;this.unbindAll()}});this.handleEventProps(r)}n.prototype=s.instance;return n});h("moxie/core/utils/Encode",[],function(){var k=function(m){return unescape(encodeURIComponent(m))};var l=function(m){return decodeURIComponent(escape(m))};var j=function(t,y){if(typeof(window.atob)==="function"){return y?l(window.atob(t)):window.atob(t)}var p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o,n,m,x,w,v,u,z,s=0,A=0,q="",r=[];if(!t){return t}t+="";do{x=p.indexOf(t.charAt(s++));w=p.indexOf(t.charAt(s++));v=p.indexOf(t.charAt(s++));u=p.indexOf(t.charAt(s++));z=x<<18|w<<12|v<<6|u;o=z>>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<t.length);q=r.join("");return y?l(q):q};var i=function(v,A){if(A){v=k(v)}if(typeof(window.btoa)==="function"){return window.btoa(v)}var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var p,o,n,z,y,x,w,B,u=0,C=0,t="",s=[];if(!v){return v}do{p=v.charCodeAt(u++);o=v.charCodeAt(u++);n=v.charCodeAt(u++);B=p<<16|o<<8|n;z=B>>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(u<v.length);t=s.join("");var m=v.length%3;return(m?t.slice(0,m-3):t)+"===".slice(m||3)};return{utf8_encode:k,utf8_decode:l,atob:j,btoa:i}});h("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(l,j,k){var i={};function m(p,o){function n(u,q,s){var r,t=i[this.uid];if(l.typeOf(t)!=="string"||!t.length){return null}r=new m(null,{type:s,size:q-u});r.detach(t.substr(u,r.size));return r}k.call(this);if(p){this.connectRuntime(p)}if(!o){o={}}else{if(l.typeOf(o)==="string"){o={data:o}}}l.extend(this,{uid:o.uid||l.guid("uid_"),ruid:p,size:o.size||0,type:o.type||"",slice:function(s,q,r){if(this.isDetached()){return n.apply(this,arguments)}return this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),s,q,r)},getSource:function(){if(!i[this.uid]){return null}return i[this.uid]},detach:function(r){if(this.ruid){this.getRuntime().exec.call(this,"Blob","destroy");this.disconnectRuntime();this.ruid=null}r=r||"";if(r.substr(0,5)=="data:"){var q=r.indexOf(";base64,");this.type=r.substring(5,q);r=j.atob(r.substring(q+8))}this.size=r.length;i[this.uid]=r},isDetached:function(){return !this.ruid&&l.typeOf(i[this.uid])==="string"},destroy:function(){this.detach();delete i[this.uid]}});if(o.data){this.detach(o.data)}else{i[this.uid]=o}}return m});h("moxie/file/File",["moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/file/Blob"],function(k,j,l){function i(n,o){if(!o){o={}}l.apply(this,arguments);if(!this.type){this.type=j.getFileMime(o.name)}var m;if(o.name){m=o.name.replace(/\\/g,"/");m=m.substr(m.lastIndexOf("/")+1)}else{if(this.type){var p=this.type.split("/")[0];m=k.guid((p!==""?p:"file")+"_");if(j.extensions[this.type]){m+="."+j.extensions[this.type][0]}}}k.extend(this,{name:m||k.guid("file_"),relativePath:"",lastModifiedDate:o.lastModifiedDate||(new Date()).toLocaleString()})}i.prototype=l.prototype;return i});h("moxie/file/FileDrop",["moxie/core/I18n","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/core/utils/Env","moxie/file/File","moxie/runtime/RuntimeClient","moxie/core/EventTarget","moxie/core/utils/Mime"],function(k,m,q,i,n,o,p,s,l){var r=["ready","dragenter","dragleave","drop","error"];function j(u){if(MXI_DEBUG){n.log("Instantiating FileDrop...")}var t=this,v;if(typeof(u)==="string"){u={drop_zone:u}}v={accept:[{title:k.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:true}};u=typeof(u)==="object"?i.extend({},v,u):v;u.container=m.get(u.drop_zone)||document.body;if(m.getStyle(u.container,"position")==="static"){u.container.style.position="relative"}if(typeof(u.accept)==="string"){u.accept=l.mimes2extList(u.accept)}p.call(t);i.extend(t,{uid:i.guid("uid_"),ruid:null,files:null,init:function(){t.bind("RuntimeInit",function(x,w){t.ruid=w.uid;w.exec.call(t,"FileDrop","init",u);t.dispatchEvent("ready")});t.connectRuntime(u)},destroy:function(){var w=this.getRuntime();if(w){w.exec.call(this,"FileDrop","destroy");this.disconnectRuntime()}this.files=null;this.unbindAll()}});this.handleEventProps(r)}j.prototype=s.instance;return j});h("moxie/file/FileReader",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/Exceptions","moxie/core/EventTarget","moxie/file/Blob","moxie/runtime/RuntimeClient"],function(n,j,i,p,o,l){var k=["loadstart","progress","load","abort","error","loadend"];function m(){l.call(this);n.extend(this,{uid:n.guid("uid_"),readyState:m.EMPTY,result:null,error:null,readAsBinaryString:function(r){q.call(this,"readAsBinaryString",r)},readAsDataURL:function(r){q.call(this,"readAsDataURL",r)},readAsText:function(r){q.call(this,"readAsText",r)},abort:function(){this.result=null;if(n.inArray(this.readyState,[m.EMPTY,m.DONE])!==-1){return}else{if(this.readyState===m.LOADING){this.readyState=m.DONE}}this.exec("FileReader","abort");this.trigger("abort");this.trigger("loadend")},destroy:function(){this.abort();this.exec("FileReader","destroy");this.disconnectRuntime();this.unbindAll()}});this.handleEventProps(k);this.bind("Error",function(s,r){this.readyState=m.DONE;this.error=r},999);this.bind("Load",function(r){this.readyState=m.DONE},999);function q(u,s){var r=this;this.trigger("loadstart");if(this.readyState===m.LOADING){this.trigger("error",new i.DOMException(i.DOMException.INVALID_STATE_ERR));this.trigger("loadend");return}if(!(s instanceof o)){this.trigger("error",new i.DOMException(i.DOMException.NOT_FOUND_ERR));this.trigger("loadend");return}this.result=null;this.readyState=m.LOADING;if(s.isDetached()){var t=s.getSource();switch(u){case"readAsText":case"readAsBinaryString":this.result=t;break;case"readAsDataURL":this.result="data:"+s.type+";base64,"+j.btoa(t);break}this.readyState=m.DONE;this.trigger("load");this.trigger("loadend")}else{this.connectRuntime(s.ruid);this.exec("FileReader","read",u,s)}}}m.EMPTY=0;m.LOADING=1;m.DONE=2;m.prototype=p.instance;return m});h("moxie/core/utils/Url",[],function(){var i=function(l,t){var s=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],p=s.length,q={http:80,https:443},n={},r=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,o=r.exec(l||"");while(p--){if(o[p]){n[s[p]]=o[p]}}if(!n.scheme){if(!t||typeof(t)==="string"){t=i(t||document.location.href)}n.scheme=t.scheme;n.host=t.host;n.port=t.port;var u="";if(/^[^\/]/.test(n.path)){u=t.path;if(/\/[^\/]*\.[^\/]*$/.test(u)){u=u.replace(/\/[^\/]+$/,"/")}else{u=u.replace(/\/?$/,"/")}}n.path=u+(n.path||"")}if(!n.port){n.port=q[n.scheme]||80}n.port=parseInt(n.port,10);if(!n.path){n.path="/"}delete n.source;return n};var k=function(m){var n={http:80,https:443},l=typeof(m)==="object"?m:i(m);return l.scheme+"://"+l.host+(l.port!==n[l.scheme]?":"+l.port:"")+l.path+(l.query?l.query:"")};var j=function(m){function l(n){return[n.scheme,n.host,n.port].join("/")}if(typeof m==="string"){m=i(m)}return l(i())===l(m)};return{parseUrl:i,resolveUrl:k,hasSameOrigin:j}});h("moxie/runtime/RuntimeTarget",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(k,j,l){function i(){this.uid=k.guid("uid_");j.call(this);this.destroy=function(){this.disconnectRuntime();this.unbindAll()}}i.prototype=l.instance;return i});h("moxie/file/FileReaderSync",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/utils/Encode"],function(k,j,i){return function(){j.call(this);k.extend(this,{uid:k.guid("uid_"),readAsBinaryString:function(m){return l.call(this,"readAsBinaryString",m)},readAsDataURL:function(m){return l.call(this,"readAsDataURL",m)},readAsText:function(m){return l.call(this,"readAsText",m)}});function l(s,o){if(o.isDetached()){var r=o.getSource();switch(s){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+o.type+";base64,"+i.btoa(r);case"readAsText":var n="";for(var p=0,q=r.length;p<q;p++){n+=String.fromCharCode(r[p])}return n}}else{var m=this.connectRuntime(o.ruid).exec.call(this,"FileReaderSync","read",s,o);this.disconnectRuntime();return m}}}});h("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(i,j,l){function k(){var m,n=[];j.extend(this,{append:function(p,q){var o=this,r=j.typeOf(q);if(q instanceof l){m={name:p,value:q}}else{if("array"===r){p+="[]";j.each(q,function(s){o.append(p,s)})}else{if("object"===r){j.each(q,function(t,s){o.append(p+"["+s+"]",t)})}else{if("null"===r||"undefined"===r||"number"===r&&isNaN(q)){o.append(p,"false")}else{n.push({name:p,value:q.toString()})}}}}},hasBlob:function(){return !!this.getBlob()},getBlob:function(){return m&&m.value||null},getBlobName:function(){return m&&m.name||null},each:function(o){j.each(n,function(p){o(p.value,p.name)});if(m){o(m.value,m.name)}},destroy:function(){m=null;n=[]}})}return k});h("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(q,r,p,y,u,o,s,n,w,z,i,t){var j={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};function m(){this.uid=q.guid("uid_")}m.prototype=p.instance;var l=["loadstart","progress","abort","error","load","timeout","loadend"];var k=1,A=2;function v(){var R=this,E={timeout:0,readyState:v.UNSENT,withCredentials:false,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},X=true,J,P,Q={},S,G,I=null,K=null,aa=false,B=false,x=false,L=false,D=false,H=false,N,W,V=null,Y=null,T={},O,U="",C;q.extend(this,E,{uid:q.guid("uid_"),upload:new m(),open:function(ag,ae,af,ac,ad){var ab;if(!ag||!ae){throw new r.DOMException(r.DOMException.SYNTAX_ERR)}if(/[\u0100-\uffff]/.test(ag)||y.utf8_encode(ag)!==ag){throw new r.DOMException(r.DOMException.SYNTAX_ERR)}if(!!~q.inArray(ag.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])){P=ag.toUpperCase()}if(!!~q.inArray(P,["CONNECT","TRACE","TRACK"])){throw new r.DOMException(r.DOMException.SECURITY_ERR)}ae=y.utf8_encode(ae);ab=u.parseUrl(ae);H=u.hasSameOrigin(ab);J=u.resolveUrl(ae);if((ac||ad)&&!H){throw new r.DOMException(r.DOMException.INVALID_ACCESS_ERR)}S=ac||ab.user;G=ad||ab.pass;X=af||true;if(X===false&&(Z("timeout")||Z("withCredentials")||Z("responseType")!=="")){throw new r.DOMException(r.DOMException.INVALID_ACCESS_ERR)}aa=!X;B=false;Q={};M.call(this);Z("readyState",v.OPENED);this.dispatchEvent("readystatechange")},setRequestHeader:function(ad,ac){var ab=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(Z("readyState")!==v.OPENED||B){throw new r.DOMException(r.DOMException.INVALID_STATE_ERR)}if(/[\u0100-\uffff]/.test(ad)||y.utf8_encode(ad)!==ad){throw new r.DOMException(r.DOMException.SYNTAX_ERR)}ad=q.trim(ad).toLowerCase();if(!!~q.inArray(ad,ab)||/^(proxy\-|sec\-)/.test(ad)){return false}if(!Q[ad]){Q[ad]=ac}else{Q[ad]+=", "+ac}return true},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(ab){ab=ab.toLowerCase();if(D||!!~q.inArray(ab,["set-cookie","set-cookie2"])){return null}if(U&&U!==""){if(!C){C={};q.each(U.split(/\r\n/),function(ac){var ad=ac.split(/:\s+/);if(ad.length===2){ad[0]=q.trim(ad[0]);C[ad[0].toLowerCase()]={header:ad[0],value:q.trim(ad[1])}}})}if(C.hasOwnProperty(ab)){return C[ab].header+": "+C[ab].value}}return null},overrideMimeType:function(ac){var ab,ad;if(!!~q.inArray(Z("readyState"),[v.LOADING,v.DONE])){throw new r.DOMException(r.DOMException.INVALID_STATE_ERR)}ac=q.trim(ac.toLowerCase());if(/;/.test(ac)&&(ab=ac.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))){ac=ab[1];if(ab[2]){ad=ab[2]}}if(!t.mimes[ac]){throw new r.DOMException(r.DOMException.SYNTAX_ERR)}V=ac;Y=ad},send:function(ad,ac){if(q.typeOf(ac)==="string"){T={ruid:ac}}else{if(!ac){T={}}else{T=ac}}if(this.readyState!==v.OPENED||B){throw new r.DOMException(r.DOMException.INVALID_STATE_ERR)}if(ad instanceof n){T.ruid=ad.ruid;K=ad.type||"application/octet-stream"}else{if(ad instanceof z){if(ad.hasBlob()){var ab=ad.getBlob();T.ruid=ab.ruid;K=ab.type||"application/octet-stream"}}else{if(typeof ad==="string"){I="UTF-8";K="text/plain;charset=UTF-8";ad=y.utf8_encode(ad)}}}if(!this.withCredentials){this.withCredentials=(T.required_caps&&T.required_caps.send_browser_cookies)&&!H}x=(!aa&&this.upload.hasEventListener());D=false;L=!ad;if(!aa){B=true}F.call(this,ad)},abort:function(){D=true;aa=false;if(!~q.inArray(Z("readyState"),[v.UNSENT,v.OPENED,v.DONE])){Z("readyState",v.DONE);B=false;if(O){O.getRuntime().exec.call(O,"XMLHttpRequest","abort",L)}else{throw new r.DOMException(r.DOMException.INVALID_STATE_ERR)}L=true}else{Z("readyState",v.UNSENT)}},destroy:function(){if(O){if(q.typeOf(O.destroy)==="function"){O.destroy()}O=null}this.unbindAll();if(this.upload){this.upload.unbindAll();this.upload=null}}});this.handleEventProps(l.concat(["readystatechange"]));this.upload.handleEventProps(l);function Z(ac,ab){if(!E.hasOwnProperty(ac)){return}if(arguments.length===1){return i.can("define_property")?E[ac]:R[ac]}else{if(i.can("define_property")){E[ac]=ab}else{R[ac]=ab}}}function F(ae){var ac=this;N=new Date().getTime();O=new s();function ad(){if(O){O.destroy();O=null}ac.dispatchEvent("loadend");ac=null}function ab(af){O.bind("LoadStart",function(ag){Z("readyState",v.LOADING);ac.dispatchEvent("readystatechange");ac.dispatchEvent(ag);if(x){ac.upload.dispatchEvent(ag)}});O.bind("Progress",function(ag){if(Z("readyState")!==v.LOADING){Z("readyState",v.LOADING);ac.dispatchEvent("readystatechange")}ac.dispatchEvent(ag)});O.bind("UploadProgress",function(ag){if(x){ac.upload.dispatchEvent({type:"progress",lengthComputable:false,total:ag.total,loaded:ag.loaded})}});O.bind("Load",function(ag){Z("readyState",v.DONE);Z("status",Number(af.exec.call(O,"XMLHttpRequest","getStatus")||0));Z("statusText",j[Z("status")]||"");Z("response",af.exec.call(O,"XMLHttpRequest","getResponse",Z("responseType")));if(!!~q.inArray(Z("responseType"),["text",""])){Z("responseText",Z("response"))}else{if(Z("responseType")==="document"){Z("responseXML",Z("response"))}}U=af.exec.call(O,"XMLHttpRequest","getAllResponseHeaders");ac.dispatchEvent("readystatechange");if(Z("status")>0){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(!q.isEmptyObj(Q)){T.required_caps.send_custom_headers=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(v<s&&l.inArray(w.state,[k.IDLE,k.DONE])===-1){o.call(w)}},999);w.bind("TransportingComplete",function(){v=s;w.state=k.DONE;n=null;w.result=p.exec.call(w,"Transporter","getAsBlob",x||"")},999);w.state=k.BUSY;w.trigger("TransportingStarted");o.call(w)}function o(){var w=this,x,y=s-v;if(u>y){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(){z.apply(this,arguments)},downsize:function(D){var E={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:false,preserveHeaders:true,resample:false};if(typeof(D)==="object"){D=k.extend(E,D)}else{D=k.extend(E,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]})}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)}this.exec("Image","downsize",D.width,D.height,D.crop,D.preserveHeaders)}catch(C){this.trigger("error",C.code)}},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)}return this.exec("Image","getAsBlob",C||"image/jpeg",D||90)},getAsDataURL:function(C,D){if(!this.size){throw new t.DOMException(t.DOMException.INVALID_STATE_ERR)}return this.exec("Image","getAsDataURL",C||"image/jpeg",D||90)},getAsBinaryString:function(C,E){var D=this.getAsDataURL(C,E);return o.atob(D.substring(D.indexOf("base64,")+7))},embed:function(G,I){var D=this,H;I=k.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},I||{});function F(L,O){var J=this;if(q.can("create_canvas")){var K=J.getAsCanvas();if(K){G.appendChild(K);K=null;J.destroy();D.trigger("embedded");return}}var N=J.getAsDataURL(L,O);if(!N){throw new t.ImageError(t.ImageError.WRONG_FORMAT)}if(q.can("use_data_uri_of",N.length)){G.innerHTML='<img src="'+N+'" width="'+J.width+'" height="'+J.height+'" />';J.destroy();D.trigger("embedded")}else{var M=new m();M.bind("TransportingComplete",function(){H=D.connectRuntime(this.result.ruid);D.bind("Embedded",function(){k.extend(H.getShimContainer().style,{top:"0px",left:"0px",width:J.width+"px",height:J.height+"px"});H=null},999);H.exec.call(D,"ImageView","display",this.result.uid,width,height);J.destroy()});M.transport(o.atob(N.substring(N.indexOf("base64,")+7)),L,{required_caps:{display_media:true},runtime_order:"flash,silverlight",container:G})}}try{if(!(G=n.get(G))){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){}var C=new i();C.bind("Resize",function(){F.call(this,I.type,I.quality)});C.bind("Load",function(){C.downsize(I)});if(this.meta.thumb&&this.meta.thumb.width>=I.width&&this.meta.thumb.height>=I.height){C.load(this.meta.thumb.data)}else{C.clone(this,false)}return C}catch(E){this.trigger("error",E.code)}},destroy:function(){if(this.ruid){this.getRuntime().exec.call(this,"Image","destroy");this.disconnectRuntime()}this.unbindAll()}});this.handleEventProps(v);this.bind("Load Resize",function(){y.call(this)},999);function y(C){if(!C){C=this.exec("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(E.substr(0,5)==="data:"){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.code)}}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=8192;i.MAX_RESIZE_HEIGHT=8192;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.verComp(j.version,9,">"))}()),filter_by_extension:t(function(){return(j.browser==="Chrome"&&j.verComp(j.version,28,">="))||(j.browser==="IE"&&j.verComp(j.version,10,">="))||(j.browser==="Safari"&&j.verComp(j.version,7,">="))}()),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.verComp(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.0",">")&&j.verComp(j.osVersion,"8.0.0","<"))},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:function(){return p.can("select_file")&&((j.browser==="Firefox"&&j.verComp(j.version,4,">="))||(j.browser==="Opera"&&j.verComp(j.version,12,">="))||(j.browser==="IE"&&j.verComp(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/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/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(n,k,p,m,j,l,i){function o(){var q;p.extend(this,{init:function(A){var r=this,y=r.getRuntime(),x,t,u,z,w,v;q=A;u=q.accept.mimes||l.extList2mimes(q.accept,y.can("filter_by_extension"));t=y.getShimContainer();t.innerHTML='<input id="'+y.uid+'" type="file" style="font-size:999px;opacity:0;"'+(q.multiple&&y.can("select_multiple")?"multiple":"")+(q.directory&&y.can("select_folder")?"webkitdirectory directory":"")+(u?' accept="'+u.join(",")+'"':"")+" />";x=m.get(y.uid);p.extend(x.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});z=m.get(q.browse_button);if(y.can("summon_file_dialog")){if(m.getStyle(z,"position")==="static"){z.style.position="relative"}w=parseInt(m.getStyle(z,"z-index"),10)||1;z.style.zIndex=w;t.style.zIndex=w-1;j.addEvent(z,"click",function(C){var B=m.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(m.get(q.container),"mouseup",function(){r.trigger("mouseup")},r.uid);x.onchange=function s(B){r.files=[];p.each(this.files,function(E){var D="";if(q.directory){if(E.name=="."){return true}}if(E.webkitRelativePath){D="/"+E.webkitRelativePath.replace(/^\//,"")}E=new k(y.uid,E);E.relativePath=D;r.files.push(E)});if(i.browser!=="IE"&&i.browser!=="IEMobile"){this.value=""}else{var C=this.cloneNode(true);this.parentNode.replaceChild(C,this);C.onchange=s}if(r.files.length){r.trigger("change")}};r.trigger({type:"ready",async:true});t=null},disable:function(t){var s=this.getRuntime(),r;if((r=m.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(q&&m.get(q.container),this.uid);j.removeAllEvents(q&&m.get(q.browse_button),this.uid);if(r){r.innerHTML=""}t.removeInstance(this.uid);q=r=t=null}})}return(n.FileInput=o)});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/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(m,j,n,l,i,k){function o(){var r=[],u=[],z,v;n.extend(this,{init:function(C){var B=this,D;z=C;v=B.ruid;u=t(z.accept);D=z.container;i.addEvent(D,"dragover",function(E){if(!s(E)){return}E.preventDefault();E.dataTransfer.dropEffect="copy"},B.uid);i.addEvent(D,"drop",function(E){if(!s(E)){return}E.preventDefault();r=[];if(E.dataTransfer.items&&E.dataTransfer.items[0].webkitGetAsEntry){y(E.dataTransfer.items,function(){B.files=r;B.trigger("drop")})}else{n.each(E.dataTransfer.files,function(F){q(F)});B.files=r;B.trigger("drop")}},B.uid);i.addEvent(D,"dragenter",function(E){B.trigger("dragenter")},B.uid);i.addEvent(D,"dragleave",function(E){B.trigger("dragleave")},B.uid)},destroy:function(){i.removeAllEvents(z&&l.get(z.container),this.uid);v=r=u=z=null}});function s(C){if(!C.dataTransfer||!C.dataTransfer.types){return false}var B=n.toArray(C.dataTransfer.types||[]);return n.inArray("Files",B)!==-1||n.inArray("public.file-url",B)!==-1||n.inArray("application/x-moz-file",B)!==-1}function q(C,B){if(x(C)){var D=new j(v,C);D.relativePath=B||"";r.push(D)}}function t(D){var C=[];for(var B=0;B<D.length;B++){[].push.apply(C,D[B].extensions.split(/\s*,\s*/))}return n.inArray("*",C)===-1?C:[]}function x(B){if(!u.length){return true}var C=k.getFileExtension(B.name);return !C||n.inArray(C,u)!==-1}function y(D,C){var B=[];n.each(D,function(F){var E=F.webkitGetAsEntry();if(E){if(E.isFile){q(F.getAsFile(),E.fullPath)}else{B.push(E)}}});if(B.length){w(B,C)}else{C()}}function w(D,C){var B=[];n.each(D,function(E){B.push(function(F){p(E,F)})});n.inSeries(B,function(){C()})}function p(C,B){if(C.isFile){C.file(function(D){q(D,C.fullPath);B()},function(){B()})}else{if(C.isDirectory){A(C,B)}else{B()}}}function A(F,C){var B=[],E=F.createReader();function D(G){E.readEntries(function(H){if(H.length){[].push.apply(B,H);D(G)}else{G()}},G)}D(function(){w(B,C)})}}return(m.FileDrop=o)});h("moxie/runtime/html5/file/FileReader",["moxie/runtime/html5/Runtime","moxie/core/utils/Encode","moxie/core/utils/Basic"],function(j,i,l){function k(){var n,o=false;l.extend(this,{read:function(r,q){var p=this;p.result="";n=new window.FileReader();n.addEventListener("progress",function(s){p.trigger(s)});n.addEventListener("load",function(s){p.result=o?m(n.result):n.result;p.trigger(s)});n.addEventListener("error",function(s){p.trigger(s,n.error)});n.addEventListener("loadend",function(s){n=null;p.trigger(s)});if(l.typeOf(n[r])==="function"){o=false;n[r](q.getSource())}else{if(r==="readAsBinaryString"){o=true;n.readAsDataURL(q.getSource())}}},abort:function(){if(n){n.abort()}},destroy:function(){n=null}});function m(p){return i.atob(p.substring(p.indexOf("base64,")+7))}}return(j.FileReader=k)});h("moxie/runtime/html5/xhr/XMLHttpRequest",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/core/utils/Url","moxie/file/File","moxie/file/Blob","moxie/xhr/FormData","moxie/core/Exceptions","moxie/core/utils/Env"],function(o,j,l,i,n,k,r,p,m){function q(){var u=this,y,w;j.extend(this,{send:function(G,D){var F=this,C=(m.browser==="Mozilla"&&m.verComp(m.version,4,">=")&&m.verComp(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<D.length;I++){H[I]=(D.charCodeAt(I)&255)}y.send(H.buffer)}())}}F.trigger("loadstart")},getStatus:function(){try{if(y){return y.status}}catch(z){}return 0},getResponse:function(B){var A=this.getRuntime();try{switch(B){case"blob":var D=new n(A.uid,y.response);var E=y.getResponseHeader("Content-Disposition");if(E){var z=E.match(/filename=([\'\"'])([^\1]+)\1/);if(z){w=z[2]}}D.name=w;if(!D.type){D.type=l.getFileMime(w)}return D;case"json":if(!m.can("return_response_type","json")){return y.status===200&&!!window.JSON?JSON.parse(y.responseText):null}return y.response;case"document":return t(y);default:return y.responseText!==""?y.responseText:null}}catch(C){return null}},getAllResponseHeaders:function(){try{return y.getAllResponseHeaders()}catch(z){}return""},abort:function(){if(y){y.abort()}},destroy:function(){u=w=null}});function s(D,B){var C=this,A,z;A=B.getBlob().getSource();z=new window.FileReader();z.onload=function(){B.append(B.getBlobName(),new k(null,{type:A.type,data:z.result}));u.send.call(C,D,B)};z.readAsBinaryString(A)}function x(){if(window.XMLHttpRequest&&!(m.browser==="IE"&&m.verComp(m.version,8,"<"))){return new window.XMLHttpRequest()}else{return(function(){var z=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"];for(var B=0;B<z.length;B++){try{return new ActiveXObject(z[B])}catch(A){}}})()}}function t(A){var B=A.responseXML;var z=A.responseText;if(m.browser==="IE"&&z&&B&&!B.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(A.getResponseHeader("Content-Type"))){B=new window.ActiveXObject("Microsoft.XMLDOM");B.async=false;B.validateOnParse=false;B.loadXML(z)}if(B){if((m.browser==="IE"&&B.parseError!==0)||!B.documentElement||B.documentElement.tagName==="parsererror"){return null}}return B}function v(B){var E="----moxieboundary"+new Date().getTime(),C="--",D="\r\n",z="",A=this.getRuntime();if(!A.can("send_binary_string")){throw new p.RuntimeError(p.RuntimeError.NOT_SUPPORTED_ERR)}y.setRequestHeader("Content-Type","multipart/form-data; boundary="+E);B.each(function(G,F){if(G instanceof k){z+=C+E+D+'Content-Disposition: form-data; name="'+F+'"; filename="'+unescape(encodeURIComponent(G.name||"blob"))+'"'+D+"Content-Type: "+(G.type||"application/octet-stream")+D+D+G.getSource()+D}else{z+=C+E+D+'Content-Disposition: form-data; name="'+F+'"'+D+D+unescape(encodeURIComponent(G))+D}});z+=C+E+C+D;return z}}return(o.XMLHttpRequest=q)});h("moxie/runtime/html5/utils/BinaryReader",["moxie/core/utils/Basic"],function(k){function j(m){if(m instanceof ArrayBuffer){i.apply(this,arguments)}else{l.apply(this,arguments)}}k.extend(j.prototype,{littleEndian:false,read:function(n,p){var q,m,o;if(n+p>this.length()){throw new Error("You are trying to read outside the source boundaries.")}m=this.littleEndian?0:-8*(p-1);for(o=0,q=0;o<p;o++){q|=(this.readByteAt(n+o)<<Math.abs(m+o*8))}return q},write:function(n,o,q){var m,p,r="";if(n>this.length()){throw new Error("You are trying to write outside the source boundaries.")}m=this.littleEndian?0:-8*(q-1);for(p=0;p<q;p++){this.writeByteAt(n+p,(o>>Math.abs(m+p*8))&255)}},BYTE:function(m){return this.read(m,1)},SHORT:function(m){return this.read(m,2)},LONG:function(m){return this.read(m,4)},SLONG:function(m){var n=this.read(m,4);return(n>2147483647?n-4294967296:n)},CHAR:function(m){return String.fromCharCode(this.read(m,1))},STRING:function(m,n){return this.asArray("CHAR",m,n).join("")},asArray:function(p,m,q){var n=[];for(var o=0;o<q;o++){n[o]=this[p](m+o)}return n}});function i(m){var n=new DataView(m);k.extend(this,{readByteAt:function(o){return n.getUint8(o)},writeByteAt:function(o,p){n.setUint8(o,p)},SEGMENT:function(p,q,r){switch(arguments.length){case 2:return m.slice(p,p+q);case 1:return m.slice(p);case 3:if(r===null){r=new ArrayBuffer()}if(r instanceof ArrayBuffer){var o=new Uint8Array(this.length()-q+r.byteLength);if(p>0){o.set(new Uint8Array(m.slice(0,p)),0)}o.set(new Uint8Array(r),p);o.set(new Uint8Array(m.slice(p+q)),p+r.byteLength);this.clear();m=o.buffer;n=new DataView(m);break}default:return m}},length:function(){return m?m.byteLength:0},clear:function(){n=m=null}})}function l(n){k.extend(this,{readByteAt:function(o){return n.charCodeAt(o)},writeByteAt:function(o,p){m(String.fromCharCode(p),o,1)},SEGMENT:function(o,q,p){switch(arguments.length){case 1:return n.substr(o);case 2:return n.substr(o,q);case 3:m(p!==null?p:"",o,q);break;default:return n}},length:function(){return n?n.length:0},clear:function(){n=null}});function m(q,o,p){p=arguments.length===3?p:n.length-o-1;n=n.substr(0,o)+q+n.substr(p+o)}}return j});h("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(k,i){return function j(o){var q=[],p,l,m,n=0;p=new k(o);if(p.SHORT(0)!==65496){p.clear();throw new i.ImageError(i.ImageError.WRONG_FORMAT)}l=2;while(l<=p.length()){m=p.SHORT(l);if(m>=65488&&m<=65495){l+=2;continue}if(m===65498||m===65497){break}n=p.SHORT(l+2)+2;if(m>=65505&&m<=65519){q.push({hex:m,name:"APP"+(m&15),start:l,length:n,segment:p.SEGMENT(l,n)})}l+=n}p.clear();return{headers:q,restore:function(u){var r,t,s;s=new k(u);l=s.SHORT(2)==65504?4+s.SHORT(4):2;for(t=0,r=q.length;t<r;t++){s.SEGMENT(l,0,q[t].segment);l+=q[t].length}u=s.SEGMENT();s.clear();return u},strip:function(u){var t,v,r,s;r=new j(u);v=r.headers;r.purge();t=new k(u);s=v.length;while(s--){t.SEGMENT(v[s].start,v[s].length,"")}u=t.SEGMENT();t.clear();return u},get:function(s){var u=[];for(var t=0,r=q.length;t<r;t++){if(q[t].name===s.toUpperCase()){u.push(q[t].segment)}}return u},set:function(s,v){var w=[],t,u,r;if(typeof(v)==="string"){w.push(v)}else{w=v}for(t=u=0,r=q.length;t<r;t++){if(q[t].name===s.toUpperCase()){q[t].segment=w[u];q[t].length=w[u].length;u++}if(u>=w.length){break}}},purge:function(){this.headers=q=[]}}}});h("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(l,k,i){function j(p){var t,u,q,o,s,v;k.call(this,p);u={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"}};q={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"}};o={tiffHeader:10};s=o.tiffHeader;t={clear:this.clear};l.extend(this,{read:function(){try{return j.prototype.read.apply(this,arguments)}catch(w){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}},write:function(){try{return j.prototype.write.apply(this,arguments)}catch(w){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(w){return this.LONG(w)/this.LONG(w+4)},SRATIONAL:function(w){return this.SLONG(w)/this.SLONG(w+4)},ASCII:function(w){return this.CHAR(w)},TIFF:function(){return v||null},EXIF:function(){var x=null;if(o.exifIFD){try{x=r.call(this,o.exifIFD,u.exif)}catch(z){return null}if(x.ExifVersion&&l.typeOf(x.ExifVersion)==="array"){for(var y=0,w="";y<x.ExifVersion.length;y++){w+=String.fromCharCode(x.ExifVersion[y])}x.ExifVersion=w}}return x},GPS:function(){var w=null;if(o.gpsIFD){try{w=r.call(this,o.gpsIFD,u.gps)}catch(x){return null}if(w.GPSVersionID&&l.typeOf(w.GPSVersionID)==="array"){w.GPSVersionID=w.GPSVersionID.join(".")}}return w},thumb:function(){if(o.IFD1){try{var w=r.call(this,o.IFD1,u.thumb);if("JPEGInterchangeFormat" in w){return this.SEGMENT(o.tiffHeader+w.JPEGInterchangeFormat,w.JPEGInterchangeFormatLength)}}catch(x){}}return null},setExif:function(w,x){if(w!=="PixelXDimension"&&w!=="PixelYDimension"){return false}return n.call(this,"exif",w,x)},clear:function(){t.clear();p=u=q=v=o=t=null}});if(this.SHORT(0)!==65505||this.STRING(4,5).toUpperCase()!=="EXIF\0"){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}this.littleEndian=(this.SHORT(s)==18761);if(this.SHORT(s+=2)!==42){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}o.IFD0=o.tiffHeader+this.LONG(s+=2);v=r.call(this,o.IFD0,u.tiff);if("ExifIFDPointer" in v){o.exifIFD=o.tiffHeader+v.ExifIFDPointer;delete v.ExifIFDPointer}if("GPSInfoIFDPointer" in v){o.gpsIFD=o.tiffHeader+v.GPSInfoIFDPointer;delete v.GPSInfoIFDPointer}if(l.isEmptyObj(v)){v=null}var m=this.LONG(o.IFD0+this.SHORT(o.IFD0)*12+2);if(m){o.IFD1=o.tiffHeader+m}function r(w,F){var A=this;var x,B,K,E,D,J,y,G,H=[],z={};var C={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"};var I={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};x=A.SHORT(w);for(B=0;B<x;B++){H=[];y=w+2+B*12;K=F[A.SHORT(y)];if(K===g){continue}E=C[A.SHORT(y+=2)];D=A.LONG(y+=2);J=I[E];if(!J){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}y+=4;if(J*D>4){y=A.LONG(y)+o.tiffHeader}if(y+J*D>=this.length()){throw new i.ImageError(i.ImageError.INVALID_META_ERR)}if(E==="ASCII"){z[K]=l.trim(A.STRING(y,D).replace(/\0$/,""));continue}else{H=A.asArray(E,y,D);G=(D==1?H[0]:H);if(q.hasOwnProperty(K)&&typeof G!="object"){z[K]=q[K][G]}else{z[K]=G}}}return z}function n(E,G,D){var A,y,x,w=0;if(typeof(G)==="string"){var F=u[E.toLowerCase()];for(var z in F){if(F[z]===G){G=z;break}}}A=o[E.toLowerCase()+"IFD"];y=this.SHORT(A);for(var B=0;B<y;B++){x=A+12*B+2;if(this.SHORT(x)==G){w=x+8;break}}if(!w){return false}try{this.write(w,D,4)}catch(C){return false}return true}}j.prototype=k.prototype;return j});h("moxie/runtime/html5/image/JPEG",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEGHeaders","moxie/runtime/html5/utils/BinaryReader","moxie/runtime/html5/image/ExifParser"],function(n,i,k,m,j){function l(o){var q,u,r,w;q=new m(o);if(q.SHORT(0)!==65496){throw new i.ImageError(i.ImageError.WRONG_FORMAT)}u=new k(o);try{r=new j(u.get("app1")[0])}catch(s){}w=v.call(this);n.extend(this,{type:"image/jpeg",size:q.length(),width:w&&w.width||0,height:w&&w.height||0,setExif:function(x,y){if(!r){return false}if(n.typeOf(x)==="object"){n.each(x,function(A,z){r.setExif(z,A)})}else{r.setExif(x,y)}u.set("app1",r.SEGMENT())},writeHeaders:function(){if(!arguments.length){return u.restore(o)}return u.restore(arguments[0])},stripHeaders:function(x){return u.strip(x)},purge:function(){p.call(this)}});if(r){this.meta={tiff:r.TIFF(),exif:r.EXIF(),gps:r.GPS(),thumb:t()}}function v(z){var x=0,y,A;if(!z){z=q}while(x<=z.length()){y=z.SHORT(x+=2);if(y>=65472&&y<=65475){x+=5;return{height:z.SHORT(x),width:z.SHORT(x+=2)}}A=z.SHORT(x+=2);x+=A-2}return null}function t(){var y=r.thumb(),x,z;if(y){x=new m(y);z=v(x);x.clear();if(z){z.data=y;return z}}return null}function p(){if(!r||!u||!q){return}r.clear();u.purge();q.clear();w=u=r=q=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(q){var s,n,p,o;s=new k(q);(function(){var u=0,w=0,v=[35152,20039,3338,6666];for(w=0;w<v.length;w++,u+=2){if(v[w]!=s.SHORT(u)){throw new i.ImageError(i.ImageError.WRONG_FORMAT)}}}());function t(){var v,u;v=m.call(this,8);if(v.type=="IHDR"){u=v.start;return{width:s.LONG(u),height:s.LONG(u+=4)}}return null}function r(){if(!s){return}s.clear();q=o=n=p=s=null}o=t.call(this);l.extend(this,{type:"image/png",size:s.length(),width:o.width,height:o.height,purge:function(){r.call(this)}});r.call(this);function m(u){var x,w,y,v;x=s.LONG(u);w=s.STRING(u+=4,4);y=u+=4;v=s.LONG(u+x);return{length:x,type:w,start:y,CRC:v}}}return j});h("moxie/runtime/html5/image/ImageInfo",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEG","moxie/runtime/html5/image/PNG"],function(l,i,k,j){return function(n){var o=[k,j],m;m=(function(){for(var q=0;q<o.length;q++){try{return new o[q](n)}catch(p){}}throw new i.ImageError(i.ImageError.WRONG_FORMAT)}());l.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(p){return p},stripHeaders:function(p){return p},purge:function(){n=null}});l.extend(this,m);this.purge=function(){m.purge();m=null}}});h("moxie/runtime/html5/image/MegaPixel",[],function(){function i(I,m,n){var p=I.naturalWidth,v=I.naturalHeight;var C=n.width,z=n.height;var r=n.x||0,q=n.y||0;var D=m.getContext("2d");if(j(I)){p/=2;v/=2}var G=1024;var l=document.createElement("canvas");l.width=l.height=G;var o=l.getContext("2d");var E=k(I,p,v);var w=0;while(w<v){var H=w+G>v?v-w:G;var A=0;while(A<p){var B=A+G>p?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/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/MegaPixel","moxie/core/utils/Mime","moxie/core/utils/Env"],function(p,i,q,l,j,n,s,r,k,m){function o(){var D=this,C,H,B,x,F,J=false,u=true;i.extend(this,{loadFromBlob:function(M){var L=this,N=L.getRuntime(),K=arguments.length>1?arguments[1]:true;if(!N.can("access_binary")){throw new q.RuntimeError(q.RuntimeError.NOT_SUPPORTED_ERR)}F=M;if(M.isDetached()){x=M.getSource();A.call(this,x);return}else{G.call(this,M.getSource(),function(O){if(K){x=I(O)}A.call(L,O)})}},loadFromImage:function(K,L){this.meta=K.meta;F=new n(null,{name:K.name,size:K.size,type:K.type});A.call(this,L?(x=K.getAsBinaryString()):K.getAsDataURL())},getInfo:function(){var K=this.getRuntime(),L;if(!H&&x&&K.can("access_image_binary")){H=new s(x)}L={width:y().width||0,height:y().height||0,type:F.type||k.getFileMime(F.name),size:x&&x.length||F.size||0,name:F.name||"",meta:H&&H.meta||this.meta||{}};if(L.meta&&L.meta.thumb&&!(L.meta.thumb.data instanceof j)){L.meta.thumb.data=new j(null,{type:"image/jpeg",data:L.meta.thumb.data})}return L},downsize:function(){t.apply(this,arguments)},getAsCanvas:function(){if(B){B.id=this.uid+"_canvas"}return B},getAsBlob:function(K,L){if(K!==this.type){t.call(this,this.width,this.height,false)}return new n(null,{name:F.name||"",type:K,data:D.getAsBinaryString.call(this,K,L)})},getAsDataURL:function(L){var M=arguments[1]||90;if(!J){return C.src}if("image/jpeg"!==L){return B.toDataURL("image/png")}else{try{return B.toDataURL("image/jpeg",M/100)}catch(K){return B.toDataURL("image/jpeg")}}},getAsBinaryString:function(L,N){if(!J){if(!x){x=I(D.getAsDataURL(L,N))}return x}if("image/jpeg"!==L){x=I(D.getAsDataURL(L,N))}else{var M;if(!N){N=90}try{M=B.toDataURL("image/jpeg",N/100)}catch(K){M=B.toDataURL("image/jpeg")}x=I(M);if(H){x=H.stripHeaders(x);if(u){if(H.meta&&H.meta.exif){H.setExif({PixelXDimension:this.width,PixelYDimension:this.height})}x=H.writeHeaders(x)}H.purge();H=null}}J=false;return x},destroy:function(){D=null;v.call(this);this.getRuntime().getShim().removeInstance(this.uid)}});function y(){if(!B&&!C){throw new q.ImageError(q.DOMException.INVALID_STATE_ERR)}return B||C}function I(K){return l.atob(K.substring(K.indexOf("base64,")+7))}function E(L,K){return"data:"+(K||"")+";base64,"+l.btoa(L)}function A(L){var K=this;C=new Image();C.onerror=function(){v.call(this);K.trigger("error",q.ImageError.WRONG_FORMAT)};C.onload=function(){K.trigger("load")};C.src=L.substr(0,5)=="data:"?L:E(L,F.type)}function G(M,N){var L=this,K;if(window.FileReader){K=new FileReader();K.onload=function(){N(this.result)};K.onerror=function(){L.trigger("error",q.ImageError.WRONG_FORMAT)};K.readAsDataURL(M)}else{return N(M.getAsDataURL())}}function t(L,W,R,T){var X=this,O,N,U=0,S=0,Q,V,M,K;u=T;K=(this.meta&&this.meta.tiff&&this.meta.tiff.Orientation)||1;if(i.inArray(K,[5,6,7,8])!==-1){var P=L;L=W;W=P}Q=y();if(!R){O=Math.min(L/Q.width,W/Q.height)}else{L=Math.min(L,Q.width);W=Math.min(W,Q.height);O=Math.max(L/Q.width,W/Q.height)}if(O>1&&!R&&T){this.trigger("Resize");return}if(!B){B=document.createElement("canvas")}V=Math.round(Q.width*O);M=Math.round(Q.height*O);if(R){B.width=L;B.height=W;if(V>L){U=Math.round((V-L)/2)}if(M>W){S=Math.round((M-W)/2)}}else{B.width=V;B.height=M}if(!u){z(B.width,B.height,K)}w.call(this,Q,B,-U,-S,V,M);this.width=B.width;this.height=B.height;J=true;X.trigger("Resize")}function w(N,O,K,Q,M,P){if(m.OS==="iOS"){r.renderTo(N,O,{width:M,height:P,x:K,y:Q})}else{var L=O.getContext("2d");L.drawImage(N,K,Q,M,P)}}function z(N,K,M){switch(M){case 5:case 6:case 7:case 8:B.width=K;B.height=N;break;default:B.width=N;B.height=K}var L=B.getContext("2d");switch(M){case 2:L.translate(N,0);L.scale(-1,1);break;case 3:L.translate(N,K);L.rotate(Math.PI);break;case 4:L.translate(0,K);L.scale(1,-1);break;case 5:L.rotate(0.5*Math.PI);L.scale(1,-1);break;case 6:L.rotate(0.5*Math.PI);L.translate(0,-K);break;case 7:L.rotate(0.5*Math.PI);L.translate(N,-K);L.scale(-1,1);break;case 8:L.rotate(-0.5*Math.PI);L.translate(-N,0);break}}function v(){if(H){H.purge();H=null}x=C=B=F=null;J=false}}return(p.Image=o)});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,n,k,q,i){var o="flash",p={};function m(){var t;try{t=navigator.plugins["Shockwave Flash"];t=t.description}catch(v){try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(u){t="0.0"}}t=t.match(/\d+/g);return parseFloat(t[0]+"."+t[1])}function l(v){var u=k.get(v);if(u&&u.nodeName=="OBJECT"){if(n.browser==="IE"){u.style.display="none";(function t(){if(u.readyState==4){s(v)}else{setTimeout(t,10)}})()}else{u.parentNode.removeChild(u)}}}function s(v){var u=k.get(v);if(u){for(var t in u){if(typeof u[t]=="function"){u[t]=null}}u.parentNode.removeChild(u)}}function r(u){var t=this,v;u=j.extend({swf_url:n.swf_url},u);i.call(this,u,o,{access_binary:function(w){return w&&t.mode==="browser"},access_image_binary:function(w){return w&&t.mode==="browser"},display_media:i.capTrue,do_cors:i.capTrue,drag_and_drop:false,report_upload_progress:function(){return t.mode==="client"},resize_image:i.capTrue,return_response_headers:false,return_response_type:function(w){if(w==="json"&&!!window.JSON){return true}return !j.arrayDiff(w,["","text","document"])||t.mode==="browser"},return_status_code:function(w){return t.mode==="browser"||!j.arrayDiff(w,[200,404])},select_file:i.capTrue,select_multiple:i.capTrue,send_binary_string:function(w){return w&&t.mode==="browser"},send_browser_cookies:function(w){return w&&t.mode==="browser"},send_custom_headers:function(w){return w&&t.mode==="browser"},send_multipart:i.capTrue,slice_blob:function(w){return w&&t.mode==="browser"},stream_upload:function(w){return w&&t.mode==="browser"},summon_file_dialog:false,upload_filesize:function(w){return j.parseSizeStr(w)<=2097152||t.mode==="client"},use_http_method:function(w){return !j.arrayDiff(w,["GET","POST"])}},{access_binary:function(w){return w?"browser":"client"},access_image_binary:function(w){return w?"browser":"client"},report_upload_progress:function(w){return w?"browser":"client"},return_response_type:function(w){return j.arrayDiff(w,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(w){return j.arrayDiff(w,[200,404])?"browser":["client","browser"]},send_binary_string:function(w){return w?"browser":"client"},send_browser_cookies:function(w){return w?"browser":"client"},send_custom_headers:function(w){return w?"browser":"client"},stream_upload:function(w){return w?"client":"browser"},upload_filesize:function(w){return j.parseSizeStr(w)>=2097152?"client":"browser"}},"client");if(m()<10){if(MXI_DEBUG&&n.debug.runtime){n.log("\tFlash didn't meet minimal version requirement (10).")}this.mode=false}j.extend(this,{getShim:function(){return k.get(this.uid)},shimExec:function(x,y){var w=[].slice.call(arguments,2);return t.getShim().exec(this.uid,x,y,w)},init:function(){var x,y,w;w=this.getShimContainer();j.extend(w.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"});x='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+u.swf_url+'" ';if(n.browser==="IE"){x+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '}x+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+u.swf_url+'" /><param name="flashvars" value="uid='+escape(this.uid)+"&target="+n.global_event_dispatcher+'" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>';if(n.browser==="IE"){y=document.createElement("div");w.appendChild(y);y.outerHTML=x;y=w=null}else{w.innerHTML=x}v=setTimeout(function(){if(t&&!t.initialized){t.trigger("Error",new q.RuntimeError(q.RuntimeError.NOT_INIT_ERR));if(MXI_DEBUG&&n.debug.runtime){n.log("\tFlash failed to initialize within a specified period of time (typically 5s).")}}},5000)},destroy:(function(w){return function(){l(t.uid);w.call(t);clearTimeout(v);u=v=w=t=null}}(this.destroy))},p)}i.addConstructor(o,r);return p});h("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(j,i,l){var k={init:function(o){var m=this,n=this.getRuntime();this.bind("Change",function(){var p=n.shimExec.call(m,"FileInput","getFiles");m.files=[];l.each(p,function(q){m.files.push(new i(n.uid,q))})},999);this.getRuntime().shimExec.call(this,"FileInput","init",{name:o.name,accept:o.accept,multiple:o.multiple});this.trigger("ready")}};return(j.FileInput=k)});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/FileReader",["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(o,n){var m=this;m.result="";if(o==="readAsDataURL"){m.result="data:"+(n.type||"")+";base64,"}m.bind("Progress",function(q,p){if(p){m.result+=j(p,o)}},999);return m.getRuntime().shimExec.call(this,"FileReader","readAsBase64",n.uid)}};return(k.FileReader=l)});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)},getInfo:function(){var o=this.getRuntime(),p=o.shimExec.call(this,"Image","getInfo");if(p.meta&&p.meta.thumb&&!(p.meta.thumb.data instanceof n)){p.meta.thumb.data=new n(o.uid,p.meta.thumb.data)}return p},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.length&&B===u);if(B<=u&&!isNaN(B)){C=true}}}}catch(A){C=false}return C}function k(s){var r=this,t;s=j.extend({xap_url:m.xap_url},s);i.call(this,s,n,{access_binary:i.capTrue,access_image_binary:i.capTrue,display_media:i.capTrue,do_cors:i.capTrue,drag_and_drop:false,report_upload_progress:i.capTrue,resize_image:i.capTrue,return_response_headers:function(u){return u&&r.mode==="client"},return_response_type:function(u){if(u!=="json"){return true}else{return !!window.JSON}},return_status_code:function(u){return r.mode==="client"||!j.arrayDiff(u,[200,404])},select_file:i.capTrue,select_multiple:i.capTrue,send_binary_string:i.capTrue,send_browser_cookies:function(u){return u&&r.mode==="browser"},send_custom_headers:function(u){return u&&r.mode==="client"},send_multipart:i.capTrue,slice_blob:i.capTrue,stream_upload:true,summon_file_dialog:false,upload_filesize:i.capTrue,use_http_method:function(u){return r.mode==="client"||!j.arrayDiff(u,["GET","POST"])}},{return_response_headers:function(u){return u?"client":"browser"},return_status_code:function(u){return j.arrayDiff(u,[200,404])?"client":["client","browser"]},send_browser_cookies:function(u){return u?"browser":"client"},send_custom_headers:function(u){return u?"client":"browser"},use_http_method:function(u){return j.arrayDiff(u,["GET","POST"])?"client":["client","browser"]}});if(!q("2.0.31005.0")||m.browser==="Opera"){if(MXI_DEBUG&&m.debug.runtime){m.log("\tSilverlight is not installed or minimal version (2.0.31005.0) requirement not met (not likely).")}this.mode=false}j.extend(this,{getShim:function(){return l.get(this.uid).content.Moxie},shimExec:function(v,w){var u=[].slice.call(arguments,2);return r.getShim().exec(this.uid,v,w,u)},init:function(){var u;u=this.getShimContainer();u.innerHTML='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;"><param name="source" value="'+s.xap_url+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="enablehtmlaccess" value="true"/><param name="initParams" value="uid='+this.uid+",target="+m.global_event_dispatcher+'"/></object>';t=setTimeout(function(){if(r&&!r.initialized){r.trigger("Error",new p.RuntimeError(p.RuntimeError.NOT_INIT_ERR));if(MXI_DEBUG&&m.debug.runtime){m.log("Silverlight failed to initialize within a specified period of time (5-10s).")}}},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/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(j,i,l){var k={init:function(p){var m=this,o=this.getRuntime();function n(r){var s="";for(var q=0;q<r.length;q++){s+=(s!==""?"|":"")+r[q].title+" | *."+r[q].extensions.replace(/,/g,";*.")}return s}this.bind("Change",function(){var q=o.shimExec.call(m,"FileInput","getFiles");m.files=[];l.each(q,function(r){m.files.push(new i(o.uid,r))})},999);this.getRuntime().shimExec.call(this,"FileInput","init",n(p.accept),p.name,p.multiple);this.trigger("ready")}};return(j.FileInput=k)});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/FileDrop",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Dom","moxie/core/utils/Events"],function(k,j,i){var l={init:function(){var n=this,m=n.getRuntime(),o;o=m.getShimContainer();i.addEvent(o,"dragover",function(p){p.preventDefault();p.stopPropagation();p.dataTransfer.dropEffect="copy"},n.uid);i.addEvent(o,"dragenter",function(q){q.preventDefault();var p=j.get(m.uid).dragEnter(q);if(p){q.stopPropagation()}},n.uid);i.addEvent(o,"drop",function(q){q.preventDefault();var p=j.get(m.uid).dragDrop(q);if(p){q.stopPropagation()}},n.uid);return m.shimExec.call(this,"FileDrop","init")}};return(k.FileDrop=l)});h("moxie/runtime/silverlight/file/FileReader",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReader"],function(i,k,j){return(i.FileReader=k.extend({},j))});h("moxie/runtime/silverlight/file/FileReaderSync",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReaderSync"],function(i,j,k){return(i.FileReaderSync=j.extend({},k))});h("moxie/runtime/silverlight/xhr/XMLHttpRequest",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/xhr/XMLHttpRequest"],function(i,k,j){return(i.XMLHttpRequest=k.extend({},j))});h("moxie/runtime/silverlight/runtime/Transporter",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/runtime/Transporter"],function(i,k,j){return(i.Transporter=k.extend({},j))});h("moxie/runtime/silverlight/image/Image",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/runtime/flash/image/Image"],function(j,k,l,i){return(j.Image=k.extend({},i,{getInfo:function(){var n=this.getRuntime(),o=["tiff","exif","gps","thumb"],p={meta:{}},m=n.shimExec.call(this,"Image","getInfo");if(m.meta){k.each(o,function(r){var v=m.meta[r],q,s,t,u;if(v&&v.keys){p.meta[r]={};for(s=0,t=v.keys.length;s<t;s++){q=v.keys[s];u=v[q];if(u){if(/^(\d|[1-9]\d+)$/.test(u)){u=parseInt(u,10)}else{if(/^\d*\.\d+$/.test(u)){u=parseFloat(u)}}p.meta[r][q]=u}}}});if(p.meta&&p.meta.thumb&&!(p.meta.thumb.data instanceof l)){p.meta.thumb.data=new l(n.uid,p.meta.thumb.data)}}p.width=parseInt(m.width,10);p.height=parseInt(m.height,10);p.size=parseInt(m.size,10);p.type=m.type;p.name=m.name;return p}}))});h("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(o,i,l,k){var n="html4",m={};function j(q){var p=this,s=l.capTest,r=l.capTrue;l.call(this,q,n,{access_binary:s(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:false,display_media:s(m.Image&&(k.can("create_canvas")||k.can("use_data_uri_over32kb"))),do_cors:false,drag_and_drop:false,filter_by_extension:s(function(){return(k.browser==="Chrome"&&k.verComp(k.version,28,">="))||(k.browser==="IE"&&k.verComp(k.version,10,">="))||(k.browser==="Safari"&&k.verComp(k.version,7,">="))}()),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:function(){return p.can("select_file")&&((k.browser==="Firefox"&&k.verComp(k.version,4,">="))||(k.browser==="Opera"&&k.verComp(k.version,12,">="))||(k.browser==="IE"&&k.verComp(k.version,10,">="))||!!~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/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(n,k,p,m,j,l,i){function o(){var s,t=[],q;function r(){var w=this,z=w.getRuntime(),y,x,u,B,v,A;A=p.guid("uid_");y=z.getShimContainer();if(s){u=m.get(s+"_form");if(u){p.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");p.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",q.name||"Filedata");v.setAttribute("accept",t.join(","));p.extend(v.style,{fontSize:"999px",opacity:0});B.appendChild(v);y.appendChild(B);p.extend(v.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"});if(i.browser==="IE"&&i.verComp(i.version,10,"<")){p.extend(v.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"})}v.onchange=function(){var C;if(!this.value){return}if(this.files){C=this.files[0];if(C.size===0){B.parentNode.removeChild(B);return}}else{C={name:this.value}}C=new k(z.uid,C);this.onchange=function(){};r.call(w);w.files=[C];v.setAttribute("id",C.uid);B.setAttribute("id",C.uid+"_form");w.trigger("change");v=B=null};if(z.can("summon_file_dialog")){x=m.get(q.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}p.extend(this,{init:function(x){var u=this,w=u.getRuntime(),v;q=x;t=x.accept.mimes||l.extList2mimes(x.accept,w.can("filter_by_extension"));v=w.getShimContainer();(function(){var y,A,z;y=m.get(x.browse_button);if(w.can("summon_file_dialog")){if(m.getStyle(y,"position")==="static"){y.style.position="relative"}A=parseInt(m.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(m.get(x.container),"mouseup",function(){u.trigger("mouseup")},u.uid);y=null}());r.call(this);v=null;u.trigger({type:"ready",async:true})},disable:function(v){var u;if((u=m.get(s))){u.disabled=!!v}},destroy:function(){var v=this.getRuntime(),w=v.getShim(),u=v.getShimContainer();j.removeAllEvents(u,this.uid);j.removeAllEvents(q&&m.get(q.container),this.uid);j.removeAllEvents(q&&m.get(q.browse_button),this.uid);if(u){u.innerHTML=""}w.removeInstance(this.uid);s=t=q=u=w=null}})}return(n.FileInput=o)});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='<iframe id="'+y+'_iframe" name="'+y+'_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>';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");C.getShimContainer().appendChild(w)}w.setAttribute("target",y+"_iframe");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*<pre[^>]*>/,"").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/utils/Env","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/FileInput","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events"])})(this);(function(a){var d={},c=a.moxie.core.utils.Basic.inArray;(function b(f){var e,g;for(e in f){g=typeof(f[e]);if(g==="object"&&!~c(e,["Exceptions","Env","Mime"])){b(f[e])}else{if(g==="function"){d[e]=f[e]}}}})(a.moxie);d.Env=a.moxie.core.utils.Env;d.Mime=a.moxie.core.utils.Mime;d.Exceptions=a.moxie.core.Exceptions;a.mOxie=d;if(!a.o){a.o=d}return d})(this);