function get_dirname(e){dir=e,""!=dir&&dir.indexOf("/")!=dir.length-1&&(dir+="/"),g_dirname=dir}function random_string(e){e=e||32;var t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",n=t.length,r="";for(i=0;i>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&t.rotl(e,8)|4278255360&t.rotl(e,24);for(var n=0;n0;e--)t.push(Math.floor(256*Math.random()));return t},stringToBytes:function(e){for(var t=[],n=0;n>>5]|=e.charCodeAt(n)<<24-i%32;return t},bytesToWords:function(e){for(var t=[],n=0,i=0;n>>5]|=e[n]<<24-i%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>2)),r=(3&n[o])<<4;break;case 1:i.push(e.charAt(r|n[o]>>>4)),r=(15&n[o])<<2;break;case 2:i.push(e.charAt(r|n[o]>>>6)),i.push(e.charAt(63&n[o])),r=-1}for(void 0!=r&&-1!=r&&i.push(e.charAt(r));i.length%4!=0;)i.push("=");return i.join("")},base64ToBytes:function(n){if("function"==typeof atob)return t.stringToBytes(atob(n));n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],r=0;r>>4);break;case 2:i.push((15&e.indexOf(n.charAt(r-1)))<<4|e.indexOf(n.charAt(r))>>>2);break;case 3:i.push((3&e.indexOf(n.charAt(r-1)))<<6|e.indexOf(n.charAt(r)));break}return i}};Crypto.mode={}}(),function(){var e=Crypto.util;Crypto.HMAC=function(t,n,i,r){i=i.length>4*t._blocksize?t(i,{asBytes:!0}):e.stringToBytes(i);for(var o=i,a=i.slice(0),s=0;s<4*t._blocksize;s++)o[s]^=92,a[s]^=54;var u=t(e.bytesToString(o)+t(e.bytesToString(a)+n,{asString:!0}),{asBytes:!0});return r&&r.asBytes?u:r&&r.asString?e.bytesToString(u):e.bytesToHex(u)}}(),function(){var e=Crypto.util,t=Crypto.SHA1=function(n,i){var r=e.wordsToBytes(t._sha1(n));return i&&i.asBytes?r:i&&i.asString?e.bytesToString(r):e.bytesToHex(r)};t._sha1=function(t){var n=e.stringToWords(t),i=8*t.length,r=[],o=1732584193,a=-271733879,s=-1732584194,u=271733878,c=-1009589776;n[i>>5]|=128<<24-i%32,n[15+(i+64>>>9<<4)]=i;for(var l=0;l>>31}var _=(o<<5|o>>>27)+c+(r[m]>>>0)+(m<20?1518500249+(a&s|~a&u):m<40?1859775393+(a^s^u):m<60?(a&s|a&u|s&u)-1894007588:(a^s^u)-899497514);c=u,u=s,s=a<<30|a>>>2,a=o,o=_}o+=d,a+=f,s+=h,u+=p,c+=g}return[o,a,s,u,c]},t._blocksize=16}();var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="",n,i,r,o,a,s,u,c=0;for(e=Base64._utf8_encode(e);c>2,a=(3&n)<<4|i>>4,s=(15&i)<<2|r>>6,u=63&r,isNaN(i)?s=u=64:isNaN(r)&&(u=64),t=t+this._keyStr.charAt(o)+this._keyStr.charAt(a)+this._keyStr.charAt(s)+this._keyStr.charAt(u);return t},decode:function(e){var t="",n,i,r,o,a,s,u,c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,i=(15&a)<<4|s>>2,r=(3&s)<<6|u,t+=String.fromCharCode(n),64!=s&&(t+=String.fromCharCode(i)),64!=u&&(t+=String.fromCharCode(r));return t=Base64._utf8_decode(t)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n127&&i<2048?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128))}return t},_utf8_decode:function(e){for(var t="",n=0,i=c1=c2=0;n191&&i<224?(c2=e.charCodeAt(n+1),t+=String.fromCharCode((31&i)<<6|63&c2),n+=2):(c2=e.charCodeAt(n+1),c3=e.charCodeAt(n+2),t+=String.fromCharCode((15&i)<<12|(63&c2)<<6|63&c3),n+=3);return t}};!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r0&&n(o,function(n,o){n!==r&&(e(i[o])===e(n)&&~a(e(n),["array","object"])?t(i[o],n):i[o]=n)})}),i},n=function(e,t){var n,i,r,o;if(e){try{n=e.length}catch(e){n=o}if(n===o){for(i in e)if(e.hasOwnProperty(i)&&!1===t(e[i],i))return}else for(r=0;n>r;r++)if(!1===t(e[r],r))return}},i=function(t){var n;if(!t||"object"!==e(t))return!0;for(n in t)return!1;return!0},r=function(t,n){function i(r){"function"===e(t[r])&&t[r](function(e){++rn;n++)if(t[n]===e)return n}return-1},s=function(t,n){var i=[];"array"!==e(t)&&(t=[t]),"array"!==e(n)&&(n=[n]);for(var r in t)-1===a(t[r],n)&&i.push(t[r]);return!!i.length&&i},u=function(e,t){var i=[];return n(e,function(e){-1!==a(e,t)&&i.push(e)}),i.length?i:null},c=function(e){var t,n=[];for(t=0;ti;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}(),d=function(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e},f=function(e){if("string"!=typeof e)return e;var t={t:1099511627776,g:1073741824,m:1048576,k:1024},n;return e=/^([0-9]+)([mgk]?)$/.exec(e.toLowerCase().replace(/[^0-9mkg]/g,"")),n=e[2],e=+e[1],t.hasOwnProperty(n)&&(e*=t[n]),e};return{guid:l,typeOf:e,extend:t,each:n,isEmptyObj:i,inSeries:r,inParallel:o,inArray:a,arrayDiff:s,arrayIntersect:u,toArray:c,trim:d,parseSizeStr:f}}),i(c,[u],function(e){var t={};return{addI18n:function(n){return e.extend(t,n)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var n=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=n.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),i(l,[u,c],function(e,t){var n={mimes:{},extensions:{},addMimeType:function(e){var t=e.split(/,/),n,i,r;for(n=0;ni;i++)if(e[i]!=t[i]){if(e[i]=u(e[i]),t[i]=u(t[i]),e[i]t[i]){o=1;break}}if(!n)return o;switch(n){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="?",n="function",i="undefined",r="object",o="major",a="model",s="name",u="type",c="vendor",l="version",d="architecture",f="console",h="mobile",p="tablet",g={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},m={rgx:function(){for(var t,o=0,a,s,u,c,l,d,f=arguments;o0?2==c.length?t[c[0]]=typeof c[1]==n?c[1].call(this,d):c[1]:3==c.length?t[c[0]]=typeof c[1]!==n||c[1].exec&&c[1].test?d?d.replace(c[1],c[2]):e:d?c[1].call(this,d,c[2]):e:4==c.length&&(t[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):e):t[c]=d||e;break}if(l)break}return t},str:function(n,i){for(var o in i)if(typeof i[o]===r&&i[o].length>0){for(var a=0;a=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(n){var i=[].slice.call(arguments);return i.shift(),"function"===e.typeOf(t[n])?t[n].apply(this,i):!!t[n]}}(),r={can:i,browser:n.browser.name,version:parseFloat(n.browser.major),os:n.os.name,osVersion:n.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return r.OS=r.os,r}),i(f,[d],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},n=function(e,t){return!!e.className&&new RegExp("(^|\\s+)"+t+"(\\s+|$)").test(e.className)},i=function(e,t){n(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(n,function(e,t,n){return" "===t&&" "===n?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,n){function i(e){var t,n,i=0,r=0;return e&&(n=e.getBoundingClientRect(),t="CSS1Compat"===s.compatMode?s.documentElement:s.body,i=n.left+t.scrollLeft,r=n.top+t.scrollTop),{x:i,y:r}}var r=0,o=0,a,s=document,u,c;if(t=t,n=n||s.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!s.documentMode||s.documentMode<8))return u=i(t),c=i(n),{x:u.x-c.x,y:u.y-c.y};for(a=t;a&&a!=n&&a.nodeType;)r+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=t.parentNode;a&&a!=n&&a.nodeType;)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;return{x:r,y:o}};return{get:t,hasClass:n,addClass:i,removeClass:r,getStyle:o,getPos:a,getSize:function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}}}}),i(h,[u],function(e){function t(e,t){var n;for(n in e)if(e[n]===t)return n;return null}return{RuntimeError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": RuntimeError "+this.code}var i={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(n,i),n.prototype=Error.prototype,n}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": ImageError "+this.code}var i={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2};return e.extend(n,i),n.prototype=Error.prototype,n}(),FileException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": FileException "+this.code}var i={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 e.extend(n,i),n.prototype=Error.prototype,n}(),DOMException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": DOMException "+this.code}var i={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 e.extend(n,i),n.prototype=Error.prototype,n}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),i(p,[h,u],function(e,t){function n(){var n={};t.extend(this,{uid:null,init:function(){this.uid||(this.uid=t.guid("uid_"))},addEventListener:function(e,i,r,o){var a=this,s;return e=t.trim(e),/\s/.test(e)?void t.each(e.split(/\s+/),function(e){a.addEventListener(e,i,r,o)}):(e=e.toLowerCase(),r=parseInt(r,10)||0,s=n[this.uid]&&n[this.uid][e]||[],s.push({fn:i,priority:r,scope:o||this}),n[this.uid]||(n[this.uid]={}),void(n[this.uid][e]=s))},hasEventListener:function(e){return e?!(!n[this.uid]||!n[this.uid][e]):!!n[this.uid]},removeEventListener:function(e,i){e=e.toLowerCase();var r=n[this.uid]&&n[this.uid][e],o;if(r){if(i){for(o=r.length-1;o>=0;o--)if(r[o].fn===i){r.splice(o,1);break}}else r=[];r.length||(delete n[this.uid][e],t.isEmptyObj(n[this.uid])&&delete n[this.uid])}},removeAllEventListeners:function(){n[this.uid]&&delete n[this.uid]},dispatchEvent:function(i){var r,o,a,s,u={},c=!0,l;if("string"!==t.typeOf(i)){if(s=i,"string"!==t.typeOf(s.type))throw new e.EventException(e.EventException.UNSPECIFIED_EVENT_TYPE_ERR);i=s.type,s.total!==l&&s.loaded!==l&&(u.total=s.total,u.loaded=s.loaded),u.async=s.async||!1}if(-1!==i.indexOf("::")?function(e){r=e[0],i=e[1]}(i.split("::")):r=this.uid,i=i.toLowerCase(),o=n[r]&&n[r][i]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),u.type=i,a.unshift(u);var d=[];t.each(o,function(e){a[0].target=e.scope,d.push(u.async?function(t){setTimeout(function(){t(!1===e.fn.apply(e.scope,a))},1)}:function(t){t(!1===e.fn.apply(e.scope,a))})}),d.length&&t.inSeries(d,function(e){c=!e})}return c},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(e){var n;"array"!==t.typeOf(e)&&(e=[e]);for(var i=0;i>16&255,o=d>>8&255,a=255&d,g[h++]=64==c?String.fromCharCode(r):64==l?String.fromCharCode(r,o):String.fromCharCode(r,o,a)}while(f>18&63,u=d>>12&63,c=d>>6&63,l=63&d,g[h++]=i.charAt(s)+i.charAt(u)+i.charAt(c)+i.charAt(l)}while(fa;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return i.call(this,"readAsDataURL",e)},readAsText:function(e){return i.call(this,"readAsText",e)}})}}),i(T,[h,u,_],function(e,t,n){function i(){var e,i=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof n?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):i.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(n){t.each(i,function(e){n(e.value,e.name)}),e&&n(e.value,e.name)},destroy:function(){e=null,i=[]}})}return i}),i(A,[u,h,p,g,R,m,b,_,S,T,d,l],function(e,t,n,i,r,o,a,s,u,c,l,d){function f(){this.uid=e.guid("uid_")}function h(){function n(e,t){return _.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?_[e]:v[e]:void(l.can("define_property")?_[e]=t:v[e]=t):void 0}function u(t){function i(){H&&(H.destroy(),H=null),s.dispatchEvent("loadend"),s=null}function r(r){H.bind("LoadStart",function(e){n("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),I&&s.upload.dispatchEvent(e)}),H.bind("Progress",function(e){n("readyState")!==h.LOADING&&(n("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),H.bind("UploadProgress",function(e){I&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),H.bind("Load",function(t){n("readyState",h.DONE),n("status",Number(r.exec.call(H,"XMLHttpRequest","getStatus")||0)),n("statusText",p[n("status")]||""),n("response",r.exec.call(H,"XMLHttpRequest","getResponse",n("responseType"))),~e.inArray(n("responseType"),["text",""])?n("responseText",n("response")):"document"===n("responseType")&&n("responseXML",n("response")),k=r.exec.call(H,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),n("status")>0?(I&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(C=!0,s.dispatchEvent("error")),i()}),H.bind("Abort",function(e){s.dispatchEvent(e),i()}),H.bind("Error",function(e){C=!0,n("readyState",h.DONE),s.dispatchEvent("readystatechange"),D=!0,s.dispatchEvent(e),i()}),r.exec.call(H,"XMLHttpRequest","send",{url:w,method:E,async:y,user:x,password:R,headers:b,mimeType:T,encoding:S,responseType:s.responseType,withCredentials:s.withCredentials,options:z},t)}var s=this;M=(new Date).getTime(),H=new a,"string"==typeof z.required_caps&&(z.required_caps=o.parseCaps(z.required_caps)),z.required_caps=e.extend({},z.required_caps,{return_response_type:s.responseType}),t instanceof c&&(z.required_caps.send_multipart=!0),N||(z.required_caps.do_cors=!0),z.ruid?r(H.connectRuntime(z)):(H.bind("RuntimeInit",function(e,t){r(t)}),H.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),H.connectRuntime(z))}function m(){n("responseText",""),n("responseXML",null),n("response",null),n("status",0),n("statusText",""),M=L=null}var v=this,_={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},y=!0,w,E,b={},x,R,S=null,T=null,A=!1,O=!1,I=!1,D=!1,C=!1,N=!1,M,L,F=null,P=null,z={},H,k="",U;e.extend(this,_,{uid:e.guid("uid_"),upload:new f,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||i.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(E=o.toUpperCase()),~e.inArray(E,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=i.utf8_encode(a),l=r.parseUrl(a),N=r.hasSameOrigin(l),w=r.resolveUrl(a),(u||c)&&!N)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(x=u||l.user,R=c||l.pass,!1===(y=s||!0)&&(n("timeout")||n("withCredentials")||""!==n("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);A=!y,O=!1,b={},m.call(this),n("readyState",h.OPENED),this.convertEventPropsToHandlers(["readystatechange"]),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["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(n("readyState")!==h.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||i.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),!~e.inArray(r,a)&&!/^(proxy\-|sec\-)/.test(r)&&(b[r]?b[r]+=", "+o:b[r]=o,!0)},getAllResponseHeaders:function(){return k||""},getResponseHeader:function(t){return t=t.toLowerCase(),C||~e.inArray(t,["set-cookie","set-cookie2"])?null:k&&""!==k&&(U||(U={},e.each(k.split(/\r\n/),function(t){var n=t.split(/:\s+/);2===n.length&&(n[0]=e.trim(n[0]),U[n[0].toLowerCase()]={header:n[0],value:e.trim(n[1])})})),U.hasOwnProperty(t))?U[t].header+": "+U[t].value:null},overrideMimeType:function(i){var r,o;if(~e.inArray(n("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i=e.trim(i.toLowerCase()),/;/.test(i)&&(r=i.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(i=r[1],r[2]&&(o=r[2])),!d.mimes[i])throw new t.DOMException(t.DOMException.SYNTAX_ERR);F=i,P=o},send:function(n,r){if(z="string"===e.typeOf(r)?{ruid:r}:r||{},this.convertEventPropsToHandlers(g),this.upload.convertEventPropsToHandlers(g),this.readyState!==h.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n instanceof s)z.ruid=n.ruid,T=n.type||"application/octet-stream";else if(n instanceof c){if(n.hasBlob()){var o=n.getBlob();z.ruid=o.ruid,T=o.type||"application/octet-stream"}}else"string"==typeof n&&(S="UTF-8",T="text/plain;charset=UTF-8",n=i.utf8_encode(n));this.withCredentials||(this.withCredentials=z.required_caps&&z.required_caps.send_browser_cookies&&!N),I=!A&&this.upload.hasEventListener(),C=!1,D=!n,A||(O=!0),u.call(this,n)},abort:function(){if(C=!0,A=!1,~e.inArray(n("readyState"),[h.UNSENT,h.OPENED,h.DONE]))n("readyState",h.UNSENT);else{if(n("readyState",h.DONE),O=!1,!H)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);H.getRuntime().exec.call(H,"XMLHttpRequest","abort",D),D=!0}},destroy:function(){H&&("function"===e.typeOf(H.destroy)&&H.destroy(),H=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}})}var p={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"};f.prototype=n.instance;var g=["loadstart","progress","abort","error","load","timeout","loadend"],m=1,v=2;return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=n.instance,h}),i(O,[u,g,v,p],function(e,t,n,i){function r(){function i(){l=d=0,c=this.result=null}function o(t,n){var i=this;u=n,i.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(i.state,[r.IDLE,r.DONE])&&a.call(i)},999),i.bind("TransportingComplete",function(){d=l,i.state=r.DONE,c=null,i.result=u.exec.call(i,"Transporter","getAsBlob",t||"")},999),i.state=r.BUSY,i.trigger("TransportingStarted"),a.call(i)}function a(){var e=this,n,i=l-d;f>i&&(f=i),n=t.btoa(c.substr(d,f)),u.exec.call(e,"Transporter","receive",n,l)}var s,u,c,l,d,f;n.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,n,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),f=r.chunk_size,i.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,n,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,n,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),i.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),i.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=i.instance,r}),i(I,[u,f,h,S,A,m,v,O,d,p,_,y,g],function(e,t,n,i,r,o,a,s,u,c,l,d,f){function h(){function i(e){e||(e=this.getRuntime().exec.call(this,"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)}function c(t){var i=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);g.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new n.ImageError(n.ImageError.WRONG_FORMAT);m.apply(this,arguments)}else if(-1!==e.inArray(i,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===i)/^data:[^;]*;base64,/.test(t)?c.call(this,new l(null,{data:t}),arguments[1]):v.apply(this,arguments);else{if("node"!==i||"img"!==t.nodeName.toLowerCase())throw new n.DOMException(n.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(e){this.trigger("error",e.code)}}function g(t,n){var i=this.connectRuntime(t.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(n)||n)}function m(t,n){function i(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){i(t)}),n&&"string"==typeof n.required_caps&&(n.required_caps=o.parseCaps(n.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},n))):i(this.connectRuntime(t.ruid))}function v(e,t){var n=this,i;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){m.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.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(){i.call(this)},999),this.convertEventPropsToHandlers(p),c.apply(this,arguments)},downsize:function(t){var i={width:this.width,height:this.height,crop:!1,preserveHeaders:!0};t="object"==typeof t?e.extend(i,t):e.extend(i,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]});try{if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);this.getRuntime().exec.call(this,"Image","downsize",t.width,t.height,t.crop,t.preserveHeaders)}catch(e){this.trigger("error",e.code)}},crop:function(e,t,n){this.downsize(e,t,!0,n)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);return this.connectRuntime(this.ruid).exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return e||(e="image/jpeg"),"image/jpeg"!==e||t||(t=90),this.getRuntime().exec.call(this,"Image","getAsBlob",e,t)},getAsDataURL:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return this.getRuntime().exec.call(this,"Image","getAsDataURL",e,t)},getAsBinaryString:function(e,t){var n=this.getAsDataURL(e,t);return f.atob(n.substring(n.indexOf("base64,")+7))},embed:function(i){function r(){if(u.can("create_canvas")){var t=a.getAsCanvas();if(t)return i.appendChild(t),t=null,a.destroy(),void o.trigger("embedded")}var r=a.getAsDataURL(c,l);if(!r)throw new n.ImageError(n.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",r.length))i.innerHTML='',a.destroy(),o.trigger("embedded");else{var d=new s;d.bind("TransportingComplete",function(){v=o.connectRuntime(this.result.ruid),o.bind("Embedded",function(){e.extend(v.getShimContainer().style,{top:"0px",left:"0px",width:a.width+"px",height:a.height+"px"}),v=null},999),v.exec.call(o,"ImageView","display",this.result.uid,g,m),a.destroy()}),d.transport(f.atob(r.substring(r.indexOf("base64,")+7)),c,e.extend({},p,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:i}))}}var o=this,a,c,l,d,p=arguments[1]||{},g=this.width,m=this.height,v;try{if(!(i=t.get(i)))throw new n.DOMException(n.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);if(c=p.type||this.type||"image/jpeg",l=p.quality||90,d="undefined"!==e.typeOf(p.crop)&&p.crop,p.width)g=p.width,m=p.height||g;else{var _=t.getSize(i);_.w&&_.h&&(g=_.w,m=_.h)}return a=new h,a.bind("Resize",function(){r.call(o)}),a.bind("Load",function(){a.downsize(g,m,d,!1)}),a.clone(this,!1),a}catch(e){this.trigger("error",e.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}})}var p=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=6500,h.MAX_RESIZE_HEIGHT=6500,h.prototype=c.instance,h}),i(D,[u,h,m,d],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue,c=e.extend({access_binary:s(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return r.can("access_binary")&&!!a.Image},display_media:s(i.can("create_canvas")||i.can("use_data_uri_over32kb")),do_cors:s(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:s(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==i.browser||i.version>9)}()),filter_by_extension:s(function(){return"Chrome"===i.browser&&i.version>=28||"IE"===i.browser&&i.version>=10}()),return_response_headers:u,return_response_type:function(e){return!("json"!==e||!window.JSON)||i.can("return_response_type",e)},return_status_code:u,report_upload_progress:s(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return r.can("access_binary")&&i.can("create_canvas")},select_file:function(){return i.can("use_fileinput")&&window.File},select_folder:function(){return r.can("select_file")&&"Chrome"===i.browser&&i.version>=21},select_multiple:function(){return!(!r.can("select_file")||"Safari"===i.browser&&"Windows"===i.os||"iOS"===i.os&&i.verComp(i.osVersion,"7.0.4","<"))},send_binary_string:s(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:s(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||r.can("send_binary_string")},slice_blob:s(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return r.can("slice_blob")&&r.can("send_multipart")},summon_file_dialog:s(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||"IE"===i.browser&&i.version>=10||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:u},arguments[2]);n.call(this,t,arguments[1]||o,c),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html5",a={};return n.addConstructor(o,r),a}),i("moxie/runtime/html5/file/Blob",[D,_],function(e,t){function n(){function e(e,t,n){var i;if(!window.File.prototype.slice)return(i=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?i.call(e,t,n):null;try{return e.slice(),e.slice(t,n)}catch(i){return e.slice(t,n-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=n}),i(C,[u],function(e){function t(){this.returnValue=!1}function n(){this.cancelBubble=!0}var i={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=n,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),i.hasOwnProperty(o[r])||(i[o[r]]={}),l=i[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,n,o){var a,s;if(n=n.toLowerCase(),t[r]&&i[t[r]]&&i[t[r]][n]){a=i[t[r]][n];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(n,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+n,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete i[t[r]][n],e.isEmptyObj(i[t[r]])){delete i[t[r]];try{delete t[r]}catch(e){t[r]=s}}}};return{addEvent:o,removeEvent:a,removeAllEvents:function(t,n){t&&t[r]&&e.each(i[t[r]],function(e,i){a(t,i,n)})}}}),i("moxie/runtime/html5/file/FileInput",[D,u,f,C,l,d],function(e,t,n,i,r,o){function a(){var e=[],a;t.extend(this,{init:function(s){var u=this,c=u.getRuntime(),l,d,f,h,p,g;a=s,e=[],f=a.accept.mimes||r.extList2mimes(a.accept,c.can("filter_by_extension")),d=c.getShimContainer(),d.innerHTML='",l=n.get(c.uid),t.extend(l.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=n.get(a.browse_button),c.can("summon_file_dialog")&&("static"===n.getStyle(h,"position")&&(h.style.position="relative"),p=parseInt(n.getStyle(h,"z-index"),10)||1,h.style.zIndex=p,d.style.zIndex=p-1,i.addEvent(h,"click",function(e){var t=n.get(c.uid);t&&!t.disabled&&t.click(),e.preventDefault()},u.uid)),g=c.can("summon_file_dialog")?h:d,i.addEvent(g,"mouseover",function(){u.trigger("mouseenter")},u.uid),i.addEvent(g,"mouseout",function(){u.trigger("mouseleave")},u.uid),i.addEvent(g,"mousedown",function(){u.trigger("mousedown")},u.uid),i.addEvent(n.get(a.container),"mouseup",function(){u.trigger("mouseup")},u.uid),l.onchange=function n(){if(e=[],a.directory?t.each(this.files,function(t){"."!==t.name&&e.push(t)}):e=[].slice.call(this.files),"IE"!==o.browser&&"IEMobile"!==o.browser)this.value="";else{var i=this.cloneNode(!0);this.parentNode.replaceChild(i,this),i.onchange=n}u.trigger("change")},u.trigger({type:"ready",async:!0}),d=null},getFiles:function(){return e},disable:function(e){var t=this.getRuntime(),i;(i=n.get(t.uid))&&(i.disabled=!!e)},destroy:function(){var t=this.getRuntime(),r=t.getShim(),o=t.getShimContainer();i.removeAllEvents(o,this.uid),i.removeAllEvents(a&&n.get(a.container),this.uid),i.removeAllEvents(a&&n.get(a.browse_button),this.uid),o&&(o.innerHTML=""),r.removeInstance(this.uid),e=a=o=r=null}})}return e.FileInput=a}),i("moxie/runtime/html5/file/FileDrop",[D,u,f,C,l],function(e,t,n,i,r){function o(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var n=t.toArray(e.dataTransfer.types||[]);return-1!==t.inArray("Files",n)||-1!==t.inArray("public.file-url",n)||-1!==t.inArray("application/x-moz-file",n)}function o(e){for(var n=[],i=0;i=4&&u.version<7,f="Android Browser"===u.browser,g=!1;if(p=n.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),h=c(),h.open(n.method,n.url,n.async,n.user,n.password),r instanceof o)r.isDetached()&&(g=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),g=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return void e.call(s,n,r);if(r instanceof a){var m=new window.FormData;r.each(function(e,t){e instanceof o?m.append(t,e.getSource()):m.append(t,e)}),r=m}}h.upload?(n.withCredentials&&(h.withCredentials=!0), h.addEventListener("load",function(e){s.trigger(e)}),h.addEventListener("error",function(e){s.trigger(e)}),h.addEventListener("progress",function(e){s.trigger(e)}),h.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):h.onreadystatechange=function e(){switch(h.readyState){case 1:break;case 2:break;case 3:var t,r;try{i.hasSameOrigin(n.url)&&(t=h.getResponseHeader("Content-Length")||0),h.responseText&&(r=h.responseText.length)}catch(e){t=r=0}s.trigger({type:"progress",lengthComputable:!!t,total:parseInt(t,10),loaded:r});break;case 4:h.onreadystatechange=function(){},s.trigger(0===h.status?"error":"load")}},t.isEmptyObj(n.headers)||t.each(n.headers,function(e,t){h.setRequestHeader(t,e)}),""!==n.responseType&&"responseType"in h&&(h.responseType="json"!==n.responseType||u.can("return_response_type","json")?n.responseType:"text"),g?h.sendAsBinary?h.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;ta;a++)i|=o.charCodeAt(e+a)<s;s++)o+=String.fromCharCode(t>>Math.abs(a+8*s)&255);n(o,e,i)}var r=!1,o;return{II:function(e){return e===t?r:void(r=e)},init:function(e){r=!1,o=e},SEGMENT:function(e,t,i){switch(arguments.length){case 1:return o.substr(e,o.length-e-1);case 2:return o.substr(e,t);case 3:n(i,e,t);break;default:return o}},BYTE:function(t){return e(t,1)},SHORT:function(t){return e(t,2)},LONG:function(n,r){return r===t?e(n,4):void i(n,r,4)},SLONG:function(t){var n=e(t,4);return n>2147483647?n-4294967296:n},STRING:function(t,n){var i="";for(n+=t;n>t;t++)i+=String.fromCharCode(e(t,1));return i}}}}),i(L,[M],function(e){return function t(n){var i=[],r,o,a,s=0;if(r=new e,r.init(n),65496===r.SHORT(0)){for(o=2;o<=n.length;)if((a=r.SHORT(o))>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;s=r.SHORT(o+2)+2,a>=65505&&65519>=a&&i.push({hex:a,name:"APP"+(15&a),start:o,length:s,segment:r.SEGMENT(o,s)}),o+=s}return r.init(null),{headers:i,restore:function(e){var t,n;for(r.init(e),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,t=i.length;t>n;n++)r.SEGMENT(o,0,i[n].segment),o+=i[n].length;return e=r.SEGMENT(),r.init(null),e},strip:function(e){var n,i,o;for(i=new t(e),n=i.headers,i.purge(),r.init(e),o=n.length;o--;)r.SEGMENT(n[o].start,n[o].length,"");return e=r.SEGMENT(),r.init(null),e},get:function(e){for(var t=[],n=0,r=i.length;r>n;n++)i[n].name===e.toUpperCase()&&t.push(i[n].segment);return t},set:function(e,t){var n=[],r,o,a;for("string"==typeof t?n.push(t):n=t,r=o=0,a=i.length;a>r&&(i[r].name===e.toUpperCase()&&(i[r].segment=n[o],i[r].length=n[o].length,o++),!(o>=n.length));r++);},purge:function(){i=[],r.init(null),r=null}}}}}),i(F,[u,M],function(e,n){return function i(){function i(e,n){var i=a.SHORT(e),r,o,s,u,d,f,h,p,g=[],m={};for(r=0;i>r;r++)if(h=f=e+12*r+2,(s=n[a.SHORT(h)])!==t){switch(u=a.SHORT(h+=2),d=a.LONG(h+=2),h+=4,g=[],u){case 1:case 7:for(d>4&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)g[o]=a.BYTE(h+o);break;case 2:d>4&&(h=a.LONG(h)+c.tiffHeader),m[s]=a.STRING(h,d-1);continue;case 3:for(d>2&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)g[o]=a.SHORT(h+2*o);break;case 4:for(d>1&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)g[o]=a.LONG(h+4*o);break;case 5:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)g[o]=a.LONG(h+4*o)/a.LONG(h+4*o+4);break;case 9:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)g[o]=a.SLONG(h+4*o);break;case 10:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)g[o]=a.SLONG(h+4*o)/a.SLONG(h+4*o+4);break;default:continue}p=1==d?g[0]:g,m[s]=l.hasOwnProperty(s)&&"object"!=typeof p?l[s][p]:p}return m}function r(){var e=c.tiffHeader;return a.II(18761==a.SHORT(e)),42===a.SHORT(e+=2)&&(c.IFD0=c.tiffHeader+a.LONG(e+=2),u=i(c.IFD0,s.tiff),"ExifIFDPointer"in u&&(c.exifIFD=c.tiffHeader+u.ExifIFDPointer,delete u.ExifIFDPointer),"GPSInfoIFDPointer"in u&&(c.gpsIFD=c.tiffHeader+u.GPSInfoIFDPointer,delete u.GPSInfoIFDPointer),!0)}function o(e,t,n){var i,r,o,u=0;if("string"==typeof t){var l=s[e.toLowerCase()];for(var d in l)if(l[d]===t){t=d;break}}i=c[e.toLowerCase()+"IFD"],r=a.SHORT(i);for(var f=0;r>f;f++)if(o=i+12*f+2,a.SHORT(o)==t){u=o+8;break}return!!u&&(a.LONG(u,n),!0)}var a,s,u,c={},l;return a=new n,s={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"}},l={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"}},{init:function(e){return c={tiffHeader:10},!(e===t||!e.length)&&(a.init(e),65505===a.SHORT(0)&&"EXIF\0"===a.STRING(4,5).toUpperCase()&&r())},TIFF:function(){return u},EXIF:function(){var t;if(t=i(c.exifIFD,s.exif),t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n=65472&&65475>=t)return e+=5,{height:c.SHORT(e),width:c.SHORT(e+=2)};n=c.SHORT(e+=2),e+=n-2}return null}function s(){d&&l&&c&&(d.purge(),l.purge(),c.init(null),u=f=l=d=c=null)}var u,c,l,d,f,h;if(u=o,c=new i,c.init(u),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new n(o),d=new r,h=!!d.init(l.get("app1")[0]),f=a.call(this),e.extend(this,{type:"image/jpeg",size:u.length,width:f&&f.width||0,height:f&&f.height||0,setExif:function(t,n){return!!h&&("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,n),void l.set("app1",d.getBinary()))},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):u=l.restore(u)},stripHeaders:function(e){return l.strip(e)},purge:function(){s.call(this)}}),h&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS()})}return o}),i(z,[h,u,M],function(e,t,n){function i(i){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:u.LONG(t),height:u.LONG(t+=4)}):null}function o(){u&&(u.init(null),s=d=c=l=u=null)}function a(e){var t,n,i,r;return t=u.LONG(e),n=u.STRING(e+=4,4),i=e+=4,r=u.LONG(e+t),{length:t,type:n,start:i,CRC:r}}var s,u,c,l,d;s=i,u=new n,u.init(s),function(){var t=0,n=0,i=[35152,20039,3338,6666];for(n=0;nm;){for(var v=m+f>a?a-m:f,_=0;o>_;){var y=_+f>o?o-_:f;p.clearRect(0,0,f,f),p.drawImage(e,-_,-m);var w=_*s/o+c<<0,E=Math.ceil(y*s/o),b=m*u/a/g+l<<0,x=Math.ceil(v*u/a/g);d.drawImage(h,0,0,y,v,w,b,E,x),_+=f}m+=f}h=p=null}function t(e){var t=e.naturalWidth;if(t*e.naturalHeight>1048576){var n=document.createElement("canvas");n.width=n.height=1;var i=n.getContext("2d");return i.drawImage(e,1-t,0),0===i.getImageData(0,0,1,1).data[3]}return!1}function n(e,t,n){var i=document.createElement("canvas");i.width=1,i.height=n;var r=i.getContext("2d");r.drawImage(e,0,0);for(var o=r.getImageData(0,0,1,n).data,a=0,s=n,u=n;u>a;)0===o[4*(u-1)+3]?s=u:a=u,u=s+a>>1;i=null;var c=u/n;return 0===c?1:c}return{isSubsampled:t,renderTo:e}}),i(U,[D,u,h,g,y,H,k,l,d],function(e,t,n,i,r,o,a,s,u){function c(){function e(){if(!w&&!_)throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);return w||_}function c(e){return i.atob(e.substring(e.indexOf("base64,")+7))}function l(e,t){return"data:"+(t||"")+";base64,"+i.btoa(e)}function d(e){var t=this;_=new Image,_.onerror=function(){m.call(this),t.trigger("error",n.ImageError.WRONG_FORMAT)},_.onload=function(){t.trigger("load")},_.src=/^data:[^;]*;base64,/.test(e)?e:l(e,b.type)}function f(e,t){var i=this,r;return window.FileReader?(r=new FileReader,r.onload=function(){t(this.result)},r.onerror=function(){i.trigger("error",n.ImageError.WRONG_FORMAT)},void r.readAsDataURL(e)):t(e.getAsDataURL())}function h(n,i,r,o){var a=this,s,u,c=0,l=0,d,f,h,m;if(R=o,m=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,-1!==t.inArray(m,[5,6,7,8])){var v=n;n=i,i=v}return d=e(),r?(n=Math.min(n,d.width),i=Math.min(i,d.height),s=Math.max(n/d.width,i/d.height)):s=Math.min(n/d.width,i/d.height),s>1&&!r&&o?void this.trigger("Resize"):(w||(w=document.createElement("canvas")),f=Math.round(d.width*s),h=Math.round(d.height*s),r?(w.width=n,w.height=i,f>n&&(c=Math.round((f-n)/2)),h>i&&(l=Math.round((h-i)/2))):(w.width=f,w.height=h),R||g(w.width,w.height,m),p.call(this,d,w,-c,-l,f,h),this.width=w.width,this.height=w.height,x=!0,void a.trigger("Resize"))}function p(e,t,n,i,r,o){"iOS"===u.OS?a.renderTo(e,t,{width:r,height:o,x:n,y:i}):t.getContext("2d").drawImage(e,n,i,r,o)}function g(e,t,n){switch(n){case 5:case 6:case 7:case 8:w.width=t,w.height=e;break;default:w.width=e,w.height=t}var i=w.getContext("2d");switch(n){case 2:i.translate(e,0),i.scale(-1,1);break;case 3:i.translate(e,t),i.rotate(Math.PI);break;case 4:i.translate(0,t),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-t);break;case 7:i.rotate(.5*Math.PI),i.translate(e,-t),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-e,0)}}function m(){y&&(y.purge(),y=null),E=_=w=b=null,x=!1}var v=this,_,y,w,E,b,x=!1,R=!0;t.extend(this,{loadFromBlob:function(e){var t=this,i=t.getRuntime(),r=!(arguments.length>1)||arguments[1];if(!i.can("access_binary"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);return b=e,e.isDetached()?(E=e.getSource(),void d.call(this,E)):void f.call(this,e.getSource(),function(e){r&&(E=c(e)),d.call(t,e)})},loadFromImage:function(e,t){this.meta=e.meta,b=new r(null,{name:e.name,size:e.size,type:e.type}),d.call(this,t?E=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t=this.getRuntime(),n;return!y&&E&&t.can("access_image_binary")&&(y=new o(E)),n={width:e().width||0,height:e().height||0,type:b.type||s.getFileMime(b.name),size:E&&E.length||b.size||0,name:b.name||"",meta:y&&y.meta||this.meta||{}}},downsize:function(){h.apply(this,arguments)},getAsCanvas:function(){return w&&(w.id=this.uid+"_canvas"),w},getAsBlob:function(e,t){return e!==this.type&&h.call(this,this.width,this.height,!1),new r(null,{name:b.name||"",type:e,data:v.getAsBinaryString.call(this,e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!x)return _.src;if("image/jpeg"!==e)return w.toDataURL("image/png");try{return w.toDataURL("image/jpeg",t/100)}catch(e){return w.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!x)return E||(E=c(v.getAsDataURL(e,t))),E;if("image/jpeg"!==e)E=c(v.getAsDataURL(e,t));else{var n;t||(t=90);try{n=w.toDataURL("image/jpeg",t/100)}catch(e){n=w.toDataURL("image/jpeg")}E=c(n),y&&(E=y.stripHeaders(E),R&&(y.meta&&y.meta.exif&&y.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),E=y.writeHeaders(E)),y.purge(),y=null)}return x=!1,E},destroy:function(){v=null,m.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),i(B,[u,d,f,h,m],function(e,t,n,i,r){function o(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(t){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function a(a){var c=this,l;a=e.extend({swf_url:t.swf_url},a),r.call(this,a,s,{access_binary:function(e){return e&&"browser"===c.mode},access_image_binary:function(e){return e&&"browser"===c.mode},display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===c.mode},resize_image:r.capTrue,return_response_headers:!1,return_response_type:function(t){return!("json"!==t||!window.JSON)||!e.arrayDiff(t,["","text","document"])||"browser"===c.mode},return_status_code:function(t){return"browser"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:function(e){return e&&"browser"===c.mode},send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"browser"===c.mode},send_multipart:r.capTrue,slice_blob:function(e){return e&&"browser"===c.mode},stream_upload:function(e){return e&&"browser"===c.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===c.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),o()<10&&(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid)},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var n,r,o;o=this.getShimContainer(),e.extend(o.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),n='',"IE"===t.browser?(r=document.createElement("div"),o.appendChild(r),r.outerHTML=n,r=o=null):o.innerHTML=n,l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="flash",u={};return r.addConstructor(s,a),u}),i(q,[B,_],function(e,t){var n={slice:function(e,n,i,r){var o=this.getRuntime();return 0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),e=o.shimExec.call(this,"Blob","slice",n,i,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=n}),i("moxie/runtime/flash/file/FileInput",[B],function(e){var t={init:function(e){this.getRuntime().shimExec.call(this,"FileInput","init",{name:e.name,accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=t}),i(G,[B,g],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i="",r={read:function(e,t){var r=this,o=r.getRuntime();return"readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"),r.bind("Progress",function(t,r){r&&(i+=n(r,e))}),o.shimExec.call(this,"FileReader","readAsBase64",t.uid)},getResult:function(){return i},destroy:function(){i=null}};return e.FileReader=r}),i($,[B,g],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i={read:function(e,t){var i;return(i=this.getRuntime().shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"+i),n(i,e,t.type)):null}};return e.FileReaderSync=i}),i(j,[B,u,_,y,S,T,O],function(e,t,n,i,r,o,a){var s={send:function(e,i){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,i)}function s(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),i=null,r()}function u(e,t){var n=new a;n.bind("TransportingComplete",function(){t(this.result)}),n.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),i instanceof o){var d;if(i.each(function(e,t){e instanceof n?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),i.hasBlob()){var f=i.getBlob();f.isDetached()?u(f,function(e){f.destroy(),s(d,e)}):s(d,f)}else i=null,r()}else i instanceof n?i.isDetached()?u(i,function(e){i.destroy(),i=e.uid,r()}):(i=i.uid,r()):r()},getResponse:function(e){var n,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new i(a.uid,o),"blob"===e)return o;try{if(n=new r,~t.inArray(e,["","text"]))return n.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(n.readAsText(o))}finally{o.destroy()}}return null},abort:function(e){this.getRuntime().shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=s}),i(X,[B,_],function(e,t){var n={getAsBlob:function(e){var n=this.getRuntime(),i=n.shimExec.call(this,"Transporter","getAsBlob",e);return i?new t(n.uid,i):null}};return e.Transporter=n}),i(V,[B,u,O,_,S],function(e,t,n,i,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(i,"Image","loadFromBlob",e.uid),i=r=null}var i=this,r=i.getRuntime();if(e.isDetached()){var o=new n;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){return this.getRuntime().shimExec.call(this,"Image","loadFromImage",e.uid)},getAsBlob:function(e,t){var n=this.getRuntime(),r=n.shimExec.call(this,"Image","getAsBlob",e,t);return r?new i(n.uid,r):null},getAsDataURL:function(){var e=this.getRuntime(),t=e.Image.getAsBlob.apply(this,arguments),n;return t?(n=new r,n.readAsDataURL(t)):null}};return e.Image=o}),i(W,[u,d,f,h,m],function(e,t,n,i,r){function o(e){var t=!1,n=null,i,r,o,a,s,u=0;try{try{n=new ActiveXObject("AgControl.AgControl"),n.IsVersionSupported(e)&&(t=!0),n=null}catch(n){var c=navigator.plugins["Silverlight Plug-In"];if(c){for(i=c.description,"1.0.30226.2"===i&&(i="2.0.30226.2"),r=i.split(".");r.length>3;)r.pop();for(;r.length<4;)r.push(0);for(o=e.split(".");o.length>4;)o.pop();do{a=parseInt(o[u],10),s=parseInt(r[u],10),u++}while(u=a&&!isNaN(a)&&(t=!0)}}}catch(e){t=!1}return t}function a(a){var c=this,l;a=e.extend({xap_url:t.xap_url},a),r.call(this,a,s,{access_binary:r.capTrue,access_image_binary:r.capTrue,display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:r.capTrue,resize_image:r.capTrue,return_response_headers:function(e){return e&&"client"===c.mode},return_response_type:function(e){return"json"!==e||!!window.JSON},return_status_code:function(t){return"client"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:r.capTrue,send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"client"===c.mode},send_multipart:r.capTrue,slice_blob:r.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:r.capTrue,use_http_method:function(t){return"client"===c.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),o("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid).content.Moxie},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='',l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="silverlight",u={};return r.addConstructor(s,a),u}),i("moxie/runtime/silverlight/file/Blob",[W,u,q],function(e,t,n){return e.Blob=t.extend({},n)}),i("moxie/runtime/silverlight/file/FileInput",[W],function(e){var t={init:function(e){function t(e){for(var t="",n=0;no;o++)n=t.keys[o],(s=t[n])&&(/^(\d|[1-9]\d+)$/.test(s)?s=parseInt(s,10):/^\d*\.\d+$/.test(s)&&(s=parseFloat(s)),i.meta[e][n]=s)}),i.width=parseInt(r.width,10),i.height=parseInt(r.height,10),i.size=parseInt(r.size,10),i.type=r.type,i.name=r.name,i}})}),i(Y,[u,h,m,d],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue;n.call(this,t,o,{access_binary:s(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:s(a.Image&&(i.can("create_canvas")||i.can("use_data_uri_over32kb"))),do_cors:!1,drag_and_drop:!1,filter_by_extension:s(function(){return"Chrome"===i.browser&&i.version>=28||"IE"===i.browser&&i.version>=10}()),resize_image:function(){return a.Image&&r.can("access_binary")&&i.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return!("json"!==t||!window.JSON)||!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return i.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return r.can("select_file")},summon_file_dialog:s(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:u,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html4",a={};return n.addConstructor(o,r),a}),i("moxie/runtime/html4/file/FileInput",[Y,u,f,C,l,d],function(e,t,n,i,r,o){function a(){function e(){var r=this,l=r.getRuntime(),d,f,h,p,g,m;m=t.guid("uid_"),d=l.getShimContainer(),a&&(h=n.get(a+"_form"))&&t.extend(h.style,{top:"100%"}),p=document.createElement("form"),p.setAttribute("id",m+"_form"),p.setAttribute("method","post"),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),t.extend(p.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),g=document.createElement("input"),g.setAttribute("id",m),g.setAttribute("type","file"),g.setAttribute("name",c.name||"Filedata"),g.setAttribute("accept",u.join(",")),t.extend(g.style,{fontSize:"999px",opacity:0}),p.appendChild(g),d.appendChild(p),t.extend(g.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===o.browser&&o.version<10&&t.extend(g.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),g.onchange=function(){var t;this.value&&(t=this.files?this.files[0]:{name:this.value},s=[t],this.onchange=function(){},e.call(r),r.bind("change",function e(){var t=n.get(m),i=n.get(m+"_form"),o;r.unbind("change",e),r.files.length&&t&&i&&(o=r.files[0],t.setAttribute("id",o.uid),i.setAttribute("id",o.uid+"_form"),i.setAttribute("target",o.uid+"_iframe")),t=i=null},998),g=p=null,r.trigger("change"))},l.can("summon_file_dialog")&&(f=n.get(c.browse_button),i.removeEvent(f,"click",r.uid),i.addEvent(f,"click",function(e){g&&!g.disabled&&g.click(),e.preventDefault()},r.uid)),a=m,d=h=f=null}var a,s=[],u=[],c;t.extend(this,{init:function(t){var o=this,a=o.getRuntime(),s;c=t,u=t.accept.mimes||r.extList2mimes(t.accept,a.can("filter_by_extension")),s=a.getShimContainer(),function(){var e,r,u;e=n.get(t.browse_button),a.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),r=parseInt(n.getStyle(e,"z-index"),10)||1,e.style.zIndex=r,s.style.zIndex=r-1),u=a.can("summon_file_dialog")?e:s,i.addEvent(u,"mouseover",function(){o.trigger("mouseenter")},o.uid),i.addEvent(u,"mouseout",function(){o.trigger("mouseleave")},o.uid),i.addEvent(u,"mousedown",function(){o.trigger("mousedown")},o.uid),i.addEvent(n.get(t.container),"mouseup",function(){o.trigger("mouseup")},o.uid),e=null}(),e.call(this),s=null,o.trigger({type:"ready",async:!0})},getFiles:function(){return s},disable:function(e){var t;(t=n.get(a))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),r=e.getShimContainer();i.removeAllEvents(r,this.uid),i.removeAllEvents(c&&n.get(c.container),this.uid),i.removeAllEvents(c&&n.get(c.browse_button),this.uid),r&&(r.innerHTML=""),t.removeInstance(this.uid),a=s=u=c=r=t=null}})}return e.FileInput=a}),i("moxie/runtime/html4/file/FileReader",[Y,N],function(e,t){return e.FileReader=t}),i("moxie/runtime/html4/xhr/XMLHttpRequest",[Y,u,f,R,h,C,_,T],function(e,t,n,i,r,o,a,s){function u(){function e(e){var t=this,i,r,a,s,u=!1;if(l){if(i=l.id.replace(/_iframe$/,""),r=n.get(i+"_form")){for(a=r.getElementsByTagName("input"),s=a.length;s--;)switch(a[s].getAttribute("type")){case"hidden":a[s].parentNode.removeChild(a[s]);break;case"file":u=!0}a=[],u||r.parentNode.removeChild(r),r=null}setTimeout(function(){o.removeEvent(l,"load",t.uid),l.parentNode&&l.parentNode.removeChild(l);var n=t.getRuntime().getShimContainer() ;n.children.length||n.parentNode.removeChild(n),n=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,f){function h(){var n=g.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='',l=r.firstChild,n.appendChild(l),o.addEvent(l,"load",function(){var n;try{n=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(n.title)?u=n.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(n.body.innerHTML),p.trigger({type:"progress",loaded:c.length,total:c.length}),y&&p.trigger({type:"uploadprogress",loaded:y.size||1025,total:y.size||1025}))}catch(t){if(!i.hasSameOrigin(d.url))return void e.call(p,function(){p.trigger("error")});u=404}e.call(p,function(){p.trigger("load")})},p.uid)}var p=this,g=p.getRuntime(),m,v,_,y;if(u=c=null,f instanceof s&&f.hasBlob()){if(y=f.getBlob(),m=y.uid,_=n.get(m),!(v=n.get(m+"_form")))throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else m=t.guid("uid_"),v=document.createElement("form"),v.setAttribute("id",m+"_form"),v.setAttribute("method",d.method),v.setAttribute("enctype","multipart/form-data"),v.setAttribute("encoding","multipart/form-data"),v.setAttribute("target",m+"_iframe"),g.getShimContainer().appendChild(v);f instanceof s&&f.each(function(e,n){if(e instanceof a)_&&_.setAttribute("name",n);else{var i=document.createElement("input");t.extend(i,{type:"hidden",name:n,value:e}),_?v.insertBefore(i,_):v.appendChild(i)}}),v.setAttribute("action",d.url),h(),v.submit(),p.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(e){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),i("moxie/runtime/html4/image/Image",[Y,U],function(e,t){return e.Image=t}),a([u,c,l,d,f,h,p,g,m,v,_,y,w,E,b,x,R,S,T,A,O,I,C])}(this),function(e){"use strict";var t={},n=e.moxie.core.utils.Basic.inArray;(function e(i){var r,o;for(r in i)o=typeof i[r],"object"!==o||~n(r,["Exceptions","Env","Mime"])?"function"===o&&(t[r]=i[r]):e(i[r])})(e.moxie),t.Env=e.moxie.core.utils.Env,t.Mime=e.moxie.core.utils.Mime,t.Exceptions=e.moxie.core.Exceptions,e.mOxie=t,e.o||(e.o=t)}(this),function(e,t,n){function i(e){function t(e,t,n){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?i[r[e]]=t:n||(i[e]=t)}var n=e.required_features,i={};return"string"==typeof n?a.each(n.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof n?a.each(n,function(e,n){t(n,e)}):!0===n&&(e.chunk_size>0&&(i.slice_blob=!0),!e.resize.enabled&&e.multipart||(i.send_binary_string=!0),a.each(e,function(e,n){t(n,!!e,!0)})),i}var r=e.setTimeout,o={},a={VERSION:"2.1.2",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:t.mimes,ua:t.ua,typeOf:t.typeOf,extend:t.extend,guid:t.guid,get:function(e){var n=[],i;"array"!==t.typeOf(e)&&(e=[e]);for(var r=e.length;r--;)(i=t.get(e[r]))&&n.push(i);return n.length?n:null},each:t.each,getPos:t.getPos,getSize:t.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},n=/[<>&\"\']/g;return e?(""+e).replace(n,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:t.toArray,inArray:t.inArray,addI18n:t.addI18n,translate:t.translate,isEmptyObj:t.isEmptyObj,hasClass:t.hasClass,addClass:t.addClass,removeClass:t.removeClass,getStyle:t.getStyle,addEvent:t.addEvent,removeEvent:t.removeEvent,removeAllEvents:t.removeAllEvents,cleanName:function(e){var t,n;for(n=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t0?"&":"?")+n),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===n||/\D/.test(e))return a.translate("N/A");var i=Math.pow(1024,4);return e>i?t(e/i,1)+" "+a.translate("tb"):e>(i/=1024)?t(e/i,1)+" "+a.translate("gb"):e>(i/=1024)?t(e/i,1)+" "+a.translate("mb"):e>1024?Math.round(e/1024)+" "+a.translate("kb"):e+" "+a.translate("b")},parseSize:t.parseSizeStr,predictRuntime:function(e,n){var i,r;return i=new a.Uploader(e),r=t.Runtime.thatCan(i.getOption().required_features,n||e.runtimes),i.destroy(),r},addFileFilter:function(e,t){o[e]=t}};a.addFileFilter("mime_types",function(e,t,n){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:a.FILE_EXTENSION_ERROR,message:a.translate("File extension error."),file:t}),n(!1)):n(!0)}),a.addFileFilter("max_file_size",function(e,t,n){var i;e=a.parseSize(e),t.size!==i&&e&&t.size>e?(layer.msg("最大"+e+"字节"),this.trigger("Error",{code:a.FILE_SIZE_ERROR,message:a.translate("File size error."),file:t}),n(!1)):n(!0)}),a.addFileFilter("prevent_duplicates",function(e,t,n){if(e)for(var i=this.files.length;i--;)if(t.name===this.files[i].name&&t.size===this.files[i].size)return this.trigger("Error",{code:a.FILE_DUPLICATE_ERROR,message:a.translate("Duplicate file error."),file:t}),void n(!1);n(!0)}),a.Uploader=function(e){function s(){var e,t=0,n;if(this.state==a.STARTED){for(n=0;n0?Math.ceil(e.loaded/e.size*100):100,c()}function c(){var e,t;for(C.reset(),e=0;e0?Math.ceil(C.uploaded/T.length*100):0:(C.bytesPerSec=Math.ceil(C.loaded/((+new Date-D||1)/1e3)),C.percent=C.size>0?Math.ceil(C.loaded/C.size*100):0)}function l(){var e=O[0]||I[0];return!!e&&e.getRuntime().uid}function d(e,n){if(e.ruid){var i=t.Runtime.getInfo(e.ruid);if(i)return i.can(n)}return!1}function f(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",w),this.bind("BeforeUpload",m),this.bind("UploadFile",v),this.bind("UploadProgress",_),this.bind("StateChanged",y),this.bind("QueueChanged",c),this.bind("Error",b),this.bind("FileUploaded",E),this.bind("Destroy",x)}function h(e,n){var i=this,r=0,o=[],s={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:A,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};a.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(s[t]=e[t])}),e.browse_button&&a.each(e.browse_button,function(n){o.push(function(o){var u=new t.FileInput(a.extend({},s,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:n}));u.onready=function(){var e=t.Runtime.getInfo(this.ruid);t.extend(i.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,O.push(this),o()},u.onchange=function(){i.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(i){N||(e.browse_button_hover&&("mouseenter"===i.type?t.addClass(n,e.browse_button_hover):"mouseleave"===i.type&&t.removeClass(n,e.browse_button_hover)),e.browse_button_active&&("mousedown"===i.type?t.addClass(n,e.browse_button_active):"mouseup"===i.type&&t.removeClass(n,e.browse_button_active)))}),u.bind("mousedown",function(){i.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,o()}),u.init()})}),e.drop_element&&a.each(e.drop_element,function(e){o.push(function(n){var o=new t.FileDrop(a.extend({},s,{drop_zone:e}));o.onready=function(){var e=t.Runtime.getInfo(this.ruid);i.features.dragdrop=e.can("drag_and_drop"),r++,I.push(this),n()},o.ondrop=function(){i.addFile(this.files)},o.bind("error runtimeerror",function(){o=null,n()}),o.init()})}),t.inSeries(o,function(){"function"==typeof n&&n(r)})}function p(e,i,r){var o=new t.Image;try{o.onload=function(){if(i.width>this.width&&i.height>this.height&&i.quality===n&&i.preserve_headers&&!i.crop)return this.destroy(),r(e);o.downsize(i.width,i.height,i.crop,i.preserve_headers)},o.onresize=function(){r(this.getAsBlob(e.type,i.quality)),this.destroy()},o.onerror=function(){r(e)},o.load(e)}catch(t){r(e)}}function g(e,n,r){function o(e,t,n){var i=S[e];switch(e){case"max_file_size":"max_file_size"===e&&(S.max_file_size=S.filters.max_file_size=t);break;case"chunk_size":(t=a.parseSize(t))&&(S[e]=t,S.send_file_name=!0);break;case"multipart":S[e]=t,t||(S.send_file_name=!0);break;case"unique_names":S[e]=t,t&&(S.send_file_name=!0);break;case"filters":"array"===a.typeOf(t)&&(t={mime_types:t}),n?a.extend(S.filters,t):S.filters=t,t.mime_types&&(S.filters.mime_types.regexp=function(e){var t=[];return a.each(e,function(e){a.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(S.filters.mime_types));break;case"resize":n?a.extend(S.resize,t,{enabled:!0}):S.resize=t;break;case"prevent_duplicates":S.prevent_duplicates=S.filters.prevent_duplicates=!!t;break;case"browse_button":case"drop_element":t=a.get(t);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":S[e]=t,n||(u=!0);break;default:S[e]=t}n||s.trigger("OptionChanged",e,t,i)}var s=this,u=!1;"object"==typeof e?a.each(e,function(e,t){o(t,e,r)}):o(e,n,r),r?(S.required_features=i(a.extend({},S)),A=i(a.extend({},S,{required_features:!0}))):u&&(s.trigger("Destroy"),h.call(s,S,function(e){e?(s.runtime=t.Runtime.getInfo(l()).type,s.trigger("Init",{runtime:s.runtime}),s.trigger("PostInit")):s.trigger("Error",{code:a.INIT_ERROR,message:a.translate("Init error.")})}))}function m(e,t){if(e.settings.unique_names){var n=t.name.match(/\.([^.]+)$/),i="part";n&&(i=n[1]),t.target_name=t.id+"."+i}}function v(e,n){function i(){c-- >0?r(o,1e3):(n.loaded=f,e.trigger("Error",{code:a.HTTP_ERROR,message:a.translate("HTTP Error."),file:n,response:M.responseText,status:M.status,responseHeaders:M.getAllResponseHeaders()}))}function o(){var d,p,g={},m;n.status===a.UPLOADING&&e.state!==a.STOPPED&&(e.settings.send_file_name&&(g.name=n.target_name||n.name),u&&l.chunks&&h.size>u?(m=Math.min(u,h.size-f),d=h.slice(f,f+m)):(m=h.size,d=h),u&&l.chunks&&(e.settings.send_chunk_number?(g.chunk=Math.ceil(f/u),g.chunks=Math.ceil(h.size/u)):(g.offset=f,g.total=h.size)),M=new t.XMLHttpRequest,M.upload&&(M.upload.onprogress=function(t){n.loaded=Math.min(n.size,f+t.loaded),e.trigger("UploadProgress",n)}),M.onload=function(){if(M.status>=400)return void i();c=e.settings.max_retries,m=h.size?(n.size!=n.origSize&&(h.destroy(),h=null),e.trigger("UploadProgress",n),n.status=a.DONE,e.trigger("FileUploaded",n,{response:M.responseText,status:M.status,responseHeaders:M.getAllResponseHeaders()})):r(o,1)},M.onerror=function(){i()},M.onloadend=function(){this.destroy(),M=null},e.settings.multipart&&l.multipart?(M.open("post",s,!0),a.each(e.settings.headers,function(e,t){M.setRequestHeader(t,e)}),p=new t.FormData,a.each(a.extend(g,e.settings.multipart_params),function(e,t){p.append(t,e)}),p.append(e.settings.file_data_name,d),M.send(p,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:A,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(s=a.buildUrl(e.settings.url,a.extend(g,e.settings.multipart_params)),M.open("post",s,!0),M.setRequestHeader("Content-Type","application/octet-stream"),a.each(e.settings.headers,function(e,t){M.setRequestHeader(t,e)}),M.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:A,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})))}var s=e.settings.url,u=e.settings.chunk_size,c=e.settings.max_retries,l=e.features,f=0,h;n.loaded&&(f=n.loaded=u?u*Math.floor(n.loaded/u):0),h=n.getSource(),e.settings.resize.enabled&&d(h,"send_binary_string")&&~t.inArray(h.type,["image/jpeg","image/png"])?p.call(this,h,e.settings.resize,function(e){h=e,n.size=e.size,o()}):o()}function _(e,t){u(t)}function y(e){if(e.state==a.STARTED)D=+new Date;else if(e.state==a.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==a.UPLOADING&&(e.files[t].status=a.QUEUED,c())}function w(){M&&M.abort()}function E(e){c(),r(function(){s.call(e)},1)}function b(e,t){t.code===a.INIT_ERROR?e.destroy():t.file&&(t.file.status=a.FAILED,u(t.file),e.state==a.STARTED&&(e.trigger("CancelUpload"),r(function(){s.call(e)},1)))}function x(e){e.stop(),a.each(T,function(e){e.destroy()}),T=[],O.length&&(a.each(O,function(e){e.destroy()}),O=[]),I.length&&(a.each(I,function(e){e.destroy()}),I=[]),A={},N=!1,D=M=null,C.reset()}var R=a.guid(),S,T=[],A={},O=[],I=[],D,C,N=!1,M;S={runtimes:t.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},g.call(this,e,null,!0),C=new a.QueueProgress,a.extend(this,{id:R,uid:R,state:a.STOPPED,features:{},runtime:null,files:T,settings:S,total:C,init:function(){var e=this;if("function"==typeof S.preinit?S.preinit(e):a.each(S.preinit,function(t,n){e.bind(n,t)}),f.call(this),!S.browse_button||!S.url)return void this.trigger("Error",{code:a.INIT_ERROR,message:a.translate("Init error.")});h.call(this,S,function(n){"function"==typeof S.init?S.init(e):a.each(S.init,function(t,n){e.bind(n,t)}),n?(e.runtime=t.Runtime.getInfo(l()).type,e.trigger("Init",{runtime:e.runtime}),e.trigger("PostInit")):e.trigger("Error",{code:a.INIT_ERROR,message:a.translate("Init error.")})})},setOption:function(e,t){g.call(this,e,t,!this.runtime)},getOption:function(e){return e?S[e]:S},refresh:function(){O.length&&a.each(O,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=a.STARTED&&(this.state=a.STARTED,this.trigger("StateChanged"),s.call(this))},stop:function(){this.state!=a.STOPPED&&(this.state=a.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){N=arguments[0]===n||arguments[0],O.length&&a.each(O,function(e){e.disable(N)}),this.trigger("DisableBrowse",N)},getFile:function(e){var t;for(t=T.length-1;t>=0;t--)if(T[t].id===e)return T[t]},addFile:function(e,n){function i(e,n){var i=[];t.each(u.settings.filters,function(t,n){o[n]&&i.push(function(i){o[n].call(u,t,e,function(e){i(!e)})})}),t.inSeries(i,n)}function s(e){var o=t.typeOf(e);if(e instanceof t.File){if(!e.ruid&&!e.isDetached()){if(!f)return!1;e.ruid=f,e.connectRuntime(f)}s(new a.File(e))}else e instanceof t.Blob?(s(e.getSource()),e.destroy()):e instanceof a.File?(n&&(e.name=n),c.push(function(t){i(e,function(n){n||(T.push(e),d.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==t.inArray(o,["file","blob"])?s(new t.File(null,e)):"node"===o&&"filelist"===t.typeOf(e.files)?t.each(e.files,s):"array"===o&&(n=null,t.each(e,s))}var u=this,c=[],d=[],f;f=l(),s(e),c.length&&t.inSeries(c,function(){d.length&&u.trigger("FilesAdded",d)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,n=T.length-1;n>=0;n--)if(T[n].id===t)return this.splice(n,1)[0]},splice:function(e,t){var i=T.splice(e===n?0:e,t===n?T.length:t),r=!1;return this.state==a.STARTED&&(a.each(i,function(e){if(e.status===a.UPLOADING)return r=!0,!1}),r&&this.stop()),this.trigger("FilesRemoved",i),a.each(i,function(e){e.destroy()}),r&&this.start(),i},bind:function(e,t,n){var i=this;a.Uploader.prototype.bind.call(this,e,function(){var e=[].slice.call(arguments);return e.splice(0,1,i),t.apply(this,e)},0,n)},destroy:function(){this.trigger("Destroy"),S=C=null,this.unbindAll()}})},a.Uploader.prototype=t.EventTarget.instance,a.File=function(){function e(e){a.extend(this,{id:a.guid(),name:e.name||e.fileName,type:e.type||"",size:e.size||e.fileSize,origSize:e.size||e.fileSize,loaded:0,percent:0,status:a.QUEUED,lastModifiedDate:e.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return-1!==t.inArray(t.typeOf(e),["blob","file"])?e:null},getSource:function(){return n[this.id]?n[this.id]:null},destroy:function(){var e=this.getSource();e&&(e.destroy(),delete n[this.id])}}),n[this.id]=e}var n={};return e}(),a.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=a}(window,mOxie),Date.prototype.Format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"H+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),f:this.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var n in t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e},accessid="iL9dWgBunZRwGbHQ",accesskey="Q6P2vSNEY2LBNdygO8gUCkBZQpiswZ",osshost="http://yunmuit.oss-cn-hangzhou.aliyuncs.com",g_dirname="",g_object_name="",now=timestamp=Date.parse(new Date)/1e3;var policyText={expiration:"2050-01-01T12:00:00.000Z",conditions:[["content-length-range",0,1048576e3]]},policyBase64=Base64.encode(JSON.stringify(policyText));message=policyBase64;var bytes=Crypto.HMAC(Crypto.SHA1,message,accesskey,{asBytes:!0}),signature=Crypto.util.bytesToBase64(bytes);