var MXI_DEBUG=!1;!function(a,v){"use strict";var s={};function e(e,t,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(t===v)throw"invalid module definition, dependencies must be specified";if(i===v)throw"invalid module definition, definition function must be specified";!function(e,t){for(var i,n=[],r=0;rt[a]){s=1;break}}if(!i)return s;switch(i){case">":case"gt":return 0=":case"ge":return 0<=s;case"<=":case"le":return s<=0;case"==":case"=":case"eq":return 0===s;case"<>":case"!=":case"ne":return 0!==s;case"":case"<":case"lt":return s<0;default:return null}},global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return g.OS=g.os,MXI_DEBUG&&(g.debug={runtime:!0,events:!1},g.log=function(){var e,t=arguments[0];if("string"===n.typeOf(t)&&(t=n.sprintf.apply(this,arguments)),window&&window.console&&window.console.log)window.console.log(t);else if(document){var i=document.getElementById("moxie-console");i||((i=document.createElement("pre")).id="moxie-console",document.body.appendChild(i)),-1!==n.inArray(n.typeOf(t),["object","array"])?(e=t,i.appendChild(document.createTextNode(e+"\n"))):i.appendChild(document.createTextNode(t+"\n"))}}),g}),e("moxie/core/I18n",["moxie/core/utils/Basic"],function(i){var t={};return{addI18n:function(e){return i.extend(t,e)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(e){var t=[].slice.call(arguments,1);return e.replace(/%[a-z]/g,function(){var e=t.shift();return"undefined"!==i.typeOf(e)?e:""})}}}),e("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(s,n){var e={mimes:{},extensions:{},addMimeType:function(e){var t,i,n,r=e.split(/,/);for(t=0;t>16&255,n=s>>8&255,r=255&s,h[d++]=64==o?String.fromCharCode(i):64==a?String.fromCharCode(i,n):String.fromCharCode(i,n,r),l>18&63,n=a>>12&63,r=a>>6&63,o=63&a,d[c++]=s.charAt(i)+s.charAt(n)+s.charAt(r)+s.charAt(o),ug.MAX_RESIZE_WIDTH||this.height>g.MAX_RESIZE_HEIGHT)throw new l.ImageError(l.ImageError.MAX_RESOLUTION_ERR);this.exec("Image","downsize",e.width,e.height,e.crop,e.preserveHeaders)}catch(e){this.trigger("error",e.code)}},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!h.can("create_canvas"))throw new l.RuntimeError(l.RuntimeError.NOT_SUPPORTED_ERR);return this.connectRuntime(this.ruid).exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new l.DOMException(l.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new l.DOMException(l.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return f.atob(i.substring(i.indexOf("base64,")+7))},embed:function(a,e){var s,u=this;e=c.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},e||{});try{if(!(a=i.get(a)))throw new l.DOMException(l.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new l.DOMException(l.DOMException.INVALID_STATE_ERR);this.width>g.MAX_RESIZE_WIDTH||this.height;var t=new g;return t.bind("Resize",function(){(function(e,t){var i=this;if(h.can("create_canvas")){var n=i.getAsCanvas();if(n)return a.appendChild(n),n=null,i.destroy(),void u.trigger("embedded")}var r=i.getAsDataURL(e,t);if(!r)throw new l.ImageError(l.ImageError.WRONG_FORMAT);if(h.can("use_data_uri_of",r.length))a.innerHTML='',i.destroy(),u.trigger("embedded");else{var o=new d;o.bind("TransportingComplete",function(){s=u.connectRuntime(this.result.ruid),u.bind("Embedded",function(){c.extend(s.getShimContainer().style,{top:"0px",left:"0px",width:i.width+"px",height:i.height+"px"}),s=null},999),s.exec.call(u,"ImageView","display",this.result.uid,width,height),i.destroy()}),o.transport(f.atob(r.substring(r.indexOf("base64,")+7)),e,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:a})}}).call(this,e.type,e.quality)}),t.bind("Load",function(){t.downsize(e)}),this.meta.thumb&&this.meta.thumb.width>=e.width&&this.meta.thumb.height>=e.height?t.load(this.meta.thumb.data):t.clone(this,!1),t}catch(e){this.trigger("error",e.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}}),this.handleEventProps(p),this.bind("Load Resize",function(){(function(e){e=e||this.exec("Image","getInfo");this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}).call(this)},999)}return g.MAX_RESIZE_WIDTH=8192,g.MAX_RESIZE_HEIGHT=8192,g.prototype=n.instance,g}),e("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(s,e,u,c){var l={};return u.addConstructor("html5",function(e){var t,i,n=this,r=u.capTest,o=u.capTrue,a=s.extend({access_binary:r(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return n.can("access_binary")&&!!l.Image},display_media:r(c.can("create_canvas")||c.can("use_data_uri_over32kb")),do_cors:r(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:r((t=document.createElement("div"),("draggable"in t||"ondragstart"in t&&"ondrop"in t)&&("IE"!==c.browser||c.verComp(c.version,9,">")))),filter_by_extension:r("Chrome"===c.browser&&c.verComp(c.version,28,">=")||"IE"===c.browser&&c.verComp(c.version,10,">=")||"Safari"===c.browser&&c.verComp(c.version,7,">=")),return_response_headers:o,return_response_type:function(e){return!("json"!==e||!window.JSON)||c.can("return_response_type",e)},return_status_code:o,report_upload_progress:r(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return n.can("access_binary")&&c.can("create_canvas")},select_file:function(){return c.can("use_fileinput")&&window.File},select_folder:function(){return n.can("select_file")&&"Chrome"===c.browser&&c.verComp(c.version,21,">=")},select_multiple:function(){return n.can("select_file")&&!("Safari"===c.browser&&"Windows"===c.os)&&!("iOS"===c.os&&c.verComp(c.osVersion,"7.0.0",">")&&c.verComp(c.osVersion,"8.0.0","<"))},send_binary_string:r(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:r(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||n.can("send_binary_string")},slice_blob:r(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return n.can("slice_blob")&&n.can("send_multipart")},summon_file_dialog:function(){return n.can("select_file")&&("Firefox"===c.browser&&c.verComp(c.version,4,">=")||"Opera"===c.browser&&c.verComp(c.version,12,">=")||"IE"===c.browser&&c.verComp(c.version,10,">=")||!!~s.inArray(c.browser,["Chrome","Safari"]))},upload_filesize:o},arguments[2]);u.call(this,e,arguments[1]||"html5",a),s.extend(this,{init:function(){this.trigger("Init")},destroy:(i=this.destroy,function(){i.call(n),i=n=null})}),s.extend(this.getShim(),l)}),l}),e("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(a){var s={},u="moxie_"+a.guid();function c(){this.returnValue=!1}function l(){this.cancelBubble=!0}function r(t,e,i){var n;if(e=e.toLowerCase(),t[u]&&s[t[u]]&&s[t[u]][e]){for(var r=(n=s[t[u]][e]).length-1;0<=r&&(n[r].orig!==i&&n[r].key!==i||(t.removeEventListener?t.removeEventListener(e,n[r].func,!1):t.detachEvent&&t.detachEvent("on"+e,n[r].func),n[r].orig=null,n[r].func=null,n.splice(r,1),void 0===i));r--);if(n.length||delete s[t[u]][e],a.isEmptyObj(s[t[u]])){delete s[t[u]];try{delete t[u]}catch(e){t[u]=void 0}}}}return{addEvent:function(e,t,i,n){var r,o;t=t.toLowerCase(),e.addEventListener?(r=i,e.addEventListener(t,r,!1)):e.attachEvent&&(r=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=c,e.stopPropagation=l,i(e)},e.attachEvent("on"+t,r)),e[u]||(e[u]=a.guid()),s.hasOwnProperty(e[u])||(s[e[u]]={}),(o=s[e[u]]).hasOwnProperty(t)||(o[t]=[]),o[t].push({func:r,orig:i,key:n})},removeEvent:r,removeAllEvents:function(i,n){i&&i[u]&&a.each(s[i[u]],function(e,t){r(i,t,n)})}}}),e("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,l,d,h,m,f,p){return e.FileInput=function(){var c;d.extend(this,{init:function(e){var t,i,n,r,o,a,s=this,u=s.getRuntime();n=(c=e).accept.mimes||f.extList2mimes(c.accept,u.can("filter_by_extension")),(i=u.getShimContainer()).innerHTML='",t=h.get(u.uid),d.extend(t.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),r=h.get(c.browse_button),u.can("summon_file_dialog")&&("static"===h.getStyle(r,"position")&&(r.style.position="relative"),o=parseInt(h.getStyle(r,"z-index"),10)||1,r.style.zIndex=o,i.style.zIndex=o-1,m.addEvent(r,"click",function(e){var t=h.get(u.uid);t&&!t.disabled&&t.click(),e.preventDefault()},s.uid)),a=u.can("summon_file_dialog")?r:i,m.addEvent(a,"mouseover",function(){s.trigger("mouseenter")},s.uid),m.addEvent(a,"mouseout",function(){s.trigger("mouseleave")},s.uid),m.addEvent(a,"mousedown",function(){s.trigger("mousedown")},s.uid),m.addEvent(h.get(c.container),"mouseup",function(){s.trigger("mouseup")},s.uid),t.onchange=function e(t){if(s.files=[],d.each(this.files,function(e){var t="";if(c.directory&&"."==e.name)return!0;e.webkitRelativePath&&(t="/"+e.webkitRelativePath.replace(/^\//,"")),(e=new l(u.uid,e)).relativePath=t,s.files.push(e)}),"IE"!==p.browser&&"IEMobile"!==p.browser)this.value="";else{var i=this.cloneNode(!0);this.parentNode.replaceChild(i,this),i.onchange=e}s.files.length&&s.trigger("change")},s.trigger({type:"ready",async:!0}),i=null},disable:function(e){var t,i=this.getRuntime();(t=h.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer();m.removeAllEvents(i,this.uid),m.removeAllEvents(c&&h.get(c.container),this.uid),m.removeAllEvents(c&&h.get(c.browse_button),this.uid),i&&(i.innerHTML=""),t.removeInstance(this.uid),c=i=t=null}})}}),e("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){return e.Blob=function(){this.slice=function(){return new t(this.getRuntime().uid,function(t,i,n){var e;if(!window.File.prototype.slice)return(e=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?e.call(t,i,n):null;try{return t.slice(),t.slice(i,n)}catch(e){return t.slice(i,n-i)}}.apply(this,arguments))}}}),e("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,l,d,t,h,m){return e.FileDrop=function(){var n,r,o=[],a=[];function s(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=d.toArray(e.dataTransfer.types||[]);return-1!==d.inArray("Files",t)||-1!==d.inArray("public.file-url",t)||-1!==d.inArray("application/x-moz-file",t)}function u(e,t){if(function(e){if(!a.length)return!0;var t=m.getFileExtension(e.name);return!t||-1!==d.inArray(t,a)}(e)){var i=new l(r,e);i.relativePath=t||"",o.push(i)}}function c(e,t){var i=[];d.each(e,function(t){i.push(function(e){!function(t,i){t.isFile?t.file(function(e){u(e,t.fullPath),i()},function(){i()}):t.isDirectory?function(e,t){var n=[],r=e.createReader();!function t(i){r.readEntries(function(e){e.length?([].push.apply(n,e),t(i)):i()},i)}(function(){c(n,t)})}(t,i):i()}(t,e)})}),d.inSeries(i,function(){t()})}d.extend(this,{init:function(e){var t,i=this;n=e,r=i.ruid,a=function(e){for(var t=[],i=0;i=")&&p.verComp(p.version,7,"<"),r="Android Browser"===p.browser,o=!1;if(u=e.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),(s=!window.XMLHttpRequest||"IE"===p.browser&&p.verComp(p.version,8,"<")?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;tthis.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),i=r=0;rthis.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;r>Math.abs(n+8*r)&255)},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return 2147483647=o.length));i++);},purge:function(){this.headers=a=[]}}}}),e("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(x,a,E){function s(e){var t,l,p,g,i,n;if(a.call(this,e),l={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},p={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},i=(g={tiffHeader:10}).tiffHeader,t={clear:this.clear},x.extend(this,{read:function(){try{return s.prototype.read.apply(this,arguments)}catch(e){throw new E.ImageError(E.ImageError.INVALID_META_ERR)}},write:function(){try{return s.prototype.write.apply(this,arguments)}catch(e){throw new E.ImageError(E.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return n||null},EXIF:function(){var e=null;if(g.exifIFD){try{e=o.call(this,g.exifIFD,l.exif)}catch(e){return null}if(e.ExifVersion&&"array"===x.typeOf(e.ExifVersion)){for(var t=0,i="";t=this.length())throw new E.ImageError(E.ImageError.INVALID_META_ERR);"ASCII"!==o?(d=l.asArray(o,u,a),c=1==a?d[0]:d,p.hasOwnProperty(r)&&"object"!=typeof c?h[r]=p[r][c]:h[r]=c):h[r]=x.trim(l.STRING(u,a).replace(/\0$/,""))}return h}r&&(g.IFD1=g.tiffHeader+r)}return s.prototype=a.prototype,s}),e("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(a,s,u,c,l){return function(e){var r,i,n,t;if(65496!==(r=new c(e)).SHORT(0))throw new s.ImageError(s.ImageError.WRONG_FORMAT);i=new u(e);try{n=new l(i.get("app1")[0])}catch(e){}function o(e){var t,i,n=0;for(e=e||r;n<=e.length();){if(65472<=(t=e.SHORT(n+=2))&&t<=65475)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}t=o.call(this),a.extend(this,{type:"image/jpeg",size:r.length(),width:t&&t.width||0,height:t&&t.height||0,setExif:function(e,t){if(!n)return!1;"object"===a.typeOf(e)?a.each(e,function(e,t){n.setExif(t,e)}):n.setExif(e,t),i.set("app1",n.SEGMENT())},writeHeaders:function(){return arguments.length?i.restore(arguments[0]):i.restore(e)},stripHeaders:function(e){return i.strip(e)},purge:function(){(function(){if(!n||!i||!r)return;n.clear(),i.purge(),r.clear(),t=i=n=r=null}).call(this)}}),n&&(this.meta={tiff:n.TIFF(),exif:n.EXIF(),gps:n.GPS(),thumb:function(){var e,t,i=n.thumb();if(i&&(e=new c(i),t=o(e),e.clear(),t))return t.data=i,t;return null}()})}}),e("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(n,r,a){return function(e){var o,t;function i(){o&&(o.clear(),e=t=o=null)}o=new a(e),function(){var e=0,t=0,i=[35152,20039,3338,6666];for(t=0;t>1}n=null;var c=u/i;return 0==c?1:c}(e,0,r),f=0;f=")||"IE"===s.browser&&s.verComp(s.version,10,">=")||"Safari"===s.browser&&s.verComp(s.version,7,">=")),resize_image:function(){return u.Image&&i.can("access_binary")&&s.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(e){return!("json"!==e||!window.JSON)||!!~o.inArray(e,["text","document",""])},return_status_code:function(e){return!o.arrayDiff(e,[200,404])},select_file:function(){return s.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return i.can("select_file")},summon_file_dialog:function(){return i.can("select_file")&&("Firefox"===s.browser&&s.verComp(s.version,4,">=")||"Opera"===s.browser&&s.verComp(s.version,12,">=")||"IE"===s.browser&&s.verComp(s.version,10,">=")||!!~o.inArray(s.browser,["Chrome","Safari"]))},upload_filesize:r,use_http_method:function(e){return!o.arrayDiff(e,["GET","POST"])}}),o.extend(this,{init:function(){this.trigger("Init")},destroy:(t=this.destroy,function(){t.call(i),t=i=null})}),o.extend(this.getShim(),u)}),u}),e("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,h,m,f,p,s,g){return e.FileInput=function(){var c,l,d=[];m.extend(this,{init:function(e){var t,i,n,r,o=this,a=o.getRuntime();d=(l=e).accept.mimes||s.extList2mimes(e.accept,a.can("filter_by_extension")),t=a.getShimContainer(),i=f.get(e.browse_button),a.can("summon_file_dialog")&&("static"===f.getStyle(i,"position")&&(i.style.position="relative"),n=parseInt(f.getStyle(i,"z-index"),10)||1,i.style.zIndex=n,t.style.zIndex=n-1),r=a.can("summon_file_dialog")?i:t,p.addEvent(r,"mouseover",function(){o.trigger("mouseenter")},o.uid),p.addEvent(r,"mouseout",function(){o.trigger("mouseleave")},o.uid),p.addEvent(r,"mousedown",function(){o.trigger("mousedown")},o.uid),p.addEvent(f.get(e.container),"mouseup",function(){o.trigger("mouseup")},o.uid),i=null,function t(){var e,i,n,r,o,a,s=this,u=s.getRuntime();a=m.guid("uid_"),e=u.getShimContainer(),c&&(n=f.get(c+"_form"))&&m.extend(n.style,{top:"100%"}),(r=document.createElement("form")).setAttribute("id",a+"_form"),r.setAttribute("method","post"),r.setAttribute("enctype","multipart/form-data"),r.setAttribute("encoding","multipart/form-data"),m.extend(r.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),(o=document.createElement("input")).setAttribute("id",a),o.setAttribute("type","file"),o.setAttribute("name",l.name||"Filedata"),o.setAttribute("accept",d.join(",")),m.extend(o.style,{fontSize:"999px",opacity:0}),r.appendChild(o),e.appendChild(r),m.extend(o.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===g.browser&&g.verComp(g.version,10,"<")&&m.extend(o.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),o.onchange=function(){var e;if(this.value){if(this.files){if(0===(e=this.files[0]).size)return void r.parentNode.removeChild(r)}else e={name:this.value};e=new h(u.uid,e),this.onchange=function(){},t.call(s),s.files=[e],o.setAttribute("id",e.uid),r.setAttribute("id",e.uid+"_form"),s.trigger("change"),o=r=null}},u.can("summon_file_dialog")&&(i=f.get(l.browse_button),p.removeEvent(i,"click",s.uid),p.addEvent(i,"click",function(e){o&&!o.disabled&&o.click(),e.preventDefault()},s.uid)),c=a,e=n=i=null}.call(this),t=null,o.trigger({type:"ready",async:!0})},disable:function(e){var t;(t=f.get(c))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer();p.removeAllEvents(i,this.uid),p.removeAllEvents(l&&f.get(l.container),this.uid),p.removeAllEvents(l&&f.get(l.browse_button),this.uid),i&&(i.innerHTML=""),t.removeInstance(this.uid),c=d=l=i=t=null}})}}),e("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),e("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,f,p,g,x,E,v,y){return e.XMLHttpRequest=function(){var l,d,h;function m(t){var e,i,n,r,o=this,a=!1;if(h){if(e=h.id.replace(/_iframe$/,""),i=p.get(e+"_form")){for(r=(n=i.getElementsByTagName("input")).length;r--;)switch(n[r].getAttribute("type")){case"hidden":n[r].parentNode.removeChild(n[r]);break;case"file":a=!0}n=[],a||i.parentNode.removeChild(i),i=null}setTimeout(function(){E.removeEvent(h,"load",o.uid),h.parentNode&&h.parentNode.removeChild(h);var e=o.getRuntime().getShimContainer();e.children.length||e.parentNode.removeChild(e),e=h=null,t()},1)}}f.extend(this,{send:function(t,e){var i,n,r,o,a,s,u=this,c=u.getRuntime();if(l=d=null,e instanceof y&&e.hasBlob()){if(o=e.getBlob(),i=o.uid,r=p.get(i),!(n=p.get(i+"_form")))throw new x.DOMException(x.DOMException.NOT_FOUND_ERR)}else i=f.guid("uid_"),(n=document.createElement("form")).setAttribute("id",i+"_form"),n.setAttribute("method",t.method),n.setAttribute("enctype","multipart/form-data"),n.setAttribute("encoding","multipart/form-data"),c.getShimContainer().appendChild(n);n.setAttribute("target",i+"_iframe"),e instanceof y&&e.each(function(e,t){if(e instanceof v)r&&r.setAttribute("name",t);else{var i=document.createElement("input");f.extend(i,{type:"hidden",name:t,value:e}),r?n.insertBefore(i,r):n.appendChild(i)}}),n.setAttribute("action",t.url),a=c.getShimContainer()||document.body,(s=document.createElement("div")).innerHTML='',h=s.firstChild,a.appendChild(h),E.addEvent(h,"load",function(){var e;try{e=h.contentWindow.document||h.contentDocument||window.frames[h.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(e.title)?l=e.title.replace(/^(\d+).*$/,"$1"):(l=200,d=f.trim(e.body.innerHTML),u.trigger({type:"progress",loaded:d.length,total:d.length}),o&&u.trigger({type:"uploadprogress",loaded:o.size||1025,total:o.size||1025}))}catch(e){if(!g.hasSameOrigin(t.url))return void m.call(u,function(){u.trigger("error")});l=404}m.call(u,function(){u.trigger("load")})},u.uid),n.submit(),u.trigger("loadstart")},getStatus:function(){return l},getResponse:function(e){if("json"===e&&"string"===f.typeOf(d)&&window.JSON)try{return JSON.parse(d.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(e){return null}return d},abort:function(){var e=this;h&&h.contentWindow&&(h.contentWindow.stop?h.contentWindow.stop():h.contentWindow.document.execCommand?h.contentWindow.document.execCommand("Stop"):h.src="about:blank"),m.call(this,function(){e.dispatchEvent("abort")})}})}}),e("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),function(e){for(var t=0;t