var MXI_DEBUG=!1;!function(o,x){"use strict";var s={};function n(e,t){for(var i,n=[],r=0;rt[s]){a=1;break}}if(!i)return a;switch(i){case">":case"gt":return 0=":case"ge":return 0<=a;case"<=":case"le":return a<=0;case"==":case"=":case"eq":return 0===a;case"<>":case"!=":case"ne":return 0!==a;case"":case"<":case"lt":return a<0;default:return null}},global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return s.OS=s.os,MXI_DEBUG&&(s.debug={runtime:!0,events:!1},s.log=function(){var e,t,i=arguments[0];"string"===n.typeOf(i)&&(i=n.sprintf.apply(this,arguments)),window&&window.console&&window.console.log?window.console.log(i):document&&((e=document.getElementById("moxie-console"))||((e=document.createElement("pre")).id="moxie-console",document.body.appendChild(e)),-1!==n.inArray(n.typeOf(i),["object","array"])?(t=i,e.appendChild(document.createTextNode(t+"\n"))):e.appendChild(document.createTextNode(i+"\n")))}),s}),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(a,n){var e={mimes:{},extensions:{},addMimeType:function(e){for(var t,i,n=e.split(/,/),r=0;r>16&255,n=s>>8&255,s=255&s,d[l++]=64==r?String.fromCharCode(i):64==o?String.fromCharCode(i,n):String.fromCharCode(i,n,s),c>12&63,n=o>>6&63,r=63&o,c[u++]=s.charAt(o>>18&63)+s.charAt(i)+s.charAt(n)+s.charAt(r),ap.MAX_RESIZE_WIDTH||this.height>p.MAX_RESIZE_HEIGHT)throw new u.ImageError(u.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(l.can("create_canvas"))return this.connectRuntime(this.ruid).exec.call(this,"Image","getAsCanvas");throw new u.RuntimeError(u.RuntimeError.NOT_SUPPORTED_ERR)},getAsBlob:function(e,t){if(this.size)return this.exec("Image","getAsBlob",e||"image/jpeg",t||90);throw new u.DOMException(u.DOMException.INVALID_STATE_ERR)},getAsDataURL:function(e,t){if(this.size)return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90);throw new u.DOMException(u.DOMException.INVALID_STATE_ERR)},getAsBinaryString:function(e,t){e=this.getAsDataURL(e,t);return h.atob(e.substring(e.indexOf("base64,")+7))},embed:function(r,e){var o,s=this;e=a.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},e||{});try{if(!(r=n.get(r)))throw new u.DOMException(u.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new u.DOMException(u.DOMException.INVALID_STATE_ERR);this.width>p.MAX_RESIZE_WIDTH||this.height;var t=new p;return t.bind("Resize",function(){!function(e,t){var i=this;if(l.can("create_canvas")){var n=i.getAsCanvas();if(n)return r.appendChild(n),i.destroy(),void s.trigger("embedded")}if(!(n=i.getAsDataURL(e,t)))throw new u.ImageError(u.ImageError.WRONG_FORMAT);l.can("use_data_uri_of",n.length)?(r.innerHTML='',i.destroy(),s.trigger("embedded")):((t=new c).bind("TransportingComplete",function(){o=s.connectRuntime(this.result.ruid),s.bind("Embedded",function(){a.extend(o.getShimContainer().style,{top:"0px",left:"0px",width:i.width+"px",height:i.height+"px"}),o=null},999),o.exec.call(s,"ImageView","display",this.result.uid,width,height),i.destroy()}),t.transport(h.atob(n.substring(n.indexOf("base64,")+7)),e,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:r}))}.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(f),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 p.MAX_RESIZE_WIDTH=8192,p.MAX_RESIZE_HEIGHT=8192,p.prototype=i.instance,p}),e("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(s,e,a,u){var c={};return a.addConstructor("html5",function(e){var t,i=this,n=a.capTest,r=a.capTrue,o=s.extend({access_binary:n(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return i.can("access_binary")&&!!c.Image},display_media:n(u.can("create_canvas")||u.can("use_data_uri_over32kb")),do_cors:n(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:n(("draggable"in(o=document.createElement("div"))||"ondragstart"in o&&"ondrop"in o)&&("IE"!==u.browser||u.verComp(u.version,9,">"))),filter_by_extension:n("Chrome"===u.browser&&u.verComp(u.version,28,">=")||"IE"===u.browser&&u.verComp(u.version,10,">=")||"Safari"===u.browser&&u.verComp(u.version,7,">=")),return_response_headers:r,return_response_type:function(e){return!("json"!==e||!window.JSON)||u.can("return_response_type",e)},return_status_code:r,report_upload_progress:n(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return i.can("access_binary")&&u.can("create_canvas")},select_file:function(){return u.can("use_fileinput")&&window.File},select_folder:function(){return i.can("select_file")&&"Chrome"===u.browser&&u.verComp(u.version,21,">=")},select_multiple:function(){return i.can("select_file")&&!("Safari"===u.browser&&"Windows"===u.os)&&!("iOS"===u.os&&u.verComp(u.osVersion,"7.0.0",">")&&u.verComp(u.osVersion,"8.0.0","<"))},send_binary_string:n(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:n(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||i.can("send_binary_string")},slice_blob:n(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return i.can("slice_blob")&&i.can("send_multipart")},summon_file_dialog:function(){return i.can("select_file")&&("Firefox"===u.browser&&u.verComp(u.version,4,">=")||"Opera"===u.browser&&u.verComp(u.version,12,">=")||"IE"===u.browser&&u.verComp(u.version,10,">=")||!!~s.inArray(u.browser,["Chrome","Safari"]))},upload_filesize:r},arguments[2]);a.call(this,e,arguments[1]||"html5",o),s.extend(this,{init:function(){this.trigger("Init")},destroy:(t=this.destroy,function(){t.call(i),t=i=null})}),s.extend(this.getShim(),c)}),c}),e("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(o){var s={},a="moxie_"+o.guid();function u(){this.returnValue=!1}function c(){this.cancelBubble=!0}function r(t,e,i){if(e=e.toLowerCase(),t[a]&&s[t[a]]&&s[t[a]][e]){for(var n,r=(n=s[t[a]][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[a]][e],o.isEmptyObj(s[t[a]])){delete s[t[a]];try{delete t[a]}catch(e){t[a]=void 0}}}}return{addEvent:function(e,t,i,n){var r;t=t.toLowerCase(),e.addEventListener?e.addEventListener(t,r=i,!1):e.attachEvent&&e.attachEvent("on"+t,r=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=u,e.stopPropagation=c,i(e)}),e[a]||(e[a]=o.guid()),s.hasOwnProperty(e[a])||(s[e[a]]={}),(e=s[e[a]]).hasOwnProperty(t)||(e[t]=[]),e[t].push({func:r,orig:i,key:n})},removeEvent:r,removeAllEvents:function(i,n){i&&i[a]&&o.each(s[i[a]],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,a,u,c,l,d,m){return e.FileInput=function(){var s;u.extend(this,{init:function(e){var t,i,n,r=this,o=r.getRuntime(),e=(s=e).accept.mimes||d.extList2mimes(s.accept,o.can("filter_by_extension"));(t=o.getShimContainer()).innerHTML='",e=c.get(o.uid),u.extend(e.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),i=c.get(s.browse_button),o.can("summon_file_dialog")&&("static"===c.getStyle(i,"position")&&(i.style.position="relative"),n=parseInt(c.getStyle(i,"z-index"),10)||1,i.style.zIndex=n,t.style.zIndex=n-1,l.addEvent(i,"click",function(e){var t=c.get(o.uid);t&&!t.disabled&&t.click(),e.preventDefault()},r.uid)),n=o.can("summon_file_dialog")?i:t,l.addEvent(n,"mouseover",function(){r.trigger("mouseenter")},r.uid),l.addEvent(n,"mouseout",function(){r.trigger("mouseleave")},r.uid),l.addEvent(n,"mousedown",function(){r.trigger("mousedown")},r.uid),l.addEvent(c.get(s.container),"mouseup",function(){r.trigger("mouseup")},r.uid),e.onchange=function e(t){var i;r.files=[],u.each(this.files,function(e){var t="";if(s.directory&&"."==e.name)return!0;e.webkitRelativePath&&(t="/"+e.webkitRelativePath.replace(/^\//,"")),(e=new a(o.uid,e)).relativePath=t,r.files.push(e)}),"IE"!==m.browser&&"IEMobile"!==m.browser?this.value="":(i=this.cloneNode(!0),this.parentNode.replaceChild(i,this),i.onchange=e),r.files.length&&r.trigger("change")},r.trigger({type:"ready",async:!0})},disable:function(e){var t=this.getRuntime();(t=c.get(t.uid))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),e=e.getShimContainer();l.removeAllEvents(e,this.uid),l.removeAllEvents(s&&c.get(s.container),this.uid),l.removeAllEvents(s&&c.get(s.browse_button),this.uid),e&&(e.innerHTML=""),t.removeInstance(this.uid),s=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,r,c,l,d,m){return e.FileDrop=function(){var t,i,o=[],n=[];function s(e){if(e.dataTransfer&&e.dataTransfer.types)return e=c.toArray(e.dataTransfer.types||[]),-1!==c.inArray("Files",e)||-1!==c.inArray("public.file-url",e)||-1!==c.inArray("application/x-moz-file",e)}function a(e,t){!function(e){if(!n.length)return 1;e=m.getFileExtension(e.name);return!e||-1!==c.inArray(e,n)}(e)||((e=new r(i,e)).relativePath=t||"",o.push(e))}function u(e,t){var i=[];c.each(e,function(s){i.push(function(e){{var t,n,r;(o=e,(i=s).isFile)?i.file(function(e){a(e,i.fullPath),o()},function(){o()}):i.isDirectory?(t=o,n=[],r=(e=i).createReader(),function t(i){r.readEntries(function(e){e.length?([].push.apply(n,e),t(i)):i()},i)}(function(){u(n,t)})):o()}var i,o})}),c.inSeries(i,function(){t()})}c.extend(this,{init:function(e){var r=this;t=e,i=r.ruid,n=function(e){for(var t=[],i=0;i=")&&E.verComp(E.version,7,"<"),o="Android Browser"===E.browser,s=!1;if(l=e.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),(c=!window.XMLHttpRequest||"IE"===E.browser&&E.verComp(E.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){e=this.read(e,4);return 2147483647=o.length));i++);},purge:function(){this.headers=s=[]}}}}),e("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(p,o,g){function s(e){var t,l,h,f,i;if(o.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"}},h={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"}},n=(f={tiffHeader:10}).tiffHeader,t={clear:this.clear},p.extend(this,{read:function(){try{return s.prototype.read.apply(this,arguments)}catch(e){throw new g.ImageError(g.ImageError.INVALID_META_ERR)}},write:function(){try{return s.prototype.write.apply(this,arguments)}catch(e){throw new g.ImageError(g.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 i||null},EXIF:function(){var e=null;if(f.exifIFD){try{e=r.call(this,f.exifIFD,l.exif)}catch(e){return null}if(e.ExifVersion&&"array"===p.typeOf(e.ExifVersion)){for(var t=0,i="";t=this.length())throw new g.ImageError(g.ImageError.INVALID_META_ERR);"ASCII"===o?u[i]=p.trim(a.STRING(r,n).replace(/\0$/,"")):(s=a.asArray(o,r,n),o=1==n?s[0]:s,h.hasOwnProperty(i)&&"object"!=typeof o?u[i]=h[i][o]:u[i]=o)}return u}n&&(f.IFD1=f.tiffHeader+n)}return s.prototype=o.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(s,a,u,c,l){return function(e){var i,n,t,r=new c(e);if(65496!==r.SHORT(0))throw new a.ImageError(a.ImageError.WRONG_FORMAT);i=new u(e);try{n=new l(i.get("app1")[0])}catch(e){}function o(e){var t,i=0;for(e=e||r;i<=e.length();){if(65472<=(t=e.SHORT(i+=2))&&t<=65475)return i+=5,{height:e.SHORT(i),width:e.SHORT(i+=2)};t=e.SHORT(i+=2),i+=t-2}return null}t=o.call(this),s.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"===s.typeOf(e)?s.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(){n&&i&&r&&(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(a,u,c){return function(e){for(var t,r=new c(e),i=0,n=0,o=[35152,20039,3338,6666],n=0;n>1;i=null;e=a/t;return 0==e?1:e}(e,r),f=0;f=")||"IE"===a.browser&&a.verComp(a.version,10,">=")||"Safari"===a.browser&&a.verComp(a.version,7,">=")),resize_image:function(){return u.Image&&i.can("access_binary")&&a.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 a.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"===a.browser&&a.verComp(a.version,4,">=")||"Opera"===a.browser&&a.verComp(a.version,12,">=")||"IE"===a.browser&&a.verComp(a.version,10,">=")||!!~o.inArray(a.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,d,m,h,f,s,p){return e.FileInput=function(){var a,u,c=[];function l(){var e,t,i,n=this,r=n.getRuntime(),o=m.guid("uid_"),s=r.getShimContainer();a&&(e=h.get(a+"_form"))&&m.extend(e.style,{top:"100%"}),(t=document.createElement("form")).setAttribute("id",o+"_form"),t.setAttribute("method","post"),t.setAttribute("enctype","multipart/form-data"),t.setAttribute("encoding","multipart/form-data"),m.extend(t.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),(i=document.createElement("input")).setAttribute("id",o),i.setAttribute("type","file"),i.setAttribute("name",u.name||"Filedata"),i.setAttribute("accept",c.join(",")),m.extend(i.style,{fontSize:"999px",opacity:0}),t.appendChild(i),s.appendChild(t),m.extend(i.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===p.browser&&p.verComp(p.version,10,"<")&&m.extend(i.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),i.onchange=function(){var e;if(this.value){if(this.files){if(0===(e=this.files[0]).size)return void t.parentNode.removeChild(t)}else e={name:this.value};e=new d(r.uid,e),this.onchange=function(){},l.call(n),n.files=[e],i.setAttribute("id",e.uid),t.setAttribute("id",e.uid+"_form"),n.trigger("change"),i=t=null}},r.can("summon_file_dialog")&&(e=h.get(u.browse_button),f.removeEvent(e,"click",n.uid),f.addEvent(e,"click",function(e){i&&!i.disabled&&i.click(),e.preventDefault()},n.uid)),a=o}m.extend(this,{init:function(e){var t,i,n,r=this,o=r.getRuntime();c=(u=e).accept.mimes||s.extList2mimes(e.accept,o.can("filter_by_extension")),t=o.getShimContainer(),n=h.get(e.browse_button),o.can("summon_file_dialog")&&("static"===h.getStyle(n,"position")&&(n.style.position="relative"),i=parseInt(h.getStyle(n,"z-index"),10)||1,n.style.zIndex=i,t.style.zIndex=i-1),i=o.can("summon_file_dialog")?n:t,f.addEvent(i,"mouseover",function(){r.trigger("mouseenter")},r.uid),f.addEvent(i,"mouseout",function(){r.trigger("mouseleave")},r.uid),f.addEvent(i,"mousedown",function(){r.trigger("mousedown")},r.uid),f.addEvent(h.get(e.container),"mouseup",function(){r.trigger("mouseup")},r.uid),l.call(this),t=null,r.trigger({type:"ready",async:!0})},disable:function(e){var t;(t=h.get(a))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),e=e.getShimContainer();f.removeAllEvents(e,this.uid),f.removeAllEvents(u&&h.get(u.container),this.uid),f.removeAllEvents(u&&h.get(u.browse_button),this.uid),e&&(e.innerHTML=""),t.removeInstance(this.uid),a=c=u=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,m,h,f,p,g,x,E){return e.XMLHttpRequest=function(){var u,c,l;function d(t){var e,i,n,r=this,o=!1;if(l){if(e=l.id.replace(/_iframe$/,""),e=h.get(e+"_form")){for(n=(i=e.getElementsByTagName("input")).length;n--;)switch(i[n].getAttribute("type")){case"hidden":i[n].parentNode.removeChild(i[n]);break;case"file":o=!0}i=[],o||e.parentNode.removeChild(e),e=null}setTimeout(function(){g.removeEvent(l,"load",r.uid),l.parentNode&&l.parentNode.removeChild(l);var e=r.getRuntime().getShimContainer();e.children.length||e.parentNode.removeChild(e),e=l=null,t()},1)}}m.extend(this,{send:function(t,e){var i,n,r,o,s=this,a=s.getRuntime();if(u=c=null,e instanceof E&&e.hasBlob()){if(o=e.getBlob(),i=o.uid,r=h.get(i),!(n=h.get(i+"_form")))throw new p.DOMException(p.DOMException.NOT_FOUND_ERR)}else i=m.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"),a.getShimContainer().appendChild(n);n.setAttribute("target",i+"_iframe"),e instanceof E&&e.each(function(e,t){var i;e instanceof x?r&&r.setAttribute("name",t):(i=document.createElement("input"),m.extend(i,{type:"hidden",name:t,value:e}),r?n.insertBefore(i,r):n.appendChild(i))}),n.setAttribute("action",t.url),e=a.getShimContainer()||document.body,(a=document.createElement("div")).innerHTML='',l=a.firstChild,e.appendChild(l),g.addEvent(l,"load",function(){var e;try{e=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(e.title)?u=e.title.replace(/^(\d+).*$/,"$1"):(u=200,c=m.trim(e.body.innerHTML),s.trigger({type:"progress",loaded:c.length,total:c.length}),o&&s.trigger({type:"uploadprogress",loaded:o.size||1025,total:o.size||1025}))}catch(e){if(!f.hasSameOrigin(t.url))return void d.call(s,function(){s.trigger("error")});u=404}d.call(s,function(){s.trigger("load")})},s.uid),n.submit(),s.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===m.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(e){return null}return c},abort:function(){var e=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),d.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});for(var t=["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"],i=0;i