!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f0&&c(f,function(c,f){c!==e&&(a(d[f])===a(c)&&~g(a(c),["array","object"])?b(d[f],c):d[f]=c)})}),d},c=function(a,b){var c,d,e,f;if(a){try{c=a.length}catch(g){c=f}if(c===f){for(d in a)if(a.hasOwnProperty(d)&&b(a[d],d)===!1)return}else for(e=0;c>e;e++)if(b(a[e],e)===!1)return}},d=function(b){var c;if(!b||"object"!==a(b))return!0;for(c in b)return!1;return!0},e=function(b,c){function d(e){"function"===a(b[e])&&b[e](function(a){++ec;c++)if(b[c]===a)return c}return-1},h=function(b,c){var d=[];"array"!==a(b)&&(b=[b]),"array"!==a(c)&&(c=[c]);for(var e in b)-1===g(b[e],c)&&d.push(b[e]);return d.length?d:!1},i=function(a,b){var d=[];return c(a,function(a){-1!==g(a,b)&&d.push(a)}),d.length?d:null},j=function(a){var b,c=[];for(b=0;bc;c++)d+=Math.floor(65535*Math.random()).toString(32);return(b||"o_")+d+(a++).toString(32)}}(),l=function(a){return a?String.prototype.trim?String.prototype.trim.call(a):a.toString().replace(/^\s*/,"").replace(/\s*$/,""):a},m=function(a){if("string"!=typeof a)return a;var b,c={t:1099511627776,g:1073741824,m:1048576,k:1024};return a=/^([0-9]+)([mgk]?)$/.exec(a.toLowerCase().replace(/[^0-9mkg]/g,"")),b=a[2],a=+a[1],c.hasOwnProperty(b)&&(a*=c[b]),a};return{guid:k,typeOf:a,extend:b,each:c,isEmptyObj:d,inSeries:e,inParallel:f,inArray:g,arrayDiff:h,arrayIntersect:i,toArray:j,trim:l,parseSizeStr:m}}),d("moxie/core/I18n",["moxie/core/utils/Basic"],function(a){var b={};return{addI18n:function(c){return a.extend(b,c)},translate:function(a){return b[a]||a},_:function(a){return this.translate(a)},sprintf:function(b){var c=[].slice.call(arguments,1);return b.replace(/%[a-z]/g,function(){var b=c.shift();return"undefined"!==a.typeOf(b)?b:""})}}}),d("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(a,b){var c="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",d={mimes:{},extensions:{},addMimeType:function(a){var b,c,d,e=a.split(/,/);for(b=0;bd;d++)if(a[d]!=b[d]){if(a[d]=i(a[d]),b[d]=i(b[d]),a[d]b[d]){f=1;break}}if(!c)return f;switch(c){case">":case"gt":return f>0;case">=":case"ge":return f>=0;case"<=":case"le":return 0>=f;case"==":case"=":case"eq":return 0===f;case"<>":case"!=":case"ne":return 0!==f;case"":case"<":case"lt":return 0>f;default:return null}}var c=function(a){var b="",c="?",d="function",e="undefined",f="object",g="major",h="name",i="version",j={has:function(a,b){return-1!==b.toLowerCase().indexOf(a.toLowerCase())},lowerize:function(a){return a.toLowerCase()}},k={rgx:function(){for(var b,c,g,h,i,j,k,l=0,m=arguments;l0?2==i.length?b[i[0]]=typeof i[1]==d?i[1].call(this,k):i[1]:3==i.length?b[i[0]]=typeof i[1]!==d||i[1].exec&&i[1].test?k?k.replace(i[1],i[2]):a:k?i[1].call(this,k,i[2]):a:4==i.length&&(b[i[0]]=k?i[3].call(this,k.replace(i[1],i[2])):a):b[i]=k?k:a;break}if(j)break}return b},str:function(b,d){for(var e in d)if(typeof d[e]===f&&d[e].length>0){for(var g=0;g=9)},use_data_uri_of:function(a){return b.use_data_uri&&33e3>a||b.use_data_uri_over32kb()},use_fileinput:function(){var a=document.createElement("input");return a.setAttribute("type","file"),!a.disabled}};return function(c){var d=[].slice.call(arguments);return d.shift(),"function"===a.typeOf(b[c])?b[c].apply(this,d):!!b[c]}}(),e={can:d,browser:c.browser.name,version:parseFloat(c.browser.major),os:c.os.name,osVersion:c.os.version,verComp:b,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return e.OS=e.os,e}),d("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(a){var b=function(a){return"string"!=typeof a?a:document.getElementById(a)},c=function(a,b){if(!a.className)return!1;var c=new RegExp("(^|\\s+)"+b+"(\\s+|$)");return c.test(a.className)},d=function(a,b){c(a,b)||(a.className=a.className?a.className.replace(/\s+$/,"")+" "+b:b)},e=function(a,b){if(a.className){var c=new RegExp("(^|\\s+)"+b+"(\\s+|$)");a.className=a.className.replace(c,function(a,b,c){return" "===b&&" "===c?" ":""})}},f=function(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null)[b]:void 0},g=function(b,c){function d(a){var b,c,d=0,e=0;return a&&(c=a.getBoundingClientRect(),b="CSS1Compat"===j.compatMode?j.documentElement:j.body,d=c.left+b.scrollLeft,e=c.top+b.scrollTop),{x:d,y:e}}var e,f,g,h=0,i=0,j=document;if(b=b,c=c||j.body,b&&b.getBoundingClientRect&&"IE"===a.browser&&(!j.documentMode||j.documentMode<8))return f=d(b),g=d(c),{x:f.x-g.x,y:f.y-g.y};for(e=b;e&&e!=c&&e.nodeType;)h+=e.offsetLeft||0,i+=e.offsetTop||0,e=e.offsetParent;for(e=b.parentNode;e&&e!=c&&e.nodeType;)h-=e.scrollLeft||0,i-=e.scrollTop||0,e=e.parentNode;return{x:h,y:i}},h=function(a){return{w:a.offsetWidth||a.clientWidth,h:a.offsetHeight||a.clientHeight}};return{get:b,hasClass:c,addClass:d,removeClass:e,getStyle:f,getPos:g,getSize:h}}),d("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(a){function b(a,b){var c;for(c in a)if(a[c]===b)return c;return null}return{RuntimeError:function(){function c(a){this.code=a,this.name=b(d,a),this.message=this.name+": RuntimeError "+this.code}var d={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};return a.extend(c,d),c.prototype=Error.prototype,c}(),OperationNotAllowedException:function(){function b(a){this.code=a,this.name="OperationNotAllowedException"}return a.extend(b,{NOT_ALLOWED_ERR:1}),b.prototype=Error.prototype,b}(),ImageError:function(){function c(a){this.code=a,this.name=b(d,a),this.message=this.name+": ImageError "+this.code}var d={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2};return a.extend(c,d),c.prototype=Error.prototype,c}(),FileException:function(){function c(a){this.code=a,this.name=b(d,a),this.message=this.name+": FileException "+this.code}var d={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};return a.extend(c,d),c.prototype=Error.prototype,c}(),DOMException:function(){function c(a){this.code=a,this.name=b(d,a),this.message=this.name+": DOMException "+this.code}var d={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};return a.extend(c,d),c.prototype=Error.prototype,c}(),EventException:function(){function b(a){this.code=a,this.name="EventException"}return a.extend(b,{UNSPECIFIED_EVENT_TYPE_ERR:0}),b.prototype=Error.prototype,b}()}}),d("moxie/core/EventTarget",["moxie/core/Exceptions","moxie/core/utils/Basic"],function(a,b){function c(){var c={};b.extend(this,{uid:null,init:function(){this.uid||(this.uid=b.guid("uid_"))},addEventListener:function(a,d,e,f){var g,h=this;return a=b.trim(a),/\s/.test(a)?void b.each(a.split(/\s+/),function(a){h.addEventListener(a,d,e,f)}):(a=a.toLowerCase(),e=parseInt(e,10)||0,g=c[this.uid]&&c[this.uid][a]||[],g.push({fn:d,priority:e,scope:f||this}),c[this.uid]||(c[this.uid]={}),void(c[this.uid][a]=g))},hasEventListener:function(a){return a?!(!c[this.uid]||!c[this.uid][a]):!!c[this.uid]},removeEventListener:function(a,d){a=a.toLowerCase();var e,f=c[this.uid]&&c[this.uid][a];if(f){if(d){for(e=f.length-1;e>=0;e--)if(f[e].fn===d){f.splice(e,1);break}}else f=[];f.length||(delete c[this.uid][a],b.isEmptyObj(c[this.uid])&&delete c[this.uid])}},removeAllEventListeners:function(){c[this.uid]&&delete c[this.uid]},dispatchEvent:function(d){var e,f,g,h,i,j={},k=!0;if("string"!==b.typeOf(d)){if(h=d,"string"!==b.typeOf(h.type))throw new a.EventException(a.EventException.UNSPECIFIED_EVENT_TYPE_ERR);d=h.type,h.total!==i&&h.loaded!==i&&(j.total=h.total,j.loaded=h.loaded),j.async=h.async||!1}if(-1!==d.indexOf("::")?!function(a){e=a[0],d=a[1]}(d.split("::")):e=this.uid,d=d.toLowerCase(),f=c[e]&&c[e][d]){f.sort(function(a,b){return b.priority-a.priority}),g=[].slice.call(arguments),g.shift(),j.type=d,g.unshift(j);var l=[];b.each(f,function(a){g[0].target=a.scope,l.push(j.async?function(b){setTimeout(function(){b(a.fn.apply(a.scope,g)===!1)},1)}:function(b){b(a.fn.apply(a.scope,g)===!1)})}),l.length&&b.inSeries(l,function(a){k=!a})}return k},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},convertEventPropsToHandlers:function(a){var c;"array"!==b.typeOf(a)&&(a=[a]);for(var d=0;d>16&255,e=k>>8&255,f=255&k,p[n++]=64==i?String.fromCharCode(d):64==j?String.fromCharCode(d,e):String.fromCharCode(d,e,f);while(m>18&63,h=k>>12&63,i=k>>6&63,j=63&k,p[n++]=l.charAt(g)+l.charAt(h)+l.charAt(i)+l.charAt(j);while(mg;g++)f+=String.fromCharCode(e[g]); return f}}b.call(this),a.extend(this,{uid:a.guid("uid_"),readAsBinaryString:function(a){return d.call(this,"readAsBinaryString",a)},readAsDataURL:function(a){return d.call(this,"readAsDataURL",a)},readAsText:function(a){return d.call(this,"readAsText",a)}})}}),d("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(a,b,c){function d(){var a,d=[];b.extend(this,{append:function(e,f){var g=this,h=b.typeOf(f);f instanceof c?a={name:e,value:f}:"array"===h?(e+="[]",b.each(f,function(a){g.append(e,a)})):"object"===h?b.each(f,function(a,b){g.append(e+"["+b+"]",a)}):"null"===h||"undefined"===h||"number"===h&&isNaN(f)?g.append(e,"false"):d.push({name:e,value:f.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return a&&a.value||null},getBlobName:function(){return a&&a.name||null},each:function(c){b.each(d,function(a){c(a.value,a.name)}),a&&c(a.value,a.name)},destroy:function(){a=null,d=[]}})}return d}),d("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(a,b,c,d,e,f,g,h,i,j,k,l){function m(){this.uid=a.guid("uid_")}function n(){function c(a,b){return A.hasOwnProperty(a)?1===arguments.length?k.can("define_property")?A[a]:z[a]:void(k.can("define_property")?A[a]=b:z[a]=b):void 0}function i(b){function d(){x&&(x.destroy(),x=null),h.dispatchEvent("loadend"),h=null}function e(e){x.bind("LoadStart",function(a){c("readyState",n.LOADING),h.dispatchEvent("readystatechange"),h.dispatchEvent(a),H&&h.upload.dispatchEvent(a)}),x.bind("Progress",function(a){c("readyState")!==n.LOADING&&(c("readyState",n.LOADING),h.dispatchEvent("readystatechange")),h.dispatchEvent(a)}),x.bind("UploadProgress",function(a){H&&h.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:a.total,loaded:a.loaded})}),x.bind("Load",function(b){c("readyState",n.DONE),c("status",Number(e.exec.call(x,"XMLHttpRequest","getStatus")||0)),c("statusText",o[c("status")]||""),c("response",e.exec.call(x,"XMLHttpRequest","getResponse",c("responseType"))),~a.inArray(c("responseType"),["text",""])?c("responseText",c("response")):"document"===c("responseType")&&c("responseXML",c("response")),O=e.exec.call(x,"XMLHttpRequest","getAllResponseHeaders"),h.dispatchEvent("readystatechange"),c("status")>0?(H&&h.upload.dispatchEvent(b),h.dispatchEvent(b)):(J=!0,h.dispatchEvent("error")),d()}),x.bind("Abort",function(a){h.dispatchEvent(a),d()}),x.bind("Error",function(a){J=!0,c("readyState",n.DONE),h.dispatchEvent("readystatechange"),I=!0,h.dispatchEvent(a),d()}),e.exec.call(x,"XMLHttpRequest","send",{url:r,method:s,async:B,user:t,password:u,headers:C,mimeType:E,encoding:D,responseType:h.responseType,withCredentials:h.withCredentials,options:N},b)}var h=this;v=(new Date).getTime(),x=new g,"string"==typeof N.required_caps&&(N.required_caps=f.parseCaps(N.required_caps)),N.required_caps=a.extend({},N.required_caps,{return_response_type:h.responseType}),b instanceof j&&(N.required_caps.send_multipart=!0),K||(N.required_caps.do_cors=!0),N.ruid?e(x.connectRuntime(N)):(x.bind("RuntimeInit",function(a,b){e(b)}),x.bind("RuntimeError",function(a,b){h.dispatchEvent("RuntimeError",b)}),x.connectRuntime(N))}function q(){c("responseText",""),c("responseXML",null),c("response",null),c("status",0),c("statusText",""),v=w=null}var r,s,t,u,v,w,x,y,z=this,A={timeout:0,readyState:n.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},B=!0,C={},D=null,E=null,F=!1,G=!1,H=!1,I=!1,J=!1,K=!1,L=null,M=null,N={},O="";a.extend(this,A,{uid:a.guid("uid_"),upload:new m,open:function(f,g,h,i,j){var k;if(!f||!g)throw new b.DOMException(b.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(f)||d.utf8_encode(f)!==f)throw new b.DOMException(b.DOMException.SYNTAX_ERR);if(~a.inArray(f.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(s=f.toUpperCase()),~a.inArray(s,["CONNECT","TRACE","TRACK"]))throw new b.DOMException(b.DOMException.SECURITY_ERR);if(g=d.utf8_encode(g),k=e.parseUrl(g),K=e.hasSameOrigin(k),r=e.resolveUrl(g),(i||j)&&!K)throw new b.DOMException(b.DOMException.INVALID_ACCESS_ERR);if(t=i||k.user,u=j||k.pass,B=h||!0,B===!1&&(c("timeout")||c("withCredentials")||""!==c("responseType")))throw new b.DOMException(b.DOMException.INVALID_ACCESS_ERR);F=!B,G=!1,C={},q.call(this),c("readyState",n.OPENED),this.convertEventPropsToHandlers(["readystatechange"]),this.dispatchEvent("readystatechange")},setRequestHeader:function(e,f){var g=["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(c("readyState")!==n.OPENED||G)throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(e)||d.utf8_encode(e)!==e)throw new b.DOMException(b.DOMException.SYNTAX_ERR);return e=a.trim(e).toLowerCase(),~a.inArray(e,g)||/^(proxy\-|sec\-)/.test(e)?!1:(C[e]?C[e]+=", "+f:C[e]=f,!0)},getAllResponseHeaders:function(){return O||""},getResponseHeader:function(b){return b=b.toLowerCase(),J||~a.inArray(b,["set-cookie","set-cookie2"])?null:O&&""!==O&&(y||(y={},a.each(O.split(/\r\n/),function(b){var c=b.split(/:\s+/);2===c.length&&(c[0]=a.trim(c[0]),y[c[0].toLowerCase()]={header:c[0],value:a.trim(c[1])})})),y.hasOwnProperty(b))?y[b].header+": "+y[b].value:null},overrideMimeType:function(d){var e,f;if(~a.inArray(c("readyState"),[n.LOADING,n.DONE]))throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);if(d=a.trim(d.toLowerCase()),/;/.test(d)&&(e=d.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(d=e[1],e[2]&&(f=e[2])),!l.mimes[d])throw new b.DOMException(b.DOMException.SYNTAX_ERR);L=d,M=f},send:function(c,e){if(N="string"===a.typeOf(e)?{ruid:e}:e?e:{},this.convertEventPropsToHandlers(p),this.upload.convertEventPropsToHandlers(p),this.readyState!==n.OPENED||G)throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);if(c instanceof h)N.ruid=c.ruid,E=c.type||"application/octet-stream";else if(c instanceof j){if(c.hasBlob()){var f=c.getBlob();N.ruid=f.ruid,E=f.type||"application/octet-stream"}}else"string"==typeof c&&(D="UTF-8",E="text/plain;charset=UTF-8",c=d.utf8_encode(c));this.withCredentials||(this.withCredentials=N.required_caps&&N.required_caps.send_browser_cookies&&!K),H=!F&&this.upload.hasEventListener(),J=!1,I=!c,F||(G=!0),i.call(this,c)},abort:function(){if(J=!0,F=!1,~a.inArray(c("readyState"),[n.UNSENT,n.OPENED,n.DONE]))c("readyState",n.UNSENT);else{if(c("readyState",n.DONE),G=!1,!x)throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);x.getRuntime().exec.call(x,"XMLHttpRequest","abort",I),I=!0}},destroy:function(){x&&("function"===a.typeOf(x.destroy)&&x.destroy(),x=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}})}var o={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"};m.prototype=c.instance;var p=["loadstart","progress","abort","error","load","timeout","loadend"];return n.UNSENT=0,n.OPENED=1,n.HEADERS_RECEIVED=2,n.LOADING=3,n.DONE=4,n.prototype=c.instance,n}),d("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(a,b,c,d){function e(){function d(){k=l=0,j=this.result=null}function f(b,c){var d=this;i=c,d.bind("TransportingProgress",function(b){l=b.loaded,k>l&&-1===a.inArray(d.state,[e.IDLE,e.DONE])&&g.call(d)},999),d.bind("TransportingComplete",function(){l=k,d.state=e.DONE,j=null,d.result=i.exec.call(d,"Transporter","getAsBlob",b||"")},999),d.state=e.BUSY,d.trigger("TransportingStarted"),g.call(d)}function g(){var a,c=this,d=k-l;m>d&&(m=d),a=b.btoa(j.substr(l,m)),i.exec.call(c,"Transporter","receive",a,k)}var h,i,j,k,l,m;c.call(this),a.extend(this,{uid:a.guid("uid_"),state:e.IDLE,result:null,transport:function(b,c,e){var g=this;if(e=a.extend({chunk_size:204798},e),(h=e.chunk_size%3)&&(e.chunk_size+=3-h),m=e.chunk_size,d.call(this),j=b,k=b.length,"string"===a.typeOf(e)||e.ruid)f.call(g,c,this.connectRuntime(e));else{var i=function(a,b){g.unbind("RuntimeInit",i),f.call(g,c,b)};this.bind("RuntimeInit",i),this.connectRuntime(e)}},abort:function(){var a=this;a.state=e.IDLE,i&&(i.exec.call(a,"Transporter","clear"),a.trigger("TransportingAborted")),d.call(a)},destroy:function(){this.unbindAll(),i=null,this.disconnectRuntime(),d.call(this)}})}return e.IDLE=0,e.BUSY=1,e.DONE=2,e.prototype=d.instance,e}),d("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(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){function d(a){a||(a=this.getRuntime().exec.call(this,"Image","getInfo")),this.size=a.size,this.width=a.width,this.height=a.height,this.type=a.type,this.meta=a.meta,""===this.name&&(this.name=a.name)}function j(b){var d=a.typeOf(b);try{if(b instanceof n){if(!b.size)throw new c.DOMException(c.DOMException.INVALID_STATE_ERR);p.apply(this,arguments)}else if(b instanceof k){if(!~a.inArray(b.type,["image/jpeg","image/png"]))throw new c.ImageError(c.ImageError.WRONG_FORMAT);q.apply(this,arguments)}else if(-1!==a.inArray(d,["blob","file"]))j.call(this,new l(null,b),arguments[1]);else if("string"===d)/^data:[^;]*;base64,/.test(b)?j.call(this,new k(null,{data:b}),arguments[1]):r.apply(this,arguments);else{if("node"!==d||"img"!==b.nodeName.toLowerCase())throw new c.DOMException(c.DOMException.TYPE_MISMATCH_ERR);j.call(this,b.src,arguments[1])}}catch(e){this.trigger("error",e.code)}}function p(b,c){var d=this.connectRuntime(b.ruid);this.ruid=d.uid,d.exec.call(this,"Image","loadFromImage",b,"undefined"===a.typeOf(c)?!0:c)}function q(b,c){function d(a){e.ruid=a.uid,a.exec.call(e,"Image","loadFromBlob",b)}var e=this;e.name=b.name||"",b.isDetached()?(this.bind("RuntimeInit",function(a,b){d(b)}),c&&"string"==typeof c.required_caps&&(c.required_caps=f.parseCaps(c.required_caps)),this.connectRuntime(a.extend({required_caps:{access_image_binary:!0,resize_image:!0}},c))):d(this.connectRuntime(b.ruid))}function r(a,b){var c,d=this;c=new e,c.open("get",a),c.responseType="blob",c.onprogress=function(a){d.trigger(a)},c.onload=function(){q.call(d,c.response,!0)},c.onerror=function(a){d.trigger(a)},c.onloadend=function(){c.destroy()},c.bind("RuntimeError",function(a,b){d.trigger("RuntimeError",b)}),c.send(null,b)}g.call(this),a.extend(this,{uid:a.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){this.bind("Load Resize",function(){d.call(this)},999),this.convertEventPropsToHandlers(o),j.apply(this,arguments)},downsize:function(b){var d={width:this.width,height:this.height,crop:!1,preserveHeaders:!0};b="object"==typeof b?a.extend(d,b):a.extend(d,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]});try{if(!this.size)throw new c.DOMException(c.DOMException.INVALID_STATE_ERR);if(this.width>n.MAX_RESIZE_WIDTH||this.height>n.MAX_RESIZE_HEIGHT)throw new c.ImageError(c.ImageError.MAX_RESOLUTION_ERR);this.getRuntime().exec.call(this,"Image","downsize",b.width,b.height,b.crop,b.preserveHeaders)}catch(e){this.trigger("error",e.code)}},crop:function(a,b,c){this.downsize(a,b,!0,c)},getAsCanvas:function(){if(!i.can("create_canvas"))throw new c.RuntimeError(c.RuntimeError.NOT_SUPPORTED_ERR);var a=this.connectRuntime(this.ruid);return a.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(a,b){if(!this.size)throw new c.DOMException(c.DOMException.INVALID_STATE_ERR);return a||(a="image/jpeg"),"image/jpeg"!==a||b||(b=90),this.getRuntime().exec.call(this,"Image","getAsBlob",a,b)},getAsDataURL:function(a,b){if(!this.size)throw new c.DOMException(c.DOMException.INVALID_STATE_ERR);return this.getRuntime().exec.call(this,"Image","getAsDataURL",a,b)},getAsBinaryString:function(a,b){var c=this.getAsDataURL(a,b);return m.atob(c.substring(c.indexOf("base64,")+7))},embed:function(d){function e(){if(i.can("create_canvas")){var b=f.getAsCanvas();if(b)return d.appendChild(b),b=null,f.destroy(),void o.trigger("embedded")}var e=f.getAsDataURL(g,j);if(!e)throw new c.ImageError(c.ImageError.WRONG_FORMAT);if(i.can("use_data_uri_of",e.length))d.innerHTML='',f.destroy(),o.trigger("embedded");else{var k=new h;k.bind("TransportingComplete",function(){l=o.connectRuntime(this.result.ruid),o.bind("Embedded",function(){a.extend(l.getShimContainer().style,{top:"0px",left:"0px",width:f.width+"px",height:f.height+"px"}),l=null},999),l.exec.call(o,"ImageView","display",this.result.uid,q,r),f.destroy()}),k.transport(m.atob(e.substring(e.indexOf("base64,")+7)),g,a.extend({},p,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:d}))}}var f,g,j,k,l,o=this,p=arguments[1]||{},q=this.width,r=this.height;try{if(!(d=b.get(d)))throw new c.DOMException(c.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new c.DOMException(c.DOMException.INVALID_STATE_ERR);if(this.width>n.MAX_RESIZE_WIDTH||this.height>n.MAX_RESIZE_HEIGHT)throw new c.ImageError(c.ImageError.MAX_RESOLUTION_ERR);if(g=p.type||this.type||"image/jpeg",j=p.quality||90,k="undefined"!==a.typeOf(p.crop)?p.crop:!1,p.width)q=p.width,r=p.height||q;else{var s=b.getSize(d);s.w&&s.h&&(q=s.w,r=s.h)}return f=new n,f.bind("Resize",function(){e.call(o)}),f.bind("Load",function(){f.downsize(q,r,k,!1)}),f.clone(this,!1),f}catch(t){this.trigger("error",t.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}})}var o=["progress","load","error","resize","embedded"];return n.MAX_RESIZE_WIDTH=6500,n.MAX_RESIZE_HEIGHT=6500,n.prototype=j.instance,n}),d("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(a,b,c,d,e){function f(){var a;try{a=navigator.plugins["Shockwave Flash"],a=a.description}catch(b){try{a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(c){a="0.0"}}return a=a.match(/\d+/g),parseFloat(a[0]+"."+a[1])}function g(g){var j,k=this;g=a.extend({swf_url:b.swf_url},g),e.call(this,g,h,{access_binary:function(a){return a&&"browser"===k.mode},access_image_binary:function(a){return a&&"browser"===k.mode},display_media:e.capTrue,do_cors:e.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===k.mode},resize_image:e.capTrue,return_response_headers:!1,return_response_type:function(b){return"json"===b&&window.JSON?!0:!a.arrayDiff(b,["","text","document"])||"browser"===k.mode},return_status_code:function(b){return"browser"===k.mode||!a.arrayDiff(b,[200,404])},select_file:e.capTrue,select_multiple:e.capTrue,send_binary_string:function(a){return a&&"browser"===k.mode},send_browser_cookies:function(a){return a&&"browser"===k.mode},send_custom_headers:function(a){return a&&"browser"===k.mode},send_multipart:e.capTrue,slice_blob:function(a){return a&&"browser"===k.mode},stream_upload:function(a){return a&&"browser"===k.mode},summon_file_dialog:!1,upload_filesize:function(b){return a.parseSizeStr(b)<=2097152||"client"===k.mode},use_http_method:function(b){return!a.arrayDiff(b,["GET","POST"])}},{access_binary:function(a){return a?"browser":"client"},access_image_binary:function(a){return a?"browser":"client"},report_upload_progress:function(a){return a?"browser":"client"},return_response_type:function(b){return a.arrayDiff(b,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(b){return a.arrayDiff(b,[200,404])?"browser":["client","browser"]},send_binary_string:function(a){return a?"browser":"client"},send_browser_cookies:function(a){return a?"browser":"client"},send_custom_headers:function(a){return a?"browser":"client"},stream_upload:function(a){return a?"client":"browser"},upload_filesize:function(b){return a.parseSizeStr(b)>=2097152?"client":"browser"}},"client"),f()<10&&(this.mode=!1),a.extend(this,{getShim:function(){return c.get(this.uid)},shimExec:function(a,b){var c=[].slice.call(arguments,2);return k.getShim().exec(this.uid,a,b,c)},init:function(){var c,e,f;f=this.getShimContainer(),a.extend(f.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),c='',"IE"===b.browser?(e=document.createElement("div"),f.appendChild(e),e.outerHTML=c,e=f=null):f.innerHTML=c,j=setTimeout(function(){k&&!k.initialized&&k.trigger("Error",new d.RuntimeError(d.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(a){return function(){a.call(k),clearTimeout(j),g=j=a=k=null}}(this.destroy)},i)}var h="flash",i={};return e.addConstructor(h,g),i}),d("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(a,b){var c={slice:function(a,c,d,e){var f=this.getRuntime();return 0>c?c=Math.max(a.size+c,0):c>0&&(c=Math.min(c,a.size)),0>d?d=Math.max(a.size+d,0):d>0&&(d=Math.min(d,a.size)),a=f.shimExec.call(this,"Blob","slice",c,d,e||""),a&&(a=new b(f.uid,a)),a}};return a.Blob=c}),d("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime"],function(a){var b={init:function(a){this.getRuntime().shimExec.call(this,"FileInput","init",{name:a.name,accept:a.accept,multiple:a.multiple}),this.trigger("ready")}};return a.FileInput=b}),d("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(a,b){function c(a,c){switch(c){case"readAsText":return b.atob(a,"utf8");case"readAsBinaryString":return b.atob(a);case"readAsDataURL":return a}return null}var d="",e={read:function(a,b){var e=this,f=e.getRuntime();return"readAsDataURL"===a&&(d="data:"+(b.type||"")+";base64,"),e.bind("Progress",function(b,e){e&&(d+=c(e,a))}),f.shimExec.call(this,"FileReader","readAsBase64",b.uid)},getResult:function(){return d},destroy:function(){d=null}};return a.FileReader=e}),d("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(a,b){function c(a,c){switch(c){case"readAsText":return b.atob(a,"utf8");case"readAsBinaryString":return b.atob(a);case"readAsDataURL":return a}return null}var d={read:function(a,b){var d,e=this.getRuntime();return(d=e.shimExec.call(this,"FileReaderSync","readAsBase64",b.uid))?("readAsDataURL"===a&&(d="data:"+(b.type||"")+";base64,"+d),c(d,a,b.type)):null}};return a.FileReaderSync=d}),d("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(a,b,c,d,e,f,g){var h={send:function(a,d){function e(){a.transport=k.mode,k.shimExec.call(j,"XMLHttpRequest","send",a,d)}function h(a,b){k.shimExec.call(j,"XMLHttpRequest","appendBlob",a,b.uid),d=null,e()}function i(a,b){var c=new g;c.bind("TransportingComplete",function(){b(this.result)}),c.transport(a.getSource(),a.type,{ruid:k.uid})}var j=this,k=j.getRuntime();if(b.isEmptyObj(a.headers)||b.each(a.headers,function(a,b){k.shimExec.call(j,"XMLHttpRequest","setRequestHeader",b,a.toString())}),d instanceof f){var l;if(d.each(function(a,b){a instanceof c?l=b:k.shimExec.call(j,"XMLHttpRequest","append",b,a)}),d.hasBlob()){var m=d.getBlob();m.isDetached()?i(m,function(a){m.destroy(),h(l,a)}):h(l,m)}else d=null,e()}else d instanceof c?d.isDetached()?i(d,function(a){d.destroy(),d=a.uid,e()}):(d=d.uid,e()):e()},getResponse:function(a){var c,f,g=this.getRuntime();if(f=g.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(f=new d(g.uid,f),"blob"===a)return f;try{if(c=new e,~b.inArray(a,["","text"]))return c.readAsText(f);if("json"===a&&window.JSON)return JSON.parse(c.readAsText(f))}finally{f.destroy()}}return null},abort:function(){var a=this.getRuntime();a.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return a.XMLHttpRequest=h}),d("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(a,b){var c={getAsBlob:function(a){var c=this.getRuntime(),d=c.shimExec.call(this,"Transporter","getAsBlob",a);return d?new b(c.uid,d):null}};return a.Transporter=c}),d("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(a,b,c,d,e){var f={loadFromBlob:function(a){function b(a){e.shimExec.call(d,"Image","loadFromBlob",a.uid),d=e=null}var d=this,e=d.getRuntime();if(a.isDetached()){var f=new c;f.bind("TransportingComplete",function(){b(f.result.getSource())}),f.transport(a.getSource(),a.type,{ruid:e.uid})}else b(a.getSource())},loadFromImage:function(a){var b=this.getRuntime();return b.shimExec.call(this,"Image","loadFromImage",a.uid)},getAsBlob:function(a,b){var c=this.getRuntime(),e=c.shimExec.call(this,"Image","getAsBlob",a,b);return e?new d(c.uid,e):null},getAsDataURL:function(){var a,b=this.getRuntime(),c=b.Image.getAsBlob.apply(this,arguments);return c?(a=new e,a.readAsDataURL(c)):null}};return a.Image=f}),f(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/runtime/RuntimeTarget","moxie/file/FileReader","moxie/core/utils/Url","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image"])}(this),function(a){"use strict";var b={},c=a.moxie.core.utils.Basic.inArray;return function d(a){var e,f;for(e in a)f=typeof a[e],"object"!==f||~c(e,["Exceptions","Env","Mime"])?"function"===f&&(b[e]=a[e]):d(a[e])}(a.moxie),b.Env=a.moxie.core.utils.Env,b.Mime=a.moxie.core.utils.Mime,b.Exceptions=a.moxie.core.Exceptions,a.mOxie=b,a.o||(a.o=b),b}(this);