{"size": 526659, "ext": "js", "max_stars_repo_path": "img/clouds_files/third_party.js", "max_stars_repo_name": "thomasjohan/thomasjohan.github.io", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "img/clouds_files/third_party.js", "max_issues_repo_name": "thomasjohan/thomasjohan.github.io", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "img/clouds_files/third_party.js", "max_forks_repo_name": "thomasjohan/thomasjohan.github.io", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 2757.3769633508, "max_line_length": 249539, "alphanum_fraction": 0.7115476997}
/* Add to Homescreen v3.0.6 ~ (c) 2014 Matteo Spinelli ~ @license: http://cubiq.org/license */
(function(window,document){var _DOMReady=false;if(document.readyState==="complete"){_DOMReady=true}else{window.addEventListener("load",loaded,false)}function loaded(){window.removeEventListener("load",loaded,false);_DOMReady=true}var _reSmartURL=/\/ath(\/)?$/;var _reQueryString=/([\?&]ath=[^&]*$|&ath=[^&]*(&))/;var _instance;function ath(options){_instance=_instance||new ath.Class(options);return _instance}ath.intl={de_de:{message:"Um diese Web-App zum Home-Bildschirm hinzuzufügen, tippen Sie auf %icon und dann <strong>%action</strong>.",action:{ios:"Zum Home-Bildschirm",android:"Zum Startbildschirm hinzufügen",windows:"Auf Startseite"}},en_us:{message:"To add this web app to the home screen: tap %icon and then <strong>%action</strong>.",action:{ios:"Add to Home Screen",android:"Add to homescreen",windows:"pin to start"}},es_es:{message:"Para añadir esta aplicación web a la pantalla de inicio: pulsa %icon y selecciona <strong>%action</strong>.",action:{ios:"Añadir a pantalla de inicio",android:"Añadir a pantalla de inicio",windows:"Añadir a inicio"}},it_it:{message:"Per Aggiungere questa web app alla schermata iniziale: premi %icon e poi <strong>%action</strong>.",action:{ios:"Aggiungi a Home",android:"Aggiungi alla homescreen",windows:"aggiungi a start"}},nl_nl:{message:"Om deze webapp op je telefoon te installeren, klik op %icon en dan <strong>%action</strong>.",action:{ios:"Voeg toe aan beginscherm",android:"Toevoegen aan startscherm",windows:"Aan startscherm vastmaken"}},zh_cn:{message:"如要把应用程式加至主屏幕,请点击%icon, 然后<strong>%action</strong>",action:{ios:"加至主屏幕",android:"加至主屏幕",windows:"按住启动"}},zh_tw:{message:"如要把應用程式加至主屏幕, 請點擊%icon, 然後<strong>%action</strong>.",action:{ios:"加至主屏幕",android:"加至主屏幕",windows:"按住啟動"}}};ath.defaults={appID:"org.cubiq.addtohome",fontSize:15,debug:false,modal:false,mandatory:false,autostart:true,skipFirstVisit:false,startDelay:1,lifespan:15,displayPace:1440,maxDisplayCount:0,icon:true,message:"",validLocation:[],onInit:null,onShow:null,onRemove:null,onAdd:null,onPrivate:null,detectHomescreen:false};var _ua=window.navigator.userAgent;var _nav=window.navigator;_extend(ath,{hasToken:document.location.hash=="#ath"||_reSmartURL.test(document.location.href)||_reQueryString.test(document.location.search),isRetina:window.devicePixelRatio&&window.devicePixelRatio>1,isIDevice:/iphone|ipod|ipad/i.test(_ua),isMobileChrome:_ua.indexOf("Android")>-1&&/Chrome\/[.0-9]*/.test(_ua),isMobileIE:_ua.indexOf("Windows Phone")>-1,language:_nav.language&&_nav.language.toLowerCase().replace("-","_")||""});if(ath.language.length==2){ath.language+="_"+ath.language}ath.language=ath.language&&ath.language in ath.intl?ath.language:"en_us";ath.isMobileSafari=ath.isIDevice&&_ua.indexOf("Safari")>-1&&_ua.indexOf("CriOS")<0;ath.OS=ath.isIDevice?"ios":ath.isMobileChrome?"android":ath.isMobileIE?"windows":"unsupported";ath.OSVersion=_ua.match(/(OS|Android) (\d+[_\.]\d+)/);ath.OSVersion=ath.OSVersion&&ath.OSVersion[2]?+ath.OSVersion[2].replace("_","."):0;ath.isStandalone=window.navigator.standalone||ath.isMobileChrome&&screen.height-document.documentElement.clientHeight<40;ath.isTablet=ath.isMobileSafari&&_ua.indexOf("iPad")>-1||ath.isMobileChrome&&_ua.indexOf("Mobile")<0;ath.isCompatible=ath.isMobileSafari&&ath.OSVersion>=6||ath.isMobileChrome;var _defaultSession={lastDisplayTime:0,returningVisitor:false,displayCount:0,optedout:false,added:false};ath.removeSession=function(appID){try{localStorage.removeItem(appID||ath.defaults.appID)}catch(e){}};ath.Class=function(options){this.options=_extend({},ath.defaults);_extend(this.options,options);this.options.mandatory=this.options.mandatory&&("standalone"in window.navigator||this.options.debug);this.options.modal=this.options.modal||this.options.mandatory;if(this.options.mandatory){this.options.startDelay=-.5}this.options.detectHomescreen=this.options.detectHomescreen===true?"hash":this.options.detectHomescreen;if(this.options.debug){ath.isCompatible=true;ath.OS=typeof this.options.debug=="string"?this.options.debug:ath.OS=="unsupported"?"android":ath.OS;ath.OSVersion=ath.OS=="ios"?"7":"4"}this.container=document.documentElement;this.session=JSON.parse(localStorage.getItem(this.options.appID));if(ath.hasToken&&(!ath.isCompatible||!this.session)){ath.hasToken=false;_removeToken()}if(!ath.isCompatible){return}this.session=this.session||_defaultSession;try{localStorage.setItem(this.options.appID,JSON.stringify(this.session));ath.hasLocalStorage=true}catch(e){ath.hasLocalStorage=false;if(this.options.onPrivate){this.options.onPrivate.call(this)}}var isValidLocation=!this.options.validLocation.length;for(var i=this.options.validLocation.length;i--;){if(this.options.validLocation[i].test(document.location.href)){isValidLocation=true;break}}if(localStorage.getItem("addToHome")){this.optOut()}if(this.session.optedout||this.session.added||!isValidLocation){return}if(ath.isStandalone){if(!this.session.added){this.session.added=true;this.updateSession();if(this.options.onAdd&&ath.hasLocalStorage){this.options.onAdd.call(this)}}return}if(this.options.detectHomescreen){if(ath.hasToken){_removeToken();if(!this.session.added){this.session.added=true;this.updateSession();if(this.options.onAdd&&ath.hasLocalStorage){this.options.onAdd.call(this)}}return}if(this.options.detectHomescreen=="hash"){history.replaceState("",window.document.title,document.location.href+"#ath")}else if(this.options.detectHomescreen=="smartURL"){history.replaceState("",window.document.title,document.location.href.replace(/(\/)?$/,"/ath$1"))}else{history.replaceState("",window.document.title,document.location.href+(document.location.search?"&":"?")+"ath=")}}if(!this.session.returningVisitor){this.session.returningVisitor=true;this.updateSession();if(this.options.skipFirstVisit){return}}if(!ath.hasLocalStorage){return}this.ready=true;if(this.options.onInit){this.options.onInit.call(this)}if(this.options.autostart){this.show()}};ath.Class.prototype={events:{load:"_delayedShow",error:"_delayedShow",orientationchange:"resize",resize:"resize",scroll:"resize",click:"remove",touchmove:"_preventDefault",transitionend:"_removeElements",webkitTransitionEnd:"_removeElements",MSTransitionEnd:"_removeElements"},handleEvent:function(e){var type=this.events[e.type];if(type){this[type](e)}},show:function(force){if(this.options.autostart&&!_DOMReady){setTimeout(this.show.bind(this),50);return}if(this.shown){return}var now=Date.now();var lastDisplayTime=this.session.lastDisplayTime;if(force!==true){if(!this.ready){return}if(now-lastDisplayTime<this.options.displayPace*6e4){return}if(this.options.maxDisplayCount&&this.session.displayCount>=this.options.maxDisplayCount){return}}this.shown=true;this.session.lastDisplayTime=now;this.session.displayCount++;this.updateSession();if(!this.applicationIcon){if(ath.OS=="ios"){this.applicationIcon=document.querySelector('head link[rel^=apple-touch-icon][sizes="152x152"],head link[rel^=apple-touch-icon][sizes="144x144"],head link[rel^=apple-touch-icon][sizes="120x120"],head link[rel^=apple-touch-icon][sizes="114x114"],head link[rel^=apple-touch-icon]')}else{this.applicationIcon=document.querySelector('head link[rel^="shortcut icon"][sizes="196x196"],head link[rel^=apple-touch-icon]')}}var message="";if(this.options.message in ath.intl){message=ath.intl[this.options.message].message.replace("%action",ath.intl[this.options.message].action[ath.OS])}else if(this.options.message!==""){message=this.options.message}else{message=ath.intl[ath.language].message.replace("%action",ath.intl[ath.language].action[ath.OS])}message="<p>"+message.replace("%icon",'<span class="ath-action-icon">icon</span>')+"</p>";this.viewport=document.createElement("div");this.viewport.className="ath-viewport";if(this.options.modal){this.viewport.className+=" ath-modal"}if(this.options.mandatory){this.viewport.className+=" ath-mandatory"}this.viewport.style.position="absolute";this.element=document.createElement("div");this.element.className="ath-container ath-"+ath.OS+" ath-"+ath.OS+(ath.OSVersion+"").substr(0,1)+" ath-"+(ath.isTablet?"tablet":"phone");this.element.style.cssText="-webkit-transition-property:-webkit-transform,opacity;-webkit-transition-duration:0;-webkit-transform:translate3d(0,0,0);transition-property:transform,opacity;transition-duration:0;transform:translate3d(0,0,0);-webkit-transition-timing-function:ease-out";this.element.style.webkitTransform="translate3d(0,-"+window.innerHeight+"px,0)";this.element.style.webkitTransitionDuration="0s";if(this.options.icon&&this.applicationIcon){this.element.className+=" ath-icon";this.img=document.createElement("img");this.img.className="ath-application-icon";this.img.addEventListener("load",this,false);this.img.addEventListener("error",this,false);this.img.src=this.applicationIcon.href;this.element.appendChild(this.img)}this.element.innerHTML+=message;this.viewport.style.left="-99999em";this.viewport.appendChild(this.element);this.container.appendChild(this.viewport);if(!this.img){this._delayedShow()}},_delayedShow:function(e){setTimeout(this._show.bind(this),this.options.startDelay*1e3+500)},_show:function(){var that=this;this.updateViewport();window.addEventListener("resize",this,false);window.addEventListener("scroll",this,false);window.addEventListener("orientationchange",this,false);if(this.options.modal){document.addEventListener("touchmove",this,true)}if(!this.options.mandatory){setTimeout(function(){that.element.addEventListener("click",that,true)},1e3)}setTimeout(function(){that.element.style.webkitTransform="translate3d(0,0,0)";that.element.style.webkitTransitionDuration="1.2s"},0);if(this.options.lifespan){this.removeTimer=setTimeout(this.remove.bind(this),this.options.lifespan*1e3)}if(this.options.onShow){this.options.onShow.call(this)}},remove:function(){clearTimeout(this.removeTimer);if(this.img){this.img.removeEventListener("load",this,false);this.img.removeEventListener("error",this,false)}window.removeEventListener("resize",this,false);window.removeEventListener("scroll",this,false);window.removeEventListener("orientationchange",this,false);document.removeEventListener("touchmove",this,true);this.element.removeEventListener("click",this,true);this.element.addEventListener("transitionend",this,false);this.element.addEventListener("webkitTransitionEnd",this,false);this.element.addEventListener("MSTransitionEnd",this,false);this.element.style.webkitTransitionDuration="0.3s";this.element.style.opacity="0"},_removeElements:function(){this.element.removeEventListener("transitionend",this,false);this.element.removeEventListener("webkitTransitionEnd",this,false);this.element.removeEventListener("MSTransitionEnd",this,false);this.container.removeChild(this.viewport);this.shown=false;if(this.options.onRemove){this.options.onRemove.call(this)}},updateViewport:function(){if(!this.shown){return}this.viewport.style.width=window.innerWidth+"px";this.viewport.style.height=window.innerHeight+"px";this.viewport.style.left=window.scrollX+"px";this.viewport.style.top=window.scrollY+"px";var clientWidth=document.documentElement.clientWidth;this.orientation=clientWidth>document.documentElement.clientHeight?"landscape":"portrait";var screenWidth=ath.OS=="ios"?this.orientation=="portrait"?screen.width:screen.height:screen.width;this.scale=screen.width>clientWidth?1:screenWidth/window.innerWidth;this.element.style.fontSize=this.options.fontSize/this.scale+"px"},resize:function(){clearTimeout(this.resizeTimer);this.resizeTimer=setTimeout(this.updateViewport.bind(this),100)},updateSession:function(){if(ath.hasLocalStorage===false){return}localStorage.setItem(this.options.appID,JSON.stringify(this.session))},clearSession:function(){this.session=_defaultSession;this.updateSession()},optOut:function(){this.session.optedout=true;this.updateSession()},optIn:function(){this.session.optedout=false;this.updateSession()},clearDisplayCount:function(){this.session.displayCount=0;this.updateSession()},_preventDefault:function(e){e.preventDefault();e.stopPropagation()}};function _extend(target,obj){for(var i in obj){target[i]=obj[i]}return target}function _removeToken(){if(document.location.hash=="#ath"){history.replaceState("",window.document.title,document.location.href.split("#")[0])}if(_reSmartURL.test(document.location.href)){history.replaceState("",window.document.title,document.location.href.replace(_reSmartURL,"$1"))}if(_reQueryString.test(document.location.search)){history.replaceState("",window.document.title,document.location.href.replace(_reQueryString,"$2"))}}window.addToHomescreen=ath})(window,document);/*!
 * imagesLoaded PACKAGED v3.1.6
 * JavaScript is all like "You images are done yet or what?"
 * MIT License
 */

(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("eventEmitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(this,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function c(e){this.img=e}function f(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var c=r[o];this.addImage(c)}}},s.prototype.addImage=function(e){var t=new c(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),c.prototype=new t,c.prototype.check=function(){var e=v[this.img.src]||new f(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},c.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return f.prototype=new t,f.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},f.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},f.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},f.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},f.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},f.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});
(function(a){if(typeof define==="function"&&define.amd)define(["jquery"],a);else a(jQuery);}(function(a){a.ui=a.ui||{};a.extend(a.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});a.fn.extend({scrollParent:function(b){var c=this.css("position"),d=c==="absolute",e=b?/(auto|scroll|hidden)/:/(auto|scroll)/,f=this.parents().filter(function(){var b=a(this);if(d&&b.css("position")==="static")return false;return e.test(b.css("overflow")+b.css("overflow-y")+b.css("overflow-x"));}).eq(0);return c==="fixed"||!f.length?a(this[0].ownerDocument||document):f;},uniqueId:(function(){var a=0;return function(){return this.each(function(){if(!this.id)this.id="ui-id-"+ (++a);});};})(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id))a(this).removeAttr("id");});}});function b(b,d){var e,f,g,h=b.nodeName.toLowerCase();if("area"===h){e=b.parentNode;f=e.name;if(!b.href||!f||e.nodeName.toLowerCase()!=="map")return false;g=a("img[usemap='#"+f+"']")[0];return !!g&&c(g);}return(/^(input|select|textarea|button|object)$/.test(h)?!b.disabled:"a"===h?b.href||d:d)&&c(b);}function c(b){return a.expr.filters.visible(b)&&!a(b).parents().addBack().filter(function(){return a.css(this,"visibility")==="hidden";}).length;}a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return !!a.data(c,b);};}):function(b,c,d){return !!a.data(b,d[3]);},focusable:function(c){return b(c,!isNaN(a.attr(c,"tabindex")));},tabbable:function(c){var d=a.attr(c,"tabindex"),e=isNaN(d);return(e||d>=0)&&b(c,!e);}});if(!a("<a>").outerWidth(1).jquery)a.each(["Width","Height"],function(b,c){var d=c==="Width"?["Left","Right"]:["Top","Bottom"],e=c.toLowerCase(),f={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function g(b,c,e,f){a.each(d,function(){c-=parseFloat(a.css(b,"padding"+this))||0;if(e)c-=parseFloat(a.css(b,"border"+this+"Width"))||0;if(f)c-=parseFloat(a.css(b,"margin"+this))||0;});return c;}a.fn["inner"+c]=function(b){if(b===undefined)return f["inner"+c].call(this);return this.each(function(){a(this).css(e,g(this,b)+"px");});};a.fn["outer"+c]=function(b,d){if(typeof b!=="number")return f["outer"+c].call(this,b);return this.each(function(){a(this).css(e,g(this,b,true,d)+"px");});};});if(!a.fn.addBack)a.fn.addBack=function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a));};if(a("<a>").data("a-b","a").removeData("a-b").data("a-b"))a.fn.removeData=(function(b){return function(c){if(arguments.length)return b.call(this,a.camelCase(c));else return b.call(this);};})(a.fn.removeData);a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());a.fn.extend({focus:(function(b){return function(c,d){return typeof c==="number"?this.each(function(){var b=this;setTimeout(function(){a(b).focus();if(d)d.call(b);},c);}):b.apply(this,arguments);};})(a.fn.focus),disableSelection:(function(){var a="onselectstart" in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(a+".ui-disableSelection",function(a){a.preventDefault();});};})(),enableSelection:function(){return this.unbind(".ui-disableSelection");},zIndex:function(b){if(b!==undefined)return this.css("zIndex",b);if(this.length){var c=a(this[0]),d,e;while(c.length&&c[0]!==document){d=c.css("position");if(d==="absolute"||d==="relative"||d==="fixed"){e=parseInt(c.css("zIndex"),10);if(!isNaN(e)&&e!==0)return e;}c=c.parent();}}return 0;}});a.ui.plugin={add:function(b,c,d){var e,f=a.ui[b].prototype;for(e in d){f.plugins[e]=f.plugins[e]||[];f.plugins[e].push([c,d[e]]);}},call:function(a,b,c,d){var e,f=a.plugins[b];if(!f)return;if(!d&&(!a.element[0].parentNode||a.element[0].parentNode.nodeType===11))return;for(e=0;e<f.length;e++)if(a.options[f[e][0]])f[e][1].apply(a.element,c);}};var d=0,e=Array.prototype.slice;a.cleanData=(function(b){return function(c){var d,e,f;for(f=0;(e=c[f])!=null;f++)try{d=a._data(e,"events");if(d&&d.remove)a(e).triggerHandler("remove");}catch(g){}b(c);};})(a.cleanData);a.widget=function(b,c,d){var e,f,g,h,i={},j=b.split(".")[0];b=b.split(".")[1];e=j+"-"+b;if(!d){d=c;c=a.Widget;}a.expr[":"][e.toLowerCase()]=function(b){return !!a.data(b,e);};a[j]=a[j]||{};f=a[j][b];g=a[j][b]=function(a,b){if(!this._createWidget)return new g(a,b);if(arguments.length)this._createWidget(a,b);};a.extend(g,f,{version:d.version,_proto:a.extend({},d),_childConstructors:[]});h=new c();h.options=a.widget.extend({},h.options);a.each(d,function(b,d){if(!a.isFunction(d)){i[b]=d;return;}i[b]=(function(){var a=function(){return c.prototype[b].apply(this,arguments);},e=function(a){return c.prototype[b].apply(this,a);};return function(){var b=this._super,c=this._superApply,f;this._super=a;this._superApply=e;f=d.apply(this,arguments);this._super=b;this._superApply=c;return f;};})();});g.prototype=a.widget.extend(h,{widgetEventPrefix:f?(h.widgetEventPrefix||b):b},i,{constructor:g,namespace:j,widgetName:b,widgetFullName:e});if(f){a.each(f._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,g,c._proto);});delete f._childConstructors;}else c._childConstructors.push(g);a.widget.bridge(b,g);return g;};a.widget.extend=function(b){var c=e.call(arguments,1),d=0,f=c.length,g,h;for(;d<f;d++)for(g in c[d]){h=c[d][g];if(c[d].hasOwnProperty(g)&&h!==undefined)if(a.isPlainObject(h))b[g]=a.isPlainObject(b[g])?a.widget.extend({},b[g],h):a.widget.extend({},h);else b[g]=h;}return b;};a.widget.bridge=function(b,c){var d=c.prototype.widgetFullName||b;a.fn[b]=function(f){var g=typeof f==="string",h=e.call(arguments,1),i=this;if(g){this.each(function(){var c,e=a.data(this,d);if(f==="instance"){i=e;return false;}if(!e)return a.error("cannot call methods on "+b+" prior to initialization; "+"attempted to call method '"+f+"'");if(!a.isFunction(e[f])||f.charAt(0)==="_")return a.error("no such method '"+f+"' for "+b+" widget instance");c=e[f].apply(e,h);if(c!==e&&c!==undefined){i=c&&c.jquery?i.pushStack(c.get()):c;return false;}});}else{if(h.length)f=a.widget.extend.apply(null,[f].concat(h));this.each(function(){var b=a.data(this,d);if(b){b.option(f||{});if(b._init)b._init();}else a.data(this,d,new c(f,this));});}return i;};};a.Widget=function(){};a.Widget._childConstructors=[];a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false,create:null},_createWidget:function(b,c){c=a(c||this.defaultElement||this)[0];this.element=a(c);this.uuid=d++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=a();this.hoverable=a();this.focusable=a();if(c!==this){a.data(c,this.widgetFullName,this);this._on(true,this.element,{remove:function(a){if(a.target===c)this.destroy();}});this.document=a(c.style?c.ownerDocument:c.document||c);this.window=a(this.document[0].defaultView||this.document[0].parentWindow);}this.options=a.widget.extend({},this.options,this._getCreateOptions(),b);this._create();this._trigger("create",null,this._getCreateEventData());this._init();},_getCreateOptions:a.noop,_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(a.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");},_destroy:a.noop,widget:function(){return this.element;},option:function(b,c){var d=b,e,f,g;if(arguments.length===0)return a.widget.extend({},this.options);if(typeof b==="string"){d={};e=b.split(".");b=e.shift();if(e.length){f=d[b]=a.widget.extend({},this.options[b]);for(g=0;g<e.length-1;g++){f[e[g]]=f[e[g]]||{};f=f[e[g]];}b=e.pop();if(arguments.length===1)return f[b]===undefined?null:f[b];f[b]=c;}else{if(arguments.length===1)return this.options[b]===undefined?null:this.options[b];d[b]=c;}}this._setOptions(d);return this;},_setOptions:function(a){var b;for(b in a)this._setOption(b,a[b]);return this;},_setOption:function(a,b){this.options[a]=b;if(a==="disabled"){this.widget().toggleClass(this.widgetFullName+"-disabled",!!b);if(b){this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");}}return this;},enable:function(){return this._setOptions({disabled:false});},disable:function(){return this._setOptions({disabled:true});},_on:function(b,c,d){var e,f=this;if(typeof b!=="boolean"){d=c;c=b;b=false;}if(!d){d=c;c=this.element;e=this.widget();}else{c=e=a(c);this.bindings=this.bindings.add(c);}a.each(d,function(d,g){function h(){if(!b&&(f.options.disabled===true||a(this).hasClass("ui-state-disabled")))return;return(typeof g==="string"?f[g]:g).apply(f,arguments);}if(typeof g!=="string")h.guid=g.guid=g.guid||h.guid||a.guid++;var i=d.match(/^([\w:-]*)\s*(.*)$/),j=i[1]+f.eventNamespace,k=i[2];if(k)e.delegate(k,j,h);else c.bind(j,h);});},_off:function(b,c){c=(c||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;b.unbind(c).undelegate(c);this.bindings=a(this.bindings.not(b).get());this.focusable=a(this.focusable.not(b).get());this.hoverable=a(this.hoverable.not(b).get());},_delay:function(a,b){function c(){return(typeof a==="string"?d[a]:a).apply(d,arguments);}var d=this;return setTimeout(c,b||0);},_hoverable:function(b){this.hoverable=this.hoverable.add(b);this._on(b,{mouseenter:function(b){a(b.currentTarget).addClass("ui-state-hover");},mouseleave:function(b){a(b.currentTarget).removeClass("ui-state-hover");}});},_focusable:function(b){this.focusable=this.focusable.add(b);this._on(b,{focusin:function(b){a(b.currentTarget).addClass("ui-state-focus");},focusout:function(b){a(b.currentTarget).removeClass("ui-state-focus");}});},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{};c=a.Event(c);c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();c.target=this.element[0];f=c.originalEvent;if(f)for(e in f)if(!(e in c))c[e]=f[e];this.element.trigger(c,d);return !(a.isFunction(g)&&g.apply(this.element[0],[c].concat(d))===false||c.isDefaultPrevented());}};a.each({show:"fadeIn",hide:"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){if(typeof e==="string")e={effect:e};var g,h=!e?b:e===true||typeof e==="number"?c:e.effect||c;e=e||{};if(typeof e==="number")e={duration:e};g=!a.isEmptyObject(e);e.complete=f;if(e.delay)d.delay(e.delay);if(g&&a.effects&&a.effects.effect[h])d[b](e);else if(h!==b&&d[h])d[h](e.duration,e.easing,f);else d.queue(function(c){a(this)[b]();if(f)f.call(d[0]);c();});};});var f=a.widget;var g=false;a(document).mouseup(function(){g=false;});var h=a.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a);}).bind("click."+this.widgetName,function(c){if(true===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false;}});this.started=false;},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);if(this._mouseMoveDelegate)this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);},_mouseDown:function(b){if(g)return;this._mouseMoved=false;(this._mouseStarted&&this._mouseUp(b));this._mouseDownEvent=b;var c=this,d=(b.which===1),e=(typeof this.options.cancel==="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:false);if(!d||e||!this._mouseCapture(b))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true;},this.options.delay);if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=(this._mouseStart(b)!==false);if(!this._mouseStarted){b.preventDefault();return true;}}if(true===a.data(b.target,this.widgetName+".preventClickEvent"))a.removeData(b.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(a){return c._mouseMove(a);};this._mouseUpDelegate=function(a){return c._mouseUp(a);};this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.preventDefault();g=true;return true;},_mouseMove:function(b){if(this._mouseMoved)if(a.ui.ie&&(!document.documentMode||document.documentMode<9)&&!b.button)return this._mouseUp(b);else if(!b.which)return this._mouseUp(b);if(b.which||b.button)this._mouseMoved=true;if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault();}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,b)!==false);(this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));}return !this._mouseStarted;},_mouseUp:function(b){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(b.target===this._mouseDownEvent.target)a.data(b.target,this.widgetName+".preventClickEvent",true);this._mouseStop(b);}g=false;return false;},_mouseDistanceMet:function(a){return(Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance);},_mouseDelayMet:function(){return this.mouseDelayMet;},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true;}});(function(){a.ui=a.ui||{};var b,c,d=Math.max,e=Math.abs,f=Math.round,g=/left|center|right/,h=/top|center|bottom/,i=/[\+\-]\d+(\.[\d]+)?%?/,j=/^\w+/,k=/%$/,l=a.fn.position;function m(a,b,c){return [parseFloat(a[0])*(k.test(a[0])?b/100:1),parseFloat(a[1])*(k.test(a[1])?c/100:1)];}function n(b,c){return parseInt(a.css(b,c),10)||0;}function o(b){var c=b[0];if(c.nodeType===9)return{width:b.width(),height:b.height(),offset:{top:0,left:0}};if(a.isWindow(c))return{width:b.width(),height:b.height(),offset:{top:b.scrollTop(),left:b.scrollLeft()}};if(c.preventDefault)return{width:0,height:0,offset:{top:c.pageY,left:c.pageX}};return{width:b.outerWidth(),height:b.outerHeight(),offset:b.offset()};}a.position={scrollbarWidth:function(){if(b!==undefined)return b;var c,d,e=a("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),f=e.children()[0];a("body").append(e);c=f.offsetWidth;e.css("overflow","scroll");d=f.offsetWidth;if(c===d)d=e[0].clientWidth;e.remove();return(b=c-d);},getScrollInfo:function(b){var c=b.isWindow||b.isDocument?"":b.element.css("overflow-x"),d=b.isWindow||b.isDocument?"":b.element.css("overflow-y"),e=c==="scroll"||(c==="auto"&&b.width<b.element[0].scrollWidth),f=d==="scroll"||(d==="auto"&&b.height<b.element[0].scrollHeight);return{width:f?a.position.scrollbarWidth():0,height:e?a.position.scrollbarWidth():0};},getWithinInfo:function(b){var c=a(b||window),d=a.isWindow(c[0]),e=!!c[0]&&c[0].nodeType===9;return{element:c,isWindow:d,isDocument:e,offset:c.offset()||{left:0,top:0},scrollLeft:c.scrollLeft(),scrollTop:c.scrollTop(),width:d||e?c.width():c.outerWidth(),height:d||e?c.height():c.outerHeight()};}};a.fn.position=function(b){if(!b||!b.of)return l.apply(this,arguments);b=a.extend({},b);var k,p,q,r,s,t,u=a(b.of),v=a.position.getWithinInfo(b.within),w=a.position.getScrollInfo(v),x=(b.collision||"flip").split(" "),y={};t=o(u);if(u[0].preventDefault)b.at="left top";p=t.width;q=t.height;r=t.offset;s=a.extend({},r);a.each(["my","at"],function(){var a=(b[this]||"").split(" "),c,d;if(a.length===1)a=g.test(a[0])?a.concat(["center"]):h.test(a[0])?["center"].concat(a):["center","center"];a[0]=g.test(a[0])?a[0]:"center";a[1]=h.test(a[1])?a[1]:"center";c=i.exec(a[0]);d=i.exec(a[1]);y[this]=[c?c[0]:0,d?d[0]:0];b[this]=[j.exec(a[0])[0],j.exec(a[1])[0]];});if(x.length===1)x[1]=x[0];if(b.at[0]==="right")s.left+=p;else if(b.at[0]==="center")s.left+=p/2;if(b.at[1]==="bottom")s.top+=q;else if(b.at[1]==="center")s.top+=q/2;k=m(y.at,p,q);s.left+=k[0];s.top+=k[1];return this.each(function(){var g,h,i=a(this),j=i.outerWidth(),l=i.outerHeight(),o=n(this,"marginLeft"),t=n(this,"marginTop"),z=j+o+n(this,"marginRight")+w.width,A=l+t+n(this,"marginBottom")+w.height,B=a.extend({},s),C=m(y.my,i.outerWidth(),i.outerHeight());if(b.my[0]==="right")B.left-=j;else if(b.my[0]==="center")B.left-=j/2;if(b.my[1]==="bottom")B.top-=l;else if(b.my[1]==="center")B.top-=l/2;B.left+=C[0];B.top+=C[1];if(!c){B.left=f(B.left);B.top=f(B.top);}g={marginLeft:o,marginTop:t};a.each(["left","top"],function(c,d){if(a.ui.position[x[c]])a.ui.position[x[c]][d](B,{targetWidth:p,targetHeight:q,elemWidth:j,elemHeight:l,collisionPosition:g,collisionWidth:z,collisionHeight:A,offset:[k[0]+C[0],k[1]+C[1]],my:b.my,at:b.at,within:v,elem:i});});if(b.using)h=function(a){var c=r.left-B.left,f=c+p-j,g=r.top-B.top,h=g+q-l,k={target:{element:u,left:r.left,top:r.top,width:p,height:q},element:{element:i,left:B.left,top:B.top,width:j,height:l},horizontal:f<0?"left":c>0?"right":"center",vertical:h<0?"top":g>0?"bottom":"middle"};if(p<j&&e(c+f)<p)k.horizontal="center";if(q<l&&e(g+h)<q)k.vertical="middle";if(d(e(c),e(f))>d(e(g),e(h)))k.important="horizontal";else k.important="vertical";b.using.call(this,a,k);};i.offset(a.extend(B,{using:h}));});};a.ui.position={fit:{left:function(a,b){var c=b.within,e=c.isWindow?c.scrollLeft:c.offset.left,f=c.width,g=a.left-b.collisionPosition.marginLeft,h=e-g,i=g+b.collisionWidth-f-e,j;if(b.collisionWidth>f)if(h>0&&i<=0){j=a.left+h+b.collisionWidth-f-e;a.left+=h-j;}else if(i>0&&h<=0)a.left=e;else if(h>i)a.left=e+f-b.collisionWidth;else a.left=e;else if(h>0)a.left+=h;else if(i>0)a.left-=i;else a.left=d(a.left-g,a.left);},top:function(a,b){var c=b.within,e=c.isWindow?c.scrollTop:c.offset.top,f=b.within.height,g=a.top-b.collisionPosition.marginTop,h=e-g,i=g+b.collisionHeight-f-e,j;if(b.collisionHeight>f)if(h>0&&i<=0){j=a.top+h+b.collisionHeight-f-e;a.top+=h-j;}else if(i>0&&h<=0)a.top=e;else if(h>i)a.top=e+f-b.collisionHeight;else a.top=e;else if(h>0)a.top+=h;else if(i>0)a.top-=i;else a.top=d(a.top-g,a.top);}},flip:{left:function(a,b){var c=b.within,d=c.offset.left+c.scrollLeft,f=c.width,g=c.isWindow?c.scrollLeft:c.offset.left,h=a.left-b.collisionPosition.marginLeft,i=h-g,j=h+b.collisionWidth-f-g,k=b.my[0]==="left"?-b.elemWidth:b.my[0]==="right"?b.elemWidth:0,l=b.at[0]==="left"?b.targetWidth:b.at[0]==="right"?-b.targetWidth:0,m=-2*b.offset[0],n,o;if(i<0){n=a.left+k+l+m+b.collisionWidth-f-d;if(n<0||n<e(i))a.left+=k+l+m;}else if(j>0){o=a.left-b.collisionPosition.marginLeft+k+l+m-g;if(o>0||e(o)<j)a.left+=k+l+m;}},top:function(a,b){var c=b.within,d=c.offset.top+c.scrollTop,f=c.height,g=c.isWindow?c.scrollTop:c.offset.top,h=a.top-b.collisionPosition.marginTop,i=h-g,j=h+b.collisionHeight-f-g,k=b.my[1]==="top",l=k?-b.elemHeight:b.my[1]==="bottom"?b.elemHeight:0,m=b.at[1]==="top"?b.targetHeight:b.at[1]==="bottom"?-b.targetHeight:0,n=-2*b.offset[1],o,p;if(i<0){p=a.top+l+m+n+b.collisionHeight-f-d;if(p<0||p<e(i))a.top+=l+m+n;}else if(j>0){o=a.top-b.collisionPosition.marginTop+l+m+n-g;if(o>0||e(o)<j)a.top+=l+m+n;}}},flipfit:{left:function(){a.ui.position.flip.left.apply(this,arguments);a.ui.position.fit.left.apply(this,arguments);},top:function(){a.ui.position.flip.top.apply(this,arguments);a.ui.position.fit.top.apply(this,arguments);}}};(function(){var b,d,e,f,g,h=document.getElementsByTagName("body")[0],i=document.createElement("div");b=document.createElement(h?"div":"body");e={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(h)a.extend(e,{position:"absolute",left:"-1000px",top:"-1000px"});for(g in e)b.style[g]=e[g];b.appendChild(i);d=h||document.documentElement;d.insertBefore(b,d.firstChild);i.style.cssText="position: absolute; left: 10.7432222px;";f=a(i).offset().left;c=f>10&&f<11;b.innerHTML="";d.removeChild(b);})();})();var i=a.ui.position;a.widget("ui.draggable",a.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original")this._setPositionRelative();if(this.options.addClasses)this.element.addClass("ui-draggable");if(this.options.disabled)this.element.addClass("ui-draggable-disabled");this._setHandleClassName();this._mouseInit();},_setOption:function(a,b){this._super(a,b);if(a==="handle"){this._removeHandleClassName();this._setHandleClassName();}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return;}this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._removeHandleClassName();this._mouseDestroy();},_mouseCapture:function(b){var c=this.options;this._blurActiveElement(b);if(this.helper||c.disabled||a(b.target).closest(".ui-resizable-handle").length>0)return false;this.handle=this._getHandle(b);if(!this.handle)return false;this._blockFrames(c.iframeFix===true?"iframe":c.iframeFix);return true;},_blockFrames:function(b){this.iframeBlocks=this.document.find(b).map(function(){var b=a(this);return a("<div>").css("position","absolute").appendTo(b.parent()).outerWidth(b.outerWidth()).outerHeight(b.outerHeight()).offset(b.offset())[0];});},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks;}},_blurActiveElement:function(b){var c=this.document[0];if(!this.handleElement.is(b.target))return;try{if(c.activeElement&&c.activeElement.nodeName.toLowerCase()!=="body")a(c.activeElement).blur();}catch(d){}},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this.helper.addClass("ui-draggable-dragging");this._cacheHelperProportions();if(a.ui.ddmanager)a.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return a(this).css("position")==="fixed";}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(b);this.originalPosition=this.position=this._generatePosition(b,false);this.originalPageX=b.pageX;this.originalPageY=b.pageY;(c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt));this._setContainment();if(this._trigger("start",b)===false){this._clear();return false;}this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour)a.ui.ddmanager.prepareOffsets(this,b);this._normalizeRightBottom();this._mouseDrag(b,true);if(a.ui.ddmanager)a.ui.ddmanager.dragStart(this,b);return true;},_refreshOffsets:function(a){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:a.pageX-this.offset.left,top:a.pageY-this.offset.top};},_mouseDrag:function(b,c){if(this.hasFixedAncestor)this.offset.parent=this._getParentOffset();this.position=this._generatePosition(b,true);this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===false){this._mouseUp({});return false;}this.position=d.position;}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(a.ui.ddmanager)a.ui.ddmanager.drag(this,b);return false;},_mouseStop:function(b){var c=this,d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour)d=a.ui.ddmanager.drop(this,b);if(this.dropped){d=this.dropped;this.dropped=false;}if((this.options.revert==="invalid"&&!d)||(this.options.revert==="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(c._trigger("stop",b)!==false)c._clear();});}else if(this._trigger("stop",b)!==false)this._clear();return false;},_mouseUp:function(b){this._unblockFrames();if(a.ui.ddmanager)a.ui.ddmanager.dragStop(this,b);if(this.handleElement.is(b.target))this.element.focus();return a.ui.mouse.prototype._mouseUp.call(this,b);},cancel:function(){if(this.helper.is(".ui-draggable-dragging"))this._mouseUp({});else this._clear();return this;},_getHandle:function(b){return this.options.handle?!!a(b.target).closest(this.element.find(this.options.handle)).length:true;},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this.handleElement.addClass("ui-draggable-handle");},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle");},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper),e=d?a(c.helper.apply(this.element[0],[b])):(c.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!e.parents("body").length)e.appendTo((c.appendTo==="parent"?this.element[0].parentNode:c.appendTo));if(d&&e[0]===this.element[0])this._setPositionRelative();if(e[0]!==this.element[0]&&!(/(fixed|absolute)/).test(e.css("position")))e.css("position","absolute");return e;},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position")))this.element[0].style.position="relative";},_adjustOffsetFromHelper:function(b){if(typeof b==="string")b=b.split(" ");if(a.isArray(b))b={left:+b[0],top:+b[1]||0};if("left" in b)this.offset.click.left=b.left+this.margins.left;if("right" in b)this.offset.click.left=this.helperProportions.width-b.right+this.margins.left;if("top" in b)this.offset.click.top=b.top+this.margins.top;if("bottom" in b)this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top;},_isRootNode:function(a){return(/(html|body)/i).test(a.tagName)||a===this.document[0];},_getParentOffset:function(){var b=this.offsetParent.offset(),c=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==c&&a.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop();}if(this._isRootNode(this.offsetParent[0]))b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition!=="relative")return{top:0,left:0};var a=this.element.position(),b=this._isRootNode(this.scrollParent[0]);return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+(!b?this.scrollParent.scrollTop():0),left:a.left-(parseInt(this.helper.css("left"),10)||0)+(!b?this.scrollParent.scrollLeft():0)};},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var b,c,d,e=this.options,f=this.document[0];this.relativeContainer=null;if(!e.containment){this.containment=null;return;}if(e.containment==="window"){this.containment=[a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,a(window).scrollLeft()+a(window).width()-this.helperProportions.width-this.margins.left,a(window).scrollTop()+(a(window).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return;}if(e.containment==="document"){this.containment=[0,0,a(f).width()-this.helperProportions.width-this.margins.left,(a(f).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return;}if(e.containment.constructor===Array){this.containment=e.containment;return;}if(e.containment==="parent")e.containment=this.helper[0].parentNode;c=a(e.containment);d=c[0];if(!d)return;b=/(scroll|auto)/.test(c.css("overflow"));this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(b?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(b?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=c;},_convertPositionTo:function(a,b){if(!b)b=this.position;var c=a==="absolute"?1:-1,d=this._isRootNode(this.scrollParent[0]);return{top:(b.top+this.offset.relative.top*c+this.offset.parent.top*c-((this.cssPosition==="fixed"?-this.offset.scroll.top:(d?0:this.offset.scroll.top))*c)),left:(b.left+this.offset.relative.left*c+this.offset.parent.left*c-((this.cssPosition==="fixed"?-this.offset.scroll.left:(d?0:this.offset.scroll.left))*c))};},_generatePosition:function(a,b){var c,d,e,f,g=this.options,h=this._isRootNode(this.scrollParent[0]),i=a.pageX,j=a.pageY;if(!h||!this.offset.scroll)this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()};if(b){if(this.containment){if(this.relativeContainer){d=this.relativeContainer.offset();c=[this.containment[0]+d.left,this.containment[1]+d.top,this.containment[2]+d.left,this.containment[3]+d.top];}else c=this.containment;if(a.pageX-this.offset.click.left<c[0])i=c[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<c[1])j=c[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>c[2])i=c[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>c[3])j=c[3]+this.offset.click.top;}if(g.grid){e=g.grid[1]?this.originalPageY+Math.round((j-this.originalPageY)/g.grid[1])*g.grid[1]:this.originalPageY;j=c?((e-this.offset.click.top>=c[1]||e-this.offset.click.top>c[3])?e:((e-this.offset.click.top>=c[1])?e-g.grid[1]:e+g.grid[1])):e;f=g.grid[0]?this.originalPageX+Math.round((i-this.originalPageX)/g.grid[0])*g.grid[0]:this.originalPageX;i=c?((f-this.offset.click.left>=c[0]||f-this.offset.click.left>c[2])?f:((f-this.offset.click.left>=c[0])?f-g.grid[0]:f+g.grid[0])):f;}if(g.axis==="y")i=this.originalPageX;if(g.axis==="x")j=this.originalPageY;}return{top:(j-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:(h?0:this.offset.scroll.top))),left:(i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:(h?0:this.offset.scroll.left)))};},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval)this.helper.remove();this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear)this.destroy();},_normalizeRightBottom:function(){if(this.options.axis!=="y"&&this.helper.css("right")!=="auto"){this.helper.width(this.helper.width());this.helper.css("right","auto");}if(this.options.axis!=="x"&&this.helper.css("bottom")!=="auto"){this.helper.height(this.helper.height());this.helper.css("bottom","auto");}},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d,this],true);if(/^(drag|start|stop)/.test(b)){this.positionAbs=this._convertPositionTo("absolute");d.offset=this.positionAbs;}return a.Widget.prototype._trigger.call(this,b,c,d);},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs};}});a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c,d){var e=a.extend({},c,{item:d.element});d.sortables=[];a(d.options.connectToSortable).each(function(){var c=a(this).sortable("instance");if(c&&!c.options.disabled){d.sortables.push(c);c.refreshPositions();c._trigger("activate",b,e);}});},stop:function(b,c,d){var e=a.extend({},c,{item:d.element});d.cancelHelperRemoval=false;a.each(d.sortables,function(){var a=this;if(a.isOver){a.isOver=0;d.cancelHelperRemoval=true;a.cancelHelperRemoval=false;a._storedCSS={position:a.placeholder.css("position"),top:a.placeholder.css("top"),left:a.placeholder.css("left")};a._mouseStop(b);a.options.helper=a.options._helper;}else{a.cancelHelperRemoval=true;a._trigger("deactivate",b,e);}});},drag:function(b,c,d){a.each(d.sortables,function(){var e=false,f=this;f.positionAbs=d.positionAbs;f.helperProportions=d.helperProportions;f.offset.click=d.offset.click;if(f._intersectsWith(f.containerCache)){e=true;a.each(d.sortables,function(){this.positionAbs=d.positionAbs;this.helperProportions=d.helperProportions;this.offset.click=d.offset.click;if(this!==f&&this._intersectsWith(this.containerCache)&&a.contains(f.element[0],this.element[0]))e=false;return e;});}if(e){if(!f.isOver){f.isOver=1;d._parent=c.helper.parent();f.currentItem=c.helper.appendTo(f.element).data("ui-sortable-item",true);f.options._helper=f.options.helper;f.options.helper=function(){return c.helper[0];};b.target=f.currentItem[0];f._mouseCapture(b,true);f._mouseStart(b,true,true);f.offset.click.top=d.offset.click.top;f.offset.click.left=d.offset.click.left;f.offset.parent.left-=d.offset.parent.left-f.offset.parent.left;f.offset.parent.top-=d.offset.parent.top-f.offset.parent.top;d._trigger("toSortable",b);d.dropped=f.element;a.each(d.sortables,function(){this.refreshPositions();});d.currentItem=d.element;f.fromOutside=d;}if(f.currentItem){f._mouseDrag(b);c.position=f.position;}}else if(f.isOver){f.isOver=0;f.cancelHelperRemoval=true;f.options._revert=f.options.revert;f.options.revert=false;f._trigger("out",b,f._uiHash(f));f._mouseStop(b,true);f.options.revert=f.options._revert;f.options.helper=f.options._helper;if(f.placeholder)f.placeholder.remove();c.helper.appendTo(d._parent);d._refreshOffsets(b);c.position=d._generatePosition(b,true);d._trigger("fromSortable",b);d.dropped=false;a.each(d.sortables,function(){this.refreshPositions();});}});}});a.ui.plugin.add("draggable","cursor",{start:function(b,c,d){var e=a("body"),f=d.options;if(e.css("cursor"))f._cursor=e.css("cursor");e.css("cursor",f.cursor);},stop:function(b,c,d){var e=d.options;if(e._cursor)a("body").css("cursor",e._cursor);}});a.ui.plugin.add("draggable","opacity",{start:function(b,c,d){var e=a(c.helper),f=d.options;if(e.css("opacity"))f._opacity=e.css("opacity");e.css("opacity",f.opacity);},stop:function(b,c,d){var e=d.options;if(e._opacity)a(c.helper).css("opacity",e._opacity);}});a.ui.plugin.add("draggable","scroll",{start:function(a,b,c){if(!c.scrollParentNotHidden)c.scrollParentNotHidden=c.helper.scrollParent(false);if(c.scrollParentNotHidden[0]!==c.document[0]&&c.scrollParentNotHidden[0].tagName!=="HTML")c.overflowOffset=c.scrollParentNotHidden.offset();},drag:function(b,c,d){var e=d.options,f=false,g=d.scrollParentNotHidden[0],h=d.document[0];if(g!==h&&g.tagName!=="HTML"){if(!e.axis||e.axis!=="x")if((d.overflowOffset.top+g.offsetHeight)-b.pageY<e.scrollSensitivity)g.scrollTop=f=g.scrollTop+e.scrollSpeed;else if(b.pageY-d.overflowOffset.top<e.scrollSensitivity)g.scrollTop=f=g.scrollTop-e.scrollSpeed;if(!e.axis||e.axis!=="y")if((d.overflowOffset.left+g.offsetWidth)-b.pageX<e.scrollSensitivity)g.scrollLeft=f=g.scrollLeft+e.scrollSpeed;else if(b.pageX-d.overflowOffset.left<e.scrollSensitivity)g.scrollLeft=f=g.scrollLeft-e.scrollSpeed;}else{if(!e.axis||e.axis!=="x")if(b.pageY-a(h).scrollTop()<e.scrollSensitivity)f=a(h).scrollTop(a(h).scrollTop()-e.scrollSpeed);else if(a(window).height()-(b.pageY-a(h).scrollTop())<e.scrollSensitivity)f=a(h).scrollTop(a(h).scrollTop()+e.scrollSpeed);if(!e.axis||e.axis!=="y")if(b.pageX-a(h).scrollLeft()<e.scrollSensitivity)f=a(h).scrollLeft(a(h).scrollLeft()-e.scrollSpeed);else if(a(window).width()-(b.pageX-a(h).scrollLeft())<e.scrollSensitivity)f=a(h).scrollLeft(a(h).scrollLeft()+e.scrollSpeed);}if(f!==false&&a.ui.ddmanager&&!e.dropBehaviour)a.ui.ddmanager.prepareOffsets(d,b);}});a.ui.plugin.add("draggable","snap",{start:function(b,c,d){var e=d.options;d.snapElements=[];a(e.snap.constructor!==String?(e.snap.items||":data(ui-draggable)"):e.snap).each(function(){var b=a(this),c=b.offset();if(this!==d.element[0])d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left});});},drag:function(b,c,d){var e,f,g,h,i,j,k,l,m,n,o=d.options,p=o.snapTolerance,q=c.offset.left,r=q+d.helperProportions.width,s=c.offset.top,t=s+d.helperProportions.height;for(m=d.snapElements.length-1;m>=0;m--){i=d.snapElements[m].left-d.margins.left;j=i+d.snapElements[m].width;k=d.snapElements[m].top-d.margins.top;l=k+d.snapElements[m].height;if(r<i-p||q>j+p||t<k-p||s>l+p||!a.contains(d.snapElements[m].item.ownerDocument,d.snapElements[m].item)){if(d.snapElements[m].snapping)(d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})));d.snapElements[m].snapping=false;continue;}if(o.snapMode!=="inner"){e=Math.abs(k-t)<=p;f=Math.abs(l-s)<=p;g=Math.abs(i-r)<=p;h=Math.abs(j-q)<=p;if(e)c.position.top=d._convertPositionTo("relative",{top:k-d.helperProportions.height,left:0}).top;if(f)c.position.top=d._convertPositionTo("relative",{top:l,left:0}).top;if(g)c.position.left=d._convertPositionTo("relative",{top:0,left:i-d.helperProportions.width}).left;if(h)c.position.left=d._convertPositionTo("relative",{top:0,left:j}).left;}n=(e||f||g||h);if(o.snapMode!=="outer"){e=Math.abs(k-s)<=p;f=Math.abs(l-t)<=p;g=Math.abs(i-q)<=p;h=Math.abs(j-r)<=p;if(e)c.position.top=d._convertPositionTo("relative",{top:k,left:0}).top;if(f)c.position.top=d._convertPositionTo("relative",{top:l-d.helperProportions.height,left:0}).top;if(g)c.position.left=d._convertPositionTo("relative",{top:0,left:i}).left;if(h)c.position.left=d._convertPositionTo("relative",{top:0,left:j-d.helperProportions.width}).left;}if(!d.snapElements[m].snapping&&(e||f||g||h||n))(d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})));d.snapElements[m].snapping=(e||f||g||h||n);}}});a.ui.plugin.add("draggable","stack",{start:function(b,c,d){var e,f=d.options,g=a.makeArray(a(f.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0);});if(!g.length)return;e=parseInt(a(g[0]).css("zIndex"),10)||0;a(g).each(function(b){a(this).css("zIndex",e+b);});this.css("zIndex",(e+g.length));}});a.ui.plugin.add("draggable","zIndex",{start:function(b,c,d){var e=a(c.helper),f=d.options;if(e.css("zIndex"))f._zIndex=e.css("zIndex");e.css("zIndex",f.zIndex);},stop:function(b,c,d){var e=d.options;if(e._zIndex)a(c.helper).css("zIndex",e._zIndex);}});var j=a.ui.draggable;a.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var b,c=this.options,d=c.accept;this.isover=false;this.isout=true;this.accept=a.isFunction(d)?d:function(a){return a.is(d);};this.proportions=function(){if(arguments.length)b=arguments[0];else return b?b:b={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};};this._addToManager(c.scope);c.addClasses&&this.element.addClass("ui-droppable");},_addToManager:function(b){a.ui.ddmanager.droppables[b]=a.ui.ddmanager.droppables[b]||[];a.ui.ddmanager.droppables[b].push(this);},_splice:function(a){var b=0;for(;b<a.length;b++)if(a[b]===this)a.splice(b,1);},_destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];this._splice(b);this.element.removeClass("ui-droppable ui-droppable-disabled");},_setOption:function(b,c){if(b==="accept")this.accept=a.isFunction(c)?c:function(a){return a.is(c);};else if(b==="scope"){var d=a.ui.ddmanager.droppables[this.options.scope];this._splice(d);this._addToManager(c);}this._super(b,c);},_activate:function(b){var c=a.ui.ddmanager.current;if(this.options.activeClass)this.element.addClass(this.options.activeClass);if(c)this._trigger("activate",b,this.ui(c));},_deactivate:function(b){var c=a.ui.ddmanager.current;if(this.options.activeClass)this.element.removeClass(this.options.activeClass);if(c)this._trigger("deactivate",b,this.ui(c));},_over:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]===this.element[0])return;if(this.accept.call(this.element[0],(c.currentItem||c.element))){if(this.options.hoverClass)this.element.addClass(this.options.hoverClass);this._trigger("over",b,this.ui(c));}},_out:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]===this.element[0])return;if(this.accept.call(this.element[0],(c.currentItem||c.element))){if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass);this._trigger("out",b,this.ui(c));}},_drop:function(b,c){var d=c||a.ui.ddmanager.current,e=false;if(!d||(d.currentItem||d.element)[0]===this.element[0])return false;this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var c=a(this).droppable("instance");if(c.options.greedy&&!c.options.disabled&&c.options.scope===d.options.scope&&c.accept.call(c.element[0],(d.currentItem||d.element))&&a.ui.intersect(d,a.extend(c,{offset:c.element.offset()}),c.options.tolerance,b)){e=true;return false;}});if(e)return false;if(this.accept.call(this.element[0],(d.currentItem||d.element))){if(this.options.activeClass)this.element.removeClass(this.options.activeClass);if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass);this._trigger("drop",b,this.ui(d));return this.element;}return false;},ui:function(a){return{draggable:(a.currentItem||a.element),helper:a.helper,position:a.position,offset:a.positionAbs};}});a.ui.intersect=(function(){function a(a,b,c){return(a>=b)&&(a<(b+c));}return function(b,c,d,e){if(!c.offset)return false;var f=(b.positionAbs||b.position.absolute).left+b.margins.left,g=(b.positionAbs||b.position.absolute).top+b.margins.top,h=f+b.helperProportions.width,i=g+b.helperProportions.height,j=c.offset.left,k=c.offset.top,l=j+c.proportions().width,m=k+c.proportions().height;switch(d){case "fit":return(j<=f&&h<=l&&k<=g&&i<=m);case "intersect":return(j<f+(b.helperProportions.width/2)&&h-(b.helperProportions.width/2)<l&&k<g+(b.helperProportions.height/2)&&i-(b.helperProportions.height/2)<m);case "pointer":return a(e.pageY,k,c.proportions().height)&&a(e.pageX,j,c.proportions().width);case "touch":return((g>=k&&g<=m)||(i>=k&&i<=m)||(g<k&&i>m))&&((f>=j&&f<=l)||(h>=j&&h<=l)||(f<j&&h>l));default:return false;}};})();a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d,e,f=a.ui.ddmanager.droppables[b.options.scope]||[],g=c?c.type:null,h=(b.currentItem||b.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(d=0;d<f.length;d++){if(f[d].options.disabled||(b&&!f[d].accept.call(f[d].element[0],(b.currentItem||b.element))))continue;for(e=0;e<h.length;e++)if(h[e]===f[d].element[0]){f[d].proportions().height=0;continue droppablesLoop;}f[d].visible=f[d].element.css("display")!=="none";if(!f[d].visible)continue;if(g==="mousedown")f[d]._activate.call(f[d],c);f[d].offset=f[d].element.offset();f[d].proportions({width:f[d].element[0].offsetWidth,height:f[d].element[0].offsetHeight});}},drop:function(b,c){var d=false;a.each((a.ui.ddmanager.droppables[b.options.scope]||[]).slice(),function(){if(!this.options)return;if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance,c))d=this._drop.call(this,c)||d;if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(b.currentItem||b.element))){this.isout=true;this.isover=false;this._deactivate.call(this,c);}});return d;},dragStart:function(b,c){b.element.parentsUntil("body").bind("scroll.droppable",function(){if(!b.options.refreshPositions)a.ui.ddmanager.prepareOffsets(b,c);});},drag:function(b,c){if(b.options.refreshPositions)a.ui.ddmanager.prepareOffsets(b,c);a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var d,e,f,g=a.ui.intersect(b,this,this.options.tolerance,c),h=!g&&this.isover?"isout":(g&&!this.isover?"isover":null);if(!h)return;if(this.options.greedy){e=this.options.scope;f=this.element.parents(":data(ui-droppable)").filter(function(){return a(this).droppable("instance").options.scope===e;});if(f.length){d=a(f[0]).droppable("instance");d.greedyChild=(h==="isover");}}if(d&&h==="isover"){d.isover=false;d.isout=true;d._out.call(d,c);}this[h]=true;this[h==="isout"?"isover":"isout"]=false;this[h==="isover"?"_over":"_out"].call(this,c);if(d&&h==="isout"){d.isout=false;d.isover=true;d._over.call(d,c);}});},dragStop:function(b,c){b.element.parentsUntil("body").unbind("scroll.droppable");if(!b.options.refreshPositions)a.ui.ddmanager.prepareOffsets(b,c);}};var k=a.ui.droppable;a.widget("ui.resizable",a.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(a){return parseInt(a,10)||0;},_isNumber:function(a){return !isNaN(parseInt(a,10));},_hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return false;var d=(c&&c==="left")?"scrollLeft":"scrollTop",e=false;if(b[d]>0)return true;b[d]=1;e=(b[d]>0);b[d]=0;return e;},_create:function(){var b,c,d,e,f,g=this,h=this.options;this.element.addClass("ui-resizable");a.extend(this,{_aspectRatio:!!(h.aspectRatio),aspectRatio:h.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:h.helper||h.ghost||h.animate?h.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap(a("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize();}this.handles=h.handles||(!a(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});this._handles=a();if(this.handles.constructor===String){if(this.handles==="all")this.handles="n,e,s,w,se,sw,ne,nw";b=this.handles.split(",");this.handles={};for(c=0;c<b.length;c++){d=a.trim(b[c]);f="ui-resizable-"+d;e=a("<div class='ui-resizable-handle "+f+"'></div>");e.css({zIndex:h.zIndex});if("se"===d)e.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[d]=".ui-resizable-"+d;this.element.append(e);}}this._renderAxis=function(b){var c,d,e,f;b=b||this.element;for(c in this.handles){if(this.handles[c].constructor===String)this.handles[c]=this.element.children(this.handles[c]).first().show();else if(this.handles[c].jquery||this.handles[c].nodeType){this.handles[c]=a(this.handles[c]);this._on(this.handles[c],{"mousedown":g._mouseDown});}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){d=a(this.handles[c],this.element);f=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();e=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(e,f);this._proportionallyResize();}this._handles=this._handles.add(this.handles[c]);}};this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.mouseover(function(){if(!g.resizing){if(this.className)e=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);g.axis=e&&e[1]?e[1]:"se";}});if(h.autoHide){this._handles.hide();a(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(h.disabled)return;a(this).removeClass("ui-resizable-autohide");g._handles.show();}).mouseleave(function(){if(h.disabled)return;if(!g.resizing){a(this).addClass("ui-resizable-autohide");g._handles.hide();}});}this._mouseInit();},_destroy:function(){this._mouseDestroy();var b,c=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove();};if(this.elementIsWrapper){c(this.element);b=this.element;this.originalElement.css({position:b.css("position"),width:b.outerWidth(),height:b.outerHeight(),top:b.css("top"),left:b.css("left")}).insertAfter(b);b.remove();}this.originalElement.css("resize",this.originalResizeStyle);c(this.originalElement);return this;},_mouseCapture:function(b){var c,d,e=false;for(c in this.handles){d=a(this.handles[c])[0];if(d===b.target||a.contains(d,b.target))e=true;}return !this.options.disabled&&e;},_mouseStart:function(b){var c,d,e,f=this.options,g=this.element;this.resizing=true;this._renderProxy();c=this._num(this.helper.css("left"));d=this._num(this.helper.css("top"));if(f.containment){c+=a(f.containment).scrollLeft()||0;d+=a(f.containment).scrollTop()||0;}this.offset=this.helper.offset();this.position={left:c,top:d};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:g.width(),height:g.height()};this.originalSize=this._helper?{width:g.outerWidth(),height:g.outerHeight()}:{width:g.width(),height:g.height()};this.sizeDiff={width:g.outerWidth()-g.width(),height:g.outerHeight()-g.height()};this.originalPosition={left:c,top:d};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=(typeof f.aspectRatio==="number")?f.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);e=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",e==="auto"?this.axis+"-resize":e);g.addClass("ui-resizable-resizing");this._propagate("start",b);return true;},_mouseDrag:function(b){var c,d,e=this.originalMousePosition,f=this.axis,g=(b.pageX-e.left)||0,h=(b.pageY-e.top)||0,i=this._change[f];this._updatePrevProperties();if(!i)return false;c=i.apply(this,[b,g,h]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._updateCache(c);this._propagate("resize",b);d=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length)this._proportionallyResize();if(!a.isEmptyObject(d)){this._updatePrevProperties();this._trigger("resize",b,this.ui());this._applyChanges();}return false;},_mouseStop:function(b){this.resizing=false;var c,d,e,f,g,h,i,j=this.options,k=this;if(this._helper){c=this._proportionallyResizeElements;d=c.length&&(/textarea/i).test(c[0].nodeName);e=d&&this._hasScroll(c[0],"left")?0:k.sizeDiff.height;f=d?0:k.sizeDiff.width;g={width:(k.helper.width()-f),height:(k.helper.height()-e)};h=(parseInt(k.element.css("left"),10)+(k.position.left-k.originalPosition.left))||null;i=(parseInt(k.element.css("top"),10)+(k.position.top-k.originalPosition.top))||null;if(!j.animate)this.element.css(a.extend(g,{top:i,left:h}));k.helper.height(k.size.height);k.helper.width(k.size.width);if(this._helper&&!j.animate)this._proportionallyResize();}a("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);if(this._helper)this.helper.remove();return false;},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height};},_applyChanges:function(){var a={};if(this.position.top!==this.prevPosition.top)a.top=this.position.top+"px";if(this.position.left!==this.prevPosition.left)a.left=this.position.left+"px";if(this.size.width!==this.prevSize.width)a.width=this.size.width+"px";if(this.size.height!==this.prevSize.height)a.height=this.size.height+"px";this.helper.css(a);return a;},_updateVirtualBoundaries:function(a){var b,c,d,e,f,g=this.options;f={minWidth:this._isNumber(g.minWidth)?g.minWidth:0,maxWidth:this._isNumber(g.maxWidth)?g.maxWidth:Infinity,minHeight:this._isNumber(g.minHeight)?g.minHeight:0,maxHeight:this._isNumber(g.maxHeight)?g.maxHeight:Infinity};if(this._aspectRatio||a){b=f.minHeight*this.aspectRatio;d=f.minWidth/this.aspectRatio;c=f.maxHeight*this.aspectRatio;e=f.maxWidth/this.aspectRatio;if(b>f.minWidth)f.minWidth=b;if(d>f.minHeight)f.minHeight=d;if(c<f.maxWidth)f.maxWidth=c;if(e<f.maxHeight)f.maxHeight=e;}this._vBoundaries=f;},_updateCache:function(a){this.offset=this.helper.offset();if(this._isNumber(a.left))this.position.left=a.left;if(this._isNumber(a.top))this.position.top=a.top;if(this._isNumber(a.height))this.size.height=a.height;if(this._isNumber(a.width))this.size.width=a.width;},_updateRatio:function(a){var b=this.position,c=this.size,d=this.axis;if(this._isNumber(a.height))a.width=(a.height*this.aspectRatio);else if(this._isNumber(a.width))a.height=(a.width/this.aspectRatio);if(d==="sw"){a.left=b.left+(c.width-a.width);a.top=null;}if(d==="nw"){a.top=b.top+(c.height-a.height);a.left=b.left+(c.width-a.width);}return a;},_respectSize:function(a){var b=this._vBoundaries,c=this.axis,d=this._isNumber(a.width)&&b.maxWidth&&(b.maxWidth<a.width),e=this._isNumber(a.height)&&b.maxHeight&&(b.maxHeight<a.height),f=this._isNumber(a.width)&&b.minWidth&&(b.minWidth>a.width),g=this._isNumber(a.height)&&b.minHeight&&(b.minHeight>a.height),h=this.originalPosition.left+this.originalSize.width,i=this.position.top+this.size.height,j=/sw|nw|w/.test(c),k=/nw|ne|n/.test(c);if(f)a.width=b.minWidth;if(g)a.height=b.minHeight;if(d)a.width=b.maxWidth;if(e)a.height=b.maxHeight;if(f&&j)a.left=h-b.minWidth;if(d&&j)a.left=h-b.maxWidth;if(g&&k)a.top=i-b.minHeight;if(e&&k)a.top=i-b.maxHeight;if(!a.width&&!a.height&&!a.left&&a.top)a.top=null;else if(!a.width&&!a.height&&!a.top&&a.left)a.left=null;return a;},_getPaddingPlusBorderDimensions:function(a){var b=0,c=[],d=[a.css("borderTopWidth"),a.css("borderRightWidth"),a.css("borderBottomWidth"),a.css("borderLeftWidth")],e=[a.css("paddingTop"),a.css("paddingRight"),a.css("paddingBottom"),a.css("paddingLeft")];for(;b<4;b++){c[b]=(parseInt(d[b],10)||0);c[b]+=(parseInt(e[b],10)||0);}return{height:c[0]+c[2],width:c[1]+c[3]};},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length)return;var a,b=0,c=this.helper||this.element;for(;b<this._proportionallyResizeElements.length;b++){a=this._proportionallyResizeElements[b];if(!this.outerDimensions)this.outerDimensions=this._getPaddingPlusBorderDimensions(a);a.css({height:(c.height()-this.outerDimensions.height)||0,width:(c.width()-this.outerDimensions.width)||0});}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a("<div style='overflow:hidden;'></div>");this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++c.zIndex});this.helper.appendTo("body").disableSelection();}else this.helper=this.element;},_change:{e:function(a,b){return{width:this.originalSize.width+b};},w:function(a,b){var c=this.originalSize,d=this.originalPosition;return{left:d.left+b,width:c.width-b};},n:function(a,b,c){var d=this.originalSize,e=this.originalPosition;return{top:e.top+c,height:d.height-c};},s:function(a,b,c){return{height:this.originalSize.height+c};},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]));},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]));},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]));},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]));}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]);(b!=="resize"&&this._trigger(b,c,this.ui()));},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition};}});a.ui.plugin.add("resizable","animate",{stop:function(b){var c=a(this).resizable("instance"),d=c.options,e=c._proportionallyResizeElements,f=e.length&&(/textarea/i).test(e[0].nodeName),g=f&&c._hasScroll(e[0],"left")?0:c.sizeDiff.height,h=f?0:c.sizeDiff.width,i={width:(c.size.width-h),height:(c.size.height-g)},j=(parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left))||null,k=(parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top))||null;c.element.animate(a.extend(i,k&&j?{top:k,left:j}:{}),{duration:d.animateDuration,easing:d.animateEasing,step:function(){var d={width:parseInt(c.element.css("width"),10),height:parseInt(c.element.css("height"),10),top:parseInt(c.element.css("top"),10),left:parseInt(c.element.css("left"),10)};if(e&&e.length)a(e[0]).css({width:d.width,height:d.height});c._updateCache(d);c._propagate("resize",b);}});}});a.ui.plugin.add("resizable","containment",{start:function(){var b,c,d,e,f,g,h,i=a(this).resizable("instance"),j=i.options,k=i.element,l=j.containment,m=(l instanceof a)?l.get(0):(/parent/.test(l))?k.parent().get(0):l;if(!m)return;i.containerElement=a(m);if(/document/.test(l)||l===document){i.containerOffset={left:0,top:0};i.containerPosition={left:0,top:0};i.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};}else{b=a(m);c=[];a(["Top","Right","Left","Bottom"]).each(function(a,d){c[a]=i._num(b.css("padding"+d));});i.containerOffset=b.offset();i.containerPosition=b.position();i.containerSize={height:(b.innerHeight()-c[3]),width:(b.innerWidth()-c[1])};d=i.containerOffset;e=i.containerSize.height;f=i.containerSize.width;g=(i._hasScroll(m,"left")?m.scrollWidth:f);h=(i._hasScroll(m)?m.scrollHeight:e);i.parentData={element:m,left:d.left,top:d.top,width:g,height:h};}},resize:function(b){var c,d,e,f,g=a(this).resizable("instance"),h=g.options,i=g.containerOffset,j=g.position,k=g._aspectRatio||b.shiftKey,l={top:0,left:0},m=g.containerElement,n=true;if(m[0]!==document&&(/static/).test(m.css("position")))l=i;if(j.left<(g._helper?i.left:0)){g.size.width=g.size.width+(g._helper?(g.position.left-i.left):(g.position.left-l.left));if(k){g.size.height=g.size.width/g.aspectRatio;n=false;}g.position.left=h.helper?i.left:0;}if(j.top<(g._helper?i.top:0)){g.size.height=g.size.height+(g._helper?(g.position.top-i.top):g.position.top);if(k){g.size.width=g.size.height*g.aspectRatio;n=false;}g.position.top=g._helper?i.top:0;}e=g.containerElement.get(0)===g.element.parent().get(0);f=/relative|absolute/.test(g.containerElement.css("position"));if(e&&f){g.offset.left=g.parentData.left+g.position.left;g.offset.top=g.parentData.top+g.position.top;}else{g.offset.left=g.element.offset().left;g.offset.top=g.element.offset().top;}c=Math.abs(g.sizeDiff.width+(g._helper?g.offset.left-l.left:(g.offset.left-i.left)));d=Math.abs(g.sizeDiff.height+(g._helper?g.offset.top-l.top:(g.offset.top-i.top)));if(c+g.size.width>=g.parentData.width){g.size.width=g.parentData.width-c;if(k){g.size.height=g.size.width/g.aspectRatio;n=false;}}if(d+g.size.height>=g.parentData.height){g.size.height=g.parentData.height-d;if(k){g.size.width=g.size.height*g.aspectRatio;n=false;}}if(!n){g.position.left=g.prevPosition.left;g.position.top=g.prevPosition.top;g.size.width=g.prevSize.width;g.size.height=g.prevSize.height;}},stop:function(){var b=a(this).resizable("instance"),c=b.options,d=b.containerOffset,e=b.containerPosition,f=b.containerElement,g=a(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width,j=g.outerHeight()-b.sizeDiff.height;if(b._helper&&!c.animate&&(/relative/).test(f.css("position")))a(this).css({left:h.left-e.left-d.left,width:i,height:j});if(b._helper&&!c.animate&&(/static/).test(f.css("position")))a(this).css({left:h.left-e.left-d.left,width:i,height:j});}});a.ui.plugin.add("resizable","alsoResize",{start:function(){var b=a(this).resizable("instance"),c=b.options;a(c.alsoResize).each(function(){var b=a(this);b.data("ui-resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)});});},resize:function(b,c){var d=a(this).resizable("instance"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:(d.size.height-f.height)||0,width:(d.size.width-f.width)||0,top:(d.position.top-g.top)||0,left:(d.position.left-g.left)||0};a(e.alsoResize).each(function(){var b=a(this),d=a(this).data("ui-resizable-alsoresize"),e={},f=b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(f,function(a,b){var c=(d[b]||0)+(h[b]||0);if(c&&c>=0)e[b]=c||null;});b.css(e);});},stop:function(){a(this).removeData("resizable-alsoresize");}});a.ui.plugin.add("resizable","ghost",{start:function(){var b=a(this).resizable("instance"),c=b.options,d=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:d.height,width:d.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof c.ghost==="string"?c.ghost:"");b.ghost.appendTo(b.helper);},resize:function(){var b=a(this).resizable("instance");if(b.ghost)b.ghost.css({position:"relative",height:b.size.height,width:b.size.width});},stop:function(){var b=a(this).resizable("instance");if(b.ghost&&b.helper)b.helper.get(0).removeChild(b.ghost.get(0));}});a.ui.plugin.add("resizable","grid",{resize:function(){var b,c=a(this).resizable("instance"),d=c.options,e=c.size,f=c.originalSize,g=c.originalPosition,h=c.axis,i=typeof d.grid==="number"?[d.grid,d.grid]:d.grid,j=(i[0]||1),k=(i[1]||1),l=Math.round((e.width-f.width)/j)*j,m=Math.round((e.height-f.height)/k)*k,n=f.width+l,o=f.height+m,p=d.maxWidth&&(d.maxWidth<n),q=d.maxHeight&&(d.maxHeight<o),r=d.minWidth&&(d.minWidth>n),s=d.minHeight&&(d.minHeight>o);d.grid=i;if(r)n+=j;if(s)o+=k;if(p)n-=j;if(q)o-=k;if(/^(se|s|e)$/.test(h)){c.size.width=n;c.size.height=o;}else if(/^(ne)$/.test(h)){c.size.width=n;c.size.height=o;c.position.top=g.top-m;}else if(/^(sw)$/.test(h)){c.size.width=n;c.size.height=o;c.position.left=g.left-l;}else{if(o-k<=0||n-j<=0)b=c._getPaddingPlusBorderDimensions(this);if(o-k>0){c.size.height=o;c.position.top=g.top-m;}else{o=k-b.height;c.size.height=o;c.position.top=g.top+f.height-o;}if(n-j>0){c.size.width=n;c.position.left=g.left-l;}else{n=j-b.width;c.size.width=n;c.position.left=g.left+f.width-n;}}}});var l=a.ui.resizable;var m=a.widget("ui.selectable",a.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var b,c=this;this.element.addClass("ui-selectable");this.dragged=false;this.refresh=function(){b=a(c.options.filter,c.element[0]);b.addClass("ui-selectee");b.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:false,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")});});};this.refresh();this.selectees=b.addClass("ui-selectee");this._mouseInit();this.helper=a("<div class='ui-selectable-helper'></div>");},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled");this._mouseDestroy();},_mouseStart:function(b){var c=this,d=this.options;this.opos=[b.pageX,b.pageY];if(this.options.disabled)return;this.selectees=a(d.filter,this.element[0]);this._trigger("start",b);a(d.appendTo).append(this.helper);this.helper.css({"left":b.pageX,"top":b.pageY,"width":0,"height":0});if(d.autoRefresh)this.refresh();this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=true;if(!b.metaKey&&!b.ctrlKey){d.$element.removeClass("ui-selected");d.selected=false;d.$element.addClass("ui-unselecting");d.unselecting=true;c._trigger("unselecting",b,{unselecting:d.element});}});a(b.target).parents().addBack().each(function(){var d,e=a.data(this,"selectable-item");if(e){d=(!b.metaKey&&!b.ctrlKey)||!e.$element.hasClass("ui-selected");e.$element.removeClass(d?"ui-unselecting":"ui-selected").addClass(d?"ui-selecting":"ui-unselecting");e.unselecting=!d;e.selecting=d;e.selected=d;if(d)c._trigger("selecting",b,{selecting:e.element});else c._trigger("unselecting",b,{unselecting:e.element});return false;}});},_mouseDrag:function(b){this.dragged=true;if(this.options.disabled)return;var c,d=this,e=this.options,f=this.opos[0],g=this.opos[1],h=b.pageX,i=b.pageY;if(f>h){c=h;h=f;f=c;}if(g>i){c=i;i=g;g=c;}this.helper.css({left:f,top:g,width:h-f,height:i-g});this.selectees.each(function(){var c=a.data(this,"selectable-item"),j=false;if(!c||c.element===d.element[0])return;if(e.tolerance==="touch")j=(!(c.left>h||c.right<f||c.top>i||c.bottom<g));else if(e.tolerance==="fit")j=(c.left>f&&c.right<h&&c.top>g&&c.bottom<i);if(j){if(c.selected){c.$element.removeClass("ui-selected");c.selected=false;}if(c.unselecting){c.$element.removeClass("ui-unselecting");c.unselecting=false;}if(!c.selecting){c.$element.addClass("ui-selecting");c.selecting=true;d._trigger("selecting",b,{selecting:c.element});}}else{if(c.selecting)if((b.metaKey||b.ctrlKey)&&c.startselected){c.$element.removeClass("ui-selecting");c.selecting=false;c.$element.addClass("ui-selected");c.selected=true;}else{c.$element.removeClass("ui-selecting");c.selecting=false;if(c.startselected){c.$element.addClass("ui-unselecting");c.unselecting=true;}d._trigger("unselecting",b,{unselecting:c.element});}if(c.selected)if(!b.metaKey&&!b.ctrlKey&&!c.startselected){c.$element.removeClass("ui-selected");c.selected=false;c.$element.addClass("ui-unselecting");c.unselecting=true;d._trigger("unselecting",b,{unselecting:c.element});}}});return false;},_mouseStop:function(b){var c=this;this.dragged=false;a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;c._trigger("unselected",b,{unselected:d.element});});a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;c._trigger("selected",b,{selected:d.element});});this._trigger("stop",b);this.helper.remove();return false;}});var n=a.widget("ui.sortable",a.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(a,b,c){return(a>=b)&&(a<(b+c));},_isFloating:function(a){return(/left|right/).test(a.css("float"))||(/inline|table-cell/).test(a.css("display"));},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=true;},_setOption:function(a,b){this._super(a,b);if(a==="handle")this._setHandleClassName();},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle");a.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle");});},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData(this.widgetName+"-item");return this;},_mouseCapture:function(b,c){var d=null,e=false,f=this;if(this.reverting)return false;if(this.options.disabled||this.options.type==="static")return false;this._refreshItems(b);a(b.target).parents().each(function(){if(a.data(this,f.widgetName+"-item")===f){d=a(this);return false;}});if(a.data(b.target,f.widgetName+"-item")===f)d=a(b.target);if(!d)return false;if(this.options.handle&&!c){a(this.options.handle,d).find("*").addBack().each(function(){if(this===b.target)e=true;});if(!e)return false;}this.currentItem=d;this._removeCurrentsFromItems();return true;},_mouseStart:function(b,c,d){var e,f,g=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(b);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;(g.cursorAt&&this._adjustOffsetFromHelper(g.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0])this.currentItem.hide();this._createPlaceholder();if(g.containment)this._setContainment();if(g.cursor&&g.cursor!=="auto"){f=this.document.find("body");this.storedCursor=f.css("cursor");f.css("cursor",g.cursor);this.storedStylesheet=a("<style>*{ cursor: "+g.cursor+" !important; }</style>").appendTo(f);}if(g.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",g.opacity);}if(g.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",g.zIndex);}if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",b,this._uiHash());if(!this._preserveHelperProportions)this._cacheHelperProportions();if(!d)for(e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("activate",b,this._uiHash(this));if(a.ui.ddmanager)a.ui.ddmanager.current=this;if(a.ui.ddmanager&&!g.dropBehaviour)a.ui.ddmanager.prepareOffsets(this,b);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(b);return true;},_mouseDrag:function(b){var c,d,e,f,g=this.options,h=false;this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-b.pageY<g.scrollSensitivity)this.scrollParent[0].scrollTop=h=this.scrollParent[0].scrollTop+g.scrollSpeed;else if(b.pageY-this.overflowOffset.top<g.scrollSensitivity)this.scrollParent[0].scrollTop=h=this.scrollParent[0].scrollTop-g.scrollSpeed;if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-b.pageX<g.scrollSensitivity)this.scrollParent[0].scrollLeft=h=this.scrollParent[0].scrollLeft+g.scrollSpeed;else if(b.pageX-this.overflowOffset.left<g.scrollSensitivity)this.scrollParent[0].scrollLeft=h=this.scrollParent[0].scrollLeft-g.scrollSpeed;}else{if(b.pageY-this.document.scrollTop()<g.scrollSensitivity)h=this.document.scrollTop(this.document.scrollTop()-g.scrollSpeed);else if(this.window.height()-(b.pageY-this.document.scrollTop())<g.scrollSensitivity)h=this.document.scrollTop(this.document.scrollTop()+g.scrollSpeed);if(b.pageX-this.document.scrollLeft()<g.scrollSensitivity)h=this.document.scrollLeft(this.document.scrollLeft()-g.scrollSpeed);else if(this.window.width()-(b.pageX-this.document.scrollLeft())<g.scrollSensitivity)h=this.document.scrollLeft(this.document.scrollLeft()+g.scrollSpeed);}if(h!==false&&a.ui.ddmanager&&!g.dropBehaviour)a.ui.ddmanager.prepareOffsets(this,b);}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!=="x")this.helper[0].style.top=this.position.top+"px";for(c=this.items.length-1;c>=0;c--){d=this.items[c];e=d.item[0];f=this._intersectsWithPointer(d);if(!f)continue;if(d.instance!==this.currentContainer)continue;if(e!==this.currentItem[0]&&this.placeholder[f===1?"next":"prev"]()[0]!==e&&!a.contains(this.placeholder[0],e)&&(this.options.type==="semi-dynamic"?!a.contains(this.element[0],e):true)){this.direction=f===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(d))this._rearrange(b,d);else break;this._trigger("change",b,this._uiHash());break;}}this._contactContainers(b);if(a.ui.ddmanager)a.ui.ddmanager.drag(this,b);this._trigger("sort",b,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(b,c){if(!b)return;if(a.ui.ddmanager&&!this.options.dropBehaviour)a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=this.placeholder.offset(),f=this.options.axis,g={};if(!f||f==="x")g.left=e.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft);if(!f||f==="y")g.top=e.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop);this.reverting=true;a(this.helper).animate(g,parseInt(this.options.revert,10)||500,function(){d._clear(b);});}else this._clear(b,c);return false;},cancel:function(){if(this.dragging){this._mouseUp({target:null});if(this.options.helper==="original")this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");else this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,this._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,this._uiHash(this));this.containers[b].containerCache.over=0;}}}if(this.placeholder){if(this.placeholder[0].parentNode)this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode)this.helper.remove();a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev)a(this.domPosition.prev).after(this.currentItem);else a(this.domPosition.parent).prepend(this.currentItem);}return this;},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{};a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||(/(.+)[\-=_](.+)/));if(c)d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]));});if(!d.length&&b.key)d.push(b.key+"=");return d.join("&");},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{};c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"");});return d;},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=(this.options.axis==="x")||((d+j)>h&&(d+j)<i),m=(this.options.axis==="y")||((b+k)>f&&(b+k)<g),n=l&&m;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]))return n;else return(f<b+(this.helperProportions.width/2)&&c-(this.helperProportions.width/2)<g&&h<d+(this.helperProportions.height/2)&&e-(this.helperProportions.height/2)<i);},_intersectsWithPointer:function(a){var b=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height),c=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width),d=b&&c,e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(!d)return false;return this.floating?(((f&&f==="right")||e==="down")?2:1):(e&&(e==="down"?2:1));},_intersectsWithSides:function(a){var b=this._isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+(a.height/2),a.height),c=this._isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+(a.width/2),a.width),d=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();if(this.floating&&e)return((e==="right"&&c)||(e==="left"&&!c));else return d&&((d==="down"&&b)||(d==="up"&&!b));},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!==0&&(a>0?"down":"up");},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!==0&&(a>0?"right":"left");},refresh:function(a){this._refreshItems(a);this._setHandleClassName();this.refreshPositions();return this;},_connectWith:function(){var a=this.options;return a.connectWith.constructor===String?[a.connectWith]:a.connectWith;},_getItemsAsjQuery:function(b){var c,d,e,f,g=[],h=[],i=this._connectWith();if(i&&b)for(c=i.length-1;c>=0;c--){e=a(i[c],this.document[0]);for(d=e.length-1;d>=0;d--){f=a.data(e[d],this.widgetFullName);if(f&&f!==this&&!f.options.disabled)h.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),f]);}}h.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function j(){g.push(this);}for(c=h.length-1;c>=0;c--)h[c][0].each(j);return a(g);},_removeCurrentsFromItems:function(){var b=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=a.grep(this.items,function(a){for(var c=0;c<b.length;c++)if(b[c]===a.item[0])return false;return true;});},_refreshItems:function(b){this.items=[];this.containers=[this];var c,d,e,f,g,h,i,j,k=this.items,l=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],m=this._connectWith();if(m&&this.ready)for(c=m.length-1;c>=0;c--){e=a(m[c],this.document[0]);for(d=e.length-1;d>=0;d--){f=a.data(e[d],this.widgetFullName);if(f&&f!==this&&!f.options.disabled){l.push([a.isFunction(f.options.items)?f.options.items.call(f.element[0],b,{item:this.currentItem}):a(f.options.items,f.element),f]);this.containers.push(f);}}}for(c=l.length-1;c>=0;c--){g=l[c][1];h=l[c][0];for(d=0,j=h.length;d<j;d++){i=a(h[d]);i.data(this.widgetName+"-item",g);k.push({item:i,instance:g,width:0,height:0,left:0,top:0});}}},refreshPositions:function(b){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):false;if(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();var c,d,e,f;for(c=this.items.length-1;c>=0;c--){d=this.items[c];if(d.instance!==this.currentContainer&&this.currentContainer&&d.item[0]!==this.currentItem[0])continue;e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;if(!b){d.width=e.outerWidth();d.height=e.outerHeight();}f=e.offset();d.left=f.left;d.top=f.top;}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(c=this.containers.length-1;c>=0;c--){f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left;this.containers[c].containerCache.top=f.top;this.containers[c].containerCache.width=this.containers[c].element.outerWidth();this.containers[c].containerCache.height=this.containers[c].element.outerHeight();}return this;},_createPlaceholder:function(b){b=b||this;var c,d=b.options;if(!d.placeholder||d.placeholder.constructor===String){c=d.placeholder;d.placeholder={element:function(){var d=b.currentItem[0].nodeName.toLowerCase(),e=a("<"+d+">",b.document[0]).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");if(d==="tbody")b._createTrPlaceholder(b.currentItem.find("tr").eq(0),a("<tr>",b.document[0]).appendTo(e));else if(d==="tr")b._createTrPlaceholder(b.currentItem,e);else if(d==="img")e.attr("src",b.currentItem.attr("src"));if(!c)e.css("visibility","hidden");return e;},update:function(a,e){if(c&&!d.forcePlaceholderSize)return;if(!e.height())e.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));if(!e.width())e.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10));}};}b.placeholder=a(d.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);d.placeholder.update(b,b.placeholder);},_createTrPlaceholder:function(b,c){var d=this;b.children().each(function(){a("<td>&#160;</td>",d.document[0]).attr("colspan",a(this).attr("colspan")||1).appendTo(c);});},_contactContainers:function(b){var c,d,e,f,g,h,i,j,k,l,m=null,n=null;for(c=this.containers.length-1;c>=0;c--){if(a.contains(this.currentItem[0],this.containers[c].element[0]))continue;if(this._intersectsWith(this.containers[c].containerCache)){if(m&&a.contains(this.containers[c].element[0],m.element[0]))continue;m=this.containers[c];n=c;}else if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",b,this._uiHash(this));this.containers[c].containerCache.over=0;}}if(!m)return;if(this.containers.length===1){if(!this.containers[n].containerCache.over){this.containers[n]._trigger("over",b,this._uiHash(this));this.containers[n].containerCache.over=1;}}else{e=10000;f=null;k=m.floating||this._isFloating(this.currentItem);g=k?"left":"top";h=k?"width":"height";l=k?"clientX":"clientY";for(d=this.items.length-1;d>=0;d--){if(!a.contains(this.containers[n].element[0],this.items[d].item[0]))continue;if(this.items[d].item[0]===this.currentItem[0])continue;i=this.items[d].item.offset()[g];j=false;if(b[l]-i>this.items[d][h]/2)j=true;if(Math.abs(b[l]-i)<e){e=Math.abs(b[l]-i);f=this.items[d];this.direction=j?"up":"down";}}if(!f&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[n]){if(!this.currentContainer.containerCache.over){this.containers[n]._trigger("over",b,this._uiHash());this.currentContainer.containerCache.over=1;}return;}f?this._rearrange(b,f,null,true):this._rearrange(b,null,this.containers[n].element,true);this._trigger("change",b,this._uiHash());this.containers[n]._trigger("change",b,this._uiHash(this));this.currentContainer=this.containers[n];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[n]._trigger("over",b,this._uiHash(this));this.containers[n].containerCache.over=1;}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):(c.helper==="clone"?this.currentItem.clone():this.currentItem);if(!d.parents("body").length)a(c.appendTo!=="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]);if(d[0]===this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(!d[0].style.width||c.forceHelperSize)d.width(this.currentItem.width());if(!d[0].style.height||c.forceHelperSize)d.height(this.currentItem.height());return d;},_adjustOffsetFromHelper:function(b){if(typeof b==="string")b=b.split(" ");if(a.isArray(b))b={left:+b[0],top:+b[1]||0};if("left" in b)this.offset.click.left=b.left+this.margins.left;if("right" in b)this.offset.click.left=this.helperProportions.width-b.right+this.margins.left;if("top" in b)this.offset.click.top=b.top+this.margins.top;if("bottom" in b)this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top;},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&a.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop();}if(this.offsetParent[0]===this.document[0].body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&a.ui.ie))b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else return{top:0,left:0};},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var b,c,d,e=this.options;if(e.containment==="parent")e.containment=this.helper[0].parentNode;if(e.containment==="document"||e.containment==="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(e.containment==="document"?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(e.containment)){b=a(e.containment)[0];c=a(e.containment).offset();d=(a(b).css("overflow")!=="hidden");this.containment=[c.left+(parseInt(a(b).css("borderLeftWidth"),10)||0)+(parseInt(a(b).css("paddingLeft"),10)||0)-this.margins.left,c.top+(parseInt(a(b).css("borderTopWidth"),10)||0)+(parseInt(a(b).css("paddingTop"),10)||0)-this.margins.top,c.left+(d?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(a(b).css("borderLeftWidth"),10)||0)-(parseInt(a(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,c.top+(d?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(a(b).css("borderTopWidth"),10)||0)-(parseInt(a(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(b,c){if(!c)c=this.position;var d=b==="absolute"?1:-1,e=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&a.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=(/(html|body)/i).test(e[0].tagName);return{top:(c.top+this.offset.relative.top*d+this.offset.parent.top*d-((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(f?0:e.scrollTop()))*d)),left:(c.left+this.offset.relative.left*d+this.offset.parent.left*d-((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():f?0:e.scrollLeft())*d))};},_generatePosition:function(b){var c,d,e=this.options,f=b.pageX,g=b.pageY,h=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&a.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(h[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();if(this.originalPosition){if(this.containment){if(b.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(b.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(b.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(b.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top;}if(e.grid){c=this.originalPageY+Math.round((g-this.originalPageY)/e.grid[1])*e.grid[1];g=this.containment?((c-this.offset.click.top>=this.containment[1]&&c-this.offset.click.top<=this.containment[3])?c:((c-this.offset.click.top>=this.containment[1])?c-e.grid[1]:c+e.grid[1])):c;d=this.originalPageX+Math.round((f-this.originalPageX)/e.grid[0])*e.grid[0];f=this.containment?((d-this.offset.click.left>=this.containment[0]&&d-this.offset.click.left<=this.containment[2])?d:((d-this.offset.click.left>=this.containment[0])?d-e.grid[0]:d+e.grid[0])):d;}}return{top:(g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(i?0:h.scrollTop()))),left:(f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():i?0:h.scrollLeft()))};},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?b.item[0]:b.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var e=this.counter;this._delay(function(){if(e===this.counter)this.refreshPositions(!d);});},_clear:function(a,b){this.reverting=false;var c,d=[];if(!this._noFinalSort&&this.currentItem.parent().length)this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(c in this._storedCSS)if(this._storedCSS[c]==="auto"||this._storedCSS[c]==="static")this._storedCSS[c]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else this.currentItem.show();if(this.fromOutside&&!b)d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside));});if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!b)d.push(function(a){this._trigger("update",a,this._uiHash());});if(this!==this.currentContainer)if(!b){d.push(function(a){this._trigger("remove",a,this._uiHash());});d.push((function(a){return function(b){a._trigger("receive",b,this._uiHash(this));};}).call(this,this.currentContainer));d.push((function(a){return function(b){a._trigger("update",b,this._uiHash(this));};}).call(this,this.currentContainer));}function e(a,b,c){return function(d){c._trigger(a,d,b._uiHash(b));};}for(c=this.containers.length-1;c>=0;c--){if(!b)d.push(e("deactivate",this,this.containers[c]));if(this.containers[c].containerCache.over){d.push(e("out",this,this.containers[c]));this.containers[c].containerCache.over=0;}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove();}if(this._storedOpacity)this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex);this.dragging=false;if(!b)this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0])this.helper.remove();this.helper=null;}if(!b){for(c=0;c<d.length;c++)d[c].call(this,a);this._trigger("stop",a,this._uiHash());}this.fromOutside=false;return !this.cancelHelperRemoval;},_trigger:function(){if(a.Widget.prototype._trigger.apply(this,arguments)===false)this.cancel();},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null};}});var o=a.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:false,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var b=this.options;this.prevShow=this.prevHide=a();this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist");if(!b.collapsible&&(b.active===false||b.active==null))b.active=0;this._processPanels();if(b.active<0)b.active+=this.headers.length;this._refresh();},_getCreateEventData:function(){return{header:this.active,panel:!this.active.length?a():this.active.next()};},_createIcons:function(){var b=this.options.icons;if(b){a("<span>").addClass("ui-accordion-header-icon ui-icon "+b.header).prependTo(this.headers);this.active.children(".ui-accordion-header-icon").removeClass(b.header).addClass(b.activeHeader);this.headers.addClass("ui-accordion-icons");}},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove();},_destroy:function(){var a;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default "+"ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId();this._destroyIcons();a=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom "+"ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId();if(this.options.heightStyle!=="content")a.css("height","");},_setOption:function(a,b){if(a==="active"){this._activate(b);return;}if(a==="event"){if(this.options.event)this._off(this.headers,this.options.event);this._setupEvents(b);}this._super(a,b);if(a==="collapsible"&&!b&&this.options.active===false)this._activate(0);if(a==="icons"){this._destroyIcons();if(b)this._createIcons();}if(a==="disabled"){this.element.toggleClass("ui-state-disabled",!!b).attr("aria-disabled",b);this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!b);}},_keydown:function(b){if(b.altKey||b.ctrlKey)return;var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=false;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._eventHandler(b);break;case c.HOME:f=this.headers[0];break;case c.END:f=this.headers[d-1];break;}if(f){a(b.target).attr("tabIndex",-1);a(f).attr("tabIndex",0);f.focus();b.preventDefault();}},_panelKeyDown:function(b){if(b.keyCode===a.ui.keyCode.UP&&b.ctrlKey)a(b.currentTarget).prev().focus();},refresh:function(){var b=this.options;this._processPanels();if((b.active===false&&b.collapsible===true)||!this.headers.length){b.active=false;this.active=a();}else if(b.active===false)this._activate(0);else if(this.active.length&&!a.contains(this.element[0],this.active[0]))if(this.headers.length===this.headers.find(".ui-state-disabled").length){b.active=false;this.active=a();}else this._activate(Math.max(0,b.active-1));else b.active=this.headers.index(this.active);this._destroyIcons();this._refresh();},_processPanels:function(){var a=this.headers,b=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all");this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide();if(b){this._off(a.not(this.headers));this._off(b.not(this.panels));}},_refresh:function(){var b,c=this.options,d=c.heightStyle,e=this.element.parent();this.active=this._findActive(c.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all");this.active.next().addClass("ui-accordion-content-active").show();this.headers.attr("role","tab").each(function(){var b=a(this),c=b.uniqueId().attr("id"),d=b.next(),e=d.uniqueId().attr("id");b.attr("aria-controls",e);d.attr("aria-labelledby",c);}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();if(!this.active.length)this.headers.eq(0).attr("tabIndex",0);else this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"});this._createIcons();this._setupEvents(c.event);if(d==="fill"){b=e.height();this.element.siblings(":visible").each(function(){var c=a(this),d=c.css("position");if(d==="absolute"||d==="fixed")return;b-=c.outerHeight(true);});this.headers.each(function(){b-=a(this).outerHeight(true);});this.headers.next().each(function(){a(this).height(Math.max(0,b-a(this).innerHeight()+a(this).height()));}).css("overflow","auto");}else if(d==="auto"){b=0;this.headers.next().each(function(){b=Math.max(b,a(this).css("height","").height());}).height(b);}},_activate:function(b){var c=this._findActive(b)[0];if(c===this.active[0])return;c=c||this.active[0];this._eventHandler({target:c,currentTarget:c,preventDefault:a.noop});},_findActive:function(b){return typeof b==="number"?this.headers.eq(b):a();},_setupEvents:function(b){var c={keydown:"_keydown"};if(b)a.each(b.split(" "),function(a,b){c[b]="_eventHandler";});this._off(this.headers.add(this.headers.next()));this._on(this.headers,c);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers);},_eventHandler:function(b){var c=this.options,d=this.active,e=a(b.currentTarget),f=e[0]===d[0],g=f&&c.collapsible,h=g?a():e.next(),i=d.next(),j={oldHeader:d,oldPanel:i,newHeader:g?a():e,newPanel:h};b.preventDefault();if((f&&!c.collapsible)||(this._trigger("beforeActivate",b,j)===false))return;c.active=g?false:this.headers.index(e);this.active=f?a():e;this._toggle(j);d.removeClass("ui-accordion-header-active ui-state-active");if(c.icons)d.children(".ui-accordion-header-icon").removeClass(c.icons.activeHeader).addClass(c.icons.header);if(!f){e.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top");if(c.icons)e.children(".ui-accordion-header-icon").removeClass(c.icons.header).addClass(c.icons.activeHeader);e.next().addClass("ui-accordion-content-active");}},_toggle:function(b){var c=b.newPanel,d=this.prevShow.length?this.prevShow:b.oldPanel;this.prevShow.add(this.prevHide).stop(true,true);this.prevShow=c;this.prevHide=d;if(this.options.animate)this._animate(c,d,b);else{d.hide();c.show();this._toggleComplete(b);}d.attr({"aria-hidden":"true"});d.prev().attr({"aria-selected":"false","aria-expanded":"false"});if(c.length&&d.length)d.prev().attr({"tabIndex":-1,"aria-expanded":"false"});else if(c.length)this.headers.filter(function(){return parseInt(a(this).attr("tabIndex"),10)===0;}).attr("tabIndex",-1);c.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});},_animate:function(a,b,c){var d,e,f,g=this,h=0,i=a.css("box-sizing"),j=a.length&&(!b.length||(a.index()<b.index())),k=this.options.animate||{},l=j&&k.down||k,m=function(){g._toggleComplete(c);};if(typeof l==="number")f=l;if(typeof l==="string")e=l;e=e||l.easing||k.easing;f=f||l.duration||k.duration;if(!b.length)return a.animate(this.showProps,f,e,m);if(!a.length)return b.animate(this.hideProps,f,e,m);d=a.show().outerHeight();b.animate(this.hideProps,{duration:f,easing:e,step:function(a,b){b.now=Math.round(a);}});a.hide().animate(this.showProps,{duration:f,easing:e,complete:m,step:function(a,c){c.now=Math.round(a);if(c.prop!=="height"){if(i==="content-box")h+=c.now;}else if(g.options.heightStyle!=="content"){c.now=Math.round(d-b.outerHeight()-h);h=0;}}});},_toggleComplete:function(a){var b=a.oldPanel;b.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all");if(b.length)b.parent()[0].className=b.parent()[0].className;this._trigger("activate",null,a);}});var p=a.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element;this.mouseHandled=false;this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0});if(this.options.disabled)this.element.addClass("ui-state-disabled").attr("aria-disabled","true");this._on({"mousedown .ui-menu-item":function(a){a.preventDefault();},"click .ui-menu-item":function(b){var c=a(b.target);if(!this.mouseHandled&&c.not(".ui-state-disabled").length){this.select(b);if(!b.isPropagationStopped())this.mouseHandled=true;if(c.has(".ui-menu").length)this.expand(b);else if(!this.element.is(":focus")&&a(this.document[0].activeElement).closest(".ui-menu").length){this.element.trigger("focus",[true]);if(this.active&&this.active.parents(".ui-menu").length===1)clearTimeout(this.timer);}}},"mouseenter .ui-menu-item":function(b){if(this.previousFilter)return;var c=a(b.currentTarget);c.siblings(".ui-state-active").removeClass("ui-state-active");this.focus(b,c);},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(a,b){var c=this.active||this.element.find(this.options.items).eq(0);if(!b)this.focus(a,c);},blur:function(b){this._delay(function(){if(!a.contains(this.element[0],this.document[0].activeElement))this.collapseAll(b);});},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(a){if(this._closeOnDocumentClick(a))this.collapseAll(a);this.mouseHandled=false;}});},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show();this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var b=a(this);if(b.data("ui-menu-submenu-carat"))b.remove();});this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content");},_keydown:function(b){var c,d,e,f,g=true;switch(b.keyCode){case a.ui.keyCode.PAGE_UP:this.previousPage(b);break;case a.ui.keyCode.PAGE_DOWN:this.nextPage(b);break;case a.ui.keyCode.HOME:this._move("first","first",b);break;case a.ui.keyCode.END:this._move("last","last",b);break;case a.ui.keyCode.UP:this.previous(b);break;case a.ui.keyCode.DOWN:this.next(b);break;case a.ui.keyCode.LEFT:this.collapse(b);break;case a.ui.keyCode.RIGHT:if(this.active&&!this.active.is(".ui-state-disabled"))this.expand(b);break;case a.ui.keyCode.ENTER:case a.ui.keyCode.SPACE:this._activate(b);break;case a.ui.keyCode.ESCAPE:this.collapse(b);break;default:g=false;d=this.previousFilter||"";e=String.fromCharCode(b.keyCode);f=false;clearTimeout(this.filterTimer);if(e===d)f=true;else e=d+e;c=this._filterMenuItems(e);c=f&&c.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):c;if(!c.length){e=String.fromCharCode(b.keyCode);c=this._filterMenuItems(e);}if(c.length){this.focus(b,c);this.previousFilter=e;this.filterTimer=this._delay(function(){delete this.previousFilter;},1000);}else delete this.previousFilter;}if(g)b.preventDefault();},_activate:function(a){if(!this.active.is(".ui-state-disabled"))if(this.active.is("[aria-haspopup='true']"))this.expand(a);else this.select(a);},refresh:function(){var b,c,d=this,e=this.options.icons.submenu,f=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length);f.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var b=a(this),c=b.parent(),d=a("<span>").addClass("ui-menu-icon ui-icon "+e).data("ui-menu-submenu-carat",true);c.attr("aria-haspopup","true").prepend(d);b.attr("aria-labelledby",c.attr("id"));});b=f.add(this.element);c=b.find(this.options.items);c.not(".ui-menu-item").each(function(){var b=a(this);if(d._isDivider(b))b.addClass("ui-widget-content ui-menu-divider");});c.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()});c.filter(".ui-state-disabled").attr("aria-disabled","true");if(this.active&&!a.contains(this.element[0],this.active[0]))this.blur();},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role];},_setOption:function(a,b){if(a==="icons")this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(b.submenu);if(a==="disabled")this.element.toggleClass("ui-state-disabled",!!b).attr("aria-disabled",b);this._super(a,b);},focus:function(a,b){var c,d;this.blur(a,a&&a.type==="focus");this._scrollIntoView(b);this.active=b.first();d=this.active.addClass("ui-state-focus").removeClass("ui-state-active");if(this.options.role)this.element.attr("aria-activedescendant",d.attr("id"));this.active.parent().closest(".ui-menu-item").addClass("ui-state-active");if(a&&a.type==="keydown")this._close();else this.timer=this._delay(function(){this._close();},this.delay);c=b.children(".ui-menu");if(c.length&&a&&(/^mouse/.test(a.type)))this._startOpening(c);this.activeMenu=b.parent();this._trigger("focus",a,{item:b});},_scrollIntoView:function(b){var c,d,e,f,g,h;if(this._hasScroll()){c=parseFloat(a.css(this.activeMenu[0],"borderTopWidth"))||0;d=parseFloat(a.css(this.activeMenu[0],"paddingTop"))||0;e=b.offset().top-this.activeMenu.offset().top-c-d;f=this.activeMenu.scrollTop();g=this.activeMenu.height();h=b.outerHeight();if(e<0)this.activeMenu.scrollTop(f+e);else if(e+h>g)this.activeMenu.scrollTop(f+e-g+h);}},blur:function(a,b){if(!b)clearTimeout(this.timer);if(!this.active)return;this.active.removeClass("ui-state-focus");this.active=null;this._trigger("blur",a,{item:this.active});},_startOpening:function(a){clearTimeout(this.timer);if(a.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close();this._open(a);},this.delay);},_open:function(b){var c=a.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(b.parents(".ui-menu")).hide().attr("aria-hidden","true");b.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(c);},collapseAll:function(b,c){clearTimeout(this.timer);this.timer=this._delay(function(){var d=c?this.element:a(b&&b.target).closest(this.element.find(".ui-menu"));if(!d.length)d=this.element;this._close(d);this.blur(b);this.activeMenu=d;},this.delay);},_close:function(a){if(!a)a=this.active?this.active.parent():this.element;a.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active");},_closeOnDocumentClick:function(b){return !a(b.target).closest(".ui-menu").length;},_isDivider:function(a){return !/[^\-\u2014\u2013\s]/.test(a.text());},collapse:function(a){var b=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(b&&b.length){this._close();this.focus(a,b);}},expand:function(a){var b=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();if(b&&b.length){this._open(b.parent());this._delay(function(){this.focus(a,b);});}},next:function(a){this._move("next","first",a);},previous:function(a){this._move("prev","last",a);},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length;},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length;},_move:function(a,b,c){var d;if(this.active)if(a==="first"||a==="last")d=this.active[a==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1);else d=this.active[a+"All"](".ui-menu-item").eq(0);if(!d||!d.length||!this.active)d=this.activeMenu.find(this.options.items)[b]();this.focus(c,d);},nextPage:function(b){var c,d,e;if(!this.active){this.next(b);return;}if(this.isLastItem())return;if(this._hasScroll()){d=this.active.offset().top;e=this.element.height();this.active.nextAll(".ui-menu-item").each(function(){c=a(this);return c.offset().top-d-e<0;});this.focus(b,c);}else this.focus(b,this.activeMenu.find(this.options.items)[!this.active?"first":"last"]());},previousPage:function(b){var c,d,e;if(!this.active){this.next(b);return;}if(this.isFirstItem())return;if(this._hasScroll()){d=this.active.offset().top;e=this.element.height();this.active.prevAll(".ui-menu-item").each(function(){c=a(this);return c.offset().top-d+e>0;});this.focus(b,c);}else this.focus(b,this.activeMenu.find(this.options.items).first());},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight");},select:function(b){this.active=this.active||a(b.target).closest(".ui-menu-item");var c={item:this.active};if(!this.active.has(".ui-menu").length)this.collapseAll(b,true);this._trigger("select",b,c);},_filterMenuItems:function(b){var c=b.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),d=new RegExp("^"+c,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return d.test(a.trim(a(this).text()));});}});a.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var b,c,d,e=this.element[0].nodeName.toLowerCase(),f=e==="textarea",g=e==="input";this.isMultiLine=f?true:g?false:this.element.prop("isContentEditable");this.valueMethod=this.element[f||g?"val":"text"];this.isNewMenu=true;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off");this._on(this.element,{keydown:function(e){if(this.element.prop("readOnly")){b=true;d=true;c=true;return;}b=false;d=false;c=false;var f=a.ui.keyCode;switch(e.keyCode){case f.PAGE_UP:b=true;this._move("previousPage",e);break;case f.PAGE_DOWN:b=true;this._move("nextPage",e);break;case f.UP:b=true;this._keyEvent("previous",e);break;case f.DOWN:b=true;this._keyEvent("next",e);break;case f.ENTER:if(this.menu.active){b=true;e.preventDefault();this.menu.select(e);}break;case f.TAB:if(this.menu.active)this.menu.select(e);break;case f.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine)this._value(this.term);this.close(e);e.preventDefault();}break;default:c=true;this._searchTimeout(e);break;}},keypress:function(d){if(b){b=false;if(!this.isMultiLine||this.menu.element.is(":visible"))d.preventDefault();return;}if(c)return;var e=a.ui.keyCode;switch(d.keyCode){case e.PAGE_UP:this._move("previousPage",d);break;case e.PAGE_DOWN:this._move("nextPage",d);break;case e.UP:this._keyEvent("previous",d);break;case e.DOWN:this._keyEvent("next",d);break;}},input:function(a){if(d){d=false;a.preventDefault();return;}this._searchTimeout(a);},focus:function(){this.selectedItem=null;this.previous=this._value();},blur:function(a){if(this.cancelBlur){delete this.cancelBlur;return;}clearTimeout(this.searching);this.close(a);this._change(a);}});this._initSource();this.menu=a("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance");this._on(this.menu.element,{mousedown:function(b){b.preventDefault();this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;});var c=this.menu.element[0];if(!a(b.target).closest(".ui-menu-item").length)this._delay(function(){var b=this;this.document.one("mousedown",function(d){if(d.target!==b.element[0]&&d.target!==c&&!a.contains(c,d.target))b.close();});});},menufocus:function(b,c){var d,e;if(this.isNewMenu){this.isNewMenu=false;if(b.originalEvent&&/^mouse/.test(b.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){a(b.target).trigger(b.originalEvent);});return;}}e=c.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",b,{item:e}))if(b.originalEvent&&/^key/.test(b.originalEvent.type))this._value(e.value);d=c.item.attr("aria-label")||e.value;if(d&&a.trim(d).length){this.liveRegion.children().hide();a("<div>").text(d).appendTo(this.liveRegion);}},menuselect:function(a,b){var c=b.item.data("ui-autocomplete-item"),d=this.previous;if(this.element[0]!==this.document[0].activeElement){this.element.focus();this.previous=d;this._delay(function(){this.previous=d;this.selectedItem=c;});}if(false!==this._trigger("select",a,{item:c}))this._value(c.value);this.term=this._value();this.close(a);this.selectedItem=c;}});this.liveRegion=a("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body);this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete");}});},_destroy:function(){clearTimeout(this.searching);this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete");this.menu.element.remove();this.liveRegion.remove();},_setOption:function(a,b){this._super(a,b);if(a==="source")this._initSource();if(a==="appendTo")this.menu.element.appendTo(this._appendTo());if(a==="disabled"&&b&&this.xhr)this.xhr.abort();},_appendTo:function(){var b=this.options.appendTo;if(b)b=b.jquery||b.nodeType?a(b):this.document.find(b).eq(0);if(!b||!b[0])b=this.element.closest(".ui-front");if(!b.length)b=this.document[0].body;return b;},_initSource:function(){var b,c,d=this;if(a.isArray(this.options.source)){b=this.options.source;this.source=function(c,d){d(a.ui.autocomplete.filter(b,c.term));};}else if(typeof this.options.source==="string"){c=this.options.source;this.source=function(b,e){if(d.xhr)d.xhr.abort();d.xhr=a.ajax({url:c,data:b,dataType:"json",success:function(a){e(a);},error:function(){e([]);}});};}else this.source=this.options.source;},_searchTimeout:function(a){clearTimeout(this.searching);this.searching=this._delay(function(){var b=this.term===this._value(),c=this.menu.element.is(":visible"),d=a.altKey||a.ctrlKey||a.metaKey||a.shiftKey;if(!b||(b&&!c&&!d)){this.selectedItem=null;this.search(null,a);}},this.options.delay);},search:function(a,b){a=a!=null?a:this._value();this.term=this._value();if(a.length<this.options.minLength)return this.close(b);if(this._trigger("search",b)===false)return;return this._search(a);},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:a},this._response());},_response:function(){var b=++this.requestIndex;return a.proxy(function(a){if(b===this.requestIndex)this.__response(a);this.pending--;if(!this.pending)this.element.removeClass("ui-autocomplete-loading");},this);},__response:function(a){if(a)a=this._normalize(a);this._trigger("response",null,{content:a});if(!this.options.disabled&&a&&a.length&&!this.cancelSearch){this._suggest(a);this._trigger("open");}else this._close();},close:function(a){this.cancelSearch=true;this._close(a);},_close:function(a){if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",a);}},_change:function(a){if(this.previous!==this._value())this._trigger("change",a,{item:this.selectedItem});},_normalize:function(b){if(b.length&&b[0].label&&b[0].value)return b;return a.map(b,function(b){if(typeof b==="string")return{label:b,value:b};return a.extend({},b,{label:b.label||b.value,value:b.value||b.label});});},_suggest:function(b){var c=this.menu.element.empty();this._renderMenu(c,b);this.isNewMenu=true;this.menu.refresh();c.show();this._resizeMenu();c.position(a.extend({of:this.element},this.options.position));if(this.options.autoFocus)this.menu.next();},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()));},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItemData(b,c);});},_renderItemData:function(a,b){return this._renderItem(a,b).data("ui-autocomplete-item",b);},_renderItem:function(b,c){return a("<li>").text(c.label).appendTo(b);},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return;}if(this.menu.isFirstItem()&&/^previous/.test(a)||this.menu.isLastItem()&&/^next/.test(a)){if(!this.isMultiLine)this._value(this.term);this.menu.blur();return;}this.menu[a](b);},widget:function(){return this.menu.element;},_value:function(){return this.valueMethod.apply(this.element,arguments);},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(a,b);b.preventDefault();}}});a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a);});}});a.widget("ui.autocomplete",a.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(a){return a+(a>1?" results are":" result is")+" available, use up and down arrow keys to navigate.";}}},__response:function(b){var c;this._superApply(arguments);if(this.options.disabled||this.cancelSearch)return;if(b&&b.length)c=this.options.messages.results(b.length);else c=this.options.messages.noResults;this.liveRegion.children().hide();a("<div>").text(c).appendTo(this.liveRegion);}});var q=a.ui.autocomplete;var r,s="ui-button ui-widget ui-state-default ui-corner-all",t="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",u=function(){var b=a(this);setTimeout(function(){b.find(":ui-button").button("refresh");},1);},v=function(b){var c=b.name,d=b.form,e=a([]);if(c){c=c.replace(/'/g,"\\'");if(d)e=a(d).find("[name='"+c+"'][type=radio]");else e=a("[name='"+c+"'][type=radio]",b.ownerDocument).filter(function(){return !this.form;});}return e;};a.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,u);if(typeof this.options.disabled!=="boolean")this.options.disabled=!!this.element.prop("disabled");else this.element.prop("disabled",this.options.disabled);this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var b=this,c=this.options,d=this.type==="checkbox"||this.type==="radio",e=!d?"ui-state-active":"";if(c.label===null)c.label=(this.type==="input"?this.buttonElement.val():this.buttonElement.html());this._hoverable(this.buttonElement);this.buttonElement.addClass(s).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(c.disabled)return;if(this===r)a(this).addClass("ui-state-active");}).bind("mouseleave"+this.eventNamespace,function(){if(c.disabled)return;a(this).removeClass(e);}).bind("click"+this.eventNamespace,function(a){if(c.disabled){a.preventDefault();a.stopImmediatePropagation();}});this._on({focus:function(){this.buttonElement.addClass("ui-state-focus");},blur:function(){this.buttonElement.removeClass("ui-state-focus");}});if(d)this.element.bind("change"+this.eventNamespace,function(){b.refresh();});if(this.type==="checkbox"){this.buttonElement.bind("click"+this.eventNamespace,function(){if(c.disabled)return false;});}else if(this.type==="radio"){this.buttonElement.bind("click"+this.eventNamespace,function(){if(c.disabled)return false;a(this).addClass("ui-state-active");b.buttonElement.attr("aria-pressed","true");var d=b.element[0];v(d).not(d).map(function(){return a(this).button("widget")[0];}).removeClass("ui-state-active").attr("aria-pressed","false");});}else{this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(c.disabled)return false;a(this).addClass("ui-state-active");r=this;b.document.one("mouseup",function(){r=null;});}).bind("mouseup"+this.eventNamespace,function(){if(c.disabled)return false;a(this).removeClass("ui-state-active");}).bind("keydown"+this.eventNamespace,function(b){if(c.disabled)return false;if(b.keyCode===a.ui.keyCode.SPACE||b.keyCode===a.ui.keyCode.ENTER)a(this).addClass("ui-state-active");}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){a(this).removeClass("ui-state-active");});if(this.buttonElement.is("a"))this.buttonElement.keyup(function(b){if(b.keyCode===a.ui.keyCode.SPACE)a(this).click();});}this._setOption("disabled",c.disabled);this._resetButton();},_determineButtonType:function(){var a,b,c;if(this.element.is("[type=checkbox]"))this.type="checkbox";else if(this.element.is("[type=radio]"))this.type="radio";else if(this.element.is("input"))this.type="input";else this.type="button";if(this.type==="checkbox"||this.type==="radio"){a=this.element.parents().last();b="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(b);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(b);if(!this.buttonElement.length)this.buttonElement=a.find(b);}this.element.addClass("ui-helper-hidden-accessible");c=this.element.is(":checked");if(c)this.buttonElement.addClass("ui-state-active");this.buttonElement.prop("aria-pressed",c);}else this.buttonElement=this.element;},widget:function(){return this.buttonElement;},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(s+" ui-state-active "+t).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle)this.buttonElement.removeAttr("title");},_setOption:function(a,b){this._super(a,b);if(a==="disabled"){this.widget().toggleClass("ui-state-disabled",!!b);this.element.prop("disabled",!!b);if(b)if(this.type==="checkbox"||this.type==="radio")this.buttonElement.removeClass("ui-state-focus");else this.buttonElement.removeClass("ui-state-focus ui-state-active");return;}this._resetButton();},refresh:function(){var b=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");if(b!==this.options.disabled)this._setOption("disabled",b);if(this.type==="radio")v(this.element[0]).each(function(){if(a(this).is(":checked"))a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true");else a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false");});else if(this.type==="checkbox")if(this.element.is(":checked"))this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true");else this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false");},_resetButton:function(){if(this.type==="input"){if(this.options.label)this.element.val(this.options.label);return;}var b=this.buttonElement.removeClass(t),c=a("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];if(d.primary||d.secondary){if(this.options.text)f.push("ui-button-text-icon"+(e?"s":(d.primary?"-primary":"-secondary")));if(d.primary)b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>");if(d.secondary)b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>");if(!this.options.text){f.push(e?"ui-button-icons-only":"ui-button-icon-only");if(!this.hasTitle)b.attr("title",a.trim(c));}}else f.push("ui-button-text-only");b.addClass(f.join(" "));}});a.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset");},_init:function(){this.refresh();},_setOption:function(a,b){if(a==="disabled")this.buttons.button("option",a,b);this._super(a,b);},refresh:function(){var b=this.element.css("direction")==="rtl",c=this.element.find(this.options.items),d=c.filter(":ui-button");c.not(":ui-button").button();d.button("refresh");this.buttons=c.map(function(){return a(this).button("widget")[0];}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end();},_destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0];}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");}});var w=a.ui.button;a.extend(a.ui,{datepicker:{version:"1.11.4"}});var x;function y(a){var b,c;while(a.length&&a[0]!==document){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){c=parseInt(a.css("zIndex"),10);if(!isNaN(c)&&c!==0)return c;}a=a.parent();}return 0;}function z(){this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};a.extend(this._defaults,this.regional[""]);this.regional.en=a.extend(true,{},this.regional[""]);this.regional["en-US"]=a.extend(true,{},this.regional.en);this.dpDiv=A(a("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));}a.extend(z.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv;},setDefaults:function(a){C(this._defaults,a||{});return this;},_attachDatepicker:function(b,c){var d,e,f;d=b.nodeName.toLowerCase();e=(d==="div"||d==="span");if(!b.id){this.uuid+=1;b.id="dp"+this.uuid;}f=this._newInst(a(b),e);f.settings=a.extend({},c||{});if(d==="input")this._connectDatepicker(b,f);else if(e)this._inlineDatepicker(b,f);},_newInst:function(b,c){var d=b[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:d,input:b,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:c,dpDiv:(!c?this.dpDiv:A(a("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};},_connectDatepicker:function(b,c){var d=a(b);c.append=a([]);c.trigger=a([]);if(d.hasClass(this.markerClassName))return;this._attachments(d,c);d.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp);this._autoSize(c);a.data(b,"datepicker",c);if(c.settings.disabled)this._disableDatepicker(b);},_attachments:function(b,c){var d,e,f,g=this._get(c,"appendText"),h=this._get(c,"isRTL");if(c.append)c.append.remove();if(g){c.append=a("<span class='"+this._appendClass+"'>"+g+"</span>");b[h?"before":"after"](c.append);}b.unbind("focus",this._showDatepicker);if(c.trigger)c.trigger.remove();d=this._get(c,"showOn");if(d==="focus"||d==="both")b.focus(this._showDatepicker);if(d==="button"||d==="both"){e=this._get(c,"buttonText");f=this._get(c,"buttonImage");c.trigger=a(this._get(c,"buttonImageOnly")?a("<img/>").addClass(this._triggerClass).attr({src:f,alt:e,title:e}):a("<button type='button'></button>").addClass(this._triggerClass).html(!f?e:a("<img/>").attr({src:f,alt:e,title:e})));b[h?"before":"after"](c.trigger);c.trigger.click(function(){if(a.datepicker._datepickerShowing&&a.datepicker._lastInput===b[0])a.datepicker._hideDatepicker();else if(a.datepicker._datepickerShowing&&a.datepicker._lastInput!==b[0]){a.datepicker._hideDatepicker();a.datepicker._showDatepicker(b[0]);}else a.datepicker._showDatepicker(b[0]);return false;});}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b,c,d,e,f=new Date(2009,12-1,20),g=this._get(a,"dateFormat");if(g.match(/[DM]/)){b=function(a){c=0;d=0;for(e=0;e<a.length;e++)if(a[e].length>c){c=a[e].length;d=e;}return d;};f.setMonth(b(this._get(a,(g.match(/MM/)?"monthNames":"monthNamesShort"))));f.setDate(b(this._get(a,(g.match(/DD/)?"dayNames":"dayNamesShort")))+20-f.getDay());}a.input.attr("size",this._formatDate(a,f).length);}},_inlineDatepicker:function(b,c){var d=a(b);if(d.hasClass(this.markerClassName))return;d.addClass(this.markerClassName).append(c.dpDiv);a.data(b,"datepicker",c);this._setDate(c,this._getDefaultDate(c),true);this._updateDatepicker(c);this._updateAlternate(c);if(c.settings.disabled)this._disableDatepicker(b);c.dpDiv.css("display","block");},_dialogDatepicker:function(b,c,d,e,f){var g,h,i,j,k,l=this._dialogInst;if(!l){this.uuid+=1;g="dp"+this.uuid;this._dialogInput=a("<input type='text' id='"+g+"' style='position: absolute; top: -100px; width: 0px;'/>");this._dialogInput.keydown(this._doKeyDown);a("body").append(this._dialogInput);l=this._dialogInst=this._newInst(this._dialogInput,false);l.settings={};a.data(this._dialogInput[0],"datepicker",l);}C(l.settings,e||{});c=(c&&c.constructor===Date?this._formatDate(l,c):c);this._dialogInput.val(c);this._pos=(f?(f.length?f:[f.pageX,f.pageY]):null);if(!this._pos){h=document.documentElement.clientWidth;i=document.documentElement.clientHeight;j=document.documentElement.scrollLeft||document.body.scrollLeft;k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(h/2)-100+j,(i/2)-150+k];}this._dialogInput.css("left",(this._pos[0]+20)+"px").css("top",this._pos[1]+"px");l.settings.onSelect=d;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if(a.blockUI)a.blockUI(this.dpDiv);a.data(this._dialogInput[0],"datepicker",l);return this;},_destroyDatepicker:function(b){var c,d=a(b),e=a.data(b,"datepicker");if(!d.hasClass(this.markerClassName))return;c=b.nodeName.toLowerCase();a.removeData(b,"datepicker");if(c==="input"){e.append.remove();e.trigger.remove();d.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp);}else if(c==="div"||c==="span")d.removeClass(this.markerClassName).empty();if(x===e)x=null;},_enableDatepicker:function(b){var c,d,e=a(b),f=a.data(b,"datepicker");if(!e.hasClass(this.markerClassName))return;c=b.nodeName.toLowerCase();if(c==="input"){b.disabled=false;f.trigger.filter("button").each(function(){this.disabled=false;}).end().filter("img").css({opacity:"1.0",cursor:""});}else if(c==="div"||c==="span"){d=e.children("."+this._inlineClass);d.children().removeClass("ui-state-disabled");d.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",false);}this._disabledInputs=a.map(this._disabledInputs,function(a){return(a===b?null:a);});},_disableDatepicker:function(b){var c,d,e=a(b),f=a.data(b,"datepicker");if(!e.hasClass(this.markerClassName))return;c=b.nodeName.toLowerCase();if(c==="input"){b.disabled=true;f.trigger.filter("button").each(function(){this.disabled=true;}).end().filter("img").css({opacity:"0.5",cursor:"default"});}else if(c==="div"||c==="span"){d=e.children("."+this._inlineClass);d.children().addClass("ui-state-disabled");d.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",true);}this._disabledInputs=a.map(this._disabledInputs,function(a){return(a===b?null:a);});this._disabledInputs[this._disabledInputs.length]=b;},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]===a)return true;return false;},_getInst:function(b){try{return a.data(b,"datepicker");}catch(c){throw "Missing instance data for this datepicker";}},_optionDatepicker:function(b,c,d){var e,f,g,h,i=this._getInst(b);if(arguments.length===2&&typeof c==="string")return(c==="defaults"?a.extend({},a.datepicker._defaults):(i?(c==="all"?a.extend({},i.settings):this._get(i,c)):null));e=c||{};if(typeof c==="string"){e={};e[c]=d;}if(i){if(this._curInst===i)this._hideDatepicker();f=this._getDateDatepicker(b,true);g=this._getMinMaxDate(i,"min");h=this._getMinMaxDate(i,"max");C(i.settings,e);if(g!==null&&e.dateFormat!==undefined&&e.minDate===undefined)i.settings.minDate=this._formatDate(i,g);if(h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined)i.settings.maxDate=this._formatDate(i,h);if("disabled" in e)if(e.disabled)this._disableDatepicker(b);else this._enableDatepicker(b);this._attachments(a(b),i);this._autoSize(i);this._setDate(i,f);this._updateAlternate(i);this._updateDatepicker(i);}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c);},_refreshDatepicker:function(a){var b=this._getInst(a);if(b)this._updateDatepicker(b);},_setDateDatepicker:function(a,b){var c=this._getInst(a);if(c){this._setDate(c,b);this._updateDatepicker(c);this._updateAlternate(c);}},_getDateDatepicker:function(a,b){var c=this._getInst(a);if(c&&!c.inline)this._setDateFromField(c,b);return(c?this._getDate(c):null);},_doKeyDown:function(b){var c,d,e,f=a.datepicker._getInst(b.target),g=true,h=f.dpDiv.is(".ui-datepicker-rtl");f._keyEvent=true;if(a.datepicker._datepickerShowing){switch(b.keyCode){case 9:a.datepicker._hideDatepicker();g=false;break;case 13:e=a("td."+a.datepicker._dayOverClass+":not(."+a.datepicker._currentClass+")",f.dpDiv);if(e[0])a.datepicker._selectDay(b.target,f.selectedMonth,f.selectedYear,e[0]);c=a.datepicker._get(f,"onSelect");if(c){d=a.datepicker._formatDate(f);c.apply((f.input?f.input[0]:null),[d,f]);}else a.datepicker._hideDatepicker();return false;case 27:a.datepicker._hideDatepicker();break;case 33:a.datepicker._adjustDate(b.target,(b.ctrlKey?-a.datepicker._get(f,"stepBigMonths"):-a.datepicker._get(f,"stepMonths")),"M");break;case 34:a.datepicker._adjustDate(b.target,(b.ctrlKey?+a.datepicker._get(f,"stepBigMonths"):+a.datepicker._get(f,"stepMonths")),"M");break;case 35:if(b.ctrlKey||b.metaKey)a.datepicker._clearDate(b.target);g=b.ctrlKey||b.metaKey;break;case 36:if(b.ctrlKey||b.metaKey)a.datepicker._gotoToday(b.target);g=b.ctrlKey||b.metaKey;break;case 37:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,(h?+1:-1),"D");g=b.ctrlKey||b.metaKey;if(b.originalEvent.altKey)a.datepicker._adjustDate(b.target,(b.ctrlKey?-a.datepicker._get(f,"stepBigMonths"):-a.datepicker._get(f,"stepMonths")),"M");break;case 38:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,-7,"D");g=b.ctrlKey||b.metaKey;break;case 39:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,(h?-1:+1),"D");g=b.ctrlKey||b.metaKey;if(b.originalEvent.altKey)a.datepicker._adjustDate(b.target,(b.ctrlKey?+a.datepicker._get(f,"stepBigMonths"):+a.datepicker._get(f,"stepMonths")),"M");break;case 40:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,+7,"D");g=b.ctrlKey||b.metaKey;break;default:g=false;}}else if(b.keyCode===36&&b.ctrlKey)a.datepicker._showDatepicker(this);else g=false;if(g){b.preventDefault();b.stopPropagation();}},_doKeyPress:function(b){var c,d,e=a.datepicker._getInst(b.target);if(a.datepicker._get(e,"constrainInput")){c=a.datepicker._possibleChars(a.datepicker._get(e,"dateFormat"));d=String.fromCharCode(b.charCode==null?b.keyCode:b.charCode);return b.ctrlKey||b.metaKey||(d<" "||!c||c.indexOf(d)>-1);}},_doKeyUp:function(b){var c,d=a.datepicker._getInst(b.target);if(d.input.val()!==d.lastVal)try{c=a.datepicker.parseDate(a.datepicker._get(d,"dateFormat"),(d.input?d.input.val():null),a.datepicker._getFormatConfig(d));if(c){a.datepicker._setDateFromField(d);a.datepicker._updateAlternate(d);a.datepicker._updateDatepicker(d);}}catch(e){}return true;},_showDatepicker:function(b){b=b.target||b;if(b.nodeName.toLowerCase()!=="input")b=a("input",b.parentNode)[0];if(a.datepicker._isDisabledDatepicker(b)||a.datepicker._lastInput===b)return;var c,d,e,f,g,h,i;c=a.datepicker._getInst(b);if(a.datepicker._curInst&&a.datepicker._curInst!==c){a.datepicker._curInst.dpDiv.stop(true,true);if(c&&a.datepicker._datepickerShowing)a.datepicker._hideDatepicker(a.datepicker._curInst.input[0]);}d=a.datepicker._get(c,"beforeShow");e=d?d.apply(b,[b,c]):{};if(e===false)return;C(c.settings,e);c.lastVal=null;a.datepicker._lastInput=b;a.datepicker._setDateFromField(c);if(a.datepicker._inDialog)b.value="";if(!a.datepicker._pos){a.datepicker._pos=a.datepicker._findPos(b);a.datepicker._pos[1]+=b.offsetHeight;}f=false;a(b).parents().each(function(){f|=a(this).css("position")==="fixed";return !f;});g={left:a.datepicker._pos[0],top:a.datepicker._pos[1]};a.datepicker._pos=null;c.dpDiv.empty();c.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});a.datepicker._updateDatepicker(c);g=a.datepicker._checkOffset(c,g,f);c.dpDiv.css({position:(a.datepicker._inDialog&&a.blockUI?"static":(f?"fixed":"absolute")),display:"none",left:g.left+"px",top:g.top+"px"});if(!c.inline){h=a.datepicker._get(c,"showAnim");i=a.datepicker._get(c,"duration");c.dpDiv.css("z-index",y(a(b))+1);a.datepicker._datepickerShowing=true;if(a.effects&&a.effects.effect[h])c.dpDiv.show(h,a.datepicker._get(c,"showOptions"),i);else c.dpDiv[h||"show"](h?i:null);if(a.datepicker._shouldFocusInput(c))c.input.focus();a.datepicker._curInst=c;}},_updateDatepicker:function(b){this.maxRows=4;x=b;b.dpDiv.empty().append(this._generateHTML(b));this._attachHandlers(b);var c,d=this._getNumberOfMonths(b),e=d[1],f=17,g=b.dpDiv.find("."+this._dayOverClass+" a");if(g.length>0)B.apply(g.get(0));b.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(e>1)b.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",(f*e)+"em");b.dpDiv[(d[0]!==1||d[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");b.dpDiv[(this._get(b,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(b===a.datepicker._curInst&&a.datepicker._datepickerShowing&&a.datepicker._shouldFocusInput(b))b.input.focus();if(b.yearshtml){c=b.yearshtml;setTimeout(function(){if(c===b.yearshtml&&b.yearshtml)b.dpDiv.find("select.ui-datepicker-year:first").replaceWith(b.yearshtml);c=b.yearshtml=null;},0);}},_shouldFocusInput:function(a){return a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&!a.input.is(":focus");},_checkOffset:function(b,c,d){var e=b.dpDiv.outerWidth(),f=b.dpDiv.outerHeight(),g=b.input?b.input.outerWidth():0,h=b.input?b.input.outerHeight():0,i=document.documentElement.clientWidth+(d?0:a(document).scrollLeft()),j=document.documentElement.clientHeight+(d?0:a(document).scrollTop());c.left-=(this._get(b,"isRTL")?(e-g):0);c.left-=(d&&c.left===b.input.offset().left)?a(document).scrollLeft():0;c.top-=(d&&c.top===(b.input.offset().top+h))?a(document).scrollTop():0;c.left-=Math.min(c.left,(c.left+e>i&&i>e)?Math.abs(c.left+e-i):0);c.top-=Math.min(c.top,(c.top+f>j&&j>f)?Math.abs(f+h):0);return c;},_findPos:function(b){var c,d=this._getInst(b),e=this._get(d,"isRTL");while(b&&(b.type==="hidden"||b.nodeType!==1||a.expr.filters.hidden(b)))b=b[e?"previousSibling":"nextSibling"];c=a(b).offset();return [c.left,c.top];},_hideDatepicker:function(b){var c,d,e,f,g=this._curInst;if(!g||(b&&g!==a.data(b,"datepicker")))return;if(this._datepickerShowing){c=this._get(g,"showAnim");d=this._get(g,"duration");e=function(){a.datepicker._tidyDialog(g);};if(a.effects&&(a.effects.effect[c]||a.effects[c]))g.dpDiv.hide(c,a.datepicker._get(g,"showOptions"),d,e);else g.dpDiv[(c==="slideDown"?"slideUp":(c==="fadeIn"?"fadeOut":"hide"))]((c?d:null),e);if(!c)e();this._datepickerShowing=false;f=this._get(g,"onClose");if(f)f.apply((g.input?g.input[0]:null),[(g.input?g.input.val():""),g]);this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(a.blockUI){a.unblockUI();a("body").append(this.dpDiv);}}this._inDialog=false;}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");},_checkExternalClick:function(b){if(!a.datepicker._curInst)return;var c=a(b.target),d=a.datepicker._getInst(c[0]);if((c[0].id!==a.datepicker._mainDivId&&c.parents("#"+a.datepicker._mainDivId).length===0&&!c.hasClass(a.datepicker.markerClassName)&&!c.closest("."+a.datepicker._triggerClass).length&&a.datepicker._datepickerShowing&&!(a.datepicker._inDialog&&a.blockUI))||(c.hasClass(a.datepicker.markerClassName)&&a.datepicker._curInst!==d))a.datepicker._hideDatepicker();},_adjustDate:function(b,c,d){var e=a(b),f=this._getInst(e[0]);if(this._isDisabledDatepicker(e[0]))return;this._adjustInstDate(f,c+(d==="M"?this._get(f,"showCurrentAtPos"):0),d);this._updateDatepicker(f);},_gotoToday:function(b){var c,d=a(b),e=this._getInst(d[0]);if(this._get(e,"gotoCurrent")&&e.currentDay){e.selectedDay=e.currentDay;e.drawMonth=e.selectedMonth=e.currentMonth;e.drawYear=e.selectedYear=e.currentYear;}else{c=new Date();e.selectedDay=c.getDate();e.drawMonth=e.selectedMonth=c.getMonth();e.drawYear=e.selectedYear=c.getFullYear();}this._notifyChange(e);this._adjustDate(d);},_selectMonthYear:function(b,c,d){var e=a(b),f=this._getInst(e[0]);f["selected"+(d==="M"?"Month":"Year")]=f["draw"+(d==="M"?"Month":"Year")]=parseInt(c.options[c.selectedIndex].value,10);this._notifyChange(f);this._adjustDate(e);},_selectDay:function(b,c,d,e){var f,g=a(b);if(a(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(g[0]))return;f=this._getInst(g[0]);f.selectedDay=f.currentDay=a("a",e).html();f.selectedMonth=f.currentMonth=c;f.selectedYear=f.currentYear=d;this._selectDate(b,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear));},_clearDate:function(b){var c=a(b);this._selectDate(c,"");},_selectDate:function(b,c){var d,e=a(b),f=this._getInst(e[0]);c=(c!=null?c:this._formatDate(f));if(f.input)f.input.val(c);this._updateAlternate(f);d=this._get(f,"onSelect");if(d)d.apply((f.input?f.input[0]:null),[c,f]);else if(f.input)f.input.trigger("change");if(f.inline)this._updateDatepicker(f);else{this._hideDatepicker();this._lastInput=f.input[0];if(typeof f.input[0]!=="object")f.input.focus();this._lastInput=null;}},_updateAlternate:function(b){var c,d,e,f=this._get(b,"altField");if(f){c=this._get(b,"altFormat")||this._get(b,"dateFormat");d=this._getDate(b);e=this.formatDate(c,d,this._getFormatConfig(b));a(f).each(function(){a(this).val(e);});}},noWeekends:function(a){var b=a.getDay();return [(b>0&&b<6),""];},iso8601Week:function(a){var b,c=new Date(a.getTime());c.setDate(c.getDate()+4-(c.getDay()||7));b=c.getTime();c.setMonth(0);c.setDate(1);return Math.floor(Math.round((b-c)/86400000)/7)+1;},parseDate:function(b,c,d){if(b==null||c==null)throw "Invalid arguments";c=(typeof c==="object"?c.toString():c+"");if(c==="")return null;var e,f,g,h=0,i=(d?d.shortYearCutoff:null)||this._defaults.shortYearCutoff,j=(typeof i!=="string"?i:new Date().getFullYear()%100+parseInt(i,10)),k=(d?d.dayNamesShort:null)||this._defaults.dayNamesShort,l=(d?d.dayNames:null)||this._defaults.dayNames,m=(d?d.monthNamesShort:null)||this._defaults.monthNamesShort,n=(d?d.monthNames:null)||this._defaults.monthNames,o=-1,p=-1,q=-1,r=-1,s=false,t,u=function(a){var c=(e+1<b.length&&b.charAt(e+1)===a);if(c)e++;return c;},v=function(a){var b=u(a),d=(a==="@"?14:(a==="!"?20:(a==="y"&&b?4:(a==="o"?3:2)))),e=(a==="y"?d:1),f=new RegExp("^\\d{"+e+","+d+"}"),g=c.substring(h).match(f);if(!g)throw "Missing number at position "+h;h+=g[0].length;return parseInt(g[0],10);},w=function(b,d,e){var f=-1,g=a.map(u(b)?e:d,function(a,b){return [[b,a]];}).sort(function(a,b){return -(a[1].length-b[1].length);});a.each(g,function(a,b){var d=b[1];if(c.substr(h,d.length).toLowerCase()===d.toLowerCase()){f=b[0];h+=d.length;return false;}});if(f!==-1)return f+1;else throw "Unknown name at position "+h;},x=function(){if(c.charAt(h)!==b.charAt(e))throw "Unexpected literal at position "+h;h++;};for(e=0;e<b.length;e++)if(s)if(b.charAt(e)==="'"&&!u("'"))s=false;else x();else switch(b.charAt(e)){case "d":q=v("d");break;case "D":w("D",k,l);break;case "o":r=v("o");break;case "m":p=v("m");break;case "M":p=w("M",m,n);break;case "y":o=v("y");break;case "@":t=new Date(v("@"));o=t.getFullYear();p=t.getMonth()+1;q=t.getDate();break;case "!":t=new Date((v("!")-this._ticksTo1970)/10000);o=t.getFullYear();p=t.getMonth()+1;q=t.getDate();break;case "'":if(u("'"))x();else s=true;break;default:x();}if(h<c.length){g=c.substr(h);if(!/^\s+/.test(g))throw "Extra/unparsed characters found in date: "+g;}if(o===-1)o=new Date().getFullYear();else if(o<100)o+=new Date().getFullYear()-new Date().getFullYear()%100+(o<=j?0:-100);if(r>-1){p=1;q=r;do{f=this._getDaysInMonth(o,p-1);if(q<=f)break;p++;q-=f;}while(true);}t=this._daylightSavingAdjust(new Date(o,p-1,q));if(t.getFullYear()!==o||t.getMonth()+1!==p||t.getDate()!==q)throw "Invalid date";return t;},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*10000000),formatDate:function(a,b,c){if(!b)return "";var d,e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=function(b){var c=(d+1<a.length&&a.charAt(d+1)===b);if(c)d++;return c;},j=function(a,b,c){var d=""+b;if(i(a))while(d.length<c)d="0"+d;return d;},k=function(a,b,c,d){return(i(a)?d[b]:c[b]);},l="",m=false;if(b)for(d=0;d<a.length;d++)if(m)if(a.charAt(d)==="'"&&!i("'"))m=false;else l+=a.charAt(d);else switch(a.charAt(d)){case "d":l+=j("d",b.getDate(),2);break;case "D":l+=k("D",b.getDay(),e,f);break;case "o":l+=j("o",Math.round((new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime()-new Date(b.getFullYear(),0,0).getTime())/86400000),3);break;case "m":l+=j("m",b.getMonth()+1,2);break;case "M":l+=k("M",b.getMonth(),g,h);break;case "y":l+=(i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100);break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*10000+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else m=true;break;default:l+=a.charAt(d);}return l;},_possibleChars:function(a){var b,c="",d=false,e=function(c){var d=(b+1<a.length&&a.charAt(b+1)===c);if(d)b++;return d;};for(b=0;b<a.length;b++)if(d)if(a.charAt(b)==="'"&&!e("'"))d=false;else c+=a.charAt(b);else switch(a.charAt(b)){case "d":case "m":case "y":case "@":c+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))c+="'";else d=true;break;default:c+=a.charAt(b);}return c;},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b];},_setDateFromField:function(a,b){if(a.input.val()===a.lastVal)return;var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e=this._getDefaultDate(a),f=e,g=this._getFormatConfig(a);try{f=this.parseDate(c,d,g)||e;}catch(h){d=(b?"":d);}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=(d?f.getDate():0);a.currentMonth=(d?f.getMonth():0);a.currentYear=(d?f.getFullYear():0);this._adjustInstDate(a);},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date()));},_determineDate:function(b,c,d){var e=function(a){var b=new Date();b.setDate(b.getDate()+a);return b;},f=function(c){try{return a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),c,a.datepicker._getFormatConfig(b));}catch(d){}var e=(c.toLowerCase().match(/^c/)?a.datepicker._getDate(b):null)||new Date(),f=e.getFullYear(),g=e.getMonth(),h=e.getDate(),i=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,j=i.exec(c);while(j){switch(j[2]||"d"){case "d":case "D":h+=parseInt(j[1],10);break;case "w":case "W":h+=parseInt(j[1],10)*7;break;case "m":case "M":g+=parseInt(j[1],10);h=Math.min(h,a.datepicker._getDaysInMonth(f,g));break;case "y":case "Y":f+=parseInt(j[1],10);h=Math.min(h,a.datepicker._getDaysInMonth(f,g));break;}j=i.exec(c);}return new Date(f,g,h);},g=(c==null||c===""?d:(typeof c==="string"?f(c):(typeof c==="number"?(isNaN(c)?d:e(c)):new Date(c.getTime()))));g=(g&&g.toString()==="Invalid Date"?d:g);if(g){g.setHours(0);g.setMinutes(0);g.setSeconds(0);g.setMilliseconds(0);}return this._daylightSavingAdjust(g);},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a;},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date()));a.selectedDay=a.currentDay=g.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth();a.drawYear=a.selectedYear=a.currentYear=g.getFullYear();if((e!==a.selectedMonth||f!==a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(d?"":this._formatDate(a));},_getDate:function(a){var b=(!a.currentYear||(a.input&&a.input.val()==="")?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay)));return b;},_attachHandlers:function(b){var c=this._get(b,"stepMonths"),d="#"+b.id.replace(/\\\\/g,"\\");b.dpDiv.find("[data-handler]").map(function(){var b={prev:function(){a.datepicker._adjustDate(d,-c,"M");},next:function(){a.datepicker._adjustDate(d,+c,"M");},hide:function(){a.datepicker._hideDatepicker();},today:function(){a.datepicker._gotoToday(d);},selectDay:function(){a.datepicker._selectDay(d,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false;},selectMonth:function(){a.datepicker._selectMonthYear(d,this,"M");return false;},selectYear:function(){a.datepicker._selectMonthYear(d,this,"Y");return false;}};a(this).bind(this.getAttribute("data-event"),b[this.getAttribute("data-handler")]);});},_generateHTML:function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O=new Date(),P=this._daylightSavingAdjust(new Date(O.getFullYear(),O.getMonth(),O.getDate())),Q=this._get(a,"isRTL"),R=this._get(a,"showButtonPanel"),S=this._get(a,"hideIfNoPrevNext"),T=this._get(a,"navigationAsDateFormat"),U=this._getNumberOfMonths(a),V=this._get(a,"showCurrentAtPos"),W=this._get(a,"stepMonths"),X=(U[0]!==1||U[1]!==1),Y=this._daylightSavingAdjust((!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay))),Z=this._getMinMaxDate(a,"min"),ab=this._getMinMaxDate(a,"max"),ac=a.drawMonth-V,ad=a.drawYear;if(ac<0){ac+=12;ad--;}if(ab){b=this._daylightSavingAdjust(new Date(ab.getFullYear(),ab.getMonth()-(U[0]*U[1])+1,ab.getDate()));b=(Z&&b<Z?Z:b);while(this._daylightSavingAdjust(new Date(ad,ac,1))>b){ac--;if(ac<0){ac=11;ad--;}}}a.drawMonth=ac;a.drawYear=ad;c=this._get(a,"prevText");c=(!T?c:this.formatDate(c,this._daylightSavingAdjust(new Date(ad,ac-W,1)),this._getFormatConfig(a)));d=(this._canAdjustMonth(a,-1,ad,ac)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'"+" title='"+c+"'><span class='ui-icon ui-icon-circle-triangle-"+(Q?"e":"w")+"'>"+c+"</span></a>":(S?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+c+"'><span class='ui-icon ui-icon-circle-triangle-"+(Q?"e":"w")+"'>"+c+"</span></a>"));e=this._get(a,"nextText");e=(!T?e:this.formatDate(e,this._daylightSavingAdjust(new Date(ad,ac+W,1)),this._getFormatConfig(a)));f=(this._canAdjustMonth(a,+1,ad,ac)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'"+" title='"+e+"'><span class='ui-icon ui-icon-circle-triangle-"+(Q?"w":"e")+"'>"+e+"</span></a>":(S?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+e+"'><span class='ui-icon ui-icon-circle-triangle-"+(Q?"w":"e")+"'>"+e+"</span></a>"));g=this._get(a,"currentText");h=(this._get(a,"gotoCurrent")&&a.currentDay?Y:P);g=(!T?g:this.formatDate(g,h,this._getFormatConfig(a)));i=(!a.inline?"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(a,"closeText")+"</button>":"");j=R?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Q?i:"")+(this._isInRange(a,h)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'"+">"+g+"</button>":"")+(Q?"":i)+"</div>":"";k=parseInt(this._get(a,"firstDay"),10);k=(isNaN(k)?0:k);l=this._get(a,"showWeek");m=this._get(a,"dayNames");n=this._get(a,"dayNamesMin");o=this._get(a,"monthNames");p=this._get(a,"monthNamesShort");q=this._get(a,"beforeShowDay");r=this._get(a,"showOtherMonths");s=this._get(a,"selectOtherMonths");t=this._getDefaultDate(a);u="";v;for(w=0;w<U[0];w++){x="";this.maxRows=4;for(y=0;y<U[1];y++){z=this._daylightSavingAdjust(new Date(ad,ac,a.selectedDay));A=" ui-corner-all";B="";if(X){B+="<div class='ui-datepicker-group";if(U[1]>1)switch(y){case 0:B+=" ui-datepicker-group-first";A=" ui-corner-"+(Q?"right":"left");break;case U[1]-1:B+=" ui-datepicker-group-last";A=" ui-corner-"+(Q?"left":"right");break;default:B+=" ui-datepicker-group-middle";A="";break;}B+="'>";}B+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+A+"'>"+(/all|left/.test(A)&&w===0?(Q?f:d):"")+(/all|right/.test(A)&&w===0?(Q?d:f):"")+this._generateMonthYearHeader(a,ac,ad,Z,ab,w>0||y>0,o,p)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>";C=(l?"<th class='ui-datepicker-week-col'>"+this._get(a,"weekHeader")+"</th>":"");for(v=0;v<7;v++){D=(v+k)%7;C+="<th scope='col'"+((v+k+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+m[D]+"'>"+n[D]+"</span></th>";}B+=C+"</tr></thead><tbody>";E=this._getDaysInMonth(ad,ac);if(ad===a.selectedYear&&ac===a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,E);F=(this._getFirstDayOfMonth(ad,ac)-k+7)%7;G=Math.ceil((F+E)/7);H=(X?this.maxRows>G?this.maxRows:G:G);this.maxRows=H;I=this._daylightSavingAdjust(new Date(ad,ac,1-F));for(J=0;J<H;J++){B+="<tr>";K=(!l?"":"<td class='ui-datepicker-week-col'>"+this._get(a,"calculateWeek")(I)+"</td>");for(v=0;v<7;v++){L=(q?q.apply((a.input?a.input[0]:null),[I]):[true,""]);M=(I.getMonth()!==ac);N=(M&&!s)||!L[0]||(Z&&I<Z)||(ab&&I>ab);K+="<td class='"+((v+k+6)%7>=5?" ui-datepicker-week-end":"")+(M?" ui-datepicker-other-month":"")+((I.getTime()===z.getTime()&&ac===a.selectedMonth&&a._keyEvent)||(t.getTime()===I.getTime()&&t.getTime()===z.getTime())?" "+this._dayOverClass:"")+(N?" "+this._unselectableClass+" ui-state-disabled":"")+(M&&!r?"":" "+L[1]+(I.getTime()===Y.getTime()?" "+this._currentClass:"")+(I.getTime()===P.getTime()?" ui-datepicker-today":""))+"'"+((!M||r)&&L[2]?" title='"+L[2].replace(/'/g,"&#39;")+"'":"")+(N?"":" data-handler='selectDay' data-event='click' data-month='"+I.getMonth()+"' data-year='"+I.getFullYear()+"'")+">"+(M&&!r?"&#xa0;":(N?"<span class='ui-state-default'>"+I.getDate()+"</span>":"<a class='ui-state-default"+(I.getTime()===P.getTime()?" ui-state-highlight":"")+(I.getTime()===Y.getTime()?" ui-state-active":"")+(M?" ui-priority-secondary":"")+"' href='#'>"+I.getDate()+"</a>"))+"</td>";I.setDate(I.getDate()+1);I=this._daylightSavingAdjust(I);}B+=K+"</tr>";}ac++;if(ac>11){ac=0;ad++;}B+="</tbody></table>"+(X?"</div>"+((U[0]>0&&y===U[1]-1)?"<div class='ui-datepicker-row-break'></div>":""):"");x+=B;}u+=x;}u+=j;a._keyEvent=false;return u;},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q=this._get(a,"changeMonth"),r=this._get(a,"changeYear"),s=this._get(a,"showMonthAfterYear"),t="<div class='ui-datepicker-title'>",u="";if(f||!q)u+="<span class='ui-datepicker-month'>"+g[b]+"</span>";else{i=(d&&d.getFullYear()===c);j=(e&&e.getFullYear()===c);u+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";for(k=0;k<12;k++)if((!i||k>=d.getMonth())&&(!j||k<=e.getMonth()))u+="<option value='"+k+"'"+(k===b?" selected='selected'":"")+">"+h[k]+"</option>";u+="</select>";}if(!s)t+=u+(f||!(q&&r)?"&#xa0;":"");if(!a.yearshtml){a.yearshtml="";if(f||!r)t+="<span class='ui-datepicker-year'>"+c+"</span>";else{l=this._get(a,"yearRange").split(":");m=new Date().getFullYear();n=function(a){var b=(a.match(/c[+\-].*/)?c+parseInt(a.substring(1),10):(a.match(/[+\-].*/)?m+parseInt(a,10):parseInt(a,10)));return(isNaN(b)?m:b);};o=n(l[0]);p=Math.max(o,n(l[1]||""));o=(d?Math.max(o,d.getFullYear()):o);p=(e?Math.min(p,e.getFullYear()):p);a.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";for(;o<=p;o++)a.yearshtml+="<option value='"+o+"'"+(o===c?" selected='selected'":"")+">"+o+"</option>";a.yearshtml+="</select>";t+=a.yearshtml;a.yearshtml=null;}}t+=this._get(a,"yearSuffix");if(s)t+=(f||!(q&&r)?"&#xa0;":"")+u;t+="</div>";return t;},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c==="Y"?b:0),e=a.drawMonth+(c==="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c==="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate();a.drawMonth=a.selectedMonth=g.getMonth();a.drawYear=a.selectedYear=g.getFullYear();if(c==="M"||c==="Y")this._notifyChange(a);},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=(c&&b<c?c:b);return(d&&e>d?d:e);},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply((a.input?a.input[0]:null),[a.selectedYear,a.selectedMonth+1,a]);},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return(b==null?[1,1]:(typeof b==="number"?[1,b]:b));},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null);},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate();},_getFirstDayOfMonth:function(a,b){return new Date(a,b,1).getDay();},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));if(b<0)f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f);},_isInRange:function(a,b){var c,d,e=this._getMinMaxDate(a,"min"),f=this._getMinMaxDate(a,"max"),g=null,h=null,i=this._get(a,"yearRange");if(i){c=i.split(":");d=new Date().getFullYear();g=parseInt(c[0],10);h=parseInt(c[1],10);if(c[0].match(/[+\-].*/))g+=d;if(c[1].match(/[+\-].*/))h+=d;}return((!e||b.getTime()>=e.getTime())&&(!f||b.getTime()<=f.getTime())&&(!g||b.getFullYear()>=g)&&(!h||b.getFullYear()<=h));},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=(typeof b!=="string"?b:new Date().getFullYear()%100+parseInt(b,10));return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")};},_formatDate:function(a,b,c,d){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear;}var e=(b?(typeof b==="object"?b:this._daylightSavingAdjust(new Date(d,c,b))):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay)));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a));}});function A(b){var c="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return b.delegate(c,"mouseout",function(){a(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1)a(this).removeClass("ui-datepicker-prev-hover");if(this.className.indexOf("ui-datepicker-next")!==-1)a(this).removeClass("ui-datepicker-next-hover");}).delegate(c,"mouseover",B);}function B(){if(!a.datepicker._isDisabledDatepicker(x.inline?x.dpDiv.parent()[0]:x.input[0])){a(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");a(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1)a(this).addClass("ui-datepicker-prev-hover");if(this.className.indexOf("ui-datepicker-next")!==-1)a(this).addClass("ui-datepicker-next-hover");}}function C(b,c){a.extend(b,c);for(var d in c)if(c[d]==null)b[d]=c[d];return b;}a.fn.datepicker=function(b){if(!this.length)return this;if(!a.datepicker.initialized){a(document).mousedown(a.datepicker._checkExternalClick);a.datepicker.initialized=true;}if(a("#"+a.datepicker._mainDivId).length===0)a("body").append(a.datepicker.dpDiv);var c=Array.prototype.slice.call(arguments,1);if(typeof b==="string"&&(b==="isDisabled"||b==="getDate"||b==="widget"))return a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(c));if(b==="option"&&arguments.length===2&&typeof arguments[1]==="string")return a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(c));return this.each(function(){typeof b==="string"?a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this].concat(c)):a.datepicker._attachDatepicker(this,b);});};a.datepicker=new z();a.datepicker.initialized=false;a.datepicker.uuid=new Date().getTime();a.datepicker.version="1.11.4";var D=a.datepicker;var E=a.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:true,buttons:[],closeOnEscape:true,closeText:"Close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(b){var c=a(this).css(b).offset().top;if(c<0)a(this).css("top",b.top-c);}},resizable:true,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions:{maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height};this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)};this.originalTitle=this.element.attr("title");this.options.title=this.options.title||this.originalTitle;this._createWrapper();this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog);this._createTitlebar();this._createButtonPane();if(this.options.draggable&&a.fn.draggable)this._makeDraggable();if(this.options.resizable&&a.fn.resizable)this._makeResizable();this._isOpen=false;this._trackFocus();},_init:function(){if(this.options.autoOpen)this.open();},_appendTo:function(){var b=this.options.appendTo;if(b&&(b.jquery||b.nodeType))return a(b);return this.document.find(b||"body").eq(0);},_destroy:function(){var a,b=this.originalPosition;this._untrackInstance();this._destroyOverlay();this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach();this.uiDialog.stop(true,true).remove();if(this.originalTitle)this.element.attr("title",this.originalTitle);a=b.parent.children().eq(b.index);if(a.length&&a[0]!==this.element[0])a.before(this.element);else b.parent.append(this.element);},widget:function(){return this.uiDialog;},disable:a.noop,enable:a.noop,close:function(b){var c,d=this;if(!this._isOpen||this._trigger("beforeClose",b)===false)return;this._isOpen=false;this._focusedElement=null;this._destroyOverlay();this._untrackInstance();if(!this.opener.filter(":focusable").focus().length)try{c=this.document[0].activeElement;if(c&&c.nodeName.toLowerCase()!=="body")a(c).blur();}catch(e){}this._hide(this.uiDialog,this.options.hide,function(){d._trigger("close",b);});},isOpen:function(){return this._isOpen;},moveToTop:function(){this._moveToTop();},_moveToTop:function(b,c){var d=false,e=this.uiDialog.siblings(".ui-front:visible").map(function(){return +a(this).css("z-index");}).get(),f=Math.max.apply(null,e);if(f>=+this.uiDialog.css("z-index")){this.uiDialog.css("z-index",f+1);d=true;}if(d&&!c)this._trigger("focus",b);return d;},open:function(){var b=this;if(this._isOpen){if(this._moveToTop())this._focusTabbable();return;}this._isOpen=true;this.opener=a(this.document[0].activeElement);this._size();this._position();this._createOverlay();this._moveToTop(null,true);if(this.overlay)this.overlay.css("z-index",this.uiDialog.css("z-index")-1);this._show(this.uiDialog,this.options.show,function(){b._focusTabbable();b._trigger("focus");});this._makeFocusTarget();this._trigger("open");},_focusTabbable:function(){var a=this._focusedElement;if(!a)a=this.element.find("[autofocus]");if(!a.length)a=this.element.find(":tabbable");if(!a.length)a=this.uiDialogButtonPane.find(":tabbable");if(!a.length)a=this.uiDialogTitlebarClose.filter(":tabbable");if(!a.length)a=this.uiDialog;a.eq(0).focus();},_keepFocus:function(b){function c(){var b=this.document[0].activeElement,c=this.uiDialog[0]===b||a.contains(this.uiDialog[0],b);if(!c)this._focusTabbable();}b.preventDefault();c.call(this);this._delay(c);},_createWrapper:function(){this.uiDialog=a("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo());this._on(this.uiDialog,{keydown:function(b){if(this.options.closeOnEscape&&!b.isDefaultPrevented()&&b.keyCode&&b.keyCode===a.ui.keyCode.ESCAPE){b.preventDefault();this.close(b);return;}if(b.keyCode!==a.ui.keyCode.TAB||b.isDefaultPrevented())return;var c=this.uiDialog.find(":tabbable"),d=c.filter(":first"),e=c.filter(":last");if((b.target===e[0]||b.target===this.uiDialog[0])&&!b.shiftKey){this._delay(function(){d.focus();});b.preventDefault();}else if((b.target===d[0]||b.target===this.uiDialog[0])&&b.shiftKey){this._delay(function(){e.focus();});b.preventDefault();}},mousedown:function(a){if(this._moveToTop(a))this._focusTabbable();}});if(!this.element.find("[aria-describedby]").length)this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")});},_createTitlebar:function(){var b;this.uiDialogTitlebar=a("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog);this._on(this.uiDialogTitlebar,{mousedown:function(b){if(!a(b.target).closest(".ui-dialog-titlebar-close"))this.uiDialog.focus();}});this.uiDialogTitlebarClose=a("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:false}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar);this._on(this.uiDialogTitlebarClose,{click:function(a){a.preventDefault();this.close(a);}});b=a("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar);this._title(b);this.uiDialog.attr({"aria-labelledby":b.attr("id")});},_title:function(a){if(!this.options.title)a.html("&#160;");a.text(this.options.title);},_createButtonPane:function(){this.uiDialogButtonPane=a("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiButtonSet=a("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane);this._createButtons();},_createButtons:function(){var b=this,c=this.options.buttons;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();if(a.isEmptyObject(c)||(a.isArray(c)&&!c.length)){this.uiDialog.removeClass("ui-dialog-buttons");return;}a.each(c,function(c,d){var e,f;d=a.isFunction(d)?{click:d,text:c}:d;d=a.extend({type:"button"},d);e=d.click;d.click=function(){e.apply(b.element[0],arguments);};f={icons:d.icons,text:d.showText};delete d.icons;delete d.showText;a("<button></button>",d).button(f).appendTo(b.uiButtonSet);});this.uiDialog.addClass("ui-dialog-buttons");this.uiDialogButtonPane.appendTo(this.uiDialog);},_makeDraggable:function(){var b=this,c=this.options;function d(a){return{position:a.position,offset:a.offset};}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(c,e){a(this).addClass("ui-dialog-dragging");b._blockFrames();b._trigger("dragStart",c,d(e));},drag:function(a,c){b._trigger("drag",a,d(c));},stop:function(e,f){var g=f.offset.left-b.document.scrollLeft(),h=f.offset.top-b.document.scrollTop();c.position={my:"left top",at:"left"+(g>=0?"+":"")+g+" "+"top"+(h>=0?"+":"")+h,of:b.window};a(this).removeClass("ui-dialog-dragging");b._unblockFrames();b._trigger("dragStop",e,d(f));}});},_makeResizable:function(){var b=this,c=this.options,d=c.resizable,e=this.uiDialog.css("position"),f=typeof d==="string"?d:"n,e,s,w,se,sw,ne,nw";function g(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size};}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:c.maxWidth,maxHeight:c.maxHeight,minWidth:c.minWidth,minHeight:this._minHeight(),handles:f,start:function(c,d){a(this).addClass("ui-dialog-resizing");b._blockFrames();b._trigger("resizeStart",c,g(d));},resize:function(a,c){b._trigger("resize",a,g(c));},stop:function(d,e){var f=b.uiDialog.offset(),h=f.left-b.document.scrollLeft(),i=f.top-b.document.scrollTop();c.height=b.uiDialog.height();c.width=b.uiDialog.width();c.position={my:"left top",at:"left"+(h>=0?"+":"")+h+" "+"top"+(i>=0?"+":"")+i,of:b.window};a(this).removeClass("ui-dialog-resizing");b._unblockFrames();b._trigger("resizeStop",d,g(e));}}).css("position",e);},_trackFocus:function(){this._on(this.widget(),{focusin:function(b){this._makeFocusTarget();this._focusedElement=a(b.target);}});},_makeFocusTarget:function(){this._untrackInstance();this._trackingInstances().unshift(this);},_untrackInstance:function(){var b=this._trackingInstances(),c=a.inArray(this,b);if(c!==-1)b.splice(c,1);},_trackingInstances:function(){var a=this.document.data("ui-dialog-instances");if(!a){a=[];this.document.data("ui-dialog-instances",a);}return a;},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height);},_position:function(){var a=this.uiDialog.is(":visible");if(!a)this.uiDialog.show();this.uiDialog.position(this.options.position);if(!a)this.uiDialog.hide();},_setOptions:function(b){var c=this,d=false,e={};a.each(b,function(a,b){c._setOption(a,b);if(a in c.sizeRelatedOptions)d=true;if(a in c.resizableRelatedOptions)e[a]=b;});if(d){this._size();this._position();}if(this.uiDialog.is(":data(ui-resizable)"))this.uiDialog.resizable("option",e);},_setOption:function(a,b){var c,d,e=this.uiDialog;if(a==="dialogClass")e.removeClass(this.options.dialogClass).addClass(b);if(a==="disabled")return;this._super(a,b);if(a==="appendTo")this.uiDialog.appendTo(this._appendTo());if(a==="buttons")this._createButtons();if(a==="closeText")this.uiDialogTitlebarClose.button({label:""+b});if(a==="draggable"){c=e.is(":data(ui-draggable)");if(c&&!b)e.draggable("destroy");if(!c&&b)this._makeDraggable();}if(a==="position")this._position();if(a==="resizable"){d=e.is(":data(ui-resizable)");if(d&&!b)e.resizable("destroy");if(d&&typeof b==="string")e.resizable("option","handles",b);if(!d&&b!==false)this._makeResizable();}if(a==="title")this._title(this.uiDialogTitlebar.find(".ui-dialog-title"));},_size:function(){var a,b,c,d=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0});if(d.minWidth>d.width)d.width=d.minWidth;a=this.uiDialog.css({height:"auto",width:d.width}).outerHeight();b=Math.max(0,d.minHeight-a);c=typeof d.maxHeight==="number"?Math.max(0,d.maxHeight-a):"none";if(d.height==="auto")this.element.css({minHeight:b,maxHeight:c,height:"auto"});else this.element.height(Math.max(0,d.height-a));if(this.uiDialog.is(":data(ui-resizable)"))this.uiDialog.resizable("option","minHeight",this._minHeight());},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var b=a(this);return a("<div>").css({position:"absolute",width:b.outerWidth(),height:b.outerHeight()}).appendTo(b.parent()).offset(b.offset())[0];});},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks;}},_allowInteraction:function(b){if(a(b.target).closest(".ui-dialog").length)return true;return !!a(b.target).closest(".ui-datepicker").length;},_createOverlay:function(){if(!this.options.modal)return;var b=true;this._delay(function(){b=false;});if(!this.document.data("ui-dialog-overlays"))this._on(this.document,{focusin:function(a){if(b)return;if(!this._allowInteraction(a)){a.preventDefault();this._trackingInstances()[0]._focusTabbable();}}});this.overlay=a("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo());this._on(this.overlay,{mousedown:"_keepFocus"});this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1);},_destroyOverlay:function(){if(!this.options.modal)return;if(this.overlay){var a=this.document.data("ui-dialog-overlays")-1;if(!a)this.document.unbind("focusin").removeData("ui-dialog-overlays");else this.document.data("ui-dialog-overlays",a);this.overlay.remove();this.overlay=null;}}});var F=a.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue();this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min});this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this._refreshValue();},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.valueDiv.remove();},value:function(a){if(a===undefined)return this.options.value;this.options.value=this._constrainedValue(a);this._refreshValue();},_constrainedValue:function(a){if(a===undefined)a=this.options.value;this.indeterminate=a===false;if(typeof a!=="number")a=0;return this.indeterminate?false:Math.min(this.options.max,Math.max(this.min,a));},_setOptions:function(a){var b=a.value;delete a.value;this._super(a);this.options.value=this._constrainedValue(b);this._refreshValue();},_setOption:function(a,b){if(a==="max")b=Math.max(this.min,b);if(a==="disabled")this.element.toggleClass("ui-state-disabled",!!b).attr("aria-disabled",b);this._super(a,b);},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min);},_refreshValue:function(){var b=this.options.value,c=this._percentage();this.valueDiv.toggle(this.indeterminate||b>this.min).toggleClass("ui-corner-right",b===this.options.max).width(c.toFixed(0)+"%");this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate);if(this.indeterminate){this.element.removeAttr("aria-valuenow");if(!this.overlayDiv)this.overlayDiv=a("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv);}else{this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":b});if(this.overlayDiv){this.overlayDiv.remove();this.overlayDiv=null;}}if(this.oldValue!==b){this.oldValue=b;this._trigger("change");}if(b===this.options.max)this._trigger("complete");}});var G=a.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var a=this.element.uniqueId().attr("id");this.ids={element:a,button:a+"-button",menu:a+"-menu"};this._drawButton();this._drawMenu();if(this.options.disabled)this.disable();},_drawButton:function(){var b=this;this.label=a("label[for='"+this.ids.element+"']").attr("for",this.ids.button);this._on(this.label,{click:function(a){this.button.focus();a.preventDefault();}});this.element.hide();this.button=a("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element);a("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button);this.buttonText=a("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button);this._setText(this.buttonText,this.element.find("option:selected").text());this._resizeButton();this._on(this.button,this._buttonEvents);this.button.one("focusin",function(){if(!b.menuItems)b._refreshMenu();});this._hoverable(this.button);this._focusable(this.button);},_drawMenu:function(){var b=this;this.menu=a("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu});this.menuWrap=a("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo());this.menuInstance=this.menu.menu({role:"listbox",select:function(a,c){a.preventDefault();b._setSelection();b._select(c.item.data("ui-selectmenu-item"),a);},focus:function(a,c){var d=c.item.data("ui-selectmenu-item");if(b.focusIndex!=null&&d.index!==b.focusIndex){b._trigger("focus",a,{item:d});if(!b.isOpen)b._select(d,a);}b.focusIndex=d.index;b.button.attr("aria-activedescendant",b.menuItems.eq(d.index).attr("id"));}}).menu("instance");this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all");this.menuInstance._off(this.menu,"mouseleave");this.menuInstance._closeOnDocumentClick=function(){return false;};this.menuInstance._isDivider=function(){return false;};},refresh:function(){this._refreshMenu();this._setText(this.buttonText,this._getSelectedItem().text());if(!this.options.width)this._resizeButton();},_refreshMenu:function(){this.menu.empty();var a,b=this.element.find("option");if(!b.length)return;this._parseOptions(b);this._renderMenu(this.menu,this.items);this.menuInstance.refresh();this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup");a=this._getSelectedItem();this.menuInstance.focus(null,a);this._setAria(a.data("ui-selectmenu-item"));this._setOption("disabled",this.element.prop("disabled"));},open:function(a){if(this.options.disabled)return;if(!this.menuItems)this._refreshMenu();else{this.menu.find(".ui-state-focus").removeClass("ui-state-focus");this.menuInstance.focus(null,this._getSelectedItem());}this.isOpen=true;this._toggleAttr();this._resizeMenu();this._position();this._on(this.document,this._documentClick);this._trigger("open",a);},_position:function(){this.menuWrap.position(a.extend({of:this.button},this.options.position));},close:function(a){if(!this.isOpen)return;this.isOpen=false;this._toggleAttr();this.range=null;this._off(this.document);this._trigger("close",a);},widget:function(){return this.button;},menuWidget:function(){return this.menu;},_renderMenu:function(b,c){var d=this,e="";a.each(c,function(c,f){if(f.optgroup!==e){a("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(f.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:f.optgroup}).appendTo(b);e=f.optgroup;}d._renderItemData(b,f);});},_renderItemData:function(a,b){return this._renderItem(a,b).data("ui-selectmenu-item",b);},_renderItem:function(b,c){var d=a("<li>");if(c.disabled)d.addClass("ui-state-disabled");this._setText(d,c.label);return d.appendTo(b);},_setText:function(a,b){if(b)a.text(b);else a.html("&#160;");},_move:function(a,b){var c,d,e=".ui-menu-item";if(this.isOpen)c=this.menuItems.eq(this.focusIndex);else{c=this.menuItems.eq(this.element[0].selectedIndex);e+=":not(.ui-state-disabled)";}if(a==="first"||a==="last")d=c[a==="first"?"prevAll":"nextAll"](e).eq(-1);else d=c[a+"All"](e).eq(0);if(d.length)this.menuInstance.focus(b,d);},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex);},_toggle:function(a){this[this.isOpen?"close":"open"](a);},_setSelection:function(){var a;if(!this.range)return;if(window.getSelection){a=window.getSelection();a.removeAllRanges();a.addRange(this.range);}else this.range.select();this.button.focus();},_documentClick:{mousedown:function(b){if(!this.isOpen)return;if(!a(b.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length)this.close(b);}},_buttonEvents:{mousedown:function(){var a;if(window.getSelection){a=window.getSelection();if(a.rangeCount)this.range=a.getRangeAt(0);}else this.range=document.selection.createRange();},click:function(a){this._setSelection();this._toggle(a);},keydown:function(b){var c=true;switch(b.keyCode){case a.ui.keyCode.TAB:case a.ui.keyCode.ESCAPE:this.close(b);c=false;break;case a.ui.keyCode.ENTER:if(this.isOpen)this._selectFocusedItem(b);break;case a.ui.keyCode.UP:if(b.altKey)this._toggle(b);else this._move("prev",b);break;case a.ui.keyCode.DOWN:if(b.altKey)this._toggle(b);else this._move("next",b);break;case a.ui.keyCode.SPACE:if(this.isOpen)this._selectFocusedItem(b);else this._toggle(b);break;case a.ui.keyCode.LEFT:this._move("prev",b);break;case a.ui.keyCode.RIGHT:this._move("next",b);break;case a.ui.keyCode.HOME:case a.ui.keyCode.PAGE_UP:this._move("first",b);break;case a.ui.keyCode.END:case a.ui.keyCode.PAGE_DOWN:this._move("last",b);break;default:this.menu.trigger(b);c=false;}if(c)b.preventDefault();}},_selectFocusedItem:function(a){var b=this.menuItems.eq(this.focusIndex);if(!b.hasClass("ui-state-disabled"))this._select(b.data("ui-selectmenu-item"),a);},_select:function(a,b){var c=this.element[0].selectedIndex;this.element[0].selectedIndex=a.index;this._setText(this.buttonText,a.label);this._setAria(a);this._trigger("select",b,{item:a});if(a.index!==c)this._trigger("change",b,{item:a});this.close(b);},_setAria:function(a){var b=this.menuItems.eq(a.index).attr("id");this.button.attr({"aria-labelledby":b,"aria-activedescendant":b});this.menu.attr("aria-activedescendant",b);},_setOption:function(a,b){if(a==="icons")this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(b.button);this._super(a,b);if(a==="appendTo")this.menuWrap.appendTo(this._appendTo());if(a==="disabled"){this.menuInstance.option("disabled",b);this.button.toggleClass("ui-state-disabled",b).attr("aria-disabled",b);this.element.prop("disabled",b);if(b){this.button.attr("tabindex",-1);this.close();}else this.button.attr("tabindex",0);}if(a==="width")this._resizeButton();},_appendTo:function(){var b=this.options.appendTo;if(b)b=b.jquery||b.nodeType?a(b):this.document.find(b).eq(0);if(!b||!b[0])b=this.element.closest(".ui-front");if(!b.length)b=this.document[0].body;return b;},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen);this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen);this.menu.attr("aria-hidden",!this.isOpen);},_resizeButton:function(){var a=this.options.width;if(!a){a=this.element.show().outerWidth();this.element.hide();}this.button.outerWidth(a);},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1));},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")};},_parseOptions:function(b){var c=[];b.each(function(b,d){var e=a(d),f=e.parent("optgroup");c.push({element:e,index:b,value:e.val(),label:e.text(),optgroup:f.attr("label")||"",disabled:f.prop("disabled")||e.prop("disabled")});});this.items=c;},_destroy:function(){this.menuWrap.remove();this.button.remove();this.element.show();this.element.removeUniqueId();this.label.attr("for",this.ids.element);}});var H=a.widget("ui.slider",a.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this._calculateNewMax();this.element.addClass("ui-slider"+" ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all");this._refresh();this._setOption("disabled",this.options.disabled);this._animateOff=false;},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue();},_createHandles:function(){var b,c,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",g=[];c=(d.values&&d.values.length)||1;if(e.length>c){e.slice(c).remove();e=e.slice(0,c);}for(b=e.length;b<c;b++)g.push(f);this.handles=e.add(a(g.join("")).appendTo(this.element));this.handle=this.handles.eq(0);this.handles.each(function(b){a(this).data("ui-slider-handle-index",b);});},_createRange:function(){var b=this.options,c="";if(b.range){if(b.range===true)if(!b.values)b.values=[this._valueMin(),this._valueMin()];else if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]];else if(a.isArray(b.values))b.values=b.values.slice(0);if(!this.range||!this.range.length){this.range=a("<div></div>").appendTo(this.element);c="ui-slider-range"+" ui-widget-header ui-corner-all";}else this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({"left":"","bottom":""});this.range.addClass(c+((b.range==="min"||b.range==="max")?" ui-slider-range-"+b.range:""));}else{if(this.range)this.range.remove();this.range=null;}},_setupEvents:function(){this._off(this.handles);this._on(this.handles,this._handleEvents);this._hoverable(this.handles);this._focusable(this.handles);},_destroy:function(){this.handles.remove();if(this.range)this.range.remove();this.element.removeClass("ui-slider"+" ui-slider-horizontal"+" ui-slider-vertical"+" ui-widget"+" ui-widget-content"+" ui-corner-all");this._mouseDestroy();},_mouseCapture:function(b){var c,d,e,f,g,h,i,j,k=this,l=this.options;if(l.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c={x:b.pageX,y:b.pageY};d=this._normValueFromMouse(c);e=this._valueMax()-this._valueMin()+1;this.handles.each(function(b){var c=Math.abs(d-k.values(b));if((e>c)||(e===c&&(b===k._lastChangedValue||k.values(b)===l.min))){e=c;f=a(this);g=b;}});h=this._start(b,g);if(h===false)return false;this._mouseSliding=true;this._handleIndex=g;f.addClass("ui-state-active").focus();i=f.offset();j=!a(b.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=j?{left:0,top:0}:{left:b.pageX-i.left-(f.width()/2),top:b.pageY-i.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover"))this._slide(b,g,d);this._animateOff=true;return true;},_mouseStart:function(){return true;},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return false;},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false;},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal";},_normValueFromMouse:function(a){var b,c,d,e,f;if(this.orientation==="horizontal"){b=this.elementSize.width;c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0);}else{b=this.elementSize.height;c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0);}d=(c/b);if(d>1)d=1;if(d<0)d=0;if(this.orientation==="vertical")d=1-d;e=this._valueMax()-this._valueMin();f=this._valueMin()+d*e;return this._trimAlignValue(f);},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values();}return this._trigger("start",a,c);},_slide:function(a,b,c){var d,e,f;if(this.options.values&&this.options.values.length){d=this.values(b?0:1);if((this.options.values.length===2&&this.options.range===true)&&((b===0&&c>d)||(b===1&&c<d)))c=d;if(c!==this.values(b)){e=this.values();e[b]=c;f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e});d=this.values(b?0:1);if(f!==false)this.values(b,c);}}else if(c!==this.value()){f=this._trigger("slide",a,{handle:this.handles[b],value:c});if(f!==false)this.value(c);}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values();}this._trigger("stop",a,c);},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values();}this._lastChangedValue=b;this._trigger("change",a,c);}},value:function(a){if(arguments.length){this.options.value=this._trimAlignValue(a);this._refreshValue();this._change(null,0);return;}return this._value();},values:function(b,c){var d,e,f;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(c);this._refreshValue();this._change(null,b);return;}if(arguments.length)if(a.isArray(arguments[0])){d=this.options.values;e=arguments[0];for(f=0;f<d.length;f+=1){d[f]=this._trimAlignValue(e[f]);this._change(null,f);}this._refreshValue();}else if(this.options.values&&this.options.values.length)return this._values(b);else return this.value();else return this._values();},_setOption:function(b,c){var d,e=0;if(b==="range"&&this.options.range===true)if(c==="min"){this.options.value=this._values(0);this.options.values=null;}else if(c==="max"){this.options.value=this._values(this.options.values.length-1);this.options.values=null;}if(a.isArray(this.options.values))e=this.options.values.length;if(b==="disabled")this.element.toggleClass("ui-state-disabled",!!c);this._super(b,c);switch(b){case "orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();this.handles.css(c==="horizontal"?"bottom":"left","");break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=false;break;case "step":case "min":case "max":this._animateOff=true;this._calculateNewMax();this._refreshValue();this._animateOff=false;break;case "range":this._animateOff=true;this._refresh();this._animateOff=false;break;}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a;},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a];b=this._trimAlignValue(b);return b;}else if(this.options.values&&this.options.values.length){c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c;}else return [];},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=(this.options.step>0)?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;if(Math.abs(c)*2>=b)d+=(c>0)?b:(-b);return parseFloat(d.toFixed(5));},_calculateNewMax:function(){var a=this.options.max,b=this._valueMin(),c=this.options.step,d=Math.floor((+(a-b).toFixed(this._precision()))/c)*c;a=d+b;this.max=parseFloat(a.toFixed(this._precision()));},_precision:function(){var a=this._precisionOf(this.options.step);if(this.options.min!==null)a=Math.max(a,this._precisionOf(this.options.min));return a;},_precisionOf:function(a){var b=a.toString(),c=b.indexOf(".");return c===-1?0:b.length-c-1;},_valueMin:function(){return this.options.min;},_valueMax:function(){return this.max;},_refreshValue:function(){var b,c,d,e,f,g=this.options.range,h=this.options,i=this,j=(!this._animateOff)?h.animate:false,k={};if(this.options.values&&this.options.values.length){this.handles.each(function(d){c=(i.values(d)-i._valueMin())/(i._valueMax()-i._valueMin())*100;k[i.orientation==="horizontal"?"left":"bottom"]=c+"%";a(this).stop(1,1)[j?"animate":"css"](k,h.animate);if(i.options.range===true)if(i.orientation==="horizontal"){if(d===0)i.range.stop(1,1)[j?"animate":"css"]({left:c+"%"},h.animate);if(d===1)i.range[j?"animate":"css"]({width:(c-b)+"%"},{queue:false,duration:h.animate});}else{if(d===0)i.range.stop(1,1)[j?"animate":"css"]({bottom:c+"%"},h.animate);if(d===1)i.range[j?"animate":"css"]({height:(c-b)+"%"},{queue:false,duration:h.animate});}b=c;});}else{d=this.value();e=this._valueMin();f=this._valueMax();c=(f!==e)?(d-e)/(f-e)*100:0;k[this.orientation==="horizontal"?"left":"bottom"]=c+"%";this.handle.stop(1,1)[j?"animate":"css"](k,h.animate);if(g==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[j?"animate":"css"]({width:c+"%"},h.animate);if(g==="max"&&this.orientation==="horizontal")this.range[j?"animate":"css"]({width:(100-c)+"%"},{queue:false,duration:h.animate});if(g==="min"&&this.orientation==="vertical")this.range.stop(1,1)[j?"animate":"css"]({height:c+"%"},h.animate);if(g==="max"&&this.orientation==="vertical")this.range[j?"animate":"css"]({height:(100-c)+"%"},{queue:false,duration:h.animate});}},_handleEvents:{keydown:function(b){var c,d,e,f,g=a(b.target).data("ui-slider-handle-index");switch(b.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:b.preventDefault();if(!this._keySliding){this._keySliding=true;a(b.target).addClass("ui-state-active");c=this._start(b,g);if(c===false)return;}break;}f=this.options.step;if(this.options.values&&this.options.values.length)d=e=this.values(g);else d=e=this.value();switch(b.keyCode){case a.ui.keyCode.HOME:e=this._valueMin();break;case a.ui.keyCode.END:e=this._valueMax();break;case a.ui.keyCode.PAGE_UP:e=this._trimAlignValue(d+((this._valueMax()-this._valueMin())/this.numPages));break;case a.ui.keyCode.PAGE_DOWN:e=this._trimAlignValue(d-((this._valueMax()-this._valueMin())/this.numPages));break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(d===this._valueMax())return;e=this._trimAlignValue(d+f);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(d===this._valueMin())return;e=this._trimAlignValue(d-f);break;}this._slide(b,g,e);},keyup:function(b){var c=a(b.target).data("ui-slider-handle-index");if(this._keySliding){this._keySliding=false;this._stop(b,c);this._change(b,c);a(b.target).removeClass("ui-state-active");}}}});function I(a){return function(){var b=this.element.val();a.apply(this,arguments);this._refresh();if(b!==this.element.val())this._trigger("change");};}var J=a.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:true,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max);this._setOption("min",this.options.min);this._setOption("step",this.options.step);if(this.value()!=="")this._value(this.element.val(),true);this._draw();this._on(this._events);this._refresh();this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete");}});},_getCreateOptions:function(){var b={},c=this.element;a.each(["min","max","step"],function(a,d){var e=c.attr(d);if(e!==undefined&&e.length)b[d]=e;});return b;},_events:{keydown:function(a){if(this._start(a)&&this._keydown(a))a.preventDefault();},keyup:"_stop",focus:function(){this.previous=this.element.val();},blur:function(a){if(this.cancelBlur){delete this.cancelBlur;return;}this._stop();this._refresh();if(this.previous!==this.element.val())this._trigger("change",a);},mousewheel:function(a,b){if(!b)return;if(!this.spinning&&!this._start(a))return false;this._spin((b>0?1:-1)*this.options.step,a);clearTimeout(this.mousewheelTimer);this.mousewheelTimer=this._delay(function(){if(this.spinning)this._stop(a);},100);a.preventDefault();},"mousedown .ui-spinner-button":function(b){var c;c=this.element[0]===this.document[0].activeElement?this.previous:this.element.val();function d(){var a=this.element[0]===this.document[0].activeElement;if(!a){this.element.focus();this.previous=c;this._delay(function(){this.previous=c;});}}b.preventDefault();d.call(this);this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;d.call(this);});if(this._start(b)===false)return;this._repeat(null,a(b.currentTarget).hasClass("ui-spinner-up")?1:-1,b);},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(b){if(!a(b.currentTarget).hasClass("ui-state-active"))return;if(this._start(b)===false)return false;this._repeat(null,a(b.currentTarget).hasClass("ui-spinner-up")?1:-1,b);},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var a=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton");this.buttons=a.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all");if(this.buttons.height()>Math.ceil(a.height()*0.5)&&a.height()>0)a.height(a.height());if(this.options.disabled)this.disable();},_keydown:function(b){var c=this.options,d=a.ui.keyCode;switch(b.keyCode){case d.UP:this._repeat(null,1,b);return true;case d.DOWN:this._repeat(null,-1,b);return true;case d.PAGE_UP:this._repeat(null,c.page,b);return true;case d.PAGE_DOWN:this._repeat(null,-c.page,b);return true;}return false;},_uiSpinnerHtml:function(){return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";},_buttonHtml:function(){return ""+"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>"+"<span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>";},_start:function(a){if(!this.spinning&&this._trigger("start",a)===false)return false;if(!this.counter)this.counter=1;this.spinning=true;return true;},_repeat:function(a,b,c){a=a||500;clearTimeout(this.timer);this.timer=this._delay(function(){this._repeat(40,b,c);},a);this._spin(b*this.options.step,c);},_spin:function(a,b){var c=this.value()||0;if(!this.counter)this.counter=1;c=this._adjustValue(c+a*this._increment(this.counter));if(!this.spinning||this._trigger("spin",b,{value:c})!==false){this._value(c);this.counter++;}},_increment:function(b){var c=this.options.incremental;if(c)return a.isFunction(c)?c(b):Math.floor(b*b*b/50000-b*b/500+17*b/200+1);return 1;},_precision:function(){var a=this._precisionOf(this.options.step);if(this.options.min!==null)a=Math.max(a,this._precisionOf(this.options.min));return a;},_precisionOf:function(a){var b=a.toString(),c=b.indexOf(".");return c===-1?0:b.length-c-1;},_adjustValue:function(a){var b,c,d=this.options;b=d.min!==null?d.min:0;c=a-b;c=Math.round(c/d.step)*d.step;a=b+c;a=parseFloat(a.toFixed(this._precision()));if(d.max!==null&&a>d.max)return d.max;if(d.min!==null&&a<d.min)return d.min;return a;},_stop:function(a){if(!this.spinning)return;clearTimeout(this.timer);clearTimeout(this.mousewheelTimer);this.counter=0;this.spinning=false;this._trigger("stop",a);},_setOption:function(a,b){if(a==="culture"||a==="numberFormat"){var c=this._parse(this.element.val());this.options[a]=b;this.element.val(this._format(c));return;}if(a==="max"||a==="min"||a==="step")if(typeof b==="string")b=this._parse(b);if(a==="icons"){this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(b.up);this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(b.down);}this._super(a,b);if(a==="disabled"){this.widget().toggleClass("ui-state-disabled",!!b);this.element.prop("disabled",!!b);this.buttons.button(b?"disable":"enable");}},_setOptions:I(function(a){this._super(a);}),_parse:function(a){if(typeof a==="string"&&a!=="")a=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(a,10,this.options.culture):+a;return a===""||isNaN(a)?null:a;},_format:function(a){if(a==="")return "";return window.Globalize&&this.options.numberFormat?Globalize.format(a,this.options.numberFormat,this.options.culture):a;},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())});},isValid:function(){var a=this.value();if(a===null)return false;return a===this._adjustValue(a);},_value:function(a,b){var c;if(a!==""){c=this._parse(a);if(c!==null){if(!b)c=this._adjustValue(c);a=this._format(c);}}this.element.val(a);this._refresh();},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",false).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.uiSpinner.replaceWith(this.element);},stepUp:I(function(a){this._stepUp(a);}),_stepUp:function(a){if(this._start()){this._spin((a||1)*this.options.step);this._stop();}},stepDown:I(function(a){this._stepDown(a);}),_stepDown:function(a){if(this._start()){this._spin((a||1)*-this.options.step);this._stop();}},pageUp:I(function(a){this._stepUp((a||1)*this.options.page);}),pageDown:I(function(a){this._stepDown((a||1)*this.options.page);}),value:function(a){if(!arguments.length)return this._parse(this.element.val());I(this._value).call(this,a);},widget:function(){return this.uiSpinner;}});var K=a.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:false,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(function(){var a=/#.*$/;return function(b){var c,d;b=b.cloneNode(false);c=b.href.replace(a,"");d=location.href.replace(a,"");try{c=decodeURIComponent(c);}catch(e){}try{d=decodeURIComponent(d);}catch(e){}return b.hash.length>1&&c===d;};})(),_create:function(){var b=this,c=this.options;this.running=false;this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",c.collapsible);this._processTabs();c.active=this._initialActive();if(a.isArray(c.disabled))c.disabled=a.unique(c.disabled.concat(a.map(this.tabs.filter(".ui-state-disabled"),function(a){return b.tabs.index(a);}))).sort();if(this.options.active!==false&&this.anchors.length)this.active=this._findActive(c.active);else this.active=a();this._refresh();if(this.active.length)this.load(c.active);},_initialActive:function(){var b=this.options.active,c=this.options.collapsible,d=location.hash.substring(1);if(b===null){if(d)this.tabs.each(function(c,e){if(a(e).attr("aria-controls")===d){b=c;return false;}});if(b===null)b=this.tabs.index(this.tabs.filter(".ui-tabs-active"));if(b===null||b===-1)b=this.tabs.length?0:false;}if(b!==false){b=this.tabs.index(this.tabs.eq(b));if(b===-1)b=c?false:0;}if(!c&&b===false&&this.anchors.length)b=0;return b;},_getCreateEventData:function(){return{tab:this.active,panel:!this.active.length?a():this._getPanelForTab(this.active)};},_tabKeydown:function(b){var c=a(this.document[0].activeElement).closest("li"),d=this.tabs.index(c),e=true;if(this._handlePageNav(b))return;switch(b.keyCode){case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:d++;break;case a.ui.keyCode.UP:case a.ui.keyCode.LEFT:e=false;d--;break;case a.ui.keyCode.END:d=this.anchors.length-1;break;case a.ui.keyCode.HOME:d=0;break;case a.ui.keyCode.SPACE:b.preventDefault();clearTimeout(this.activating);this._activate(d);return;case a.ui.keyCode.ENTER:b.preventDefault();clearTimeout(this.activating);this._activate(d===this.options.active?false:d);return;default:return;}b.preventDefault();clearTimeout(this.activating);d=this._focusNextTab(d,e);if(!b.ctrlKey&&!b.metaKey){c.attr("aria-selected","false");this.tabs.eq(d).attr("aria-selected","true");this.activating=this._delay(function(){this.option("active",d);},this.delay);}},_panelKeydown:function(b){if(this._handlePageNav(b))return;if(b.ctrlKey&&b.keyCode===a.ui.keyCode.UP){b.preventDefault();this.active.focus();}},_handlePageNav:function(b){if(b.altKey&&b.keyCode===a.ui.keyCode.PAGE_UP){this._activate(this._focusNextTab(this.options.active-1,false));return true;}if(b.altKey&&b.keyCode===a.ui.keyCode.PAGE_DOWN){this._activate(this._focusNextTab(this.options.active+1,true));return true;}},_findNextTab:function(b,c){var d=this.tabs.length-1;function e(){if(b>d)b=0;if(b<0)b=d;return b;}while(a.inArray(e(),this.options.disabled)!==-1)b=c?b+1:b-1;return b;},_focusNextTab:function(a,b){a=this._findNextTab(a,b);this.tabs.eq(a).focus();return a;},_setOption:function(a,b){if(a==="active"){this._activate(b);return;}if(a==="disabled"){this._setupDisabled(b);return;}this._super(a,b);if(a==="collapsible"){this.element.toggleClass("ui-tabs-collapsible",b);if(!b&&this.options.active===false)this._activate(0);}if(a==="event")this._setupEvents(b);if(a==="heightStyle")this._setupHeightStyle(b);},_sanitizeSelector:function(a){return a?a.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):"";},refresh:function(){var b=this.options,c=this.tablist.children(":has(a[href])");b.disabled=a.map(c.filter(".ui-state-disabled"),function(a){return c.index(a);});this._processTabs();if(b.active===false||!this.anchors.length){b.active=false;this.active=a();}else if(this.active.length&&!a.contains(this.tablist[0],this.active[0]))if(this.tabs.length===b.disabled.length){b.active=false;this.active=a();}else this._activate(this._findNextTab(Math.max(0,b.active-1),false));else b.active=this.tabs.index(this.active);this._refresh();},_refresh:function(){this._setupDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"});if(!this.active.length)this.tabs.eq(0).attr("tabIndex",0);else{this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"});}},_processTabs:function(){var b=this,c=this.tabs,d=this.anchors,e=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(b){if(a(this).is(".ui-state-disabled"))b.preventDefault();}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){if(a(this).closest("li").is(".ui-state-disabled"))this.blur();});this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1});this.anchors=this.tabs.map(function(){return a("a",this)[0];}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1});this.panels=a();this.anchors.each(function(c,d){var e,f,g,h=a(d).uniqueId().attr("id"),i=a(d).closest("li"),j=i.attr("aria-controls");if(b._isLocal(d)){e=d.hash;g=e.substring(1);f=b.element.find(b._sanitizeSelector(e));}else{g=i.attr("aria-controls")||a({}).uniqueId()[0].id;e="#"+g;f=b.element.find(e);if(!f.length){f=b._createPanel(g);f.insertAfter(b.panels[c-1]||b.tablist);}f.attr("aria-live","polite");}if(f.length)b.panels=b.panels.add(f);if(j)i.data("ui-tabs-aria-controls",j);i.attr({"aria-controls":g,"aria-labelledby":h});f.attr("aria-labelledby",h);});this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel");if(c){this._off(c.not(this.tabs));this._off(d.not(this.anchors));this._off(e.not(this.panels));}},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0);},_createPanel:function(b){return a("<div>").attr("id",b).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",true);},_setupDisabled:function(b){if(a.isArray(b))if(!b.length)b=false;else if(b.length===this.anchors.length)b=true;for(var c=0,d;(d=this.tabs[c]);c++)if(b===true||a.inArray(c,b)!==-1)a(d).addClass("ui-state-disabled").attr("aria-disabled","true");else a(d).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=b;},_setupEvents:function(b){var c={};if(b)a.each(b.split(" "),function(a,b){c[b]="_eventHandler";});this._off(this.anchors.add(this.tabs).add(this.panels));this._on(true,this.anchors,{click:function(a){a.preventDefault();}});this._on(this.anchors,c);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs);},_setupHeightStyle:function(b){var c,d=this.element.parent();if(b==="fill"){c=d.height();c-=this.element.outerHeight()-this.element.height();this.element.siblings(":visible").each(function(){var b=a(this),d=b.css("position");if(d==="absolute"||d==="fixed")return;c-=b.outerHeight(true);});this.element.children().not(this.panels).each(function(){c-=a(this).outerHeight(true);});this.panels.each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()));}).css("overflow","auto");}else if(b==="auto"){c=0;this.panels.each(function(){c=Math.max(c,a(this).height("").height());}).height(c);}},_eventHandler:function(b){var c=this.options,d=this.active,e=a(b.currentTarget),f=e.closest("li"),g=f[0]===d[0],h=g&&c.collapsible,i=h?a():this._getPanelForTab(f),j=!d.length?a():this._getPanelForTab(d),k={oldTab:d,oldPanel:j,newTab:h?a():f,newPanel:i};b.preventDefault();if(f.hasClass("ui-state-disabled")||f.hasClass("ui-tabs-loading")||this.running||(g&&!c.collapsible)||(this._trigger("beforeActivate",b,k)===false))return;c.active=h?false:this.tabs.index(f);this.active=g?a():f;if(this.xhr)this.xhr.abort();if(!j.length&&!i.length)a.error("jQuery UI Tabs: Mismatching fragment identifier.");if(i.length)this.load(this.tabs.index(f),b);this._toggle(b,k);},_toggle:function(b,c){var d=this,e=c.newPanel,f=c.oldPanel;this.running=true;function g(){d.running=false;d._trigger("activate",b,c);}function h(){c.newTab.closest("li").addClass("ui-tabs-active ui-state-active");if(e.length&&d.options.show)d._show(e,d.options.show,g);else{e.show();g();}}if(f.length&&this.options.hide)this._hide(f,this.options.hide,function(){c.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");h();});else{c.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");f.hide();h();}f.attr("aria-hidden","true");c.oldTab.attr({"aria-selected":"false","aria-expanded":"false"});if(e.length&&f.length)c.oldTab.attr("tabIndex",-1);else if(e.length)this.tabs.filter(function(){return a(this).attr("tabIndex")===0;}).attr("tabIndex",-1);e.attr("aria-hidden","false");c.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});},_activate:function(b){var c,d=this._findActive(b);if(d[0]===this.active[0])return;if(!d.length)d=this.active;c=d.find(".ui-tabs-anchor")[0];this._eventHandler({target:c,currentTarget:c,preventDefault:a.noop});},_findActive:function(b){return b===false?a():this.tabs.eq(b);},_getIndex:function(a){if(typeof a==="string")a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"));return a;},_destroy:function(){if(this.xhr)this.xhr.abort();this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible");this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role");this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId();this.tablist.unbind(this.eventNamespace);this.tabs.add(this.panels).each(function(){if(a.data(this,"ui-tabs-destroy"))a(this).remove();else a(this).removeClass("ui-state-default ui-state-active ui-state-disabled "+"ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role");});this.tabs.each(function(){var b=a(this),c=b.data("ui-tabs-aria-controls");if(c)b.attr("aria-controls",c).removeData("ui-tabs-aria-controls");else b.removeAttr("aria-controls");});this.panels.show();if(this.options.heightStyle!=="content")this.panels.css("height","");},enable:function(b){var c=this.options.disabled;if(c===false)return;if(b===undefined)c=false;else{b=this._getIndex(b);if(a.isArray(c))c=a.map(c,function(a){return a!==b?a:null;});else c=a.map(this.tabs,function(a,c){return c!==b?c:null;});}this._setupDisabled(c);},disable:function(b){var c=this.options.disabled;if(c===true)return;if(b===undefined)c=true;else{b=this._getIndex(b);if(a.inArray(b,c)!==-1)return;if(a.isArray(c))c=a.merge([b],c).sort();else c=[b];}this._setupDisabled(c);},load:function(b,c){b=this._getIndex(b);var d=this,e=this.tabs.eq(b),f=e.find(".ui-tabs-anchor"),g=this._getPanelForTab(e),h={tab:e,panel:g},i=function(a,b){if(b==="abort")d.panels.stop(false,true);e.removeClass("ui-tabs-loading");g.removeAttr("aria-busy");if(a===d.xhr)delete d.xhr;};if(this._isLocal(f[0]))return;this.xhr=a.ajax(this._ajaxSettings(f,c,h));if(this.xhr&&this.xhr.statusText!=="canceled"){e.addClass("ui-tabs-loading");g.attr("aria-busy","true");this.xhr.done(function(a,b,e){setTimeout(function(){g.html(a);d._trigger("load",c,h);i(e,b);},1);}).fail(function(a,b){setTimeout(function(){i(a,b);},1);});}},_ajaxSettings:function(b,c,d){var e=this;return{url:b.attr("href"),beforeSend:function(b,f){return e._trigger("beforeLoad",c,a.extend({jqXHR:b,ajaxSettings:f},d));}};},_getPanelForTab:function(b){var c=a(b).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+c));}});var L=a.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var b=a(this).attr("title")||"";return a("<a>").text(b).html();},hide:true,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:true,tooltipClass:null,track:false,close:null,open:null},_addDescribedBy:function(b,c){var d=(b.attr("aria-describedby")||"").split(/\s+/);d.push(c);b.data("ui-tooltip-id",c).attr("aria-describedby",a.trim(d.join(" ")));},_removeDescribedBy:function(b){var c=b.data("ui-tooltip-id"),d=(b.attr("aria-describedby")||"").split(/\s+/),e=a.inArray(c,d);if(e!==-1)d.splice(e,1);b.removeData("ui-tooltip-id");d=a.trim(d.join(" "));if(d)b.attr("aria-describedby",d);else b.removeAttr("aria-describedby");},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};if(this.options.disabled)this._disable();this.liveRegion=a("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body);},_setOption:function(b,c){var d=this;if(b==="disabled"){this[c?"_disable":"_enable"]();this.options[b]=c;return;}this._super(b,c);if(b==="content")a.each(this.tooltips,function(a,b){d._updateContent(b.element);});},_disable:function(){var b=this;a.each(this.tooltips,function(c,d){var e=a.Event("blur");e.target=e.currentTarget=d.element[0];b.close(e,true);});this.element.find(this.options.items).addBack().each(function(){var b=a(this);if(b.is("[title]"))b.data("ui-tooltip-title",b.attr("title")).removeAttr("title");});},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var b=a(this);if(b.data("ui-tooltip-title"))b.attr("title",b.data("ui-tooltip-title"));});},open:function(b){var c=this,d=a(b?b.target:this.element).closest(this.options.items);if(!d.length||d.data("ui-tooltip-id"))return;if(d.attr("title"))d.data("ui-tooltip-title",d.attr("title"));d.data("ui-tooltip-open",true);if(b&&b.type==="mouseover")d.parents().each(function(){var b=a(this),d;if(b.data("ui-tooltip-open")){d=a.Event("blur");d.target=d.currentTarget=this;c.close(d,true);}if(b.attr("title")){b.uniqueId();c.parents[this.id]={element:this,title:b.attr("title")};b.attr("title","");}});this._registerCloseHandlers(b,d);this._updateContent(d,b);},_updateContent:function(a,b){var c,d=this.options.content,e=this,f=b?b.type:null;if(typeof d==="string")return this._open(b,a,d);c=d.call(a[0],function(c){e._delay(function(){if(!a.data("ui-tooltip-open"))return;if(b)b.type=f;this._open(b,a,c);});});if(c)this._open(b,a,c);},_open:function(b,c,d){var e,f,g,h,i=a.extend({},this.options.position);if(!d)return;e=this._find(c);if(e){e.tooltip.find(".ui-tooltip-content").html(d);return;}if(c.is("[title]"))if(b&&b.type==="mouseover")c.attr("title","");else c.removeAttr("title");e=this._tooltip(c);f=e.tooltip;this._addDescribedBy(c,f.attr("id"));f.find(".ui-tooltip-content").html(d);this.liveRegion.children().hide();if(d.clone){h=d.clone();h.removeAttr("id").find("[id]").removeAttr("id");}else h=d;a("<div>").html(h).appendTo(this.liveRegion);function j(a){i.of=a;if(f.is(":hidden"))return;f.position(i);}if(this.options.track&&b&&/^mouse/.test(b.type)){this._on(this.document,{mousemove:j});j(b);}else f.position(a.extend({of:c},this.options.position));f.hide();this._show(f,this.options.show);if(this.options.show&&this.options.show.delay)g=this.delayedShow=setInterval(function(){if(f.is(":visible")){j(i.of);clearInterval(g);}},a.fx.interval);this._trigger("open",b,{tooltip:f});},_registerCloseHandlers:function(b,c){var d={keyup:function(b){if(b.keyCode===a.ui.keyCode.ESCAPE){var d=a.Event(b);d.currentTarget=c[0];this.close(d,true);}}};if(c[0]!==this.element[0])d.remove=function(){this._removeTooltip(this._find(c).tooltip);};if(!b||b.type==="mouseover")d.mouseleave="close";if(!b||b.type==="focusin")d.focusout="close";this._on(true,c,d);},close:function(b){var c,d=this,e=a(b?b.currentTarget:this.element),f=this._find(e);if(!f){e.removeData("ui-tooltip-open");return;}c=f.tooltip;if(f.closing)return;clearInterval(this.delayedShow);if(e.data("ui-tooltip-title")&&!e.attr("title"))e.attr("title",e.data("ui-tooltip-title"));this._removeDescribedBy(e);f.hiding=true;c.stop(true);this._hide(c,this.options.hide,function(){d._removeTooltip(a(this));});e.removeData("ui-tooltip-open");this._off(e,"mouseleave focusout keyup");if(e[0]!==this.element[0])this._off(e,"remove");this._off(this.document,"mousemove");if(b&&b.type==="mouseleave")a.each(this.parents,function(b,c){a(c.element).attr("title",c.title);delete d.parents[b];});f.closing=true;this._trigger("close",b,{tooltip:c});if(!f.hiding)f.closing=false;},_tooltip:function(b){var c=a("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),d=c.uniqueId().attr("id");a("<div>").addClass("ui-tooltip-content").appendTo(c);c.appendTo(this.document[0].body);return this.tooltips[d]={element:b,tooltip:c};},_find:function(a){var b=a.data("ui-tooltip-id");return b?this.tooltips[b]:null;},_removeTooltip:function(a){a.remove();delete this.tooltips[a.attr("id")];},_destroy:function(){var b=this;a.each(this.tooltips,function(c,d){var e=a.Event("blur"),f=d.element;e.target=e.currentTarget=f[0];b.close(e,true);a("#"+c).remove();if(f.data("ui-tooltip-title")){if(!f.attr("title"))f.attr("title",f.data("ui-tooltip-title"));f.removeData("ui-tooltip-title");}});this.liveRegion.remove();}});var M="ui-effects-",N=a;a.effects={effect:{}};(function(a,b){var c="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",d=/^([\-+])=\s*(\d+\.?\d*)/,e=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return [a[1],a[2],a[3],a[4]];}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return [a[1]*2.55,a[2]*2.55,a[3]*2.55,a[4]];}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(a){return [parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)];}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(a){return [parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(a){return [a[1],a[2]/100,a[3]/100,a[4]];}}],f=a.Color=function(b,c,d,e){return new a.Color.fn.parse(b,c,d,e);},g={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},h={"byte":{floor:true,max:255},"percent":{max:1},"degrees":{mod:360,floor:true}},i=f.support={},j=a("<p>")[0],k,l=a.each;j.style.cssText="background-color:rgba(1,1,1,.5)";i.rgba=j.style.backgroundColor.indexOf("rgba")>-1;l(g,function(a,b){b.cache="_"+a;b.props.alpha={idx:3,type:"percent",def:1};});function m(a,b,c){var d=h[b.type]||{};if(a==null)return(c||!b.def)?null:b.def;a=d.floor?~~a:parseFloat(a);if(isNaN(a))return b.def;if(d.mod)return(a+d.mod)%d.mod;return 0>a?0:d.max<a?d.max:a;}function n(b){var c=f(),d=c._rgba=[];b=b.toLowerCase();l(e,function(a,e){var f,h=e.re.exec(b),i=h&&e.parse(h),j=e.space||"rgba";if(i){f=c[j](i);c[g[j].cache]=f[g[j].cache];d=c._rgba=f._rgba;return false;}});if(d.length){if(d.join()==="0,0,0,0")a.extend(d,k.transparent);return c;}return k[b];}f.fn=a.extend(f.prototype,{parse:function(c,d,e,h){if(c===b){this._rgba=[null,null,null,null];return this;}if(c.jquery||c.nodeType){c=a(c).css(d);d=b;}var i=this,j=a.type(c),o=this._rgba=[];if(d!==b){c=[c,d,e,h];j="array";}if(j==="string")return this.parse(n(c)||k._default);if(j==="array"){l(g.rgba.props,function(a,b){o[b.idx]=m(c[b.idx],b);});return this;}if(j==="object"){if(c instanceof f){l(g,function(a,b){if(c[b.cache])i[b.cache]=c[b.cache].slice();});}else l(g,function(b,d){var e=d.cache;l(d.props,function(a,b){if(!i[e]&&d.to){if(a==="alpha"||c[a]==null)return;i[e]=d.to(i._rgba);}i[e][b.idx]=m(c[a],b,true);});if(i[e]&&a.inArray(null,i[e].slice(0,3))<0){i[e][3]=1;if(d.from)i._rgba=d.from(i[e]);}});return this;}},is:function(a){var b=f(a),c=true,d=this;l(g,function(a,e){var f,g=b[e.cache];if(g){f=d[e.cache]||e.to&&e.to(d._rgba)||[];l(e.props,function(a,b){if(g[b.idx]!=null){c=(g[b.idx]===f[b.idx]);return c;}});}return c;});return c;},_space:function(){var a=[],b=this;l(g,function(c,d){if(b[d.cache])a.push(c);});return a.pop();},transition:function(a,b){var c=f(a),d=c._space(),e=g[d],i=this.alpha()===0?f("transparent"):this,j=i[e.cache]||e.to(i._rgba),k=j.slice();c=c[e.cache];l(e.props,function(a,d){var e=d.idx,f=j[e],g=c[e],i=h[d.type]||{};if(g===null)return;if(f===null)k[e]=g;else{if(i.mod)if(g-f>i.mod/2)f+=i.mod;else if(f-g>i.mod/2)f-=i.mod;k[e]=m((g-f)*b+f,d);}});return this[d](k);},blend:function(b){if(this._rgba[3]===1)return this;var c=this._rgba.slice(),d=c.pop(),e=f(b)._rgba;return f(a.map(c,function(a,b){return(1-d)*e[b]+d*a;}));},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return a==null?(b>2?1:0):a;});if(c[3]===1){c.pop();b="rgb(";}return b+c.join()+")";},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){if(a==null)a=b>2?1:0;if(b&&b<3)a=Math.round(a*100)+"%";return a;});if(c[3]===1){c.pop();b="hsl(";}return b+c.join()+")";},toHexString:function(b){var c=this._rgba.slice(),d=c.pop();if(b)c.push(~~(d*255));return "#"+a.map(c,function(a){a=(a||0).toString(16);return a.length===1?"0"+a:a;}).join("");},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString();}});f.fn.parse.prototype=f.fn;function o(a,b,c){c=(c+1)%1;if(c*6<1)return a+(b-a)*c*6;if(c*2<1)return b;if(c*3<2)return a+(b-a)*((2/3)-c)*6;return a;}g.hsla.to=function(a){if(a[0]==null||a[1]==null||a[2]==null)return [null,null,null,a[3]];var b=a[0]/255,c=a[1]/255,d=a[2]/255,e=a[3],f=Math.max(b,c,d),g=Math.min(b,c,d),h=f-g,i=f+g,j=i*0.5,k,l;if(g===f)k=0;else if(b===f)k=(60*(c-d)/h)+360;else if(c===f)k=(60*(d-b)/h)+120;else k=(60*(b-c)/h)+240;if(h===0)l=0;else if(j<=0.5)l=h/i;else l=h/(2-i);return [Math.round(k)%360,l,j,e==null?1:e];};g.hsla.from=function(a){if(a[0]==null||a[1]==null||a[2]==null)return [null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],e=a[3],f=d<=0.5?d*(1+c):d+c-d*c,g=2*d-f;return [Math.round(o(g,f,b+(1/3))*255),Math.round(o(g,f,b)*255),Math.round(o(g,f,b-(1/3))*255),e];};l(g,function(c,e){var g=e.props,h=e.cache,i=e.to,j=e.from;f.fn[c]=function(c){if(i&&!this[h])this[h]=i(this._rgba);if(c===b)return this[h].slice();var d,e=a.type(c),k=(e==="array"||e==="object")?c:arguments,n=this[h].slice();l(g,function(a,b){var c=k[e==="object"?a:b.idx];if(c==null)c=n[b.idx];n[b.idx]=m(c,b);});if(j){d=f(j(n));d[h]=n;return d;}else return f(n);};l(g,function(b,e){if(f.fn[b])return;f.fn[b]=function(f){var g=a.type(f),h=(b==="alpha"?(this._hsla?"hsla":"rgba"):c),i=this[h](),j=i[e.idx],k;if(g==="undefined")return j;if(g==="function"){f=f.call(this,j);g=a.type(f);}if(f==null&&e.empty)return this;if(g==="string"){k=d.exec(f);if(k)f=j+parseFloat(k[2])*(k[1]==="+"?1:-1);}i[e.idx]=f;return this[h](i);};});});f.hook=function(b){var c=b.split(" ");l(c,function(b,c){a.cssHooks[c]={set:function(b,d){var e,g,h="";if(d!=="transparent"&&(a.type(d)!=="string"||(e=n(d)))){d=f(e||d);if(!i.rgba&&d._rgba[3]!==1){g=c==="backgroundColor"?b.parentNode:b;while((h===""||h==="transparent")&&g&&g.style)try{h=a.css(g,"backgroundColor");g=g.parentNode;}catch(j){}d=d.blend(h&&h!=="transparent"?h:"_default");}d=d.toRgbaString();}try{b.style[c]=d;}catch(j){}}};a.fx.step[c]=function(b){if(!b.colorInit){b.start=f(b.elem,c);b.end=f(b.end);b.colorInit=true;}a.cssHooks[c].set(b.elem,b.start.transition(b.end,b.pos));};});};f.hook(c);a.cssHooks.borderColor={expand:function(a){var b={};l(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a;});return b;}};k=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"};})(N);(function(){var b=["add","remove","toggle"],c={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(b,c){a.fx.step[c]=function(a){if(a.end!=="none"&&!a.setAttr||a.pos===1&&!a.setAttr){N.style(a.elem,c,a.end);a.setAttr=true;}};});function d(b){var c,d,e=b.ownerDocument.defaultView?b.ownerDocument.defaultView.getComputedStyle(b,null):b.currentStyle,f={};if(e&&e.length&&e[0]&&e[e[0]]){d=e.length;while(d--){c=e[d];if(typeof e[c]==="string")f[a.camelCase(c)]=e[c];}}else for(c in e)if(typeof e[c]==="string")f[c]=e[c];return f;}function e(b,d){var e={},f,g;for(f in d){g=d[f];if(b[f]!==g)if(!c[f])if(a.fx.step[f]||!isNaN(parseFloat(g)))e[f]=g;}return e;}if(!a.fn.addBack)a.fn.addBack=function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a));};a.effects.animateClass=function(c,f,g,h){var i=a.speed(f,g,h);return this.queue(function(){var f=a(this),g=f.attr("class")||"",h,j=i.children?f.find("*").addBack():f;j=j.map(function(){var b=a(this);return{el:b,start:d(this)};});h=function(){a.each(b,function(a,b){if(c[b])f[b+"Class"](c[b]);});};h();j=j.map(function(){this.end=d(this.el[0]);this.diff=e(this.start,this.end);return this;});f.attr("class",g);j=j.map(function(){var b=this,c=a.Deferred(),d=a.extend({},i,{queue:false,complete:function(){c.resolve(b);}});this.el.animate(this.diff,d);return c.promise();});a.when.apply(a,j.get()).done(function(){h();a.each(arguments,function(){var b=this.el;a.each(this.diff,function(a){b.css(a,"");});});i.complete.call(f[0]);});});};a.fn.extend({addClass:(function(b){return function(c,d,e,f){return d?a.effects.animateClass.call(this,{add:c},d,e,f):b.apply(this,arguments);};})(a.fn.addClass),removeClass:(function(b){return function(c,d,e,f){return arguments.length>1?a.effects.animateClass.call(this,{remove:c},d,e,f):b.apply(this,arguments);};})(a.fn.removeClass),toggleClass:(function(b){return function(c,d,e,f,g){if(typeof d==="boolean"||d===undefined)if(!e)return b.apply(this,arguments);else return a.effects.animateClass.call(this,(d?{add:c}:{remove:c}),e,f,g);else return a.effects.animateClass.call(this,{toggle:c},d,e,f);};})(a.fn.toggleClass),switchClass:function(b,c,d,e,f){return a.effects.animateClass.call(this,{add:c,remove:b},d,e,f);}});})();(function(){a.extend(a.effects,{version:"1.11.4",save:function(a,b){for(var c=0;c<b.length;c++)if(b[c]!==null)a.data(M+b[c],a[0].style[b[c]]);},restore:function(a,b){var c,d;for(d=0;d<b.length;d++)if(b[d]!==null){c=a.data(M+b[d]);if(c===undefined)c="";a.css(b[d],c);}},setMode:function(a,b){if(b==="toggle")b=a.is(":hidden")?"show":"hide";return b;},getBaseline:function(a,b){var c,d;switch(a[0]){case "top":c=0;break;case "middle":c=0.5;break;case "bottom":c=1;break;default:c=a[0]/b.height;}switch(a[1]){case "left":d=0;break;case "center":d=0.5;break;case "right":d=1;break;default:d=a[1]/b.width;}return{x:d,y:c};},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(true),height:b.outerHeight(true),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:b.width(),height:b.height()},f=document.activeElement;try{f.id;}catch(g){f=document.body;}b.wrap(d);if(b[0]===f||a.contains(b[0],f))a(f).focus();d=b.parent();if(b.css("position")==="static"){d.css({position:"relative"});b.css({position:"relative"});}else{a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")});a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d);if(isNaN(parseInt(c[d],10)))c[d]="auto";});b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"});}b.css(e);return d.css(c).show();},removeWrapper:function(b){var c=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){b.parent().replaceWith(b);if(b[0]===c||a.contains(b[0],c))a(c).focus();}return b;},setTransition:function(b,c,d,e){e=e||{};a.each(c,function(a,c){var f=b.cssUnit(c);if(f[0]>0)e[c]=f[0]*d+f[1];});return e;}});function b(b,c,d,e){if(a.isPlainObject(b)){c=b;b=b.effect;}b={effect:b};if(c==null)c={};if(a.isFunction(c)){e=c;d=null;c={};}if(typeof c==="number"||a.fx.speeds[c]){e=d;d=c;c={};}if(a.isFunction(d)){e=d;d=null;}if(c)a.extend(b,c);d=d||c.duration;b.duration=a.fx.off?0:typeof d==="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default;b.complete=e||c.complete;return b;}function c(b){if(!b||typeof b==="number"||a.fx.speeds[b])return true;if(typeof b==="string"&&!a.effects.effect[b])return true;if(a.isFunction(b))return true;if(typeof b==="object"&&!b.effect)return true;return false;}a.fn.extend({effect:function(){var c=b.apply(this,arguments),d=c.mode,e=c.queue,f=a.effects.effect[c.effect];if(a.fx.off||!f)if(d)return this[d](c.duration,c.complete);else return this.each(function(){if(c.complete)c.complete.call(this);});function g(b){var d=a(this),e=c.complete,g=c.mode;function h(){if(a.isFunction(e))e.call(d[0]);if(a.isFunction(b))b();}if(d.is(":hidden")?g==="hide":g==="show"){d[g]();h();}else f.call(d[0],c,h);}return e===false?this.each(g):this.queue(e||"fx",g);},show:(function(a){return function(d){if(c(d))return a.apply(this,arguments);else{var e=b.apply(this,arguments);e.mode="show";return this.effect.call(this,e);}};})(a.fn.show),hide:(function(a){return function(d){if(c(d))return a.apply(this,arguments);else{var e=b.apply(this,arguments);e.mode="hide";return this.effect.call(this,e);}};})(a.fn.hide),toggle:(function(a){return function(d){if(c(d)||typeof d==="boolean")return a.apply(this,arguments);else{var e=b.apply(this,arguments);e.mode="toggle";return this.effect.call(this,e);}};})(a.fn.toggle),cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){if(c.indexOf(b)>0)d=[parseFloat(c),b];});return d;}});})();(function(){var b={};a.each(["Quad","Cubic","Quart","Quint","Expo"],function(a,c){b[c]=function(b){return Math.pow(b,a+2);};});a.extend(b,{Sine:function(a){return 1-Math.cos(a*Math.PI/2);},Circ:function(a){return 1-Math.sqrt(1-a*a);},Elastic:function(a){return a===0||a===1?a:-Math.pow(2,8*(a-1))*Math.sin(((a-1)*80-7.5)*Math.PI/15);},Back:function(a){return a*a*(3*a-2);},Bounce:function(a){var b,c=4;while(a<((b=Math.pow(2,--c))-1)/11){}return 1/Math.pow(4,3-c)-7.5625*Math.pow((b*3-2)/22-a,2);}});a.each(b,function(b,c){a.easing["easeIn"+b]=c;a.easing["easeOut"+b]=function(a){return 1-c(1-a);};a.easing["easeInOut"+b]=function(a){return a<0.5?c(a*2)/2:1-c(a*-2+2)/2;};});})();var O=a.effects;var P=a.effects.effect.blind=function(b,c){var d=a(this),e=/up|down|vertical/,f=/up|left|vertical|horizontal/,g=["position","top","bottom","left","right","height","width"],h=a.effects.setMode(d,b.mode||"hide"),i=b.direction||"up",j=e.test(i),k=j?"height":"width",l=j?"top":"left",m=f.test(i),n={},o=h==="show",p,q,r;if(d.parent().is(".ui-effects-wrapper"))a.effects.save(d.parent(),g);else a.effects.save(d,g);d.show();p=a.effects.createWrapper(d).css({overflow:"hidden"});q=p[k]();r=parseFloat(p.css(l))||0;n[k]=o?q:0;if(!m){d.css(j?"bottom":"right",0).css(j?"top":"left","auto").css({position:"absolute"});n[l]=o?r:q+r;}if(o){p.css(k,0);if(!m)p.css(l,r+q);}p.animate(n,{duration:b.duration,easing:b.easing,queue:false,complete:function(){if(h==="hide")d.hide();a.effects.restore(d,g);a.effects.removeWrapper(d);c();}});};var Q=a.effects.effect.bounce=function(b,c){var d=a(this),e=["position","top","bottom","left","right","height","width"],f=a.effects.setMode(d,b.mode||"effect"),g=f==="hide",h=f==="show",i=b.direction||"up",j=b.distance,k=b.times||5,l=k*2+(h||g?1:0),m=b.duration/l,n=b.easing,o=(i==="up"||i==="down")?"top":"left",p=(i==="up"||i==="left"),q,r,s,t=d.queue(),u=t.length;if(h||g)e.push("opacity");a.effects.save(d,e);d.show();a.effects.createWrapper(d);if(!j)j=d[o==="top"?"outerHeight":"outerWidth"]()/3;if(h){s={opacity:1};s[o]=0;d.css("opacity",0).css(o,p?-j*2:j*2).animate(s,m,n);}if(g)j=j/Math.pow(2,k-1);s={};s[o]=0;for(q=0;q<k;q++){r={};r[o]=(p?"-=":"+=")+j;d.animate(r,m,n).animate(s,m,n);j=g?j*2:j/2;}if(g){r={opacity:0};r[o]=(p?"-=":"+=")+j;d.animate(r,m,n);}d.queue(function(){if(g)d.hide();a.effects.restore(d,e);a.effects.removeWrapper(d);c();});if(u>1)t.splice.apply(t,[1,0].concat(t.splice(u,l+1)));d.dequeue();};var R=a.effects.effect.clip=function(b,c){var d=a(this),e=["position","top","bottom","left","right","height","width"],f=a.effects.setMode(d,b.mode||"hide"),g=f==="show",h=b.direction||"vertical",i=h==="vertical",j=i?"height":"width",k=i?"top":"left",l={},m,n,o;a.effects.save(d,e);d.show();m=a.effects.createWrapper(d).css({overflow:"hidden"});n=(d[0].tagName==="IMG")?m:d;o=n[j]();if(g){n.css(j,0);n.css(k,o/2);}l[j]=g?o:0;l[k]=g?0:o/2;n.animate(l,{queue:false,duration:b.duration,easing:b.easing,complete:function(){if(!g)d.hide();a.effects.restore(d,e);a.effects.removeWrapper(d);c();}});};var S=a.effects.effect.drop=function(b,c){var d=a(this),e=["position","top","bottom","left","right","opacity","height","width"],f=a.effects.setMode(d,b.mode||"hide"),g=f==="show",h=b.direction||"left",i=(h==="up"||h==="down")?"top":"left",j=(h==="up"||h==="left")?"pos":"neg",k={opacity:g?1:0},l;a.effects.save(d,e);d.show();a.effects.createWrapper(d);l=b.distance||d[i==="top"?"outerHeight":"outerWidth"](true)/2;if(g)d.css("opacity",0).css(i,j==="pos"?-l:l);k[i]=(g?(j==="pos"?"+=":"-="):(j==="pos"?"-=":"+="))+l;d.animate(k,{queue:false,duration:b.duration,easing:b.easing,complete:function(){if(f==="hide")d.hide();a.effects.restore(d,e);a.effects.removeWrapper(d);c();}});};var T=a.effects.effect.explode=function(b,c){var d=b.pieces?Math.round(Math.sqrt(b.pieces)):3,e=d,f=a(this),g=a.effects.setMode(f,b.mode||"hide"),h=g==="show",i=f.show().css("visibility","hidden").offset(),j=Math.ceil(f.outerWidth()/e),k=Math.ceil(f.outerHeight()/d),l=[],m,n,o,p,q,r;function s(){l.push(this);if(l.length===d*e)t();}for(m=0;m<d;m++){p=i.top+m*k;r=m-(d-1)/2;for(n=0;n<e;n++){o=i.left+n*j;q=n-(e-1)/2;f.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-n*j,top:-m*k}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:j,height:k,left:o+(h?q*j:0),top:p+(h?r*k:0),opacity:h?0:1}).animate({left:o+(h?0:q*j),top:p+(h?0:r*k),opacity:h?1:0},b.duration||500,b.easing,s);}}function t(){f.css({visibility:"visible"});a(l).remove();if(!h)f.hide();c();}};var U=a.effects.effect.fade=function(b,c){var d=a(this),e=a.effects.setMode(d,b.mode||"toggle");d.animate({opacity:e},{queue:false,duration:b.duration,easing:b.easing,complete:c});};var V=a.effects.effect.fold=function(b,c){var d=a(this),e=["position","top","bottom","left","right","height","width"],f=a.effects.setMode(d,b.mode||"hide"),g=f==="show",h=f==="hide",i=b.size||15,j=/([0-9]+)%/.exec(i),k=!!b.horizFirst,l=g!==k,m=l?["width","height"]:["height","width"],n=b.duration/2,o,p,q={},r={};a.effects.save(d,e);d.show();o=a.effects.createWrapper(d).css({overflow:"hidden"});p=l?[o.width(),o.height()]:[o.height(),o.width()];if(j)i=parseInt(j[1],10)/100*p[h?0:1];if(g)o.css(k?{height:0,width:i}:{height:i,width:0});q[m[0]]=g?p[0]:i;r[m[1]]=g?p[1]:0;o.animate(q,n,b.easing).animate(r,n,b.easing,function(){if(h)d.hide();a.effects.restore(d,e);a.effects.removeWrapper(d);c();});};var W=a.effects.effect.highlight=function(b,c){var d=a(this),e=["backgroundImage","backgroundColor","opacity"],f=a.effects.setMode(d,b.mode||"show"),g={backgroundColor:d.css("backgroundColor")};if(f==="hide")g.opacity=0;a.effects.save(d,e);d.show().css({backgroundImage:"none",backgroundColor:b.color||"#ffff99"}).animate(g,{queue:false,duration:b.duration,easing:b.easing,complete:function(){if(f==="hide")d.hide();a.effects.restore(d,e);c();}});};var X=a.effects.effect.size=function(b,c){var d,e,f,g=a(this),h=["position","top","bottom","left","right","width","height","overflow","opacity"],i=["position","top","bottom","left","right","overflow","opacity"],j=["width","height","overflow"],k=["fontSize"],l=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],m=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],n=a.effects.setMode(g,b.mode||"effect"),o=b.restore||n!=="effect",p=b.scale||"both",q=b.origin||["middle","center"],r=g.css("position"),s=o?h:i,t={height:0,width:0,outerHeight:0,outerWidth:0};if(n==="show")g.show();d={height:g.height(),width:g.width(),outerHeight:g.outerHeight(),outerWidth:g.outerWidth()};if(b.mode==="toggle"&&n==="show"){g.from=b.to||t;g.to=b.from||d;}else{g.from=b.from||(n==="show"?t:d);g.to=b.to||(n==="hide"?t:d);}f={from:{y:g.from.height/d.height,x:g.from.width/d.width},to:{y:g.to.height/d.height,x:g.to.width/d.width}};if(p==="box"||p==="both"){if(f.from.y!==f.to.y){s=s.concat(l);g.from=a.effects.setTransition(g,l,f.from.y,g.from);g.to=a.effects.setTransition(g,l,f.to.y,g.to);}if(f.from.x!==f.to.x){s=s.concat(m);g.from=a.effects.setTransition(g,m,f.from.x,g.from);g.to=a.effects.setTransition(g,m,f.to.x,g.to);}}if(p==="content"||p==="both")if(f.from.y!==f.to.y){s=s.concat(k).concat(j);g.from=a.effects.setTransition(g,k,f.from.y,g.from);g.to=a.effects.setTransition(g,k,f.to.y,g.to);}a.effects.save(g,s);g.show();a.effects.createWrapper(g);g.css("overflow","hidden").css(g.from);if(q){e=a.effects.getBaseline(q,d);g.from.top=(d.outerHeight-g.outerHeight())*e.y;g.from.left=(d.outerWidth-g.outerWidth())*e.x;g.to.top=(d.outerHeight-g.to.outerHeight)*e.y;g.to.left=(d.outerWidth-g.to.outerWidth)*e.x;}g.css(g.from);if(p==="content"||p==="both"){l=l.concat(["marginTop","marginBottom"]).concat(k);m=m.concat(["marginLeft","marginRight"]);j=h.concat(l).concat(m);g.find("*[width]").each(function(){var c=a(this),d={height:c.height(),width:c.width(),outerHeight:c.outerHeight(),outerWidth:c.outerWidth()};if(o)a.effects.save(c,j);c.from={height:d.height*f.from.y,width:d.width*f.from.x,outerHeight:d.outerHeight*f.from.y,outerWidth:d.outerWidth*f.from.x};c.to={height:d.height*f.to.y,width:d.width*f.to.x,outerHeight:d.height*f.to.y,outerWidth:d.width*f.to.x};if(f.from.y!==f.to.y){c.from=a.effects.setTransition(c,l,f.from.y,c.from);c.to=a.effects.setTransition(c,l,f.to.y,c.to);}if(f.from.x!==f.to.x){c.from=a.effects.setTransition(c,m,f.from.x,c.from);c.to=a.effects.setTransition(c,m,f.to.x,c.to);}c.css(c.from);c.animate(c.to,b.duration,b.easing,function(){if(o)a.effects.restore(c,j);});});}g.animate(g.to,{queue:false,duration:b.duration,easing:b.easing,complete:function(){if(g.to.opacity===0)g.css("opacity",g.from.opacity);if(n==="hide")g.hide();a.effects.restore(g,s);if(!o)if(r==="static")g.css({position:"relative",top:g.to.top,left:g.to.left});else a.each(["top","left"],function(a,b){g.css(b,function(b,c){var d=parseInt(c,10),e=a?g.to.left:g.to.top;if(c==="auto")return e+"px";return d+e+"px";});});a.effects.removeWrapper(g);c();}});};var Y=a.effects.effect.scale=function(b,c){var d=a(this),e=a.extend(true,{},b),f=a.effects.setMode(d,b.mode||"effect"),g=parseInt(b.percent,10)||(parseInt(b.percent,10)===0?0:(f==="hide"?0:100)),h=b.direction||"both",i=b.origin,j={height:d.height(),width:d.width(),outerHeight:d.outerHeight(),outerWidth:d.outerWidth()},k={y:h!=="horizontal"?(g/100):1,x:h!=="vertical"?(g/100):1};e.effect="size";e.queue=false;e.complete=c;if(f!=="effect"){e.origin=i||["middle","center"];e.restore=true;}e.from=b.from||(f==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:j);e.to={height:j.height*k.y,width:j.width*k.x,outerHeight:j.outerHeight*k.y,outerWidth:j.outerWidth*k.x};if(e.fade){if(f==="show"){e.from.opacity=0;e.to.opacity=1;}if(f==="hide"){e.from.opacity=1;e.to.opacity=0;}}d.effect(e);};var Z=a.effects.effect.puff=function(b,c){var d=a(this),e=a.effects.setMode(d,b.mode||"hide"),f=e==="hide",g=parseInt(b.percent,10)||150,h=g/100,i={height:d.height(),width:d.width(),outerHeight:d.outerHeight(),outerWidth:d.outerWidth()};a.extend(b,{effect:"scale",queue:false,fade:true,mode:e,complete:c,percent:f?g:100,from:f?i:{height:i.height*h,width:i.width*h,outerHeight:i.outerHeight*h,outerWidth:i.outerWidth*h}});d.effect(b);};var ab=a.effects.effect.pulsate=function(b,c){var d=a(this),e=a.effects.setMode(d,b.mode||"show"),f=e==="show",g=e==="hide",h=(f||e==="hide"),i=((b.times||5)*2)+(h?1:0),j=b.duration/i,k=0,l=d.queue(),m=l.length,n;if(f||!d.is(":visible")){d.css("opacity",0).show();k=1;}for(n=1;n<i;n++){d.animate({opacity:k},j,b.easing);k=1-k;}d.animate({opacity:k},j,b.easing);d.queue(function(){if(g)d.hide();c();});if(m>1)l.splice.apply(l,[1,0].concat(l.splice(m,i+1)));d.dequeue();};var ac=a.effects.effect.shake=function(b,c){var d=a(this),e=["position","top","bottom","left","right","height","width"],f=a.effects.setMode(d,b.mode||"effect"),g=b.direction||"left",h=b.distance||20,i=b.times||3,j=i*2+1,k=Math.round(b.duration/j),l=(g==="up"||g==="down")?"top":"left",m=(g==="up"||g==="left"),n={},o={},p={},q,r=d.queue(),s=r.length;a.effects.save(d,e);d.show();a.effects.createWrapper(d);n[l]=(m?"-=":"+=")+h;o[l]=(m?"+=":"-=")+h*2;p[l]=(m?"-=":"+=")+h*2;d.animate(n,k,b.easing);for(q=1;q<i;q++)d.animate(o,k,b.easing).animate(p,k,b.easing);d.animate(o,k,b.easing).animate(n,k/2,b.easing).queue(function(){if(f==="hide")d.hide();a.effects.restore(d,e);a.effects.removeWrapper(d);c();});if(s>1)r.splice.apply(r,[1,0].concat(r.splice(s,j+1)));d.dequeue();};var ad=a.effects.effect.slide=function(b,c){var d=a(this),e=["position","top","bottom","left","right","width","height"],f=a.effects.setMode(d,b.mode||"show"),g=f==="show",h=b.direction||"left",i=(h==="up"||h==="down")?"top":"left",j=(h==="up"||h==="left"),k,l={};a.effects.save(d,e);d.show();k=b.distance||d[i==="top"?"outerHeight":"outerWidth"](true);a.effects.createWrapper(d).css({overflow:"hidden"});if(g)d.css(i,j?(isNaN(k)?"-"+k:-k):k);l[i]=(g?(j?"+=":"-="):(j?"-=":"+="))+k;d.animate(l,{queue:false,duration:b.duration,easing:b.easing,complete:function(){if(f==="hide")d.hide();a.effects.restore(d,e);a.effects.removeWrapper(d);c();}});};var ae=a.effects.effect.transfer=function(b,c){var d=a(this),e=a(b.to),f=e.css("position")==="fixed",g=a("body"),h=f?g.scrollTop():0,i=f?g.scrollLeft():0,j=e.offset(),k={top:j.top-h,left:j.left-i,height:e.innerHeight(),width:e.innerWidth()},l=d.offset(),m=a("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(b.className).css({top:l.top-h,left:l.left-i,height:d.innerHeight(),width:d.innerWidth(),position:f?"fixed":"absolute"}).animate(k,b.duration,b.easing,function(){m.remove();c();});};}));(function(a){if(typeof define==='function'&&define.amd)define(['jquery'],a);else if(typeof exports==='object')a(require('jquery'));else a(jQuery);}(function(a){var b=/\+/g;function c(a){return h.raw?a:encodeURIComponent(a);}function d(a){return h.raw?a:decodeURIComponent(a);}function e(a){return c(h.json?JSON.stringify(a):String(a));}function f(a){if(a.indexOf('"')===0)a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');try{a=decodeURIComponent(a.replace(b,' '));return h.json?JSON.parse(a):a;}catch(c){}}function g(b,c){var d=h.raw?b:f(b);return a.isFunction(c)?c(d):d;}var h=a.cookie=function(b,f,i){if(f!==undefined&&!a.isFunction(f)){i=a.extend({},h.defaults,i);if(typeof i.expires==='number'){var j=i.expires,k=i.expires=new Date();k.setTime(+k+j*864e+5);}return(document.cookie=[c(b),'=',e(f),i.expires?'; expires='+i.expires.toUTCString():'',i.path?'; path='+i.path:'',i.domain?'; domain='+i.domain:'',i.secure?'; secure':''].join(''));}var l=b?undefined:{};var m=document.cookie?document.cookie.split('; '):[];for(var n=0,o=m.length;n<o;n++){var p=m[n].split('=');var q=d(p.shift());var r=p.join('=');if(b&&b===q){l=g(r,f);break;}if(!b&&(r=g(r))!==undefined)l[q]=r;}return l;};h.defaults={};a.removeCookie=function(b,c){if(a.cookie(b)===undefined)return false;a.cookie(b,'',a.extend({},c,{expires:-1}));return !a.cookie(b);};}));(function(a){a.ajaxSettings.xdr=function(){return(window.XDomainRequest?new window.XDomainRequest():null);};(function(b){a.extend(a.support,{iecors:!!b});})(a.ajaxSettings.xdr());if(a.support.iecors)a.ajaxTransport(function(a){var b,c=a.xdr();return{send:function(b,d){c.onload=function(){var a={'Content-Type':c.contentType};d(200,'OK',{text:c.responseText},a);};if(a.xhrFields){xhr.onerror=a.xhrFields.error;xhr.ontimeout=a.xhrFields.timeout;}c.open(a.type,a.url);c.send((a.hasContent&&a.data)||null);},abort:function(){c.abort();}};});})(jQuery);/*! Lazy Load 1.9.3 - MIT license - Copyright 2010-2013 Mika Tuupola */
!function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);
/*
    A simple jQuery modal (http://github.com/kylefox/jquery-modal)
    Version 0.5.4
*/
(function(a){var c=null;a.modal=function(b,f){a.modal.close();var e,d;this.$body=a("body");this.options=a.extend({},a.modal.defaults,f);this.options.doFade=!isNaN(parseInt(this.options.fadeDuration,10));if(b.is("a"))if(d=b.attr("href"),/^#/.test(d)){this.$elm=a(d);if(1!==this.$elm.length)return null;this.open()}else this.$elm=a("<div>"),this.$body.append(this.$elm),e=function(a,b){b.elm.remove()},this.showSpinner(),b.trigger(a.modal.AJAX_SEND),a.get(d).done(function(d){c&&(b.trigger(a.modal.AJAX_SUCCESS),
c.$elm.empty().append(d).on(a.modal.CLOSE,e),c.hideSpinner(),c.open(),b.trigger(a.modal.AJAX_COMPLETE))}).fail(function(){b.trigger(a.modal.AJAX_FAIL);c.hideSpinner();b.trigger(a.modal.AJAX_COMPLETE)});else this.$elm=b,this.open()};a.modal.prototype={constructor:a.modal,open:function(){var b=this;this.options.doFade?(this.block(),setTimeout(function(){b.show()},this.options.fadeDuration*this.options.fadeDelay)):(this.block(),this.show());if(this.options.escapeClose)a(document).on("keydown.modal",
function(b){27==b.which&&a.modal.close()});this.options.clickClose&&this.blocker.click(a.modal.close)},close:function(){this.unblock();this.hide();a(document).off("keydown.modal")},block:function(){var b=this.options.doFade?0:this.options.opacity;this.$elm.trigger(a.modal.BEFORE_BLOCK,[this._ctx()]);this.blocker=a('<div class="jquery-modal blocker"></div>').css({top:0,right:0,bottom:0,left:0,width:"100%",height:"100%",position:"fixed",zIndex:this.options.zIndex,background:this.options.overlay,opacity:b});
this.$body.append(this.blocker);this.options.doFade&&this.blocker.animate({opacity:this.options.opacity},this.options.fadeDuration);this.$elm.trigger(a.modal.BLOCK,[this._ctx()])},unblock:function(){this.options.doFade?this.blocker.fadeOut(this.options.fadeDuration,function(){this.remove()}):this.blocker.remove()},show:function(){this.$elm.trigger(a.modal.BEFORE_OPEN,[this._ctx()]);this.options.showClose&&(this.closeButton=a('<a href="#close-modal" rel="modal:close" class="close-modal">'+this.options.closeText+
"</a>"),this.$elm.append(this.closeButton));this.$elm.addClass(this.options.modalClass+" current");this.center();this.options.doFade?this.$elm.fadeIn(this.options.fadeDuration):this.$elm.show();this.$elm.trigger(a.modal.OPEN,[this._ctx()])},hide:function(){this.$elm.trigger(a.modal.BEFORE_CLOSE,[this._ctx()]);this.closeButton&&this.closeButton.remove();this.$elm.removeClass("current");this.options.doFade?this.$elm.fadeOut(this.options.fadeDuration):this.$elm.hide();this.$elm.trigger(a.modal.CLOSE,
[this._ctx()])},showSpinner:function(){this.options.showSpinner&&(this.spinner=this.spinner||a('<div class="'+this.options.modalClass+'-spinner"></div>').append(this.options.spinnerHtml),this.$body.append(this.spinner),this.spinner.show())},hideSpinner:function(){this.spinner&&this.spinner.remove()},center:function(){this.$elm.css({position:"fixed",top:"50%",left:"50%",marginTop:-(this.$elm.outerHeight()/2),marginLeft:-(this.$elm.outerWidth()/2),zIndex:this.options.zIndex+1})},_ctx:function(){return{elm:this.$elm,
blocker:this.blocker,options:this.options}}};a.modal.prototype.resize=a.modal.prototype.center;a.modal.close=function(a){if(c)return a&&a.preventDefault(),c.close(),a=c.$elm,c=null,a};a.modal.resize=function(){c&&c.resize()};a.modal.defaults={overlay:"#000",opacity:0.75,zIndex:1,escapeClose:!0,clickClose:!0,closeText:"Close",modalClass:"modal",spinnerHtml:null,showSpinner:!0,showClose:!0,fadeDuration:null,fadeDelay:1};a.modal.BEFORE_BLOCK="modal:before-block";a.modal.BLOCK="modal:block";a.modal.BEFORE_OPEN=
"modal:before-open";a.modal.OPEN="modal:open";a.modal.BEFORE_CLOSE="modal:before-close";a.modal.CLOSE="modal:close";a.modal.AJAX_SEND="modal:ajax:send";a.modal.AJAX_SUCCESS="modal:ajax:success";a.modal.AJAX_FAIL="modal:ajax:fail";a.modal.AJAX_COMPLETE="modal:ajax:complete";a.fn.modal=function(b){1===this.length&&(c=new a.modal(this,b));return this};a(document).on("click.modal",'a[rel="modal:close"]',a.modal.close);a(document).on("click.modal",'a[rel="modal:open"]',function(b){b.preventDefault();a(this).modal()})})(jQuery);
/**
 * jQuery Unveil
 * A very lightweight jQuery plugin to lazy load images
 * http://luis-almeida.github.com/unveil
 *
 * Licensed under the MIT license.
 * Copyright 2013 LuÃ­s Almeida
 * https://github.com/luis-almeida
 */

;(function($){$.fn.unveil=function(threshold,callback){var $w=$(window),th=threshold||0,retina=window.devicePixelRatio>1,attrib=retina?"data-src-retina":"data-src",images=this,loaded;this.one("unveil",function(){var source=this.getAttribute(attrib);source=source||this.getAttribute("data-src");if(source){this.setAttribute("src",source);if(typeof callback==="function")callback.call(this);}});function unveil(){var inview=images.filter(function(){var $e=$(this),wt=$w.scrollTop(),wb=wt+$w.height(),et=$e.offset().top,eb=et+$e.height();return eb>=wt-th&&et<=wb+th;});loaded=inview.trigger("unveil");images=images.not(loaded);}$w.scroll(unveil);$w.resize(unveil);unveil();return this;};})(window.jQuery||window.Zepto);
/* 
=========================================================================
   JSManipulate v1.0 (2011-08-01)

Javascript image filter & effect library

Developed by Joel Besada (http://www.joelb.me)
Demo page: http://www.joelb.me/jsmanipulate

MIT LICENSED (http://www.opensource.org/licenses/mit-license.php)
Copyright (c) 2011, Joel Besada
=========================================================================
*/
function FilterUtils(){this.HSVtoRGB=function(a,b,f){var d,g,c,e=Math.floor(a*6),h=a*6-e,a=f*(1-b),k=f*(1-h*b),b=f*(1-(1-h)*b);switch(e%6){case 0:d=f;g=b;c=a;break;case 1:d=k;g=f;c=a;break;case 2:d=a;g=f;c=b;break;case 3:d=a;g=k;c=f;break;case 4:d=b;g=a;c=f;break;case 5:d=f,g=a,c=k}return[d*255,g*255,c*255]};this.RGBtoHSV=function(a,b,f){a/=255;b/=255;f/=255;var d=Math.max(a,b,f),g=Math.min(a,b,f),c,e=d-g;if(d===g)c=0;else{switch(d){case a:c=(b-f)/e+(b<f?6:0);break;case b:c=(f-a)/e+2;break;case f:c=
(a-b)/e+4}c/=6}return[c,d===0?0:e/d,d]};this.getPixel=function(a,b,f,d,g){var c=(f*d+b)*4;if(b<0||b>=d||f<0||f>=g)return[a[(this.clampPixel(f,0,g-1)*d+this.clampPixel(b,0,d-1))*4],a[(this.clampPixel(f,0,g-1)*d+this.clampPixel(b,0,d-1))*4+1],a[(this.clampPixel(f,0,g-1)*d+this.clampPixel(b,0,d-1))*4+2],a[(this.clampPixel(f,0,g-1)*d+this.clampPixel(b,0,d-1))*4+3]];return[a[c],a[c+1],a[c+2],a[c+3]]};var h=!1,e;this.gaussianRandom=function(){if(h)return h=!1,e;else{var a,b,f;do a=2*Math.random()-1,b=2*
Math.random()-1,f=a*a+b*b;while(f>=1||f===0);f=Math.sqrt(-2*Math.log(f)/f);e=b*f;h=!0;return a*f}};this.clampPixel=function(a,b,f){return a<b?b:a>f?f:a};this.triangle=function(a){a=this.mod(a,1);return 2*(a<0.5?a:1-a)};this.mod=function(a,b){var f=parseInt(a/b,10);a-=f*b;if(a<0)return a+b;return a};this.mixColors=function(a,b,f){var d=this.linearInterpolate(a,b[0],f[0]),g=this.linearInterpolate(a,b[1],f[1]),c=this.linearInterpolate(a,b[2],f[2]),a=this.linearInterpolate(a,b[3],f[3]);return[d,g,c,a]};
this.linearInterpolate=function(a,b,f){return b+a*(f-b)};this.bilinearInterpolate=function(a,b,f,d,g,c){var e=f[0],h=f[1],k=f[2],i=d[0],o=d[1],p=d[2],s=g[0],n=g[1],m=g[2],q=g[3],t=c[0],r=c[1],g=c[2],u=c[3],c=1-a,v=1-b,f=c*f[3]+a*d[3],f=v*f+b*(c*q+a*u),e=v*(c*e+a*i)+b*(c*s+a*t),h=v*(c*h+a*o)+b*(c*n+a*r);return[e,h,v*(c*k+a*p)+b*(c*m+a*g),f]};this.tableFilter=function(a,b,f,d){for(var g=0;g<d;g++)for(var c=0;c<f;c++)for(var e=(g*f+c)*4,h=0;h<3;h++)a[e+h]=b[a[e+h]]};this.convolveFilter=function(a,b,
f,d){var g=[],c,e;c=e=Math.sqrt(b.length);c=parseInt(c/2,10);for(var h=parseInt(e/2,10),k=0;k<d;k++)for(var i=0;i<f;i++){for(var o=(k*f+i)*4,p=0,s=0,n=0,m=-c;m<=c;m++)for(var q=k+m,q=0<=q&&q<d?q*f:k*f,t=e*(m+c)+h,r=-h;r<=h;r++){var u=b[t+r];if(u!==0){var v=i+r;0<=v&&v<f||(v=i);v=(q+v)*4;p+=u*a[v];s+=u*a[v+1];n+=u*a[v+2]}}g[o]=parseInt(p+0.5,10);g[o+1]=parseInt(s+0.5,10);g[o+2]=parseInt(n+0.5,10);g[o+3]=a[o+3]}for(b=0;b<g.length;b++)a[b]=g[b]};this.transformFilter=function(a,b,f,d){for(var g=[],c=
[],e=0;e<a.length;e++)c[e]=a[e];for(e=0;e<d;e++)for(var h=0;h<f;h++){var k=(e*f+h)*4;b.apply(this,[h,e,g]);var i=Math.floor(g[0]),o=Math.floor(g[1]),p=g[0]-i,s=g[1]-o,n,m,q;i>=0&&i<f-1&&o>=0&&o<d-1?(i=(f*o+i)*4,n=[a[i],a[i+1],a[i+2],a[i+3]],m=[a[i+4],a[i+5],a[i+6],a[i+7]],q=[a[i+f*4],a[i+f*4+1],a[i+f*4+2],a[i+f*4+3]],i=[a[i+(f+1)*4],a[i+(f+1)*4+1],a[i+(f+1)*4+2],a[i+(f+1)*4+3]]):(n=this.getPixel(a,i,o,f,d),m=this.getPixel(a,i+1,o,f,d),q=this.getPixel(a,i,o+1,f,d),i=this.getPixel(a,i+1,o+1,f,d));p=
this.bilinearInterpolate(p,s,n,m,q,i);c[k]=p[0];c[k+1]=p[1];c[k+2]=p[2];c[k+3]=p[3]}for(b=0;b<c.length;b++)a[b]=c[b]}}
function BlurFilter(){this.name="Blur";this.isDirAnimatable=!1;this.defaultValues={amount:3};this.valueRanges={amount:{min:0,max:10}};this.filter=function(h,e){var a=h.width,b=a<<2,f=h.height,d=h.data,g;g=e.amount;g<0&&(g=0);g=g>=2.5?0.98711*g-0.9633:g>=0.5?3.97156-4.14554*Math.sqrt(1-0.26891*g):2*g*(3.97156-4.14554*Math.sqrt(0.865545));var c=g*g,j=c*g,l=1.57825+2.44413*g+1.4281*c+0.422205*j;g=(2.44413*g+2.85619*c+1.26661*j)/l;for(var c=-(1.4281*c+1.26661*j)/l,j=0.422205*j/l,l=1-(g+c+j),k=0,i,o,p,
s,n,m,k=0;k<3;k++)for(var q=0;q<f;q++){i=q*b+k;o=q*b+(a-1<<2)+k;for(m=n=s=p=d[i];i<=o;i+=4)p=l*d[i]+g*s+c*n+j*m,d[i]=p,m=n,n=s,s=p;i=q*b+(a-1<<2)+k;o=q*b+k;for(m=n=s=p=d[i];i>=o;i-=4)p=l*d[i]+g*s+c*n+j*m,d[i]=p,m=n,n=s,s=p}for(k=0;k<3;k++)for(q=0;q<a;q++){i=(q<<2)+k;o=(f-1)*b+(q<<2)+k;for(m=n=s=p=d[i];i<=o;i+=b)p=l*d[i]+g*s+c*n+j*m,d[i]=p,m=n,n=s,s=p;i=(f-1)*b+(q<<2)+k;o=(q<<2)+k;for(m=n=s=p=d[i];i>=o;i-=b)p=l*d[i]+g*s+c*n+j*m,d[i]=p,m=n,n=s,s=p}}}
function BrightnessFilter(){this.name="Brightness";this.isDirAnimatable=!0;this.defaultValues={amount:0};this.valueRanges={amount:{min:-1,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;for(var g=a.amount===void 0?this.defaultValues.amount:a.amount,c=0;c<f;c++)for(var j=0;j<b;j++){var l=(c*b+j)*4,k=h.RGBtoHSV(d[l],d[l+1],d[l+2]);k[2]+=g;k[2]<0?k[2]=0:k[2]>1&&(k[2]=1);for(var k=h.HSVtoRGB(k[0],k[1],k[2]),i=0;i<3;i++)d[l+i]=
k[i]}}}function BumpFilter(){this.name="Bump";this.isDirAnimatable=!0;this.defaultValues={};this.valueRanges={};var h=new FilterUtils;this.filter=function(e){h.convolveFilter(e.data,[-1,-1,0,-1,1,1,0,1,1],e.width,e.height)}}
function CircleSmearFilter(){this.name="Circle Smear";this.isDirAnimatable=!1;this.defaultValues={size:4,density:0.5,mix:0.5};this.valueRanges={size:{min:1,max:10},density:{min:0,max:1},mix:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){for(var b=e.width,f=e.height,d=e.data,g=[],c=0;c<d.length;c++)g[c]=d[c];if(a===void 0)a=this.defaultValues;var j=a.size===void 0?this.defaultValues.size:a.size;j<1&&(j=1);j=parseInt(j,10);c=a.mix===void 0?this.defaultValues.mix:a.mix;j+=1;for(var l=
j*j,k=parseInt(2*(a.density===void 0?this.defaultValues.density:a.density)/30*b*f/2,10),i=0;i<k;i++)for(var o=(Math.random()*Math.pow(2,32)&2147483647)%b,p=(Math.random()*Math.pow(2,32)&2147483647)%f,s=[d[(p*b+o)*4],d[(p*b+o)*4+1],d[(p*b+o)*4+2],d[(p*b+o)*4+3]],n=o-j;n<o+j+1;n++)for(var m=p-j;m<p+j+1;m++){var q=(n-o)*(n-o)+(m-p)*(m-p);if(n>=0&&n<b&&m>=0&&m<f&&q<=l)for(var q=h.mixColors(c,[g[(m*b+n)*4],g[(m*b+n)*4+1],g[(m*b+n)*4+2],g[(m*b+n)*4+3]],s),t=0;t<3;t++)g[(m*b+n)*4+t]=q[t]}for(b=0;b<g.length;b++)d[b]=
g[b]}}
function ContrastFilter(){this.name="Contrast";this.isDirAnimatable=!0;this.defaultValues={amount:1};this.valueRanges={amount:{min:0,max:2}};if(FilterUtils){var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;var g=a.amount===void 0?this.defaultValues.amount:a.amount;g<0&&(g=0);for(var c=[],j=0;j<256;j++)c[j]=parseInt(255*((j/255-0.5)*g+0.5),10);h.tableFilter(d,c,b,f)}}else console&&console.error("Unable to find filterutils.js, please include this file! (Required by "+this.name+
" filter)")}
function CrossSmearFilter(){this.name="Cross Smear";this.isDirAnimatable=!1;this.defaultValues={distance:8,density:0.5,mix:0.5};this.valueRanges={distance:{min:0,max:30},density:{min:0,max:1},mix:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){for(var b=e.width,f=e.height,d=e.data,g=[],c=0;c<d.length;c++)g[c]=d[c];if(a===void 0)a=this.defaultValues;c=a.distance===void 0?this.defaultValues.distance:a.distance;c<0&&(c=0);for(var c=parseInt(c,10),j=a.mix===void 0?this.defaultValues.mix:a.mix,
l=parseInt(2*(a.density===void 0?this.defaultValues.density:a.density)*b*f/(c+1),10),k=0;k<l;k++){for(var i=(Math.random()*Math.pow(2,32)&2147483647)%b,o=(Math.random()*Math.pow(2,32)&2147483647)%f,p=Math.random()*Math.pow(2,32)%c+1,s=[d[(o*b+i)*4],d[(o*b+i)*4+1],d[(o*b+i)*4+2],d[(o*b+i)*4+3]],n,m,q=i-p;q<i+p+1;q++)if(q>=0&&q<b){n=[g[(o*b+q)*4],g[(o*b+q)*4+1],g[(o*b+q)*4+2],g[(o*b+q)*4+3]];n=h.mixColors(j,n,s);for(m=0;m<3;m++)g[(o*b+q)*4+m]=n[m]}for(q=o-p;q<o+p+1;q++)if(q>=0&&q<f){n=[g[(q*b+i)*4],
g[(q*b+i)*4+1],g[(q*b+i)*4+2],g[(q*b+i)*4+3]];n=h.mixColors(j,n,s);for(m=0;m<3;m++)g[(q*b+i)*4+m]=n[m]}}for(b=0;b<g.length;b++)d[b]=g[b]}}
function DiffusionFilter(){this.name="Diffusion";this.isDirAnimatable=!1;this.defaultValues={scale:4};this.valueRanges={scale:{min:1,max:100}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;for(var g=a.scale===void 0?this.defaultValues.scale:a.scale,c=[],j=[],l=0;l<256;l++){var k=Math.PI*2*l/256;c[l]=g*Math.sin(k);j[l]=g*Math.cos(k)}transInverse=function(a,b,g){var d=parseInt(Math.random()*255,10),f=Math.random();g[0]=a+f*c[d];
g[1]=b+f*j[d]};h.transformFilter(d,transInverse,b,f)}}
function DitherFilter(){this.name="Dither";this.isDirAnimatable=!1;this.defaultValues={levels:3,color:!0};this.valueRanges={levels:{min:2,max:30},color:{min:!1,max:!0}};new FilterUtils;this.filter=function(h,e){var a=h.width,b=h.height,f=h.data,d=[],g,c;for(c=0;c<f.length;c++)d[c]=0;if(e===void 0)e=this.defaultValues;var j=e.levels===void 0?this.defaultValues.levels:e.levels,l=e.color===void 0?this.defaultValues.color:e.color;j<=1&&(j=1);var k=[0,0,0,0,0,7,3,5,1],i=0,o=[];for(g=0;g<j;g++)o[g]=parseInt(255*
g/(j-1),10);var p=[];for(g=0;g<256;g++)p[g]=parseInt(j*g/256,10);for(j=0;j<b;j++){var s=(j&1)==1,n;s?(i=(j*a+a-1)*4,n=-1):(i=j*a*4,n=1);for(var m=0;m<a;m++){var q=f[i],t=f[i+1],r=f[i+2];l||(q=t=r=parseInt((q+t+r)/3,10));var u=o[p[q]],v=o[p[t]];g=o[p[r]];d[i]=u;d[i+1]=v;d[i+2]=g;d[i+3]=f[i+3];var u=q-u,v=t-v,y=r-g;for(g=-1;g<=1;g++)if(q=g+j,0<=q&&q<b)for(c=-1;c<=1;c++)if(q=c+m,0<=q&&q<a){var w;w=s?k[(g+1)*3-c+1]:k[(g+1)*3+c+1];if(w!==0){var x=s?i-c*4:i+c*4,q=f[x],t=f[x+1],r=f[x+2];w/=16;q+=u*w;t+=
v*w;r+=y*w;f[x]=q;f[x+1]=t;f[x+2]=r}}i+=n*4}}for(c=0;c<d.length;c++)f[c]=d[c]}}
function EdgeFilter(){this.name="Edge Detection";this.isDirAnimatable=!0;this.defaultValues={};this.valueRanges={};var h=[-1,-2,-1,0,0,0,1,2,1],e=[-1,0,1,-2,0,2,-1,0,1];this.filter=function(a){for(var b=a.width,f=a.height,a=a.data,d=[],g=0;g<f;g++)for(var c=0;c<b;c++){var j=(g*b+c)*4,l=0,k=bh=gh=0;bv=gv=0;for(var i=-1;i<=1;i++)for(var o=g+i,o=o>=0&&o<f?o*b*4:g*b*4,p=3*(i+1)+1,s=-1;s<=1;s++){var n=c+s;n>=0&&n<b||(n=c);n*=4;var m=a[o+n],q=a[o+n+1],n=a[o+n+2],t=h[p+s],r=e[p+s];l+=parseInt(t*m,10);bh+=
parseInt(t*q,10);gh+=parseInt(t*n,10);k+=parseInt(r*m,10);gv+=parseInt(r*q,10);bv+=parseInt(r*n,10)}m=parseInt(Math.sqrt(l*l+k*k)/1.8,10);q=parseInt(Math.sqrt(gh*gh+gv*gv)/1.8,10);n=parseInt(Math.sqrt(bh*bh+bv*bv)/1.8,10);d[j]=m;d[j+1]=q;d[j+2]=n;d[j+3]=a[j+3]}for(b=0;b<d.length;b++)a[b]=d[b]}}
function EmbossFilter(){this.name="Emboss";this.isDirAnimatable=!1;this.defaultValues={height:1,angle:135,elevation:30};this.valueRanges={height:{min:1,max:10},angle:{min:0,max:360},elevation:{min:0,max:180}};this.filter=function(h,e){var a=h.width,b=h.height,f=h.data;if(e===void 0)e=this.defaultValues;for(var d=e.height===void 0?this.defaultValues.height:e.height,g=e.angle===void 0?this.defaultValues.angle:e.angle,c=e.elevation===void 0?this.defaultValues.elevation:e.elevation,g=g/180*Math.PI,c=
c/180*Math.PI,j=3*d,d=[],l=0;l<f.length;l+=4)d[l/4]=(f[l]+f[l+1]+f[l+2])/3;var k,i,o,p,l=parseInt(Math.cos(g)*Math.cos(c)*255.9,10),g=parseInt(Math.sin(g)*Math.cos(c)*255.9,10),c=parseInt(Math.sin(c)*255.9,10);o=parseInt(1530/j,10);j=o*o;o*=c;for(var s=0,n=0;n<b;n++,s+=a)for(var m=s,q=m+a,t=q+a,r=0;r<a;r++,m++,q++,t++){var u=(n*a+r)*4;n!==0&&n<b-2&&r!==0&&r<a-2?(k=d[m-1]+d[q-1]+d[t-1]-d[m+1]-d[q+1]-d[t+1],i=d[t-1]+d[t]+d[t+1]-d[m-1]-d[m]-d[m+1],k=k===0&&i===0?c:(p=k*l+i*g+o)<0?0:parseInt(p/Math.sqrt(k*
k+i*i+j),10)):k=c;f[u]=f[u+1]=f[u+2]=k}}}function ExposureFilter(){this.name="Exposure";this.isDirAnimatable=!0;this.defaultValues={exposure:1};this.valueRanges={exposure:{min:0,max:5}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;for(var g=a.exposure===void 0?this.defaultValues.exposure:a.exposure,c=[],j=0;j<256;j++)c[j]=parseInt(255*(1-Math.exp(-(j/255)*g)),10);h.tableFilter(d,c,b,f)}}
function GainFilter(){this.name="Gain/Bias";this.isDirAnimatable=!0;this.defaultValues={gain:0.5,bias:0.5};this.valueRanges={gain:{min:0,max:1},bias:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;for(var g=a.gain===void 0?this.defaultValues.gain:a.gain,c=a.bias===void 0?this.defaultValues.bias:a.bias,j=[],l=0;l<256;l++){var k=l/255,i=(1/g-2)*(1-2*k),k=k<0.5?k/(i+1):(i-k)/(i-1);k/=(1/c-2)*(1-k)+1;j[l]=parseInt(255*
k,10)}h.tableFilter(d,j,b,f)}}
function GammaFilter(){this.name="Gamma";this.isDirAnimatable=!0;this.defaultValues={amount:1};this.valueRanges={amount:{min:0,max:2}};this.filter=function(h,e){var a=h.width,b=h.height,f=h.data;if(e===void 0)e=this.defaultValues;var d=e.amount===void 0?this.defaultValues.amount:e.amount;d<0&&(d=0);if(FilterUtils){for(var g=new FilterUtils,c=[],j=0;j<256;j++)c[j]=255*Math.pow(j/255,1/d)+0.5;g.tableFilter(f,c,a,b)}else console&&console.error("Unable to find filterutils.js, please include this file! (Required by "+this.name+
" filter)")}}function GrayscaleFilter(){this.name="Grayscale";this.isDirAnimatable=!0;this.defaultValues={};this.valueRanges={};this.filter=function(h){for(var e=h.width,a=h.height,h=h.data,b=0;b<a;b++)for(var f=0;f<e;f++){var d=(b*e+f)*4;h[d]=h[d+1]=h[d+2]=h[d]*0.3+h[d+1]*0.59+h[d+2]*0.11}}}
function HueFilter(){this.name="Hue";this.isDirAnimatable=!0;this.defaultValues={amount:0};this.valueRanges={amount:{min:-1,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;for(var g=a.amount===void 0?this.defaultValues.amount:a.amount,c=0;c<f;c++)for(var j=0;j<b;j++){var l=(c*b+j)*4,k=h.RGBtoHSV(d[l],d[l+1],d[l+2]);for(k[0]+=g;k[0]<0;)k[0]+=360;for(var k=h.HSVtoRGB(k[0],k[1],k[2]),i=0;i<3;i++)d[l+i]=k[i]}}}
function InvertFilter(){this.name="Invert";this.isDirAnimatable=!0;this.defaultValues={};this.valueRanges={};this.filter=function(h){for(var e=h.width,a=h.height,h=h.data,b=0;b<a;b++)for(var f=0;f<e;f++)for(var d=(b*e+f)*4,g=0;g<3;g++)h[d+g]=255-h[d+g]}}
function KaleidoscopeFilter(){this.name="Kaleidoscope";this.isDirAnimatable=!1;this.defaultValues={angle:0,rotation:0,sides:3,centerX:0.5,centerY:0.5};this.valueRanges={angle:{min:0,max:360},rotation:{min:0,max:360},sides:{min:1,max:30},centerX:{min:0,max:1},centerY:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;var g=a.angle===void 0?this.defaultValues.angle:a.angle,c=a.rotation===void 0?this.defaultValues.rotation:
a.rotation,j=a.sides===void 0?this.defaultValues.sides:a.sides,l=b*(a.centerX===void 0?this.defaultValues.centerX:a.centerX),k=f*(a.centerY===void 0?this.defaultValues.centerY:a.centerY),g=g/180*Math.PI,c=c/180*Math.PI;h.transformFilter(d,function(a,b,d){a-=l;var f=b-k,b=Math.sqrt(a*a+f*f),a=Math.atan2(f,a)-g-c,a=h.triangle(a/Math.PI*j*0.5);a+=g;d[0]=l+b*Math.cos(a);d[1]=k+b*Math.sin(a)},b,f)}}
function LensDistortionFilter(){this.name="Lens Distortion";this.isDirAnimatable=!1;this.defaultValues={refraction:1.5,radius:50,centerX:0.5,centerY:0.5};this.valueRanges={refraction:{min:1,max:10},radius:{min:1,max:200},centerX:{min:0,max:1},centerY:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;var g=a.refraction===void 0?this.defaultValues.refraction:a.refraction,c=a.radius===void 0?this.defaultValues.radius:a.radius,
j=c*c,l=b*(a.centerX===void 0?this.defaultValues.centerX:a.centerX),k=f*(a.centerY===void 0?this.defaultValues.centerY:a.centerY);h.transformFilter(d,function(a,b,c){var d=a-l,f=b-k,e=d*d,h=f*f;if(h>=j-j*e/j)c[0]=a,c[1]=b;else{var t=1/g,r=Math.sqrt((1-e/j-h/j)*j),u=r*r,d=Math.acos(d/Math.sqrt(e+u)),e=Math.PI/2-d,e=Math.asin(Math.sin(e)*t),e=Math.PI/2-d-e;c[0]=a-Math.tan(e)*r;a=Math.acos(f/Math.sqrt(h+u));e=Math.PI/2-a;e=Math.asin(Math.sin(e)*t);e=Math.PI/2-a-e;c[1]=b-Math.tan(e)*r}},b,f)}}
function LineSmearFilter(){this.name="Line Smear";this.isDirAnimatable=!1;this.defaultValues={distance:8,density:0.5,angle:0,mix:0.5};this.valueRanges={distance:{min:1,max:30},density:{min:0,max:1},angle:{min:0,max:360},mix:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data,g=[],c;for(c=0;c<d.length;c++)g[c]=d[c];if(a===void 0)a=this.defaultValues;var j=a.distance===void 0?this.defaultValues.distance:a.distance;j<1&&(j=1);for(var j=parseInt(j,10),l=a.density===
void 0?this.defaultValues.density:a.density,k=a.angle===void 0?this.defaultValues.angle:a.angle,i=a.mix===void 0?this.defaultValues.mix:a.mix,k=k/180*Math.PI,o=Math.sin(k),k=Math.cos(k),l=parseInt(2*l*b*f/2,10),p=0;p<l;p++){var s=(Math.random()*Math.pow(2,32)&2147483647)%b,n=(Math.random()*Math.pow(2,32)&2147483647)%f,m=(Math.random()*Math.pow(2,32)&2147483647)%j+1,q=[d[(n*b+s)*4],d[(n*b+s)*4+1],d[(n*b+s)*4+2],d[(n*b+s)*4+3]],t=parseInt(m*k,10),m=parseInt(m*o,10),r=s-t,u=n-m;s+=t;n+=m;var v,y,w,x;
w=s<r?-1:1;x=n<u?-1:1;var t=s-r,m=n-u,t=Math.abs(t),m=Math.abs(m),z;if(r<b&&r>=0&&u<f&&u>=0){c=[g[(u*b+r)*4],g[(u*b+r)*4+1],g[(u*b+r)*4+2],g[(u*b+r)*4+3]];z=h.mixColors(i,c,q);for(c=0;c<3;c++)g[(u*b+r)*4+c]=z[c]}if(Math.abs(t)>Math.abs(m)){v=2*m-t;y=2*m;for(t=2*(m-t);r!=s;)if(v<=0?v+=y:(v+=t,u+=x),r+=w,r<b&&r>=0&&u<f&&u>=0){c=[g[(u*b+r)*4],g[(u*b+r)*4+1],g[(u*b+r)*4+2],g[(u*b+r)*4+3]];z=h.mixColors(i,c,q);for(c=0;c<3;c++)g[(u*b+r)*4+c]=z[c]}}else{v=2*t-m;y=2*t;for(t=2*(t-m);u!=n;)if(v<=0?v+=y:(v+=
t,r+=w),u+=x,r<b&&r>=0&&u<f&&u>=0){c=[g[(u*b+r)*4],g[(u*b+r)*4+1],g[(u*b+r)*4+2],g[(u*b+r)*4+3]];z=h.mixColors(i,c,q);for(c=0;c<3;c++)g[(u*b+r)*4+c]=z[c]}}}for(c=0;c<g.length;c++)d[c]=g[c]}}
function MaximumFilter(){this.name="Maximum";this.isDirAnimatable=!0;this.defaultValues={};this.valueRanges={};this.filter=function(h){for(var e=h.width,a=h.height,h=h.data,b=[],f=0;f<a;f++)for(var d=0;d<e;d++){for(var g=(f*e+d)*4,c=0,j=0,l=0,k=-1;k<=1;k++){var i=f+k;if(i>=0&&i<a)for(var o=-1;o<=1;o++){var p=d+o;p>=0&&p<e&&(p=(i*e+p)*4,c=Math.max(c,h[p]),j=Math.max(j,h[p+1]),l=Math.max(l,h[p+2]))}}b[g]=c;b[g+1]=j;b[g+2]=l;b[g+3]=h[g+3]}for(e=0;e<b.length;e++)h[e]=b[e]}}
function MedianFilter(){this.name="Median";this.isDirAnimatable=!1;this.defaultValues={};this.valueRanges={};this.filter=function(h){for(var e=h.width,a=h.height,h=h.data,b=[],f=0;f<a;f++)for(var d=0;d<e;d++){for(var g=(f*e+d)*4,c=[],j=[],l=[],k=-1;k<=1;k++){var i=f+k;if(i>=0&&i<a)for(var o=-1;o<=1;o++){var p=d+o;p>=0&&p<e&&(p=(i*e+p)*4,c.push(h[p]),j.push(h[p+1]),l.push(h[p+2]))}}k=function(a,c){return a-c};c.sort(k);j.sort(k);l.sort(k);b[g]=c[4];b[g+1]=j[4];b[g+2]=l[4];b[g+3]=h[g+3]}for(e=0;e<b.length;e++)h[e]=
b[e]}}function MinimumFilter(){this.name="Minimum";this.isDirAnimatable=!0;this.defaultValues={};this.valueRanges={};this.filter=function(h){for(var e=h.width,a=h.height,h=h.data,b=[],f=0;f<a;f++)for(var d=0;d<e;d++){for(var g=(f*e+d)*4,c=255,j=255,l=255,k=-1;k<=1;k++){var i=f+k;if(i>=0&&i<a)for(var o=-1;o<=1;o++){var p=d+o;p>=0&&p<e&&(p=(i*e+p)*4,c=Math.min(c,h[p]),j=Math.min(j,h[p+1]),l=Math.min(l,h[p+2]))}}b[g]=c;b[g+1]=j;b[g+2]=l;b[g+3]=h[g+3]}for(e=0;e<b.length;e++)h[e]=b[e]}}
function NoiseFilter(){this.name="Noise";this.isDirAnimatable=!0;this.defaultValues={amount:25,density:1,monochrome:!0};this.valueRanges={amount:{min:0,max:100},density:{min:0,max:1},monochrome:{min:!1,max:!0}};this.filter=function(h,e){var a=h.width,b=h.height,f=h.data;if(e===void 0)e=this.defaultValues;for(var d=e.amount===void 0?this.defaultValues.amount:e.amount,g=e.density===void 0?this.defaultValues.density:e.density,c=e.monochrome===void 0?this.defaultValues.monochrome:e.monochrome,j=0;j<b;j++)for(var l=
0;l<a;l++){var k=(j*a+l)*4;if(Math.random()<=g){var i;if(c)i=parseInt((2*Math.random()-1)*d,10),f[k]+=i,f[k+1]+=i,f[k+2]+=i;else for(var o=0;o<3;o++)i=parseInt((2*Math.random()-1)*d,10),f[k+o]+=i}}}}
function OilFilter(){this.name="Oil Painting";this.isDirAnimatable=!1;this.defaultValues={range:3};this.valueRanges={range:{min:0,max:5}};this.filter=function(h,e){var a=h.width,b=h.height,f=h.data,d=[];if(e===void 0)e=this.defaultValues;for(var g=e.range===void 0?this.defaultValues.range:e.range,g=parseInt(g,10),c=[],j=[],l=[],k=[],i=[],o=[],p=0;p<b;p++)for(var s=0;s<a;s++){for(var n=(p*a+s)*4,m=0;m<256;m++)c[m]=j[m]=l[m]=k[m]=i[m]=o[m]=0;for(m=-g;m<=g;m++){var q=p+m;if(0<=q&&q<b){q*=a;for(var t=
-g;t<=g;t++){var r=s+t;if(0<=r&&r<a){var u=f[(q+r)*4],v=f[(q+r)*4+1],r=f[(q+r)*4+2],y=u*256/256,w=v*256/256,x=r*256/256;k[y]+=u;i[w]+=v;o[x]+=r;c[y]++;j[w]++;l[x]++}}}}t=q=m=0;for(u=1;u<256;u++)c[u]>c[m]&&(m=u),j[u]>j[q]&&(q=u),l[u]>l[t]&&(t=u);m=k[m]/c[m];q=i[q]/j[q];t=o[t]/l[t];d[n]=m;d[n+1]=q;d[n+2]=t;d[n+3]=f[n+3]}for(a=0;a<d.length;a++)f[a]=d[a]}}
function OpacityFilter(){this.name="Opacity";this.isDirAnimatable=!0;this.defaultValues={amount:1};this.valueRanges={amount:{min:0,max:1}};this.filter=function(h,e){var a=h.width,b=h.height,f=h.data;if(e===void 0)e=this.defaultValues;for(var d=e.amount===void 0?this.defaultValues.amount:e.amount,g=0;g<b;g++)for(var c=0;c<a;c++)f[(g*a+c)*4+3]=255*d}}
function PinchFilter(){this.name="Pinch/Whirl";this.isDirAnimatable=!1;this.defaultValues={amount:0.5,radius:100,angle:0,centerX:0.5,centerY:0.5};this.valueRanges={amount:{min:-1,max:1},radius:{min:1,max:200},angle:{min:0,max:360},centerX:{min:0,max:1},centerY:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;var g=a.amount===void 0?this.defaultValues.amount:a.amount,c=a.angle===void 0?this.defaultValues.angle:a.angle,
j=a.centerX===void 0?this.defaultValues.centerX:a.centerX,l=a.centerY===void 0?this.defaultValues.centerY:a.centerY,k=a.radius===void 0?this.defaultValues.radius:a.radius,i=k*k,c=c/180*Math.PI,o=b*j,p=f*l;h.transformFilter(d,function(a,b,d){var e=a-o,f=b-p,h=e*e+f*f;h>i||h===0?(d[0]=a,d[1]=b):(a=Math.sqrt(h/i),b=Math.pow(Math.sin(Math.PI*0.5*a),-g),e*=b,f*=b,a=1-a,b=c*a*a,a=Math.sin(b),b=Math.cos(b),d[0]=o+b*e-a*f,d[1]=p+a*e+b*f)},b,f)}}
function PixelationFilter(){this.name="Pixelation";this.isDirAnimatable=!1;this.defaultValues={size:5};this.valueRanges={size:{min:1,max:50}};this.filter=function(h,e){var a=h.width,b=h.height,f=h.data;if(e===void 0)e=this.defaultValues;for(var d=e.size===void 0?this.defaultValues.size:e.size,d=parseInt(d,10),g,c,j,l=0;l<b;l+=d)for(var k=0;k<a;k+=d){var i=Math.min(d,a-k),o=Math.min(d,b-l),p=i*o,s=0,n=0,m=0;for(g=l;g<l+o;g++)for(c=k;c<k+i;c++)j=(g*a+c)*4,s+=f[j],n+=f[j+1],m+=f[j+2];for(g=l;g<l+o;g++)for(c=
k;c<k+i;c++)j=(g*a+c)*4,f[j]=s/p,f[j+1]=n/p,f[j+2]=m/p}}}
function PosterizeFilter(){this.name="Posterize";this.isDirAnimatable=!1;this.defaultValues={levels:6};this.valueRanges={levels:{min:2,max:30}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;var g=a.levels===void 0?this.defaultValues.levels:parseInt(a.levels,10);if(!(g<=1)){for(var c=[],j=0;j<256;j++)c[j]=parseInt(255*parseInt(j*g/256,10)/(g-1),10);h.tableFilter(d,c,b,f)}}}
function RGBAdjustFilter(){this.name="RGBAdjust";this.isDirAnimatable=!0;this.defaultValues={red:1,green:1,blue:1};this.valueRanges={red:{min:0,max:2},green:{min:0,max:2},blue:{min:0,max:2}};this.filter=function(h,e){var a=h.width,b=h.height,f=h.data;if(e===void 0)e=this.defaultValues;var d=e.red===void 0?this.defaultValues.red:e.red,g=e.green===void 0?this.defaultValues.green:e.green,c=e.blue===void 0?this.defaultValues.blue:e.blue;d<0&&(d=0);g<0&&(g=0);c<0&&(c=0);for(var j=0;j<b;j++)for(var l=0;l<
a;l++){var k=(j*a+l)*4;f[k]*=d;f[k+1]*=g;f[k+2]*=c}}}
function SaturationFilter(){this.name="Saturation";this.isDirAnimatable=!0;this.defaultValues={amount:1};this.valueRanges={amount:{min:0,max:2}};this.filter=function(h,e){var a=h.width,b=h.height,f=h.data;if(e===void 0)e=this.defaultValues;for(var d=e.amount===void 0?this.defaultValues.amount:e.amount,g=(1-d)*0.3+d,c=(1-d)*0.3,j=(1-d)*0.3,l=(1-d)*0.59,k=(1-d)*0.59+d,i=(1-d)*0.59,o=(1-d)*0.11,p=(1-d)*0.11,d=(1-d)*0.11+d,s=0;s<b;s++)for(var n=0;n<a;n++){var m=(s*a+n)*4,q=f[m],t=f[m+1],r=f[m+2];f[m]=
g*q+l*t+o*r;f[m+1]=c*q+k*t+p*r;f[m+2]=j*q+i*t+d*r}}}
function SawtoothRippleFilter(){this.name="Sawtooth Ripples";this.isDirAnimatable=!1;this.defaultValues={xAmplitude:5,yAmplitude:5,xWavelength:16,yWavelength:16};this.valueRanges={xAmplitude:{min:0,max:30},yAmplitude:{min:0,max:30},xWavelength:{min:1,max:50},yWavelength:{min:1,max:50}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;var g=a.xAmplitude===void 0?this.defaultValues.xAmplitude:a.xAmplitude,c=a.yAmplitude===void 0?this.defaultValues.yAmplitude:
a.yAmplitude,j=a.xWavelength===void 0?this.defaultValues.xWavelength:a.xWavelength,l=a.yWavelength===void 0?this.defaultValues.yWavelength:a.yWavelength;h.transformFilter(d,function(a,b,d){var e=a/l,f=h.mod(b/j,1),e=h.mod(e,1);d[0]=a+g*f;d[1]=b+c*e},b,f)}}
function SepiaFilter(){this.name="Sepia";this.isDirAnimatable=!0;this.defaultValues={amount:10};this.valueRanges={amount:{min:0,max:30}};new FilterUtils;this.filter=function(h,e){var a=h.width,b=h.height,f=h.data;if(e===void 0)e=this.defaultValues;var d=e.amount===void 0?this.defaultValues.amount:e.amount;d*=2.55;for(var g=0;g<b;g++)for(var c=0;c<a;c++){var j=(g*a+c)*4,l,k,i;l=k=i=f[j]*0.3+f[j+1]*0.59+f[j+2]*0.11;l+=40;k+=20;i-=d;f[j]=l;f[j+1]=k;f[j+2]=i}}}
function SharpenFilter(){this.name="Sharpen";this.isDirAnimatable=!0;this.defaultValues={};this.valueRanges={};var h=new FilterUtils;this.filter=function(e){h.convolveFilter(e.data,[0,-0.2,0,-0.2,1.8,-0.2,0,-0.2,0],e.width,e.height)}}
function SineRippleFilter(){this.name="Sine Ripples";this.isDirAnimatable=!1;this.defaultValues={xAmplitude:5,yAmplitude:5,xWavelength:16,yWavelength:16};this.valueRanges={xAmplitude:{min:0,max:30},yAmplitude:{min:0,max:30},xWavelength:{min:1,max:50},yWavelength:{min:1,max:50}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;var g=a.xAmplitude===void 0?this.defaultValues.xAmplitude:a.xAmplitude,c=a.yAmplitude===void 0?this.defaultValues.yAmplitude:
a.yAmplitude,j=a.xWavelength===void 0?this.defaultValues.xWavelength:a.xWavelength,l=a.yWavelength===void 0?this.defaultValues.yWavelength:a.yWavelength;h.transformFilter(d,function(a,b,d){var e=Math.sin(a/l);d[0]=a+g*Math.sin(b/j);d[1]=b+c*e},b,f)}}
function SolarizeFilter(){this.name="Solarize";this.isDirAnimatable=!0;this.defaultValues={};this.valueRanges={};var h=new FilterUtils;this.filter=function(e){for(var a=e.width,b=e.height,e=e.data,f=[],d=0;d<256;d++)f[d]=parseInt(255*(d/255>0.5?2*(d/255-0.5):2*(0.5-d/255)),10);h.tableFilter(e,f,a,b)}}
function SparkleFilter(){this.name="Sparkle";this.isDirAnimatable=!1;this.defaultValues={rays:50,size:25,amount:50,randomness:25,centerX:0.5,centerY:0.5};this.valueRanges={rays:{min:1,max:100},size:{min:1,max:200},amount:{min:0,max:100},randomness:{min:0,max:50},centerX:{min:0,max:1},centerY:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;for(var g=a.rays===void 0?this.defaultValues.rays:a.rays,g=parseInt(g,10),c=
a.size===void 0?this.defaultValues.size:a.size,j=a.amount===void 0?this.defaultValues.amount:a.amount,l=a.randomness===void 0?this.defaultValues.randomness:a.randomness,k=(a.centerX===void 0?this.defaultValues.centerX:a.centerX)*b,i=(a.centerY===void 0?this.defaultValues.centerY:a.centerY)*f,o=[],p=0;p<g;p++)o[p]=c+l/100*c*h.gaussianRandom();for(l=0;l<f;l++)for(p=0;p<b;p++){var s=(l*b+p)*4,n=p-k,m=l-i,q=n*n+m*m,n=(Math.atan2(m,n)+Math.PI)/(Math.PI*2)*g,m=parseInt(n,10);n-=m;c!==0&&(m=h.linearInterpolate(n,
o[m%g],o[(m+1)%g]),q=m*m/(q+1.0E-4),q=Math.pow(q,(100-j)/50),n-=0.5,n=1-n*n,n*=q);n=h.clampPixel(n,0,1);q=h.mixColors(n,[d[s],d[s+1],d[s+2],d[s+3]],[255,255,255,255]);for(n=0;n<3;n++)d[s+n]=q[n]}}}
function SquareSmearFilter(){this.name="Square Smear";this.isDirAnimatable=!1;this.defaultValues={size:4,density:0.5,mix:0.5};this.valueRanges={size:{min:1,max:10},density:{min:0,max:1},mix:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data,g=[],c;for(c=0;c<d.length;c++)g[c]=d[c];if(a===void 0)a=this.defaultValues;c=a.size===void 0?this.defaultValues.size:a.size;c<1&&(c=1);c=parseInt(c,10);for(var j=a.mix===void 0?this.defaultValues.mix:a.mix,l=c+1,k=
parseInt(2*(a.density===void 0?this.defaultValues.density:a.density)/30*b*f/2,10),i=0;i<k;i++)for(var o=(Math.random()*Math.pow(2,32)&2147483647)%b,p=(Math.random()*Math.pow(2,32)&2147483647)%f,s=[d[(p*b+o)*4],d[(p*b+o)*4+1],d[(p*b+o)*4+2],d[(p*b+o)*4+3]],n=o-l;n<o+l+1;n++)for(var m=p-l;m<p+l+1;m++)if(n>=0&&n<b&&m>=0&&m<f){var q=h.mixColors(j,[g[(m*b+n)*4],g[(m*b+n)*4+1],g[(m*b+n)*4+2],g[(m*b+n)*4+3]],s);for(c=0;c<3;c++)g[(m*b+n)*4+c]=q[c]}for(c=0;c<g.length;c++)d[c]=g[c]}}
function ThresholdFilter(){this.name="Black & White";this.isDirAnimatable=!0;this.defaultValues={threshold:127};this.valueRanges={threshold:{min:0,max:255}};this.filter=function(h,e){var a=h.width,b=h.height,f=h.data;if(e===void 0)e=this.defaultValues;for(var d=e.threshold===void 0?this.defaultValues.threshold:e.threshold,g=0;g<b;g++)for(var c=0;c<a;c++){var j=(g*a+c)*4,l=0;(f[j]+f[j+1]+f[j+2])/3>d&&(l=255);f[j]=f[j+1]=f[j+2]=l}}}
function TriangleRippleFilter(){this.name="Triangle Ripples";this.isDirAnimatable=!1;this.defaultValues={xAmplitude:5,yAmplitude:5,xWavelength:16,yWavelength:16};this.valueRanges={xAmplitude:{min:0,max:30},yAmplitude:{min:0,max:30},xWavelength:{min:1,max:50},yWavelength:{min:1,max:50}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;var g=a.xAmplitude===void 0?this.defaultValues.xAmplitude:a.xAmplitude,c=a.yAmplitude===void 0?this.defaultValues.yAmplitude:
a.yAmplitude,j=a.xWavelength===void 0?this.defaultValues.xWavelength:a.xWavelength,l=a.yWavelength===void 0?this.defaultValues.yWavelength:a.yWavelength;h.transformFilter(d,function(a,b,d){var e=a/l,f=h.triangle(b/j,1),e=h.triangle(e,1);d[0]=a+g*f;d[1]=b+c*e},b,f)}}
function TwirlFilter(){this.name="Twirl";this.isDirAnimatable=!1;this.defaultValues={radius:100,angle:180,centerX:0.5,centerY:0.5};this.valueRanges={radius:{min:1,max:200},angle:{min:0,max:360},centerX:{min:0,max:1},centerY:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;var g=a.angle===void 0?this.defaultValues.angle:a.angle,c=a.centerX===void 0?this.defaultValues.centerX:a.centerX,j=a.centerY===void 0?this.defaultValues.centerY:
a.centerY,l=a.radius===void 0?this.defaultValues.radius:a.radius,k=l*l,g=g/180*Math.PI,i=b*c,o=f*j;h.transformFilter(d,function(a,b,c){var d=a-i,e=b-o,f=d*d+e*e;f>k?(c[0]=a,c[1]=b):(f=Math.sqrt(f),a=Math.atan2(e,d)+g*(l-f)/l,c[0]=i+f*Math.cos(a),c[1]=o+f*Math.sin(a))},b,f)}}
function VignetteFilter(){this.name="Vignette";this.isDirAnimatable=!1;this.defaultValues={amount:0.3};this.valueRanges={amount:{min:0,max:1}};this.filter=function(h,e){var a=h.width,b=h.height,f=h.data,d=[];if(e===void 0)e=this.defaultValues;var d=e.amount===void 0?this.defaultValues.amount:e.amount,g=document.createElement("canvas");g.width=a;g.height=b;var g=g.getContext("2d"),c;c=Math.sqrt(Math.pow(a/2,2)+Math.pow(b/2,2));g.putImageData(h,0,0);g.globalCompositeOperation="source-over";c=g.createRadialGradient(a/
2,b/2,0,a/2,b/2,c);c.addColorStop(0,"rgba(0,0,0,0)");c.addColorStop(0.5,"rgba(0,0,0,0)");c.addColorStop(1,"rgba(0,0,0,"+d+")");g.fillStyle=c;g.fillRect(0,0,a,b);d=g.getImageData(0,0,a,b).data;for(a=0;a<d.length;a++)f[a]=d[a]}}
function WaterRippleFilter(){this.name="Water Ripples";this.isDirAnimatable=!1;this.defaultValues={phase:0,radius:50,wavelength:16,amplitude:10,centerX:0.5,centerY:0.5};this.valueRanges={phase:{min:0,max:100},radius:{min:1,max:200},wavelength:{min:1,max:100},amplitude:{min:1,max:100},centerX:{min:0,max:1},centerY:{min:0,max:1}};var h=new FilterUtils;this.filter=function(e,a){var b=e.width,f=e.height,d=e.data;if(a===void 0)a=this.defaultValues;var g=a.wavelength===void 0?this.defaultValues.wavelength:
a.wavelength,c=a.amplitude===void 0?this.defaultValues.amplitude:a.amplitude,j=a.phase===void 0?this.defaultValues.phase:a.phase,l=a.radius===void 0?this.defaultValues.radius:a.radius,k=l*l,i=b*(a.centerX===void 0?this.defaultValues.centerX:a.centerX),o=f*(a.centerY===void 0?this.defaultValues.centerY:a.centerY);h.transformFilter(d,function(a,b,d){var e=a-i,f=b-o,h=e*e+f*f;if(h>k)d[0]=a,d[1]=b;else{var h=Math.sqrt(h),r=c*Math.sin(h/g*Math.PI*2-j);r*=(l-h)/l;h!==0&&(r*=g/h);d[0]=a+e*r;d[1]=b+f*r}},
b,f)}}
var JSManipulate={blur:new BlurFilter,brightness:new BrightnessFilter,bump:new BumpFilter,circlesmear:new CircleSmearFilter,contrast:new ContrastFilter,crosssmear:new CrossSmearFilter,diffusion:new DiffusionFilter,dither:new DitherFilter,edge:new EdgeFilter,emboss:new EmbossFilter,exposure:new ExposureFilter,gain:new GainFilter,gamma:new GammaFilter,grayscale:new GrayscaleFilter,hue:new HueFilter,invert:new InvertFilter,kaleidoscope:new KaleidoscopeFilter,lensdistortion:new LensDistortionFilter,linesmear:new LineSmearFilter,
maximum:new MaximumFilter,median:new MedianFilter,minimum:new MinimumFilter,noise:new NoiseFilter,oil:new OilFilter,opacity:new OpacityFilter,pinch:new PinchFilter,pixelate:new PixelationFilter,posterize:new PosterizeFilter,rgbadjust:new RGBAdjustFilter,saturation:new SaturationFilter,sawtoothripple:new SawtoothRippleFilter,sepia:new SepiaFilter,sharpen:new SharpenFilter,sineripple:new SineRippleFilter,solarize:new SolarizeFilter,sparkle:new SparkleFilter,squaresmear:new SquareSmearFilter,threshold:new ThresholdFilter,
triangleripple:new TriangleRippleFilter,twirl:new TwirlFilter,vignette:new VignetteFilter,waterripple:new WaterRippleFilter};
!function(a){"use strict";var b=function(a,c,d){var e,f,g=document.createElement("img");if(g.onerror=c,g.onload=function(){!f||d&&d.noRevoke||b.revokeObjectURL(f),c&&c(b.scale(g,d))},b.isInstanceOf("Blob",a)||b.isInstanceOf("File",a))e=f=b.createObjectURL(a),g._type=a.type;else{if("string"!=typeof a)return!1;e=a,d&&d.crossOrigin&&(g.crossOrigin=d.crossOrigin)}return e?(g.src=e,g):b.readFile(a,function(a){var b=a.target;b&&b.result?g.src=b.result:c&&c(a)})},c=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&URL||window.webkitURL&&webkitURL;b.isInstanceOf=function(a,b){return Object.prototype.toString.call(b)==="[object "+a+"]"},b.transformCoordinates=function(){},b.getTransformedOptions=function(a,b){var c,d,e,f,g=b.aspectRatio;if(!g)return b;c={};for(d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return c.crop=!0,e=a.naturalWidth||a.width,f=a.naturalHeight||a.height,e/f>g?(c.maxWidth=f*g,c.maxHeight=f):(c.maxWidth=e,c.maxHeight=e/g),c},b.renderImageToCanvas=function(a,b,c,d,e,f,g,h,i,j){return a.getContext("2d").drawImage(b,c,d,e,f,g,h,i,j),a},b.hasCanvasOption=function(a){return a.canvas||a.crop||a.aspectRatio},b.scale=function(a,c){c=c||{};var d,e,f,g,h,i,j,k,l,m=document.createElement("canvas"),n=a.getContext||b.hasCanvasOption(c)&&m.getContext,o=a.naturalWidth||a.width,p=a.naturalHeight||a.height,q=o,r=p,s=function(){var a=Math.max((f||q)/q,(g||r)/r);a>1&&(q*=a,r*=a)},t=function(){var a=Math.min((d||q)/q,(e||r)/r);1>a&&(q*=a,r*=a)};return n&&(c=b.getTransformedOptions(a,c),j=c.left||0,k=c.top||0,c.sourceWidth?(h=c.sourceWidth,void 0!==c.right&&void 0===c.left&&(j=o-h-c.right)):h=o-j-(c.right||0),c.sourceHeight?(i=c.sourceHeight,void 0!==c.bottom&&void 0===c.top&&(k=p-i-c.bottom)):i=p-k-(c.bottom||0),q=h,r=i),d=c.maxWidth,e=c.maxHeight,f=c.minWidth,g=c.minHeight,n&&d&&e&&c.crop?(q=d,r=e,l=h/i-d/e,0>l?(i=e*h/d,void 0===c.top&&void 0===c.bottom&&(k=(p-i)/2)):l>0&&(h=d*i/e,void 0===c.left&&void 0===c.right&&(j=(o-h)/2))):((c.contain||c.cover)&&(f=d=d||f,g=e=e||g),c.cover?(t(),s()):(s(),t())),n?(m.width=q,m.height=r,b.transformCoordinates(m,c),b.renderImageToCanvas(m,a,j,k,h,i,0,0,q,r)):(a.width=q,a.height=r,a)},b.createObjectURL=function(a){return c?c.createObjectURL(a):!1},b.revokeObjectURL=function(a){return c?c.revokeObjectURL(a):!1},b.readFile=function(a,b,c){if(window.FileReader){var d=new FileReader;if(d.onload=d.onerror=b,c=c||"readAsDataURL",d[c])return d[c](a),d}return!1},"function"==typeof define&&define.amd?define(function(){return b}):a.loadImage=b}(window),function(a){"use strict";"function"==typeof define&&define.amd?define(["load-image"],a):a(window.loadImage)}(function(a){"use strict";if(window.navigator&&window.navigator.platform&&/iP(hone|od|ad)/.test(window.navigator.platform)){var b=a.renderImageToCanvas;a.detectSubsampling=function(a){var b,c;return a.width*a.height>1048576?(b=document.createElement("canvas"),b.width=b.height=1,c=b.getContext("2d"),c.drawImage(a,-a.width+1,0),0===c.getImageData(0,0,1,1).data[3]):!1},a.detectVerticalSquash=function(a,b){var c,d,e,f,g,h=a.naturalHeight||a.height,i=document.createElement("canvas"),j=i.getContext("2d");for(b&&(h/=2),i.width=1,i.height=h,j.drawImage(a,0,0),c=j.getImageData(0,0,1,h).data,d=0,e=h,f=h;f>d;)g=c[4*(f-1)+3],0===g?e=f:d=f,f=e+d>>1;return f/h||1},a.renderImageToCanvas=function(c,d,e,f,g,h,i,j,k,l){if("image/jpeg"===d._type){var m,n,o,p,q=c.getContext("2d"),r=document.createElement("canvas"),s=1024,t=r.getContext("2d");if(r.width=s,r.height=s,q.save(),m=a.detectSubsampling(d),m&&(e/=2,f/=2,g/=2,h/=2),n=a.detectVerticalSquash(d,m),m||1!==n){for(f*=n,k=Math.ceil(s*k/g),l=Math.ceil(s*l/h/n),j=0,p=0;h>p;){for(i=0,o=0;g>o;)t.clearRect(0,0,s,s),t.drawImage(d,e,f,g,h,-o,-p,g,h),q.drawImage(r,0,0,s,s,i,j,k,l),o+=s,i+=k;p+=s,j+=l}return q.restore(),c}}return b(c,d,e,f,g,h,i,j,k,l)}}}),function(a){"use strict";"function"==typeof define&&define.amd?define(["load-image"],a):a(window.loadImage)}(function(a){"use strict";var b=a.hasCanvasOption,c=a.transformCoordinates,d=a.getTransformedOptions;a.hasCanvasOption=function(c){return b.call(a,c)||c.orientation},a.transformCoordinates=function(b,d){c.call(a,b,d);var e=b.getContext("2d"),f=b.width,g=b.height,h=d.orientation;if(h&&!(h>8))switch(h>4&&(b.width=g,b.height=f),h){case 2:e.translate(f,0),e.scale(-1,1);break;case 3:e.translate(f,g),e.rotate(Math.PI);break;case 4:e.translate(0,g),e.scale(1,-1);break;case 5:e.rotate(.5*Math.PI),e.scale(1,-1);break;case 6:e.rotate(.5*Math.PI),e.translate(0,-g);break;case 7:e.rotate(.5*Math.PI),e.translate(f,-g),e.scale(-1,1);break;case 8:e.rotate(-.5*Math.PI),e.translate(-f,0)}},a.getTransformedOptions=function(b,c){var e,f,g=d.call(a,b,c),h=g.orientation;if(!h||h>8||1===h)return g;e={};for(f in g)g.hasOwnProperty(f)&&(e[f]=g[f]);switch(g.orientation){case 2:e.left=g.right,e.right=g.left;break;case 3:e.left=g.right,e.top=g.bottom,e.right=g.left,e.bottom=g.top;break;case 4:e.top=g.bottom,e.bottom=g.top;break;case 5:e.left=g.top,e.top=g.left,e.right=g.bottom,e.bottom=g.right;break;case 6:e.left=g.top,e.top=g.right,e.right=g.bottom,e.bottom=g.left;break;case 7:e.left=g.bottom,e.top=g.right,e.right=g.top,e.bottom=g.left;break;case 8:e.left=g.bottom,e.top=g.left,e.right=g.top,e.bottom=g.right}return g.orientation>4&&(e.maxWidth=g.maxHeight,e.maxHeight=g.maxWidth,e.minWidth=g.minHeight,e.minHeight=g.minWidth,e.sourceWidth=g.sourceHeight,e.sourceHeight=g.sourceWidth),e}}),function(a){"use strict";"function"==typeof define&&define.amd?define(["load-image"],a):a(window.loadImage)}(function(a){"use strict";var b=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);a.blobSlice=b&&function(){var a=this.slice||this.webkitSlice||this.mozSlice;return a.apply(this,arguments)},a.metaDataParsers={jpeg:{65505:[]}},a.parseMetaData=function(b,c,d){d=d||{};var e=this,f=d.maxMetaDataSize||262144,g={},h=!(window.DataView&&b&&b.size>=12&&"image/jpeg"===b.type&&a.blobSlice);(h||!a.readFile(a.blobSlice.call(b,0,f),function(b){if(b.target.error)return console.log(b.target.error),void c(g);var f,h,i,j,k=b.target.result,l=new DataView(k),m=2,n=l.byteLength-4,o=m;if(65496===l.getUint16(0)){for(;n>m&&(f=l.getUint16(m),f>=65504&&65519>=f||65534===f);){if(h=l.getUint16(m+2)+2,m+h>l.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(i=a.metaDataParsers.jpeg[f])for(j=0;j<i.length;j+=1)i[j].call(e,l,m,h,g,d);m+=h,o=m}!d.disableImageHead&&o>6&&(g.imageHead=k.slice?k.slice(0,o):new Uint8Array(k).subarray(0,o))}else console.log("Invalid JPEG file: Missing JPEG marker.");c(g)},"readAsArrayBuffer"))&&c(g)}}),function(a){"use strict";"function"==typeof define&&define.amd?define(["load-image","load-image-meta"],a):a(window.loadImage)}(function(a){"use strict";a.ExifMap=function(){return this},a.ExifMap.prototype.map={Orientation:274},a.ExifMap.prototype.get=function(a){return this[a]||this[this.map[a]]},a.getExifThumbnail=function(a,b,c){var d,e,f;if(!c||b+c>a.byteLength)return void console.log("Invalid Exif data: Invalid thumbnail data.");for(d=[],e=0;c>e;e+=1)f=a.getUint8(b+e),d.push((16>f?"0":"")+f.toString(16));return"data:image/jpeg,%"+d.join("%")},a.exifTagTypes={1:{getValue:function(a,b){return a.getUint8(b)},size:1},2:{getValue:function(a,b){return String.fromCharCode(a.getUint8(b))},size:1,ascii:!0},3:{getValue:function(a,b,c){return a.getUint16(b,c)},size:2},4:{getValue:function(a,b,c){return a.getUint32(b,c)},size:4},5:{getValue:function(a,b,c){return a.getUint32(b,c)/a.getUint32(b+4,c)},size:8},9:{getValue:function(a,b,c){return a.getInt32(b,c)},size:4},10:{getValue:function(a,b,c){return a.getInt32(b,c)/a.getInt32(b+4,c)},size:8}},a.exifTagTypes[7]=a.exifTagTypes[1],a.getExifValue=function(b,c,d,e,f,g){var h,i,j,k,l,m,n=a.exifTagTypes[e];if(!n)return void console.log("Invalid Exif data: Invalid tag type.");if(h=n.size*f,i=h>4?c+b.getUint32(d+8,g):d+8,i+h>b.byteLength)return void console.log("Invalid Exif data: Invalid data offset.");if(1===f)return n.getValue(b,i,g);for(j=[],k=0;f>k;k+=1)j[k]=n.getValue(b,i+k*n.size,g);if(n.ascii){for(l="",k=0;k<j.length&&(m=j[k],"\x00"!==m);k+=1)l+=m;return l}return j},a.parseExifTag=function(b,c,d,e,f){var g=b.getUint16(d,e);f.exif[g]=a.getExifValue(b,c,d,b.getUint16(d+2,e),b.getUint32(d+4,e),e)},a.parseExifTags=function(a,b,c,d,e){var f,g,h;if(c+6>a.byteLength)return void console.log("Invalid Exif data: Invalid directory offset.");if(f=a.getUint16(c,d),g=c+2+12*f,g+4>a.byteLength)return void console.log("Invalid Exif data: Invalid directory size.");for(h=0;f>h;h+=1)this.parseExifTag(a,b,c+2+12*h,d,e);return a.getUint32(g,d)},a.parseExifData=function(b,c,d,e,f){if(!f.disableExif){var g,h,i,j=c+10;if(1165519206===b.getUint32(c+4)){if(j+8>b.byteLength)return void console.log("Invalid Exif data: Invalid segment size.");if(0!==b.getUint16(c+8))return void console.log("Invalid Exif data: Missing byte alignment offset.");switch(b.getUint16(j)){case 18761:g=!0;break;case 19789:g=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}if(42!==b.getUint16(j+2,g))return void console.log("Invalid Exif data: Missing TIFF marker.");h=b.getUint32(j+4,g),e.exif=new a.ExifMap,h=a.parseExifTags(b,j,j+h,g,e),h&&!f.disableExifThumbnail&&(i={exif:{}},h=a.parseExifTags(b,j,j+h,g,i),i.exif[513]&&(e.exif.Thumbnail=a.getExifThumbnail(b,j+i.exif[513],i.exif[514]))),e.exif[34665]&&!f.disableExifSub&&a.parseExifTags(b,j,j+e.exif[34665],g,e),e.exif[34853]&&!f.disableExifGps&&a.parseExifTags(b,j,j+e.exif[34853],g,e)}}},a.metaDataParsers.jpeg[65505].push(a.parseExifData)}),function(a){"use strict";"function"==typeof define&&define.amd?define(["load-image","load-image-exif"],a):a(window.loadImage)}(function(a){"use strict";a.ExifMap.prototype.tags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},a.ExifMap.prototype.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",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"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}},a.ExifMap.prototype.getText=function(a){var b=this.get(a);switch(a){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[a][b];case"ExifVersion":case"FlashpixVersion":return String.fromCharCode(b[0],b[1],b[2],b[3]);case"ComponentsConfiguration":return this.stringValues[a][b[0]]+this.stringValues[a][b[1]]+this.stringValues[a][b[2]]+this.stringValues[a][b[3]];case"GPSVersionID":return b[0]+"."+b[1]+"."+b[2]+"."+b[3]}return String(b)},function(a){var b,c=a.tags,d=a.map;for(b in c)c.hasOwnProperty(b)&&(d[c[b]]=b)}(a.ExifMap.prototype),a.ExifMap.prototype.getAll=function(){var a,b,c={};for(a in this)this.hasOwnProperty(a)&&(b=this.tags[a],b&&(c[b]=this.getText(b)));return c}});/*!
 * Masonry PACKAGED v3.1.2
 * Cascading grid layout library
 * http://masonry.desandro.com
 * MIT License
 * by David DeSandro
 */

(function(t){"use strict";function e(t){if(t){if("string"==typeof n[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,o=0,r=i.length;r>o;o++)if(e=i[o]+t,"string"==typeof n[e])return e}}var i="Webkit Moz ms Ms O".split(" "),n=document.documentElement.style;"function"==typeof define&&define.amd?define(function(){return e}):t.getStyleProperty=e})(window),function(t){"use strict";function e(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=a.length;i>e;e++){var n=a[e];t[n]=0}return t}function n(t){function n(t){if("string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var n=s(t);if("none"===n.display)return i();var r={};r.width=t.offsetWidth,r.height=t.offsetHeight;for(var u=r.isBorderBox=!(!p||!n[p]||"border-box"!==n[p]),f=0,c=a.length;c>f;f++){var l=a[f],d=n[l];d=o(t,d);var m=parseFloat(d);r[l]=isNaN(m)?0:m}var y=r.paddingLeft+r.paddingRight,g=r.paddingTop+r.paddingBottom,v=r.marginLeft+r.marginRight,_=r.marginTop+r.marginBottom,b=r.borderLeftWidth+r.borderRightWidth,E=r.borderTopWidth+r.borderBottomWidth,L=u&&h,S=e(n.width);S!==!1&&(r.width=S+(L?0:y+b));var T=e(n.height);return T!==!1&&(r.height=T+(L?0:g+E)),r.innerWidth=r.width-(y+b),r.innerHeight=r.height-(g+E),r.outerWidth=r.width+v,r.outerHeight=r.height+_,r}}function o(t,e){if(r||-1===e.indexOf("%"))return e;var i=t.style,n=i.left,o=t.runtimeStyle,s=o&&o.left;return s&&(o.left=t.currentStyle.left),i.left=e,e=i.pixelLeft,i.left=n,s&&(o.left=s),e}var h,p=t("boxSizing");return function(){if(p){var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style[p]="border-box";var i=document.body||document.documentElement;i.appendChild(t);var n=s(t);h=200===e(n.width),i.removeChild(t)}}(),n}var o=document.defaultView,r=o&&o.getComputedStyle,s=r?function(t){return o.getComputedStyle(t,null)}:function(t){return t.currentStyle},a=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define(["get-style-property/get-style-property"],n):t.getSize=n(t.getStyleProperty)}(window),function(t){"use strict";var e=document.documentElement,i=function(){};e.addEventListener?i=function(t,e,i){t.addEventListener(e,i,!1)}:e.attachEvent&&(i=function(e,i,n){e[i+n]=n.handleEvent?function(){var e=t.event;e.target=e.target||e.srcElement,n.handleEvent.call(n,e)}:function(){var i=t.event;i.target=i.target||i.srcElement,n.call(e,i)},e.attachEvent("on"+i,e[i+n])});var n=function(){};e.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:e.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(n){t[e+i]=void 0}});var o={bind:i,unbind:n};"function"==typeof define&&define.amd?define(o):t.eventie=o}(this),function(t){"use strict";function e(t){"function"==typeof t&&(e.isReady?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==o.readyState;if(!e.isReady&&!i){e.isReady=!0;for(var n=0,s=r.length;s>n;n++){var a=r[n];a()}}}function n(n){return n.bind(o,"DOMContentLoaded",i),n.bind(o,"readystatechange",i),n.bind(t,"load",i),e}var o=t.document,r=[];e.isReady=!1,"function"==typeof define&&define.amd?(e.isReady="function"==typeof requirejs,define(["eventie/eventie"],n)):t.docReady=n(t.eventie)}(this),function(){"use strict";function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var n=t.prototype;n.getListeners=function(t){var e,i,n=this._getEvents();if("object"==typeof t){e={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},n.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},n.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},n.addListener=function(t,i){var n,o=this.getListenersAsObject(t),r="object"==typeof i;for(n in o)o.hasOwnProperty(n)&&-1===e(o[n],i)&&o[n].push(r?i:{listener:i,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},n.once=i("addOnceListener"),n.defineEvent=function(t){return this.getListeners(t),this},n.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},n.removeListener=function(t,i){var n,o,r=this.getListenersAsObject(t);for(o in r)r.hasOwnProperty(o)&&(n=e(r[o],i),-1!==n&&r[o].splice(n,1));return this},n.off=i("removeListener"),n.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},n.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},n.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},n.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if("object"===i)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},n.removeAllListeners=i("removeEvent"),n.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(o in s)if(s.hasOwnProperty(o))for(n=s[o].length;n--;)i=s[o][n],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},n.trigger=i("emitEvent"),n.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},n.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},n._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},n._getEvents=function(){return this._events||(this._events={})},"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.EventEmitter=t}.call(this),function(t){"use strict";function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function o(e,i){t.fn[e]=function(o){if("string"==typeof o){for(var s=n.call(arguments,1),a=0,h=this.length;h>a;a++){var p=this[a],u=t.data(p,e);if(u)if(t.isFunction(u[o])&&"_"!==o.charAt(0)){var f=u[o].apply(u,s);if(void 0!==f)return f}else r("no such method '"+o+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+o+"'")}return this}return this.each(function(){var n=t.data(this,e);n?(n.option(o),n._init()):(n=new i(this,o),t.data(this,e,n))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};t.bridget=function(t,e){i(e),o(t,e)}}}var n=Array.prototype.slice;"function"==typeof define&&define.amd?define(["jquery"],i):i(t.jQuery)}(window),function(t,e){"use strict";function i(t,e){return t[a](e)}function n(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function o(t,e){n(t);for(var i=t.parentNode.querySelectorAll(e),o=0,r=i.length;r>o;o++)if(i[o]===t)return!0;return!1}function r(t,e){return n(t),i(t,e)}var s,a=function(){if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0,n=t.length;n>i;i++){var o=t[i],r=o+"MatchesSelector";if(e[r])return r}}();if(a){var h=document.createElement("div"),p=i(h,"div");s=p?i:r}else s=o;"function"==typeof define&&define.amd?define(function(){return s}):window.matchesSelector=s}(this,Element.prototype),function(t){"use strict";function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){for(var e in t)return!1;return e=null,!0}function n(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function o(t,o,r){function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var h=r("transition"),p=r("transform"),u=h&&p,f=!!r("perspective"),c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[h],l=["transform","transition","transitionDuration","transitionProperty"],d=function(){for(var t={},e=0,i=l.length;i>e;e++){var n=l[e],o=r(n);o&&o!==n&&(t[n]=o)}return t}();e(a.prototype,t.prototype),a.prototype._create=function(){this._transition={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},a.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.getSize=function(){this.size=o(this.element)},a.prototype.css=function(t){var e=this.element.style;for(var i in t){var n=d[i]||i;e[n]=t[i]}},a.prototype.getPosition=function(){var t=s(this.element),e=this.layout.options,i=e.isOriginLeft,n=e.isOriginTop,o=parseInt(t[i?"left":"right"],10),r=parseInt(t[n?"top":"bottom"],10);o=isNaN(o)?0:o,r=isNaN(r)?0:r;var a=this.layout.size;o-=i?a.paddingLeft:a.paddingRight,r-=n?a.paddingTop:a.paddingBottom,this.position.x=o,this.position.y=r},a.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={};e.isOriginLeft?(i.left=this.position.x+t.paddingLeft+"px",i.right=""):(i.right=this.position.x+t.paddingRight+"px",i.left=""),e.isOriginTop?(i.top=this.position.y+t.paddingTop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingBottom+"px",i.top=""),this.css(i),this.emitEvent("layout",[this])};var m=f?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};a.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=parseInt(t,10),r=parseInt(e,10),s=o===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return this.layoutPosition(),void 0;var a=t-i,h=e-n,p={},u=this.layout.options;a=u.isOriginLeft?a:-a,h=u.isOriginTop?h:-h,p.transform=m(a,h),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},a.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},a.prototype.moveTo=u?a.prototype._transitionTo:a.prototype.goTo,a.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},a.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},a.prototype._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return this._nonTransition(t),void 0;var e=this._transition;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var y=p&&n(p)+",opacity";a.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:y,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(c,this,!1))},a.prototype.transition=a.prototype[h?"_transition":"_nonTransition"],a.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},a.prototype.onotransitionend=function(t){this.ontransitionend(t)};var g={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};a.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transition,n=g[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},a.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(c,this,!1),this.isTransitioning=!1},a.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var v={transitionProperty:"",transitionDuration:""};return a.prototype.removeTransitionStyles=function(){this.css(v)},a.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},a.prototype.remove=function(){if(!h||!parseFloat(this.layout.options.transitionDuration))return this.removeElem(),void 0;var t=this;this.on("transitionEnd",function(){return t.removeElem(),!0}),this.hide()},a.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0})},a.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:{opacity:function(){this.css({display:"none"})}}})},a.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}var r=document.defaultView,s=r&&r.getComputedStyle?function(t){return r.getComputedStyle(t,null)}:function(t){return t.currentStyle};"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],o):(t.Outlayer={},t.Outlayer.Item=o(t.EventEmitter,t.getSize,t.getStyleProperty))}(window),function(t){"use strict";function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===f.call(t)}function n(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var n=0,o=t.length;o>n;n++)e.push(t[n]);else e.push(t);return e}function o(t,e){var i=l(e,t);-1!==i&&e.splice(i,1)}function r(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()}function s(i,s,f,l,d,m){function y(t,i){if("string"==typeof t&&(t=a.querySelector(t)),!t||!c(t))return h&&h.error("Bad "+this.settings.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.options),this.option(i);var n=++v;this.element.outlayerGUID=n,_[n]=this,this._create(),this.options.isInitLayout&&this.layout()}function g(t,i){t.prototype[i]=e({},y.prototype[i])}var v=0,_={};return y.prototype.settings={namespace:"outlayer",item:m},y.prototype.options={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e(y.prototype,f.prototype),y.prototype.option=function(t){e(this.options,t)},y.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},y.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},y.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.settings.item,n=[],o=0,r=e.length;r>o;o++){var s=e[o],a=new i(s,this);n.push(a)}return n},y.prototype._filterFindItemElements=function(t){t=n(t);for(var e=this.options.itemSelector,i=[],o=0,r=t.length;r>o;o++){var s=t[o];if(c(s))if(e){d(s,e)&&i.push(s);for(var a=s.querySelectorAll(e),h=0,p=a.length;p>h;h++)i.push(a[h])}else i.push(s)}return i},y.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},y.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},y.prototype._init=y.prototype.layout,y.prototype._resetLayout=function(){this.getSize()},y.prototype.getSize=function(){this.size=l(this.element)},y.prototype._getMeasurement=function(t,e){var i,n=this.options[t];n?("string"==typeof n?i=this.element.querySelector(n):c(n)&&(i=n),this[t]=i?l(i)[e]:n):this[t]=0},y.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},y.prototype._getItemsForLayout=function(t){for(var e=[],i=0,n=t.length;n>i;i++){var o=t[i];o.isIgnored||e.push(o)}return e},y.prototype._layoutItems=function(t,e){if(!t||!t.length)return this.emitEvent("layoutComplete",[this,t]),void 0;this._itemsOn(t,"layout",function(){this.emitEvent("layoutComplete",[this,t])});for(var i=[],n=0,o=t.length;o>n;n++){var r=t[n],s=this._getItemLayoutPosition(r);s.item=r,s.isInstant=e,i.push(s)}this._processLayoutQueue(i)},y.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},y.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var n=t[e];this._positionItem(n.item,n.x,n.y,n.isInstant)}},y.prototype._positionItem=function(t,e,i,n){n?t.goTo(e,i):t.moveTo(e,i)},y.prototype._postLayout=function(){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))},y.prototype._getContainerSize=u,y.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},y.prototype._itemsOn=function(t,e,i){function n(){return o++,o===r&&i.call(s),!0}for(var o=0,r=t.length,s=this,a=0,h=t.length;h>a;a++){var p=t[a];p.on(e,n)}},y.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},y.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},y.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var n=t[e];this.ignore(n)}}},y.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var n=t[e];o(n,this.stamps),this.unignore(n)}},y.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n(t)):void 0},y.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},y.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},y.prototype._manageStamp=u,y.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,n=l(t),o={left:e.left-i.left-n.marginLeft,top:e.top-i.top-n.marginTop,right:i.right-e.right-n.marginRight,bottom:i.bottom-e.bottom-n.marginBottom};return o},y.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},y.prototype.bindResize=function(){this.isResizeBound||(i.bind(t,"resize",this),this.isResizeBound=!0)},y.prototype.unbindResize=function(){i.unbind(t,"resize",this),this.isResizeBound=!1},y.prototype.onresize=function(){function t(){e.resize(),delete e.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},y.prototype.resize=function(){var t=l(this.element),e=this.size&&t;e&&t.innerWidth===this.size.innerWidth||this.layout()},y.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},y.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},y.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},y.prototype.reveal=function(t){if(t&&t.length)for(var e=0,i=t.length;i>e;e++){var n=t[e];n.reveal()}},y.prototype.hide=function(t){if(t&&t.length)for(var e=0,i=t.length;i>e;e++){var n=t[e];n.hide()}},y.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];if(n.element===t)return n}},y.prototype.getItems=function(t){if(t&&t.length){for(var e=[],i=0,n=t.length;n>i;i++){var o=t[i],r=this.getItem(o);r&&e.push(r)}return e}},y.prototype.remove=function(t){t=n(t);var e=this.getItems(t);if(e&&e.length){this._itemsOn(e,"remove",function(){this.emitEvent("removeComplete",[this,e])});for(var i=0,r=e.length;r>i;i++){var s=e[i];s.remove(),o(s,this.items)}}},y.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];n.destroy()}this.unbindResize(),delete this.element.outlayerGUID,p&&p.removeData(this.element,this.settings.namespace)},y.data=function(t){var e=t&&t.outlayerGUID;return e&&_[e]},y.create=function(t,i){function n(){y.apply(this,arguments)}return e(n.prototype,y.prototype),g(n,"options"),g(n,"settings"),e(n.prototype.options,i),n.prototype.settings.namespace=t,n.data=y.data,n.Item=function(){m.apply(this,arguments)},n.Item.prototype=new m,n.prototype.settings.item=n.Item,s(function(){for(var e=r(t),i=a.querySelectorAll(".js-"+e),o="data-"+e+"-options",s=0,u=i.length;u>s;s++){var f,c=i[s],l=c.getAttribute(o);try{f=l&&JSON.parse(l)}catch(d){h&&h.error("Error parsing "+o+" on "+c.nodeName.toLowerCase()+(c.id?"#"+c.id:"")+": "+d);continue}var m=new n(c,f);p&&p.data(c,t,m)}}),p&&p.bridget&&p.bridget(t,n),n},y.Item=m,y}var a=t.document,h=t.console,p=t.jQuery,u=function(){},f=Object.prototype.toString,c="object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName},l=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],s):t.Outlayer=s(t.eventie,t.docReady,t.EventEmitter,t.getSize,t.matchesSelector,t.Outlayer.Item)}(window),function(t){"use strict";function e(t,e){var n=t.create("masonry");return n.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.maxY=0},n.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},n.prototype.getContainerWidth=function(){var t=this.options.isFitWidth?this.element.parentNode:this.element,i=e(t);this.containerWidth=i&&i.innerWidth},n.prototype._getItemLayoutPosition=function(t){t.getSize();var e=Math.ceil(t.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var n=this._getColGroup(e),o=Math.min.apply(Math,n),r=i(n,o),s={x:this.columnWidth*r,y:o},a=o+t.size.outerHeight,h=this.cols+1-n.length,p=0;h>p;p++)this.colYs[r+p]=a;return s},n.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++){var o=this.colYs.slice(n,n+t);e[n]=Math.max.apply(Math,o)}return e},n.prototype._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this.options.isOriginLeft?n.left:n.right,r=o+i.outerWidth,s=Math.floor(o/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a=Math.min(this.cols-1,a);for(var h=(this.options.isOriginTop?n.top:n.bottom)+i.outerHeight,p=s;a>=p;p++)this.colYs[p]=Math.max(h,this.colYs[p])},n.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this.options.isFitWidth&&(t.width=this._getContainerFitWidth()),t},n.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.prototype.resize=function(){var t=this.containerWidth;this.getContainerWidth(),t!==this.containerWidth&&this.layout()},n}var i=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,n=t.length;n>i;i++){var o=t[i];if(o===e)return i}return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):t.Masonry=e(t.Outlayer,t.getSize)}(window);
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
 * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-history-input-inputtypes-localstorage-sessionstorage-websockets-geolocation-touch-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-fullscreen_api-load
 */
;window.Modernizr=function(a,b,c){function A(a){j.cssText=a}function B(a,b){return A(n.join(a+";")+(b||""))}function C(a,b){return typeof a===b}function D(a,b){return!!~(""+a).indexOf(b)}function E(a,b){for(var d in a){var e=a[d];if(!D(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function F(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:C(f,"function")?f.bind(d||b):f}return!1}function G(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return C(b,"string")||C(b,"undefined")?E(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),F(e,b,c))}function H(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)t[c[d]]=c[d]in k;return t.list&&(t.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={},s={},t={},u=[],v=u.slice,w,x=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},y={}.hasOwnProperty,z;!C(y,"undefined")&&!C(y.call,"undefined")?z=function(a,b){return y.call(a,b)}:z=function(a,b){return b in a&&C(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=v.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(v.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(v.call(arguments)))};return e}),r.flexbox=function(){return G("flexWrap")},r.flexboxlegacy=function(){return G("boxDirection")},r.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:x(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},r.geolocation=function(){return"geolocation"in navigator},r.history=function(){return!!a.history&&!!history.pushState},r.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},r.rgba=function(){return A("background-color:rgba(150,255,150,.5)"),D(j.backgroundColor,"rgba")},r.hsla=function(){return A("background-color:hsla(120,40%,100%,.5)"),D(j.backgroundColor,"rgba")||D(j.backgroundColor,"hsla")},r.multiplebgs=function(){return A("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},r.backgroundsize=function(){return G("backgroundSize")},r.borderimage=function(){return G("borderImage")},r.borderradius=function(){return G("borderRadius")},r.boxshadow=function(){return G("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){return B("opacity:.55"),/^0.55$/.test(j.opacity)},r.cssanimations=function(){return G("animationName")},r.csscolumns=function(){return G("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return A((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),D(j.backgroundImage,"gradient")},r.cssreflections=function(){return G("boxReflect")},r.csstransforms=function(){return!!G("transform")},r.csstransforms3d=function(){var a=!!G("perspective");return a&&"webkitPerspective"in g.style&&x("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},r.csstransitions=function(){return G("transition")},r.fontface=function(){var a;return x('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},r.generatedcontent=function(){var a;return x(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},r.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},r.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},r.applicationcache=function(){return!!a.applicationCache};for(var I in r)z(r,I)&&(w=I.toLowerCase(),e[w]=r[I](),u.push((e[w]?"":"no-")+w));return e.input||H(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)z(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},A(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.testProp=function(a){return E([a])},e.testAllProps=G,e.testStyles=x,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+u.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},Modernizr.addTest("fullscreen",function(){for(var a=0;a<Modernizr._domPrefixes.length;a++)if(document[Modernizr._domPrefixes[a].toLowerCase()+"CancelFullScreen"])return!0;return!!document.cancelFullScreen||!1});
/**
 * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
 * v1.2.1
 *
 * Copyright 2013, Moxiecode Systems AB
 * Released under GPL License.
 *
 * License: http://www.plupload.com/license
 * Contributing: http://www.plupload.com/contributing
 *
 * Date: 2014-05-14
 */
!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r<e.length;++r){if(n=s[e[r]]||o(e[r]),!n)throw"module definition dependecy not found: "+e[r];i.push(n)}t.apply(null,i)}function i(e,i,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(i===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";n(i,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var n=e,i=t.split(/[.\/]/),r=0;r<i.length;++r){if(!n[i[r]])return;n=n[i[r]]}return n}function a(n){for(var i=0;i<n.length;i++){for(var r=e,o=n[i],a=o.split(/[.\/]/),u=0;u<a.length-1;++u)r[a[u]]===t&&(r[a[u]]={}),r=r[a[u]];r[a[a.length-1]]=s[o]}}var s={},u="moxie/core/utils/Basic",c="moxie/core/I18n",l="moxie/core/utils/Mime",d="moxie/core/utils/Env",f="moxie/core/utils/Dom",h="moxie/core/Exceptions",p="moxie/core/EventTarget",m="moxie/core/utils/Encode",g="moxie/runtime/Runtime",v="moxie/runtime/RuntimeClient",y="moxie/file/Blob",w="moxie/file/File",E="moxie/file/FileInput",_="moxie/file/FileDrop",x="moxie/runtime/RuntimeTarget",b="moxie/file/FileReader",R="moxie/core/utils/Url",T="moxie/file/FileReaderSync",A="moxie/xhr/FormData",S="moxie/xhr/XMLHttpRequest",O="moxie/runtime/Transporter",I="moxie/image/Image",D="moxie/runtime/html5/Runtime",N="moxie/runtime/html5/file/Blob",L="moxie/core/utils/Events",M="moxie/runtime/html5/file/FileInput",C="moxie/runtime/html5/file/FileDrop",F="moxie/runtime/html5/file/FileReader",H="moxie/runtime/html5/xhr/XMLHttpRequest",P="moxie/runtime/html5/utils/BinaryReader",k="moxie/runtime/html5/image/JPEGHeaders",U="moxie/runtime/html5/image/ExifParser",B="moxie/runtime/html5/image/JPEG",z="moxie/runtime/html5/image/PNG",G="moxie/runtime/html5/image/ImageInfo",q="moxie/runtime/html5/image/MegaPixel",X="moxie/runtime/html5/image/Image",j="moxie/runtime/flash/Runtime",V="moxie/runtime/flash/file/Blob",W="moxie/runtime/flash/file/FileInput",Y="moxie/runtime/flash/file/FileReader",$="moxie/runtime/flash/file/FileReaderSync",J="moxie/runtime/flash/xhr/XMLHttpRequest",Z="moxie/runtime/flash/runtime/Transporter",K="moxie/runtime/flash/image/Image",Q="moxie/runtime/silverlight/Runtime",et="moxie/runtime/silverlight/file/Blob",tt="moxie/runtime/silverlight/file/FileInput",nt="moxie/runtime/silverlight/file/FileDrop",it="moxie/runtime/silverlight/file/FileReader",rt="moxie/runtime/silverlight/file/FileReaderSync",ot="moxie/runtime/silverlight/xhr/XMLHttpRequest",at="moxie/runtime/silverlight/runtime/Transporter",st="moxie/runtime/silverlight/image/Image",ut="moxie/runtime/html4/Runtime",ct="moxie/runtime/html4/file/FileInput",lt="moxie/runtime/html4/file/FileReader",dt="moxie/runtime/html4/xhr/XMLHttpRequest",ft="moxie/runtime/html4/image/Image";i(u,[],function(){var e=function(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()},t=function(i){var r;return n(arguments,function(o,s){s>0&&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(a){n=o}if(n===o){for(i in e)if(e.hasOwnProperty(i)&&t(e[i],i)===!1)return}else for(r=0;n>r;r++)if(t(e[r],r)===!1)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){++r<o&&!e?i(r):n(e)})}var r=0,o=t.length;"function"!==e(n)&&(n=function(){}),t&&t.length||n(),i(r)},o=function(e,t){var i=0,r=e.length,o=new Array(r);n(e,function(e,n){e(function(e){if(e)return t(e);var a=[].slice.call(arguments);a.shift(),o[n]=a,i++,i===r&&(o.unshift(null),t.apply(this,o))})})},a=function(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var n=0,i=t.length;i>n;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:!1},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;t<e.length;t++)n[t]=e[t];return n},l=function(){var e=0;return function(t){var n=(new Date).getTime().toString(32),i;for(i=0;5>i;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="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",i={mimes:{},extensions:{},addMimeType:function(e){var t=e.split(/,/),n,i,r;for(n=0;n<t.length;n+=2){for(r=t[n+1].split(/ /),i=0;i<r.length;i++)this.mimes[r[i]]=t[n];this.extensions[t[n]]=r}},extList2mimes:function(t,n){var i=this,r,o,a,s,u=[];for(o=0;o<t.length;o++)for(r=t[o].extensions.split(/\s*,\s*/),a=0;a<r.length;a++){if("*"===r[a])return[];if(s=i.mimes[r[a]])-1===e.inArray(s,u)&&u.push(s);else{if(!n||!/^\w+$/.test(r[a]))return[];u.push("."+r[a])}}return u},mimes2exts:function(t){var n=this,i=[];return e.each(t,function(t){if("*"===t)return i=[],!1;var r=t.match(/^(\w+)\/(\*|\w+)$/);r&&("*"===r[2]?e.each(n.extensions,function(e,t){new RegExp("^"+r[1]+"/").test(t)&&[].push.apply(i,n.extensions[t])}):n.extensions[t]&&[].push.apply(i,n.extensions[t]))}),i},mimes2extList:function(n){var i=[],r=[];return"string"===e.typeOf(n)&&(n=e.trim(n).split(/\s*,\s*/)),r=this.mimes2exts(n),i.push({title:t.translate("Files"),extensions:r.length?r.join(","):"*"}),i.mimes=n,i},getFileExtension:function(e){var t=e&&e.match(/\.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return i.addMimeType(n),i}),i(d,[u],function(e){function t(e,t,n){var i=0,r=0,o=0,a={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},s=function(e){return e=(""+e).replace(/[_\-+]/g,"."),e=e.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),e.length?e.split("."):[-8]},u=function(e){return e?isNaN(e)?a[e]||-7:parseInt(e,10):0};for(e=s(e),t=s(t),r=Math.max(e.length,t.length),i=0;r>i;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(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="?",i="function",r="undefined",o="object",a="major",s="model",u="name",c="type",l="vendor",d="version",f="architecture",h="console",p="mobile",m="tablet",g={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},v={rgx:function(){for(var t,n=0,a,s,u,c,l,d,f=arguments;n<f.length;n+=2){var h=f[n],p=f[n+1];if(typeof t===r){t={};for(u in p)c=p[u],typeof c===o?t[c[0]]=e:t[c]=e}for(a=s=0;a<h.length;a++)if(l=h[a].exec(this.getUA())){for(u=0;u<p.length;u++)d=l[++s],c=p[u],typeof c===o&&c.length>0?2==c.length?t[c[0]]=typeof c[1]==i?c[1].call(this,d):c[1]:3==c.length?t[c[0]]=typeof c[1]!==i||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?d:e;break}if(l)break}return t},str:function(t,i){for(var r in i)if(typeof i[r]===o&&i[r].length>0){for(var a=0;a<i[r].length;a++)if(g.has(i[r][a],t))return r===n?e:r}else if(g.has(i[r],t))return r===n?e:r;return t}},y={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}},w={browser:[[/(opera\smini)\/((\d+)?[\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,/(opera).+version\/((\d+)?[\w\.]+)/i,/(opera)[\/\s]+((\d+)?[\w\.]+)/i],[u,d,a],[/\s(opr)\/((\d+)?[\w\.]+)/i],[[u,"Opera"],d,a],[/(kindle)\/((\d+)?[\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,/(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,/(rekonq)((?:\/)[\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i],[u,d,a],[/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],[[u,"IE"],d,a],[/(yabrowser)\/((\d+)?[\w\.]+)/i],[[u,"Yandex"],d,a],[/(comodo_dragon)\/((\d+)?[\w\.]+)/i],[[u,/_/g," "],d,a],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],[u,d,a],[/(dolfin)\/((\d+)?[\w\.]+)/i],[[u,"Dolphin"],d,a],[/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],[[u,"Chrome"],d,a],[/((?:android.+))version\/((\d+)?[\w\.]+)\smobile\ssafari/i],[[u,"Android Browser"],d,a],[/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],[d,a,[u,"Mobile Safari"]],[/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],[d,a,u],[/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],[u,[a,v.str,y.browser.oldsafari.major],[d,v.str,y.browser.oldsafari.version]],[/(konqueror)\/((\d+)?[\w\.]+)/i,/(webkit|khtml)\/((\d+)?[\w\.]+)/i],[u,d,a],[/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],[[u,"Netscape"],d,a],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,/(links)\s\(((\d+)?[\w\.]+)/i,/(gobrowser)\/?((\d+)?[\w\.]+)*/i,/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,/(mosaic)[\/\s]((\d+)?[\w\.]+)/i],[u,d,a]],engine:[[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[u,d],[/rv\:([\w\.]+).*(gecko)/i],[d,u]],os:[[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[u,[d,v.str,y.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[u,"Windows"],[d,v.str,y.os.windows.version]],[/\((bb)(10);/i],[[u,"BlackBerry"],d],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)\/([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i],[u,d],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[u,"Symbian"],d],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[u,"Firefox OS"],d],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[u,d],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[u,"Chromium OS"],d],[/(sunos)\s?([\w\.]+\d)*/i],[[u,"Solaris"],d],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[u,d],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[u,"iOS"],[d,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],[u,[d,/_/g,"."]],[/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,/(unix)\s?([\w\.]+)*/i],[u,d]]},E=function(e){var n=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:t);this.getBrowser=function(){return v.rgx.apply(this,w.browser)},this.getEngine=function(){return v.rgx.apply(this,w.engine)},this.getOS=function(){return v.rgx.apply(this,w.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this.setUA(n)};return(new E).getResult()}(),i=function(){var t={define_property:function(){return!1}(),create_canvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),return_response_type:function(t){try{if(-1!==e.inArray(t,["","text","document"]))return!0;if(window.XMLHttpRequest){var n=new XMLHttpRequest;if(n.open("get","/"),"responseType"in n)return n.responseType=t,n.responseType!==t?!1:!0}}catch(i){}return!1},use_data_uri:function(){var e=new Image;return e.onload=function(){t.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return t.use_data_uri&&("IE"!==r.browser||r.version>=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){if(!e.className)return!1;var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return n.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}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:n,addClass:i,removeClass:r,getStyle:o,getPos:a,getSize:s}}),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(e.fn.apply(e.scope,a)===!1)},1)}:function(t){t(e.fn.apply(e.scope,a)===!1)})}),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<e.length;i++)n="on"+e[i],"function"===t.typeOf(this[n])?this.addEventListener(e[i],this[n]):"undefined"===t.typeOf(this[n])&&(this[n]=null)}})}return n.instance=new n,n}),i(m,[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},n=function(e,n){if("function"==typeof window.atob)return n?t(window.atob(e)):window.atob(e);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,f=0,h=0,p="",m=[];if(!e)return e;e+="";do s=i.indexOf(e.charAt(f++)),u=i.indexOf(e.charAt(f++)),c=i.indexOf(e.charAt(f++)),l=i.indexOf(e.charAt(f++)),d=s<<18|u<<12|c<<6|l,r=d>>16&255,o=d>>8&255,a=255&d,m[h++]=64==c?String.fromCharCode(r):64==l?String.fromCharCode(r,o):String.fromCharCode(r,o,a);while(f<e.length);return p=m.join(""),n?t(p):p},i=function(t,n){if(n&&e(t),"function"==typeof window.btoa)return window.btoa(t);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,f=0,h=0,p="",m=[];if(!t)return t;do r=t.charCodeAt(f++),o=t.charCodeAt(f++),a=t.charCodeAt(f++),d=r<<16|o<<8|a,s=d>>18&63,u=d>>12&63,c=d>>6&63,l=63&d,m[h++]=i.charAt(s)+i.charAt(u)+i.charAt(c)+i.charAt(l);while(f<t.length);p=m.join("");var g=t.length%3;return(g?p.slice(0,g-3):p)+"===".slice(g||3)};return{utf8_encode:e,utf8_decode:t,atob:n,btoa:i}}),i(g,[u,f,p],function(e,t,n){function i(n,r,a,s,u){var c=this,l,d=e.guid(r+"_"),f=u||"browser";n=n||{},o[d]=this,a=e.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},a),n.preferred_caps&&(f=i.getMode(s,n.preferred_caps,f)),l=function(){var t={};return{exec:function(e,n,i,r){return l[n]&&(t[e]||(t[e]={context:this,instance:new l[n]}),t[e].instance[i])?t[e].instance[i].apply(this,r):void 0},removeInstance:function(e){delete t[e]},removeAllInstances:function(){var n=this;e.each(t,function(t,i){"function"===e.typeOf(t.instance.destroy)&&t.instance.destroy.call(t.context),n.removeInstance(i)})}}}(),e.extend(this,{initialized:!1,uid:d,type:r,mode:i.getMode(s,n.required_caps,f),shimid:d+"_container",clients:0,options:n,can:function(t,n){var r=arguments[2]||a;if("string"===e.typeOf(t)&&"undefined"===e.typeOf(n)&&(t=i.parseCaps(t)),"object"===e.typeOf(t)){for(var o in t)if(!this.can(o,t[o],r))return!1;return!0}return"function"===e.typeOf(r[t])?r[t].call(this,n):n===r[t]},getShimContainer:function(){var n,i=t.get(this.shimid);return i||(n=this.options.container?t.get(this.options.container):document.body,i=document.createElement("div"),i.id=this.shimid,i.className="moxie-shim moxie-shim-"+this.type,e.extend(i.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),n.appendChild(i),n=null),i},getShim:function(){return l},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec.call(this,this.uid,e,t,n)},exec:function(e,t){var n=[].slice.call(arguments,2);return c[e]&&c[e][t]?c[e][t].apply(this,n):c.shimExec.apply(this,arguments)},destroy:function(){if(c){var e=t.get(this.shimid);e&&e.parentNode.removeChild(e),l&&l.removeAllInstances(),this.unbindAll(),delete o[this.uid],this.uid=null,d=c=l=e=null}}}),this.mode&&n.required_caps&&!this.can(n.required_caps)&&(this.mode=!1)}var r={},o={};return i.order="html5,flash,silverlight,html4",i.getRuntime=function(e){return o[e]?o[e]:!1},i.addConstructor=function(e,t){t.prototype=n.instance,r[e]=t},i.getConstructor=function(e){return r[e]||null},i.getInfo=function(e){var t=i.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},i.parseCaps=function(t){var n={};return"string"!==e.typeOf(t)?t||{}:(e.each(t.split(","),function(e){n[e]=!0}),n)},i.can=function(e,t){var n,r=i.getConstructor(e),o;return r?(n=new r({required_caps:t}),o=n.mode,n.destroy(),!!o):!1},i.thatCan=function(e,t){var n=(t||i.order).split(/\s*,\s*/);for(var r in n)if(i.can(n[r],e))return n[r];return null},i.getMode=function(t,n,i){var r=null;if("undefined"===e.typeOf(i)&&(i="browser"),n&&!e.isEmptyObj(t)){if(e.each(n,function(n,i){if(t.hasOwnProperty(i)){var o=t[i](n);if("string"==typeof o&&(o=[o]),r){if(!(r=e.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==e.inArray(i,r)?i:r[0];if(r===!1)return!1}return i},i.capTrue=function(){return!0},i.capFalse=function(){return!1},i.capTest=function(e){return function(){return!!e}},i}),i(v,[h,u,g],function(e,t,n){return function i(){var i;t.extend(this,{connectRuntime:function(r){function o(t){var s,u;return t.length?(s=t.shift(),(u=n.getConstructor(s))?(i=new u(r),i.bind("Init",function(){i.initialized=!0,setTimeout(function(){i.clients++,a.trigger("RuntimeInit",i)},1)}),i.bind("Error",function(){i.destroy(),o(t)}),i.mode?void i.init():void i.trigger("Error")):void o(t)):(a.trigger("RuntimeError",new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)),void(i=null))}var a=this,s;if("string"===t.typeOf(r)?s=r:"string"===t.typeOf(r.ruid)&&(s=r.ruid),s){if(i=n.getRuntime(s))return i.clients++,i;throw new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},getRuntime:function(){return i&&i.uid?i:(i=null,null)},disconnectRuntime:function(){i&&--i.clients<=0&&(i.destroy(),i=null)}})}}),i(y,[u,m,v],function(e,t,n){function i(o,a){function s(t,n,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new i(null,{type:o,size:n-t}),a.detach(s.substr(t,a.size)),a):null}n.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,n){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,n)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"";var n=e.match(/^data:([^;]*);base64,/);n&&(this.type=n[1],e=t.atob(e.substring(e.indexOf("base64,")+7))),this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return i}),i(w,[u,l,y],function(e,t,n){function i(i,r){var o,a;if(r||(r={}),a=r.type&&""!==r.type?r.type:t.getFileMime(r.name),r.name)o=r.name.replace(/\\/g,"/"),o=o.substr(o.lastIndexOf("/")+1);else{var s=a.split("/")[0];o=e.guid((""!==s?s:"file")+"_"),t.extensions[a]&&(o+="."+t.extensions[a][0])}n.apply(this,arguments),e.extend(this,{type:a||"",name:o||e.guid("file_"),lastModifiedDate:r.lastModifiedDate||(new Date).toLocaleString()})}return i.prototype=n.prototype,i}),i(E,[u,l,f,h,p,c,w,g,v],function(e,t,n,i,r,o,a,s,u){function c(r){var c=this,d,f,h;if(-1!==e.inArray(e.typeOf(r),["string","node"])&&(r={browse_button:r}),f=n.get(r.browse_button),!f)throw new i.DOMException(i.DOMException.NOT_FOUND_ERR);h={accept:[{title:o.translate("All Files"),extensions:"*"}],name:"file",multiple:!1,required_caps:!1,container:f.parentNode||document.body},r=e.extend({},h,r),"string"==typeof r.required_caps&&(r.required_caps=s.parseCaps(r.required_caps)),"string"==typeof r.accept&&(r.accept=t.mimes2extList(r.accept)),d=n.get(r.container),d||(d=document.body),"static"===n.getStyle(d,"position")&&(d.style.position="relative"),d=f=null,u.call(c),e.extend(c,{uid:e.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){c.convertEventPropsToHandlers(l),c.bind("RuntimeInit",function(t,i){c.ruid=i.uid,c.shimid=i.shimid,c.bind("Ready",function(){c.trigger("Refresh")},999),c.bind("Change",function(){var t=i.exec.call(c,"FileInput","getFiles");c.files=[],e.each(t,function(e){return 0===e.size?!0:void c.files.push(new a(c.ruid,e))})},999),c.bind("Refresh",function(){var t,o,a,s;a=n.get(r.browse_button),s=n.get(i.shimid),a&&(t=n.getPos(a,n.get(r.container)),o=n.getSize(a),s&&e.extend(s.style,{top:t.y+"px",left:t.x+"px",width:o.w+"px",height:o.h+"px"})),s=a=null}),i.exec.call(c,"FileInput","init",r)}),c.connectRuntime(e.extend({},r,{required_caps:{select_file:!0}}))},disable:function(t){var n=this.getRuntime();n&&n.exec.call(this,"FileInput","disable","undefined"===e.typeOf(t)?!0:t)},refresh:function(){c.trigger("Refresh")},destroy:function(){var t=this.getRuntime();t&&(t.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===e.typeOf(this.files)&&e.each(this.files,function(e){e.destroy()}),this.files=null}})}var l=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return c.prototype=r.instance,c}),i(_,[c,f,h,u,w,v,p,l],function(e,t,n,i,r,o,a,s){function u(n){var a=this,u;"string"==typeof n&&(n={drop_zone:n}),u={accept:[{title:e.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},n="object"==typeof n?i.extend({},u,n):u,n.container=t.get(n.drop_zone)||document.body,"static"===t.getStyle(n.container,"position")&&(n.container.style.position="relative"),"string"==typeof n.accept&&(n.accept=s.mimes2extList(n.accept)),o.call(a),i.extend(a,{uid:i.guid("uid_"),ruid:null,files:null,init:function(){a.convertEventPropsToHandlers(c),a.bind("RuntimeInit",function(e,t){a.ruid=t.uid,a.bind("Drop",function(){var e=t.exec.call(a,"FileDrop","getFiles");a.files=[],i.each(e,function(e){a.files.push(new r(a.ruid,e))})},999),t.exec.call(a,"FileDrop","init",n),a.dispatchEvent("ready")}),a.connectRuntime(n)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null}})}var c=["ready","dragenter","dragleave","drop","error"];return u.prototype=a.instance,u}),i(x,[u,v,p],function(e,t,n){function i(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return i.prototype=n.instance,i}),i(b,[u,m,h,p,y,w,x],function(e,t,n,i,r,o,a){function s(){function i(e,i){function l(e){o.readyState=s.DONE,o.error=e,o.trigger("error"),d()}function d(){c.destroy(),c=null,o.trigger("loadend")}function f(t){c.bind("Error",function(e,t){l(t)}),c.bind("Progress",function(e){o.result=t.exec.call(c,"FileReader","getResult"),o.trigger(e)}),c.bind("Load",function(e){o.readyState=s.DONE,o.result=t.exec.call(c,"FileReader","getResult"),o.trigger(e),d()}),t.exec.call(c,"FileReader","read",e,i)}if(c=new a,this.convertEventPropsToHandlers(u),this.readyState===s.LOADING)return l(new n.DOMException(n.DOMException.INVALID_STATE_ERR));if(this.readyState=s.LOADING,this.trigger("loadstart"),i instanceof r)if(i.isDetached()){var h=i.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=h;break;case"readAsDataURL":this.result="data:"+i.type+";base64,"+t.btoa(h)}this.readyState=s.DONE,this.trigger("load"),d()}else f(c.connectRuntime(i.ruid));else l(new n.DOMException(n.DOMException.NOT_FOUND_ERR))}var o=this,c;e.extend(this,{uid:e.guid("uid_"),readyState:s.EMPTY,result:null,error:null,readAsBinaryString:function(e){i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){i.call(this,"readAsDataURL",e)},readAsText:function(e){i.call(this,"readAsText",e)},abort:function(){this.result=null,-1===e.inArray(this.readyState,[s.EMPTY,s.DONE])&&(this.readyState===s.LOADING&&(this.readyState=s.DONE),c&&c.getRuntime().exec.call(this,"FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))
},destroy:function(){this.abort(),c&&(c.getRuntime().exec.call(this,"FileReader","destroy"),c.disconnectRuntime()),o=c=null}})}var u=["loadstart","progress","load","abort","error","loadend"];return s.EMPTY=0,s.LOADING=1,s.DONE=2,s.prototype=i.instance,s}),i(R,[],function(){var e=function(t,n){for(var i=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],r=i.length,o={http:80,https:443},a={},s=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,u=s.exec(t||"");r--;)u[r]&&(a[i[r]]=u[r]);if(!a.scheme){n&&"string"!=typeof n||(n=e(n||document.location.href)),a.scheme=n.scheme,a.host=n.host,a.port=n.port;var c="";/^[^\/]/.test(a.path)&&(c=n.path,/(\/|\/[^\.]+)$/.test(c)?c+="/":c=c.replace(/\/[^\/]+$/,"/")),a.path=c+(a.path||"")}return a.port||(a.port=o[a.scheme]||80),a.port=parseInt(a.port,10),a.path||(a.path="/"),delete a.source,a},t=function(t){var n={http:80,https:443},i=e(t);return i.scheme+"://"+i.host+(i.port!==n[i.scheme]?":"+i.port:"")+i.path+(i.query?i.query:"")},n=function(t){function n(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof t&&(t=e(t)),n(e())===n(t)};return{parseUrl:e,resolveUrl:t,hasSameOrigin:n}}),i(T,[u,v,m],function(e,t,n){return function(){function i(e,t){if(!t.isDetached()){var i=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),i}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+n.btoa(r);case"readAsText":for(var o="",a=0,s=r.length;s>a;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(A,[h,u,y],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(S,[u,h,p,m,R,g,x,y,T,A,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 y.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?y[e]:v[e]:void(l.can("define_property")?y[e]=t:v[e]=t):void 0}function u(t){function i(){k&&(k.destroy(),k=null),s.dispatchEvent("loadend"),s=null}function r(r){k.bind("LoadStart",function(e){n("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),I&&s.upload.dispatchEvent(e)}),k.bind("Progress",function(e){n("readyState")!==h.LOADING&&(n("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),k.bind("UploadProgress",function(e){I&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),k.bind("Load",function(t){n("readyState",h.DONE),n("status",Number(r.exec.call(k,"XMLHttpRequest","getStatus")||0)),n("statusText",p[n("status")]||""),n("response",r.exec.call(k,"XMLHttpRequest","getResponse",n("responseType"))),~e.inArray(n("responseType"),["text",""])?n("responseText",n("response")):"document"===n("responseType")&&n("responseXML",n("response")),U=r.exec.call(k,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),n("status")>0?(I&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(N=!0,s.dispatchEvent("error")),i()}),k.bind("Abort",function(e){s.dispatchEvent(e),i()}),k.bind("Error",function(e){N=!0,n("readyState",h.DONE),s.dispatchEvent("readystatechange"),D=!0,s.dispatchEvent(e),i()}),r.exec.call(k,"XMLHttpRequest","send",{url:E,method:_,async:w,user:b,password:R,headers:x,mimeType:A,encoding:T,responseType:s.responseType,withCredentials:s.withCredentials,options:P},t)}var s=this;M=(new Date).getTime(),k=new a,"string"==typeof P.required_caps&&(P.required_caps=o.parseCaps(P.required_caps)),P.required_caps=e.extend({},P.required_caps,{return_response_type:s.responseType}),t instanceof c&&(P.required_caps.send_multipart=!0),L||(P.required_caps.do_cors=!0),P.ruid?r(k.connectRuntime(P)):(k.bind("RuntimeInit",function(e,t){r(t)}),k.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),k.connectRuntime(P))}function g(){n("responseText",""),n("responseXML",null),n("response",null),n("status",0),n("statusText",""),M=C=null}var v=this,y={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},w=!0,E,_,x={},b,R,T=null,A=null,S=!1,O=!1,I=!1,D=!1,N=!1,L=!1,M,C,F=null,H=null,P={},k,U="",B;e.extend(this,y,{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"])&&(_=o.toUpperCase()),~e.inArray(_,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=i.utf8_encode(a),l=r.parseUrl(a),L=r.hasSameOrigin(l),E=r.resolveUrl(a),(u||c)&&!L)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(b=u||l.user,R=c||l.pass,w=s||!0,w===!1&&(n("timeout")||n("withCredentials")||""!==n("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);S=!w,O=!1,x={},g.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)?!1:(x[r]?x[r]+=", "+o:x[r]=o,!0)},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),N||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(B||(B={},e.each(U.split(/\r\n/),function(t){var n=t.split(/:\s+/);2===n.length&&(n[0]=e.trim(n[0]),B[n[0].toLowerCase()]={header:n[0],value:e.trim(n[1])})})),B.hasOwnProperty(t))?B[t].header+": "+B[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,H=o},send:function(n,r){if(P="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.convertEventPropsToHandlers(m),this.upload.convertEventPropsToHandlers(m),this.readyState!==h.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n instanceof s)P.ruid=n.ruid,A=n.type||"application/octet-stream";else if(n instanceof c){if(n.hasBlob()){var o=n.getBlob();P.ruid=o.ruid,A=o.type||"application/octet-stream"}}else"string"==typeof n&&(T="UTF-8",A="text/plain;charset=UTF-8",n=i.utf8_encode(n));this.withCredentials||(this.withCredentials=P.required_caps&&P.required_caps.send_browser_cookies&&!L),I=!S&&this.upload.hasEventListener(),N=!1,D=!n,S||(O=!0),u.call(this,n)},abort:function(){if(N=!0,S=!1,~e.inArray(n("readyState"),[h.UNSENT,h.OPENED,h.DONE]))n("readyState",h.UNSENT);else{if(n("readyState",h.DONE),O=!1,!k)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);k.getRuntime().exec.call(k,"XMLHttpRequest","abort",D),D=!0}},destroy:function(){k&&("function"===e.typeOf(k.destroy)&&k.destroy(),k=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 m=["loadstart","progress","abort","error","load","timeout","loadend"],g=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,m,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,T,S,g,v,O,d,p,y,w,m],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);m.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);g.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(r){this.trigger("error",r.code)}}function m(t,n){var i=this.connectRuntime(t.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(n)?!0:n)}function g(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(){g.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(r){this.trigger("error",r.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);var e=this.connectRuntime(this.ruid);return e.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='<img src="'+r+'" width="'+a.width+'" height="'+a.height+'" />',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,m,g),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]||{},m=this.width,g=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:!1,p.width)m=p.width,g=p.height||m;else{var y=t.getSize(i);y.w&&y.h&&(m=y.w,g=y.h)}return a=new h,a.bind("Resize",function(){r.call(o)}),a.bind("Load",function(){a.downsize(m,g,d,!1)}),a.clone(this,!1),a}catch(w){this.trigger("error",w.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,g,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?!0: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(N,[D,y],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(r){return e.slice(t,n-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=n}),i(L,[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(c){t[r]=s}}}},s=function(t,n){t&&t[r]&&e.each(i[t[r]],function(e,i){a(t,i,n)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),i(M,[D,u,f,L,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,m;a=s,e=[],f=a.accept.mimes||r.extList2mimes(a.accept,c.can("filter_by_extension")),d=c.getShimContainer(),d.innerHTML='<input id="'+c.uid+'" type="file" style="font-size:999px;opacity:0;"'+(a.multiple&&c.can("select_multiple")?"multiple":"")+(a.directory&&c.can("select_folder")?"webkitdirectory directory":"")+(f?' accept="'+f.join(",")+'"':"")+" />",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)),m=c.can("summon_file_dialog")?h:d,i.addEvent(m,"mouseover",function(){u.trigger("mouseenter")},u.uid),i.addEvent(m,"mouseout",function(){u.trigger("mouseleave")},u.uid),i.addEvent(m,"mousedown",function(){u.trigger("mousedown")},u.uid),i.addEvent(n.get(a.container),"mouseup",function(){u.trigger("mouseup")},u.uid),l.onchange=function g(){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 n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=g}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(C,[D,u,f,L,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<e.length;i++)[].push.apply(n,e[i].extensions.split(/\s*,\s*/));return-1===t.inArray("*",n)?n:[]}function a(e){if(!f.length)return!0;var n=r.getFileExtension(e.name);return!n||-1!==t.inArray(n,f)}function s(e,n){var i=[];t.each(e,function(e){var t=e.webkitGetAsEntry();if(t)if(t.isFile){var n=e.getAsFile();a(n)&&d.push(n)}else i.push(t)}),i.length?u(i,n):n()}function u(e,n){var i=[];t.each(e,function(e){i.push(function(t){c(e,t)})}),t.inSeries(i,function(){n()})}function c(e,t){e.isFile?e.file(function(e){a(e)&&d.push(e),t()},function(){t()}):e.isDirectory?l(e,t):t()}function l(e,t){function n(e){r.readEntries(function(t){t.length?([].push.apply(i,t),n(e)):e()},e)}var i=[],r=e.createReader();n(function(){u(i,t)})}var d=[],f=[],h;t.extend(this,{init:function(n){var r=this,u;h=n,f=o(h.accept),u=h.container,i.addEvent(u,"dragover",function(t){e(t)&&(t.preventDefault(),t.dataTransfer.dropEffect="copy")},r.uid),i.addEvent(u,"drop",function(n){e(n)&&(n.preventDefault(),d=[],n.dataTransfer.items&&n.dataTransfer.items[0].webkitGetAsEntry?s(n.dataTransfer.items,function(){r.trigger("drop")}):(t.each(n.dataTransfer.files,function(e){a(e)&&d.push(e)}),r.trigger("drop")))},r.uid),i.addEvent(u,"dragenter",function(e){r.trigger("dragenter")},r.uid),i.addEvent(u,"dragleave",function(e){r.trigger("dragleave")},r.uid)},getFiles:function(){return d},destroy:function(){i.removeAllEvents(h&&n.get(h.container),this.uid),d=f=h=null}})}return e.FileDrop=o}),i(F,[D,m,u],function(e,t,n){function i(){function e(e){return t.atob(e.substring(e.indexOf("base64,")+7))}var i,r=!1;n.extend(this,{read:function(e,t){var o=this;i=new window.FileReader,i.addEventListener("progress",function(e){o.trigger(e)}),i.addEventListener("load",function(e){o.trigger(e)}),i.addEventListener("error",function(e){o.trigger(e,i.error)}),i.addEventListener("loadend",function(){i=null}),"function"===n.typeOf(i[e])?(r=!1,i[e](t.getSource())):"readAsBinaryString"===e&&(r=!0,i.readAsDataURL(t.getSource()))},getResult:function(){return i&&i.result?r?e(i.result):i.result:null},abort:function(){i&&i.abort()},destroy:function(){i=null}})}return e.FileReader=i}),i(H,[D,u,l,R,w,y,A,h,d],function(e,t,n,i,r,o,a,s,u){function c(){function e(e,t){var n=this,i,r;i=t.getBlob().getSource(),r=new window.FileReader,r.onload=function(){t.append(t.getBlobName(),new o(null,{type:i.type,data:r.result})),f.send.call(n,e,t)},r.readAsBinaryString(i)}function c(){return!window.XMLHttpRequest||"IE"===u.browser&&u.version<8?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(n){}}():new window.XMLHttpRequest}function l(e){var t=e.responseXML,n=e.responseText;return"IE"===u.browser&&n&&t&&!t.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(n)),t&&("IE"===u.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function d(e){var t="----moxieboundary"+(new Date).getTime(),n="--",i="\r\n",r="",a=this.getRuntime();if(!a.can("send_binary_string"))throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);return h.setRequestHeader("Content-Type","multipart/form-data; boundary="+t),e.each(function(e,a){r+=e instanceof o?n+t+i+'Content-Disposition: form-data; name="'+a+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+i+"Content-Type: "+(e.type||"application/octet-stream")+i+i+e.getSource()+i:n+t+i+'Content-Disposition: form-data; name="'+a+'"'+i+i+unescape(encodeURIComponent(e))+i}),r+=n+t+n+i}var f=this,h,p;t.extend(this,{send:function(n,r){var s=this,l="Mozilla"===u.browser&&u.version>=4&&u.version<7,f="Android Browser"===u.browser,m=!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()&&(m=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),m=!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 g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}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 v(){switch(h.readyState){case 1:break;case 2:break;case 3:var e,t;try{i.hasSameOrigin(n.url)&&(e=h.getResponseHeader("Content-Length")||0),h.responseText&&(t=h.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});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"),m?h.sendAsBinary?h.sendAsBinary(r):!function(){for(var e=new Uint8Array(r.length),t=0;t<r.length;t++)e[t]=255&r.charCodeAt(t);h.send(e.buffer)}():h.send(r),s.trigger("loadstart")},getStatus:function(){try{if(h)return h.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var i=new r(t.uid,h.response),o=h.getResponseHeader("Content-Disposition");if(o){var a=o.match(/filename=([\'\"'])([^\1]+)\1/);a&&(p=a[2])}return i.name=p,i.type||(i.type=n.getFileMime(p)),i;case"json":return u.can("return_response_type","json")?h.response:200===h.status&&window.JSON?JSON.parse(h.responseText):null;case"document":return l(h);default:return""!==h.responseText?h.responseText:null}}catch(s){return null}},getAllResponseHeaders:function(){try{return h.getAllResponseHeaders()}catch(e){}return""},abort:function(){h&&h.abort()},destroy:function(){f=p=null}})}return e.XMLHttpRequest=c}),i(P,[],function(){return function(){function e(e,t){var n=r?0:-8*(t-1),i=0,a;for(a=0;t>a;a++)i|=o.charCodeAt(e+a)<<Math.abs(n+8*a);return i}function n(e,t,n){n=3===arguments.length?n:o.length-t-1,o=o.substr(0,t)+e+o.substr(n+t)}function i(e,t,i){var o="",a=r?0:-8*(i-1),s;for(s=0;i>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(k,[P],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),a>=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(U,[u,P],function(e,n){return function i(){function i(e,n){var i=a.SHORT(e),r,o,s,u,d,f,h,p,m=[],g={};for(r=0;i>r;r++)if(h=f=e+12*r+2,s=n[a.SHORT(h)],s!==t){switch(u=a.SHORT(h+=2),d=a.LONG(h+=2),h+=4,m=[],u){case 1:case 7:for(d>4&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.BYTE(h+o);break;case 2:d>4&&(h=a.LONG(h)+c.tiffHeader),g[s]=a.STRING(h,d-1);continue;case 3:for(d>2&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.SHORT(h+2*o);break;case 4:for(d>1&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.LONG(h+4*o);break;case 5:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[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++)m[o]=a.SLONG(h+4*o);break;case 10:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(h+4*o)/a.SLONG(h+4*o+4);break;default:continue}p=1==d?m[0]:m,g[s]=l.hasOwnProperty(s)&&"object"!=typeof p?l[s][p]:p}return g}function r(){var e=c.tiffHeader;return a.II(18761==a.SHORT(e)),42!==a.SHORT(e+=2)?!1:(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):!1}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\x00"===a.STRING(4,5).toUpperCase()?r():!1):!1
},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<t.ExifVersion.length;n++)r+=String.fromCharCode(t.ExifVersion[n]);t.ExifVersion=r}return t},GPS:function(){var t;return t=i(c.gpsIFD,s.gps),t.GPSVersionID&&"array"===e.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join(".")),t},setExif:function(e,t){return"PixelXDimension"!==e&&"PixelYDimension"!==e?!1:o("exif",e,t)},getBinary:function(){return a.SEGMENT()},purge:function(){a.init(null),a=u=null,c={}}}}}),i(B,[u,h,k,P,U],function(e,t,n,i,r){function o(o){function a(){for(var e=0,t,n;e<=u.length;){if(t=c.SHORT(e+=2),t>=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())):!1},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,P],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;n<i.length;n++,t+=2)if(i[n]!=u.SHORT(t))throw new e.ImageError(e.ImageError.WRONG_FORMAT)}(),d=r.call(this),t.extend(this,{type:"image/png",size:s.length,width:d.width,height:d.height,purge:function(){o.call(this)}}),o.call(this)}return i}),i(G,[u,h,B,z],function(e,t,n,i){return function(r){var o=[n,i],a;a=function(){for(var e=0;e<o.length;e++)try{return new o[e](r)}catch(n){}throw new t.ImageError(t.ImageError.WRONG_FORMAT)}(),e.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){}}),e.extend(this,a),this.purge=function(){a.purge(),a=null}}}),i(q,[],function(){function e(e,i,r){var o=e.naturalWidth,a=e.naturalHeight,s=r.width,u=r.height,c=r.x||0,l=r.y||0,d=i.getContext("2d");t(e)&&(o/=2,a/=2);var f=1024,h=document.createElement("canvas");h.width=h.height=f;for(var p=h.getContext("2d"),m=n(e,o,a),g=0;a>g;){for(var v=g+f>a?a-g:f,y=0;o>y;){var w=y+f>o?o-y:f;p.clearRect(0,0,f,f),p.drawImage(e,-y,-g);var E=y*s/o+c<<0,_=Math.ceil(w*s/o),x=g*u/a/m+l<<0,b=Math.ceil(v*u/a/m);d.drawImage(h,0,0,w,v,E,x,_,b),y+=f}g+=f}h=p=null}function t(e){var t=e.naturalWidth,n=e.naturalHeight;if(t*n>1048576){var i=document.createElement("canvas");i.width=i.height=1;var r=i.getContext("2d");return r.drawImage(e,-t+1,0),0===r.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;){var c=o[4*(u-1)+3];0===c?s=u:a=u,u=s+a>>1}i=null;var l=u/n;return 0===l?1:l}return{isSubsampled:t,renderTo:e}}),i(X,[D,u,h,m,w,G,q,l,d],function(e,t,n,i,r,o,a,s,u){function c(){function e(){if(!E&&!y)throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);return E||y}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;y=new Image,y.onerror=function(){g.call(this),t.trigger("error",n.ImageError.WRONG_FORMAT)},y.onload=function(){t.trigger("load")},y.src=/^data:[^;]*;base64,/.test(e)?e:l(e,x.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)},r.readAsDataURL(e),void 0):t(e.getAsDataURL())}function h(n,i,r,o){var a=this,s,u,c=0,l=0,d,f,h,g;if(R=o,g=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,-1!==t.inArray(g,[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"):(E||(E=document.createElement("canvas")),f=Math.round(d.width*s),h=Math.round(d.height*s),r?(E.width=n,E.height=i,f>n&&(c=Math.round((f-n)/2)),h>i&&(l=Math.round((h-i)/2))):(E.width=f,E.height=h),R||m(E.width,E.height,g),p.call(this,d,E,-c,-l,f,h),this.width=E.width,this.height=E.height,b=!0,void a.trigger("Resize"))}function p(e,t,n,i,r,o){if("iOS"===u.OS)a.renderTo(e,t,{width:r,height:o,x:n,y:i});else{var s=t.getContext("2d");s.drawImage(e,n,i,r,o)}}function m(e,t,n){switch(n){case 5:case 6:case 7:case 8:E.width=t,E.height=e;break;default:E.width=e,E.height=t}var i=E.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 g(){w&&(w.purge(),w=null),_=y=E=x=null,b=!1}var v=this,y,w,E,_,x,b=!1,R=!0;t.extend(this,{loadFromBlob:function(e){var t=this,i=t.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!i.can("access_binary"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);return x=e,e.isDetached()?(_=e.getSource(),void d.call(this,_)):void f.call(this,e.getSource(),function(e){r&&(_=c(e)),d.call(t,e)})},loadFromImage:function(e,t){this.meta=e.meta,x=new r(null,{name:e.name,size:e.size,type:e.type}),d.call(this,t?_=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t=this.getRuntime(),n;return!w&&_&&t.can("access_image_binary")&&(w=new o(_)),n={width:e().width||0,height:e().height||0,type:x.type||s.getFileMime(x.name),size:_&&_.length||x.size||0,name:x.name||"",meta:w&&w.meta||this.meta||{}}},downsize:function(){h.apply(this,arguments)},getAsCanvas:function(){return E&&(E.id=this.uid+"_canvas"),E},getAsBlob:function(e,t){return e!==this.type&&h.call(this,this.width,this.height,!1),new r(null,{name:x.name||"",type:e,data:v.getAsBinaryString.call(this,e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return y.src;if("image/jpeg"!==e)return E.toDataURL("image/png");try{return E.toDataURL("image/jpeg",t/100)}catch(n){return E.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return _||(_=c(v.getAsDataURL(e,t))),_;if("image/jpeg"!==e)_=c(v.getAsDataURL(e,t));else{var n;t||(t=90);try{n=E.toDataURL("image/jpeg",t/100)}catch(i){n=E.toDataURL("image/jpeg")}_=c(n),w&&(_=w.stripHeaders(_),R&&(w.meta&&w.meta.exif&&w.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),_=w.writeHeaders(_)),w.purge(),w=null)}return b=!1,_},destroy:function(){v=null,g.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),i(j,[u,d,f,h,g],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(n){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?!0:!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='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+a.swf_url+'" ',"IE"===t.browser&&(n+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),n+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+a.swf_url+'" /><param name="flashvars" value="uid='+escape(this.uid)+"&target="+t.global_event_dispatcher+'" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>',"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(V,[j,y],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(W,[j],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(Y,[j,m],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($,[j,m],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,r=this.getRuntime();return(i=r.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,[j,u,y,w,T,A,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){var t=this.getRuntime();t.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=s}),i(Z,[j,y],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(K,[j,u,O,y,T],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){var t=this.getRuntime();return t.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(Q,[u,d,f,h,g],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(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(i=l.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<o.length&&a===s);s>=a&&!isNaN(a)&&(t=!0)}}}catch(d){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?!0:!!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='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;"><param name="source" value="'+a.xap_url+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="enablehtmlaccess" value="true"/><param name="initParams" value="uid='+this.uid+",target="+t.global_event_dispatcher+'"/></object>',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(et,[Q,u,V],function(e,t,n){return e.Blob=t.extend({},n)}),i(tt,[Q],function(e){var t={init:function(e){function t(e){for(var t="",n=0;n<e.length;n++)t+=(""!==t?"|":"")+e[n].title+" | *."+e[n].extensions.replace(/,/g,";*.");return t}this.getRuntime().shimExec.call(this,"FileInput","init",t(e.accept),e.name,e.multiple),this.trigger("ready")}};return e.FileInput=t}),i(nt,[Q,f,L],function(e,t,n){var i={init:function(){var e=this,i=e.getRuntime(),r;return r=i.getShimContainer(),n.addEvent(r,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},e.uid),n.addEvent(r,"dragenter",function(e){e.preventDefault();var n=t.get(i.uid).dragEnter(e);n&&e.stopPropagation()},e.uid),n.addEvent(r,"drop",function(e){e.preventDefault();var n=t.get(i.uid).dragDrop(e);n&&e.stopPropagation()},e.uid),i.shimExec.call(this,"FileDrop","init")}};return e.FileDrop=i}),i(it,[Q,u,Y],function(e,t,n){return e.FileReader=t.extend({},n)}),i(rt,[Q,u,$],function(e,t,n){return e.FileReaderSync=t.extend({},n)}),i(ot,[Q,u,J],function(e,t,n){return e.XMLHttpRequest=t.extend({},n)}),i(at,[Q,u,Z],function(e,t,n){return e.Transporter=t.extend({},n)}),i(st,[Q,u,K],function(e,t,n){return e.Image=t.extend({},n,{getInfo:function(){var e=this.getRuntime(),n=["tiff","exif","gps"],i={meta:{}},r=e.shimExec.call(this,"Image","getInfo");return r.meta&&t.each(n,function(e){var t=r.meta[e],n,o,a,s;if(t&&t.keys)for(i.meta[e]={},o=0,a=t.keys.length;a>o;o++)n=t.keys[o],s=t[n],s&&(/^(\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(ut,[u,h,g,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?!0:!!~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(ct,[ut,u,f,L,l,d],function(e,t,n,i,r,o){function a(){function e(){var r=this,l=r.getRuntime(),d,f,h,p,m,g;g=t.guid("uid_"),d=l.getShimContainer(),a&&(h=n.get(a+"_form"),h&&t.extend(h.style,{top:"100%"})),p=document.createElement("form"),p.setAttribute("id",g+"_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%"}),m=document.createElement("input"),m.setAttribute("id",g),m.setAttribute("type","file"),m.setAttribute("name",c.name||"Filedata"),m.setAttribute("accept",u.join(",")),t.extend(m.style,{fontSize:"999px",opacity:0}),p.appendChild(m),d.appendChild(p),t.extend(m.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===o.browser&&o.version<10&&t.extend(m.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),m.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 i(){var e=n.get(g),t=n.get(g+"_form"),o;r.unbind("change",i),r.files.length&&e&&t&&(o=r.files[0],e.setAttribute("id",o.uid),t.setAttribute("id",o.uid+"_form"),t.setAttribute("target",o.uid+"_iframe")),e=t=null},998),m=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){m&&!m.disabled&&m.click(),e.preventDefault()},r.uid)),a=g,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(lt,[ut,F],function(e,t){return e.FileReader=t}),i(dt,[ut,u,f,R,h,L,y,A],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=m.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='<iframe id="'+g+'_iframe" name="'+g+'_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>',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}),w&&p.trigger({type:"uploadprogress",loaded:w.size||1025,total:w.size||1025}))}catch(r){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,m=p.getRuntime(),g,v,y,w;if(u=c=null,f instanceof s&&f.hasBlob()){if(w=f.getBlob(),g=w.uid,y=n.get(g),v=n.get(g+"_form"),!v)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else g=t.guid("uid_"),v=document.createElement("form"),v.setAttribute("id",g+"_form"),v.setAttribute("method",d.method),v.setAttribute("enctype","multipart/form-data"),v.setAttribute("encoding","multipart/form-data"),v.setAttribute("target",g+"_iframe"),m.getShimContainer().appendChild(v);f instanceof s&&f.each(function(e,n){if(e instanceof a)y&&y.setAttribute("name",n);else{var i=document.createElement("input");t.extend(i,{type:"hidden",name:n,value:e}),y?v.insertBefore(i,y):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*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(n){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(ft,[ut,X],function(e,t){return e.Image=t}),a([u,c,l,d,f,h,p,m,g,v,y,w,E,_,x,b,R,T,A,S,O,I,L])}(this);;(function(e){"use strict";var t={},n=e.moxie.core.utils.Basic.inArray;return function r(e){var i,s;for(i in e)s=typeof e[i],s==="object"&&!~n(i,["Exceptions","Env","Mime"])?r(e[i]):s==="function"&&(t[i]=e[i])}(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),t})(this);
/**
 * Plupload - multi-runtime File Uploader
 * v2.1.2
 *
 * Copyright 2013, Moxiecode Systems AB
 * Released under GPL License.
 *
 * License: http://www.plupload.com/license
 * Contributing: http://www.plupload.com/contributing
 *
 * Date: 2014-05-14
 */
;(function(e,t,n){function s(e){function r(e,t,r){var i={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"};i[e]?n[i[e]]=t:r||(n[e]=t)}var t=e.required_features,n={};if(typeof t=="string")o.each(t.split(/\s*,\s*/),function(e){r(e,!0)});else if(typeof t=="object")o.each(t,function(e,t){r(t,e)});else if(t===!0){e.chunk_size>0&&(n.slice_blob=!0);if(e.resize.enabled||!e.multipart)n.send_binary_string=!0;o.each(e,function(e,t){r(t,!!e,!0)})}return n}var r=e.setTimeout,i={},o={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(n){var r=[],i;t.typeOf(n)!=="array"&&(n=[n]);var s=n.length;while(s--)i=t.get(n[s]),i&&r.push(i);return r.length?r: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;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"];for(t=0;t<n.length;t+=2)e=e.replace(n[t],n[t+1]);return e=e.replace(/\s+/g,"_"),e=e.replace(/[^a-z0-9_\-\.]+/gi,""),e},buildUrl:function(e,t){var n="";return o.each(t,function(e,t){n+=(n?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),n&&(e+=(e.indexOf("?")>0?"&":"?")+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 o.translate("N/A");var r=Math.pow(1024,4);return e>r?t(e/r,1)+" "+o.translate("tb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("gb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("mb"):e>1024?Math.round(e/1024)+" "+o.translate("kb"):e+" "+o.translate("b")},parseSize:t.parseSizeStr,predictRuntime:function(e,n){var r,i;return r=new o.Uploader(e),i=t.Runtime.thatCan(r.getOption().required_features,n||e.runtimes),r.destroy(),i},addFileFilter:function(e,t){i[e]=t}};o.addFileFilter("mime_types",function(e,t,n){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:o.FILE_EXTENSION_ERROR,message:o.translate("File extension error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("max_file_size",function(e,t,n){var r;e=o.parseSize(e),t.size!==r&&e&&t.size>e?(this.trigger("Error",{code:o.FILE_SIZE_ERROR,message:o.translate("File size error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("prevent_duplicates",function(e,t,n){if(e){var r=this.files.length;while(r--)if(t.name===this.files[r].name&&t.size===this.files[r].size){this.trigger("Error",{code:o.FILE_DUPLICATE_ERROR,message:o.translate("Duplicate file error."),file:t}),n(!1);return}}n(!0)}),o.Uploader=function(e){function g(){var e,t=0,n;if(this.state==o.STARTED){for(n=0;n<f.length;n++)!e&&f[n].status==o.QUEUED?(e=f[n],this.trigger("BeforeUpload",e)&&(e.status=o.UPLOADING,this.trigger("UploadFile",e))):t++;t==f.length&&(this.state!==o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",f))}}function y(e){e.percent=e.size>0?Math.ceil(e.loaded/e.size*100):100,b()}function b(){var e,t;d.reset();for(e=0;e<f.length;e++)t=f[e],t.size!==n?(d.size+=t.origSize,d.loaded+=t.loaded*t.origSize/t.size):d.size=n,t.status==o.DONE?d.uploaded++:t.status==o.FAILED?d.failed++:d.queued++;d.size===n?d.percent=f.length>0?Math.ceil(d.uploaded/f.length*100):0:(d.bytesPerSec=Math.ceil(d.loaded/((+(new Date)-p||1)/1e3)),d.percent=d.size>0?Math.ceil(d.loaded/d.size*100):0)}function w(){var e=c[0]||h[0];return e?e.getRuntime().uid:!1}function E(e,n){if(e.ruid){var r=t.Runtime.getInfo(e.ruid);if(r)return r.can(n)}return!1}function S(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",O),this.bind("BeforeUpload",C),this.bind("UploadFile",k),this.bind("UploadProgress",L),this.bind("StateChanged",A),this.bind("QueueChanged",b),this.bind("Error",_),this.bind("FileUploaded",M),this.bind("Destroy",D)}function x(e,n){var r=this,i=0,s=[],u={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:l,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};o.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(u[t]=e[t])}),e.browse_button&&o.each(e.browse_button,function(n){s.push(function(s){var a=new t.FileInput(o.extend({},u,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:n}));a.onready=function(){var e=t.Runtime.getInfo(this.ruid);t.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),i++,c.push(this),s()},a.onchange=function(){r.addFile(this.files)},a.bind("mouseenter mouseleave mousedown mouseup",function(r){v||(e.browse_button_hover&&("mouseenter"===r.type?t.addClass(n,e.browse_button_hover):"mouseleave"===r.type&&t.removeClass(n,e.browse_button_hover)),e.browse_button_active&&("mousedown"===r.type?t.addClass(n,e.browse_button_active):"mouseup"===r.type&&t.removeClass(n,e.browse_button_active)))}),a.bind("mousedown",function(){r.trigger("Browse")}),a.bind("error runtimeerror",function(){a=null,s()}),a.init()})}),e.drop_element&&o.each(e.drop_element,function(e){s.push(function(n){var s=new t.FileDrop(o.extend({},u,{drop_zone:e}));s.onready=function(){var e=t.Runtime.getInfo(this.ruid);r.features.dragdrop=e.can("drag_and_drop"),i++,h.push(this),n()},s.ondrop=function(){r.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,n()}),s.init()})}),t.inSeries(s,function(){typeof n=="function"&&n(i)})}function T(e,r,i){var s=new t.Image;try{s.onload=function(){if(r.width>this.width&&r.height>this.height&&r.quality===n&&r.preserve_headers&&!r.crop)return this.destroy(),i(e);s.downsize(r.width,r.height,r.crop,r.preserve_headers)},s.onresize=function(){i(this.getAsBlob(e.type,r.quality)),this.destroy()},s.onerror=function(){i(e)},s.load(e)}catch(o){i(e)}}function N(e,n,r){function f(e,t,n){var r=a[e];switch(e){case"max_file_size":e==="max_file_size"&&(a.max_file_size=a.filters.max_file_size=t);break;case"chunk_size":if(t=o.parseSize(t))a[e]=t,a.send_file_name=!0;break;case"multipart":a[e]=t,t||(a.send_file_name=!0);break;case"unique_names":a[e]=t,t&&(a.send_file_name=!0);break;case"filters":o.typeOf(t)==="array"&&(t={mime_types:t}),n?o.extend(a.filters,t):a.filters=t,t.mime_types&&(a.filters.mime_types.regexp=function(e){var t=[];return o.each(e,function(e){o.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")}(a.filters.mime_types));break;case"resize":n?o.extend(a.resize,t,{enabled:!0}):a.resize=t;break;case"prevent_duplicates":a.prevent_duplicates=a.filters.prevent_duplicates=!!t;break;case"browse_button":case"drop_element":t=o.get(t);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":a[e]=t,n||(u=!0);break;default:a[e]=t}n||i.trigger("OptionChanged",e,t,r)}var i=this,u=!1;typeof e=="object"?o.each(e,function(e,t){f(t,e,r)}):f(e,n,r),r?(a.required_features=s(o.extend({},a)),l=s(o.extend({},a,{required_features:!0}))):u&&(i.trigger("Destroy"),x.call(i,a,function(e){e?(i.runtime=t.Runtime.getInfo(w()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})}))}function C(e,t){if(e.settings.unique_names){var n=t.name.match(/\.([^.]+)$/),r="part";n&&(r=n[1]),t.target_name=t.id+"."+r}}function k(e,n){function h(){u-->0?r(p,1e3):(n.loaded=f,e.trigger("Error",{code:o.HTTP_ERROR,message:o.translate("HTTP Error."),file:n,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}))}function p(){var d,v,g={},y;if(n.status!==o.UPLOADING||e.state===o.STOPPED)return;e.settings.send_file_name&&(g.name=n.target_name||n.name),s&&a.chunks&&c.size>s?(y=Math.min(s,c.size-f),d=c.slice(f,f+y)):(y=c.size,d=c),s&&a.chunks&&(e.settings.send_chunk_number?(g.chunk=Math.ceil(f/s),g.chunks=Math.ceil(c.size/s)):(g.offset=f,g.total=c.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){h();return}u=e.settings.max_retries,y<c.size?(d.destroy(),f+=y,n.loaded=Math.min(f,c.size),e.trigger("ChunkUploaded",n,{offset:n.loaded,total:c.size,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}),t.Env.browser==="Android Browser"&&e.trigger("UploadProgress",n)):n.loaded=n.size,d=v=null,!f||f>=c.size?(n.size!=n.origSize&&(c.destroy(),c=null),e.trigger("UploadProgress",n),n.status=o.DONE,e.trigger("FileUploaded",n,{response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()})):r(p,1)},m.onerror=function(){h()},m.onloadend=function(){this.destroy(),m=null},e.settings.multipart&&a.multipart?(m.open("post",i,!0),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),v=new t.FormData,o.each(o.extend(g,e.settings.multipart_params),function(e,t){v.append(t,e)}),v.append(e.settings.file_data_name,d),m.send(v,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(i=o.buildUrl(e.settings.url,o.extend(g,e.settings.multipart_params)),m.open("post",i,!0),m.setRequestHeader("Content-Type","application/octet-stream"),o.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:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var i=e.settings.url,s=e.settings.chunk_size,u=e.settings.max_retries,a=e.features,f=0,c;n.loaded&&(f=n.loaded=s?s*Math.floor(n.loaded/s):0),c=n.getSource(),e.settings.resize.enabled&&E(c,"send_binary_string")&&!!~t.inArray(c.type,["image/jpeg","image/png"])?T.call(this,c,e.settings.resize,function(e){c=e,n.size=e.size,p()}):p()}function L(e,t){y(t)}function A(e){if(e.state==o.STARTED)p=+(new Date);else if(e.state==o.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==o.UPLOADING&&(e.files[t].status=o.QUEUED,b())}function O(){m&&m.abort()}function M(e){b(),r(function(){g.call(e)},1)}function _(e,t){t.code===o.INIT_ERROR?e.destroy():t.file&&(t.file.status=o.FAILED,y(t.file),e.state==o.STARTED&&(e.trigger("CancelUpload"),r(function(){g.call(e)},1)))}function D(e){e.stop(),o.each(f,function(e){e.destroy()}),f=[],c.length&&(o.each(c,function(e){e.destroy()}),c=[]),h.length&&(o.each(h,function(e){e.destroy()}),h=[]),l={},v=!1,p=m=null,d.reset()}var u=o.guid(),a,f=[],l={},c=[],h=[],p,d,v=!1,m;a={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},N.call(this,e,null,!0),d=new o.QueueProgress,o.extend(this,{id:u,uid:u,state:o.STOPPED,features:{},runtime:null,files:f,settings:a,total:d,init:function(){var e=this;typeof a.preinit=="function"?a.preinit(e):o.each(a.preinit,function(t,n){e.bind(n,t)}),S.call(this);if(!a.browse_button||!a.url){this.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")});return}x.call(this,a,function(n){typeof a.init=="function"?a.init(e):o.each(a.init,function(t,n){e.bind(n,t)}),n?(e.runtime=t.Runtime.getInfo(w()).type,e.trigger("Init",{runtime:e.runtime}),e.trigger("PostInit")):e.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})})},setOption:function(e,t){N.call(this,e,t,!this.runtime)},getOption:function(e){return e?a[e]:a},refresh:function(){c.length&&o.each(c,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=o.STARTED&&(this.state=o.STARTED,this.trigger("StateChanged"),g.call(this))},stop:function(){this.state!=o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){v=arguments[0]!==n?arguments[0]:!0,c.length&&o.each(c,function(e){e.disable(v)}),this.trigger("DisableBrowse",v)},getFile:function(e){var t;for(t=f.length-1;t>=0;t--)if(f[t].id===e)return f[t]},addFile:function(e,n){function c(e,n){var r=[];t.each(s.settings.filters,function(t,n){i[n]&&r.push(function(r){i[n].call(s,t,e,function(e){r(!e)})})}),t.inSeries(r,n)}function h(e){var i=t.typeOf(e);if(e instanceof t.File){if(!e.ruid&&!e.isDetached()){if(!l)return!1;e.ruid=l,e.connectRuntime(l)}h(new o.File(e))}else e instanceof t.Blob?(h(e.getSource()),e.destroy()):e instanceof o.File?(n&&(e.name=n),u.push(function(t){c(e,function(n){n||(f.push(e),a.push(e),s.trigger("FileFiltered",e)),r(t,1)})})):t.inArray(i,["file","blob"])!==-1?h(new t.File(null,e)):i==="node"&&t.typeOf(e.files)==="filelist"?t.each(e.files,h):i==="array"&&(n=null,t.each(e,h))}var s=this,u=[],a=[],l;l=w(),h(e),u.length&&t.inSeries(u,function(){a.length&&s.trigger("FilesAdded",a)})},removeFile:function(e){var t=typeof e=="string"?e:e.id;for(var n=f.length-1;n>=0;n--)if(f[n].id===t)return this.splice(n,1)[0]},splice:function(e,t){var r=f.splice(e===n?0:e,t===n?f.length:t),i=!1;return this.state==o.STARTED&&(o.each(r,function(e){if(e.status===o.UPLOADING)return i=!0,!1}),i&&this.stop()),this.trigger("FilesRemoved",r),o.each(r,function(e){e.destroy()}),i&&this.start(),r},bind:function(e,t,n){var r=this;o.Uploader.prototype.bind.call(this,e,function(){var e=[].slice.call(arguments);return e.splice(0,1,r),t.apply(this,e)},0,n)},destroy:function(){this.trigger("Destroy"),a=d=null,this.unbindAll()}})},o.Uploader.prototype=t.EventTarget.instance,o.File=function(){function n(n){o.extend(this,{id:o.guid(),name:n.name||n.fileName,type:n.type||"",size:n.size||n.fileSize,origSize:n.size||n.fileSize,loaded:0,percent:0,status:o.QUEUED,lastModifiedDate:n.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return t.inArray(t.typeOf(e),["blob","file"])!==-1?e:null},getSource:function(){return e[this.id]?e[this.id]:null},destroy:function(){var t=this.getSource();t&&(t.destroy(),delete e[this.id])}}),e[this.id]=n}var e={};return n}(),o.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=o})(window,mOxie);/*!
 * selectivizr v1.0.2 - (c) Keith Clark, freely distributable under the terms of the MIT license.
 * selectivizr.com
 */
(function(j){function A(a){return a.replace(B,h).replace(C,function(a,d,b){for(var a=b.split(","),b=0,e=a.length;b<e;b++){var s=D(a[b].replace(E,h).replace(F,h))+o,l=[];a[b]=s.replace(G,function(a,b,c,d,e){if(b){if(l.length>0){var a=l,f,e=s.substring(0,e).replace(H,i);if(e==i||e.charAt(e.length-1)==o)e+="*";try{f=t(e)}catch(k){}if(f){e=0;for(c=f.length;e<c;e++){for(var d=f[e],h=d.className,j=0,m=a.length;j<m;j++){var g=a[j];if(!RegExp("(^|\\s)"+g.className+"(\\s|$)").test(d.className)&&g.b&&(g.b===!0||g.b(d)===!0))h=u(h,g.className,!0)}d.className=h}}l=[]}return b}else{if(b=c?I(c):!v||v.test(d)?{className:w(d),b:!0}:null)return l.push(b),"."+b.className;return a}})}return d+a.join(",")})}function I(a){var c=!0,d=w(a.slice(1)),b=a.substring(0,5)==":not(",e,f;b&&(a=a.slice(5,-1));var l=a.indexOf("(");l>-1&&(a=a.substring(0,l));if(a.charAt(0)==":")switch(a.slice(1)){case "root":c=function(a){return b?a!=p:a==p};break;case "target":if(m==8){c=function(a){function c(){var d=location.hash,e=d.slice(1);return b?d==i||a.id!=e:d!=i&&a.id==e}k(j,"hashchange",function(){g(a,d,c())});return c()};break}return!1;case "checked":c=function(a){J.test(a.type)&&k(a,"propertychange",function(){event.propertyName=="checked"&&g(a,d,a.checked!==b)});return a.checked!==b};break;case "disabled":b=!b;case "enabled":c=function(c){if(K.test(c.tagName))return k(c,"propertychange",function(){event.propertyName=="$disabled"&&g(c,d,c.a===b)}),q.push(c),c.a=c.disabled,c.disabled===b;return a==":enabled"?b:!b};break;case "focus":e="focus",f="blur";case "hover":e||(e="mouseenter",f="mouseleave");c=function(a){k(a,b?f:e,function(){g(a,d,!0)});k(a,b?e:f,function(){g(a,d,!1)});return b};break;default:if(!L.test(a))return!1}return{className:d,b:c}}function w(a){return M+"-"+(m==6&&N?O++:a.replace(P,function(a){return a.charCodeAt(0)}))}function D(a){return a.replace(x,h).replace(Q,o)}function g(a,c,d){var b=a.className,c=u(b,c,d);if(c!=b)a.className=c,a.parentNode.className+=i}function u(a,c,d){var b=RegExp("(^|\\s)"+c+"(\\s|$)"),e=b.test(a);return d?e?a:a+o+c:e?a.replace(b,h).replace(x,h):a}function k(a,c,d){a.attachEvent("on"+c,d)}function r(a,c){if(/^https?:\/\//i.test(a))return c.substring(0,c.indexOf("/",8))==a.substring(0,a.indexOf("/",8))?a:null;if(a.charAt(0)=="/")return c.substring(0,c.indexOf("/",8))+a;var d=c.split(/[?#]/)[0];a.charAt(0)!="?"&&d.charAt(d.length-1)!="/"&&(d=d.substring(0,d.lastIndexOf("/")+1));return d+a}function y(a){if(a)return n.open("GET",a,!1),n.send(),(n.status==200?n.responseText:i).replace(R,i).replace(S,function(c,d,b,e,f){return y(r(b||f,a))}).replace(T,function(c,d,b){d=d||i;return" url("+d+r(b,a)+d+") "});return i}function U(){var a,c;a=f.getElementsByTagName("BASE");for(var d=a.length>0?a[0].href:f.location.href,b=0;b<f.styleSheets.length;b++)if(c=f.styleSheets[b],c.href!=i&&(a=r(c.href,d)))c.cssText=A(y(a));q.length>0&&setInterval(function(){for(var a=0,c=q.length;a<c;a++){var b=q[a];if(b.disabled!==b.a)b.disabled?(b.disabled=!1,b.a=!0,b.disabled=!0):b.a=b.disabled}},250)}if(!/*@cc_on!@*/true){var f=document,p=f.documentElement,n=function(){if(j.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return null}}(),m=/MSIE (\d+)/.exec(navigator.userAgent)[1];if(!(f.compatMode!="CSS1Compat"||m<6||m>8||!n)){var z={NW:"*.Dom.select",MooTools:"$$",DOMAssistant:"*.$",Prototype:"$$",YAHOO:"*.util.Selector.query",Sizzle:"*",jQuery:"*",dojo:"*.query"},t,q=[],O=0,N=!0,M="slvzr",R=/(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g,S=/@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))[^;]*;/g,T=/\burl\(\s*(["']?)(?!data:)([^"')]+)\1\s*\)/g,L=/^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/,B=/:(:first-(?:line|letter))/g,C=/(^|})\s*([^\{]*?[\[:][^{]+)/g,G=/([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g,H=/(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g,P=/[^\w-]/g,K=/^(INPUT|SELECT|TEXTAREA|BUTTON)$/,J=/^(checkbox|radio)$/,v=m>6?/[\$\^*]=(['"])\1/:null,E=/([(\[+~])\s+/g,F=/\s+([)\]+~])/g,Q=/\s+/g,x=/^\s*((?:[\S\s]*\S)?)\s*$/,i="",o=" ",h="$1";(function(a,c){function d(){try{p.doScroll("left")}catch(a){setTimeout(d,50);return}b("poll")}function b(d){if(!(d.type=="readystatechange"&&f.readyState!="complete")&&((d.type=="load"?a:f).detachEvent("on"+d.type,b,!1),!e&&(e=!0)))c.call(a,d.type||d)}var e=!1,g=!0;if(f.readyState=="complete")c.call(a,i);else{if(f.createEventObject&&p.doScroll){try{g=!a.frameElement}catch(h){}g&&d()}k(f,"readystatechange",b);k(a,"load",b)}})(j,function(){for(var a in z){var c,d,b=j;if(j[a]){for(c=z[a].replace("*",a).split(".");(d=c.shift())&&(b=b[d]););if(typeof b=="function"){t=b;U();break}}}})}}})(this);/*!
 * typeahead.js 0.9.3
 * https://github.com/twitter/typeahead
 * Copyright 2013 Twitter, Inc. and other contributors; Licensed MIT
 */

!function(a){var b="0.9.3",c={isMsie:function(){var a=/(msie) ([\w.]+)/i.exec(navigator.userAgent);return a?parseInt(a[2],10):!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},bind:a.proxy,bindAll:function(b){var c;for(var d in b)a.isFunction(c=b[d])&&(b[d]=a.proxy(c,b))},indexOf:function(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1},each:a.each,map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,getUniqueId:function(){var a=0;return function(){return a++}}(),defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},tokenizeQuery:function(b){return a.trim(b).toLowerCase().split(/[\s]+/)},tokenizeText:function(b){return a.trim(b).toLowerCase().split(/[\s\-_]+/)},getProtocol:function(){return location.protocol},noop:function(){}},d=function(){var a=/\s+/;return{on:function(b,c){var d;if(!c)return this;for(this._callbacks=this._callbacks||{},b=b.split(a);d=b.shift();)this._callbacks[d]=this._callbacks[d]||[],this._callbacks[d].push(c);return this},trigger:function(b,c){var d,e;if(!this._callbacks)return this;for(b=b.split(a);d=b.shift();)if(e=this._callbacks[d])for(var f=0;f<e.length;f+=1)e[f].call(this,{type:d,data:c});return this}}}(),e=function(){function b(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d="typeahead:";return c.mixin(b.prototype,{trigger:function(a){var b=[].slice.call(arguments,1);this.$el.trigger(d+a,b)}}),b}(),f=function(){function a(a){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+this.prefix)}function b(){return(new Date).getTime()}function d(a){return JSON.stringify(c.isUndefined(a)?null:a)}function e(a){return JSON.parse(a)}var f,g;try{f=window.localStorage,f.setItem("~~~","!"),f.removeItem("~~~")}catch(h){f=null}return g=f&&window.JSON?{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},get:function(a){return this.isExpired(a)&&this.remove(a),e(f.getItem(this._prefix(a)))},set:function(a,e,g){return c.isNumber(g)?f.setItem(this._ttlKey(a),d(b()+g)):f.removeItem(this._ttlKey(a)),f.setItem(this._prefix(a),d(e))},remove:function(a){return f.removeItem(this._ttlKey(a)),f.removeItem(this._prefix(a)),this},clear:function(){var a,b,c=[],d=f.length;for(a=0;d>a;a++)(b=f.key(a)).match(this.keyMatcher)&&c.push(b.replace(this.keyMatcher,""));for(a=c.length;a--;)this.remove(c[a]);return this},isExpired:function(a){var d=e(f.getItem(this._ttlKey(a)));return c.isNumber(d)&&b()>d?!0:!1}}:{get:c.noop,set:c.noop,remove:c.noop,clear:c.noop,isExpired:c.noop},c.mixin(a.prototype,g),a}(),g=function(){function a(a){c.bindAll(this),a=a||{},this.sizeLimit=a.sizeLimit||10,this.cache={},this.cachedKeysByAge=[]}return c.mixin(a.prototype,{get:function(a){return this.cache[a]},set:function(a,b){var c;this.cachedKeysByAge.length===this.sizeLimit&&(c=this.cachedKeysByAge.shift(),delete this.cache[c]),this.cache[a]=b,this.cachedKeysByAge.push(a)}}),a}(),h=function(){function b(a){c.bindAll(this),a=c.isString(a)?{url:a}:a,i=i||new g,h=c.isNumber(a.maxParallelRequests)?a.maxParallelRequests:h||6,this.url=a.url,this.wildcard=a.wildcard||"%QUERY",this.filter=a.filter,this.replace=a.replace,this.ajaxSettings={type:"get",cache:a.cache,timeout:a.timeout,dataType:a.dataType||"json",beforeSend:a.beforeSend},this._get=(/^throttle$/i.test(a.rateLimitFn)?c.throttle:c.debounce)(this._get,a.rateLimitWait||300)}function d(){j++}function e(){j--}function f(){return h>j}var h,i,j=0,k={};return c.mixin(b.prototype,{_get:function(a,b){function c(c){var e=d.filter?d.filter(c):c;b&&b(e),i.set(a,c)}var d=this;f()?this._sendRequest(a).done(c):this.onDeckRequestArgs=[].slice.call(arguments,0)},_sendRequest:function(b){function c(){e(),k[b]=null,f.onDeckRequestArgs&&(f._get.apply(f,f.onDeckRequestArgs),f.onDeckRequestArgs=null)}var f=this,g=k[b];return g||(d(),g=k[b]=a.ajax(b,this.ajaxSettings).always(c)),g},get:function(a,b){var d,e,f=this,g=encodeURIComponent(a||"");return b=b||c.noop,d=this.replace?this.replace(this.url,g):this.url.replace(this.wildcard,g),(e=i.get(d))?c.defer(function(){b(f.filter?f.filter(e):e)}):this._get(d,b),!!e}}),b}(),i=function(){function d(b){c.bindAll(this),c.isString(b.template)&&!b.engine&&a.error("no template engine specified"),b.local||b.prefetch||b.remote||a.error("one of local, prefetch, or remote is required"),this.name=b.name||c.getUniqueId(),this.limit=b.limit||5,this.minLength=b.minLength||1,this.header=b.header,this.footer=b.footer,this.valueKey=b.valueKey||"value",this.template=e(b.template,b.engine,this.valueKey),this.local=b.local,this.prefetch=b.prefetch,this.remote=b.remote,this.itemHash={},this.adjacencyList={},this.storage=b.name?new f(b.name):null}function e(a,b,d){var e,f;return c.isFunction(a)?e=a:c.isString(a)?(f=b.compile(a),e=c.bind(f.render,f)):e=function(a){return"<p>"+a[d]+"</p>"},e}var g={thumbprint:"thumbprint",protocol:"protocol",itemHash:"itemHash",adjacencyList:"adjacencyList"};return c.mixin(d.prototype,{_processLocalData:function(a){this._mergeProcessedData(this._processData(a))},_loadPrefetchData:function(d){function e(a){var b=d.filter?d.filter(a):a,e=m._processData(b),f=e.itemHash,h=e.adjacencyList;m.storage&&(m.storage.set(g.itemHash,f,d.ttl),m.storage.set(g.adjacencyList,h,d.ttl),m.storage.set(g.thumbprint,n,d.ttl),m.storage.set(g.protocol,c.getProtocol(),d.ttl)),m._mergeProcessedData(e)}var f,h,i,j,k,l,m=this,n=b+(d.thumbprint||"");return this.storage&&(f=this.storage.get(g.thumbprint),h=this.storage.get(g.protocol),i=this.storage.get(g.itemHash),j=this.storage.get(g.adjacencyList)),k=f!==n||h!==c.getProtocol(),d=c.isString(d)?{url:d}:d,d.ttl=c.isNumber(d.ttl)?d.ttl:864e5,i&&j&&!k?(this._mergeProcessedData({itemHash:i,adjacencyList:j}),l=a.Deferred().resolve()):l=a.getJSON(d.url).done(e),l},_transformDatum:function(a){var b=c.isString(a)?a:a[this.valueKey],d=a.tokens||c.tokenizeText(b),e={value:b,tokens:d};return c.isString(a)?(e.datum={},e.datum[this.valueKey]=a):e.datum=a,e.tokens=c.filter(e.tokens,function(a){return!c.isBlankString(a)}),e.tokens=c.map(e.tokens,function(a){return a.toLowerCase()}),e},_processData:function(a){var b=this,d={},e={};return c.each(a,function(a,f){var g=b._transformDatum(f),h=c.getUniqueId(g.value);d[h]=g,c.each(g.tokens,function(a,b){var d=b.charAt(0),f=e[d]||(e[d]=[h]);!~c.indexOf(f,h)&&f.push(h)})}),{itemHash:d,adjacencyList:e}},_mergeProcessedData:function(a){var b=this;c.mixin(this.itemHash,a.itemHash),c.each(a.adjacencyList,function(a,c){var d=b.adjacencyList[a];b.adjacencyList[a]=d?d.concat(c):c})},_getLocalSuggestions:function(a){var b,d=this,e=[],f=[],g=[];return c.each(a,function(a,b){var d=b.charAt(0);!~c.indexOf(e,d)&&e.push(d)}),c.each(e,function(a,c){var e=d.adjacencyList[c];return e?(f.push(e),(!b||e.length<b.length)&&(b=e),void 0):!1}),f.length<e.length?[]:(c.each(b,function(b,e){var h,i,j=d.itemHash[e];h=c.every(f,function(a){return~c.indexOf(a,e)}),i=h&&c.every(a,function(a){return c.some(j.tokens,function(b){return 0===b.indexOf(a)})}),i&&g.push(j)}),g)},initialize:function(){var b;return this.local&&this._processLocalData(this.local),this.transport=this.remote?new h(this.remote):null,b=this.prefetch?this._loadPrefetchData(this.prefetch):a.Deferred().resolve(),this.local=this.prefetch=this.remote=null,this.initialize=function(){return b},b},getSuggestions:function(a,b){function d(a){f=f.slice(0),c.each(a,function(a,b){var d,e=g._transformDatum(b);return d=c.some(f,function(a){return e.value===a.value}),!d&&f.push(e),f.length<g.limit}),b&&b(f)}var e,f,g=this,h=!1;a.length<this.minLength||(e=c.tokenizeQuery(a),f=this._getLocalSuggestions(e).slice(0,this.limit),f.length<this.limit&&this.transport&&(h=this.transport.get(a,d)),!h&&b&&b(f))}}),d}(),j=function(){function b(b){var d=this;c.bindAll(this),this.specialKeyCodeMap={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},this.$hint=a(b.hint),this.$input=a(b.input).on("blur.tt",this._handleBlur).on("focus.tt",this._handleFocus).on("keydown.tt",this._handleSpecialKeyEvent),c.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){d.specialKeyCodeMap[a.which||a.keyCode]||c.defer(d._compareQueryToInputValue)}):this.$input.on("input.tt",this._compareQueryToInputValue),this.query=this.$input.val(),this.$overflowHelper=e(this.$input)}function e(b){return a("<span></span>").css({position:"absolute",left:"-9999px",visibility:"hidden",whiteSpace:"nowrap",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return a=(a||"").replace(/^\s*/g,"").replace(/\s{2,}/g," "),b=(b||"").replace(/^\s*/g,"").replace(/\s{2,}/g," "),a===b}return c.mixin(b.prototype,d,{_handleFocus:function(){this.trigger("focused")},_handleBlur:function(){this.trigger("blured")},_handleSpecialKeyEvent:function(a){var b=this.specialKeyCodeMap[a.which||a.keyCode];b&&this.trigger(b+"Keyed",a)},_compareQueryToInputValue:function(){var a=this.getInputValue(),b=f(this.query,a),c=b?this.query.length!==a.length:!1;c?this.trigger("whitespaceChanged",{value:this.query}):b||this.trigger("queryChanged",{value:this.query=a})},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(a){this.query=a},getInputValue:function(){return this.$input.val()},setInputValue:function(a,b){this.$input.val(a),!b&&this._compareQueryToInputValue()},getHintValue:function(){return this.$hint.val()},setHintValue:function(a){this.$hint.val(a)},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},isOverflow:function(){return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>this.$input.width()},isCursorAtEnd:function(){var a,b=this.$input.val().length,d=this.$input[0].selectionStart;return c.isNumber(d)?d===b:document.selection?(a=document.selection.createRange(),a.moveStart("character",-b),b===a.text.length):!0}}),b}(),k=function(){function b(b){c.bindAll(this),this.isOpen=!1,this.isEmpty=!0,this.isMouseOverDropdown=!1,this.$menu=a(b.menu).on("mouseenter.tt",this._handleMouseenter).on("mouseleave.tt",this._handleMouseleave).on("click.tt",".tt-suggestion",this._handleSelection).on("mouseover.tt",".tt-suggestion",this._handleMouseover)}function e(a){return a.data("suggestion")}var f={suggestionsList:'<span class="tt-suggestions"></span>'},g={suggestionsList:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"}};return c.mixin(b.prototype,d,{_handleMouseenter:function(){this.isMouseOverDropdown=!0},_handleMouseleave:function(){this.isMouseOverDropdown=!1},_handleMouseover:function(b){var c=a(b.currentTarget);this._getSuggestions().removeClass("tt-is-under-cursor"),c.addClass("tt-is-under-cursor")},_handleSelection:function(b){var c=a(b.currentTarget);this.trigger("suggestionSelected",e(c))},_show:function(){this.$menu.css("display","block")},_hide:function(){this.$menu.hide()},_moveCursor:function(a){var b,c,d,f;if(this.isVisible()){if(b=this._getSuggestions(),c=b.filter(".tt-is-under-cursor"),c.removeClass("tt-is-under-cursor"),d=b.index(c)+a,d=(d+1)%(b.length+1)-1,-1===d)return this.trigger("cursorRemoved"),void 0;-1>d&&(d=b.length-1),f=b.eq(d).addClass("tt-is-under-cursor"),this._ensureVisibility(f),this.trigger("cursorMoved",e(f))}},_getSuggestions:function(){return this.$menu.find(".tt-suggestions > .tt-suggestion")},_ensureVisibility:function(a){var b=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),c=this.$menu.scrollTop(),d=a.position().top,e=d+a.outerHeight(!0);0>d?this.$menu.scrollTop(c+d):e>b&&this.$menu.scrollTop(c+(e-b))},destroy:function(){this.$menu.off(".tt"),this.$menu=null},isVisible:function(){return this.isOpen&&!this.isEmpty},closeUnlessMouseIsOverDropdown:function(){this.isMouseOverDropdown||this.close()},close:function(){this.isOpen&&(this.isOpen=!1,this.isMouseOverDropdown=!1,this._hide(),this.$menu.find(".tt-suggestions > .tt-suggestion").removeClass("tt-is-under-cursor"),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(a){var b={left:"0",right:"auto"},c={left:"auto",right:" 0"};"ltr"===a?this.$menu.css(b):this.$menu.css(c)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getSuggestionUnderCursor:function(){var a=this._getSuggestions().filter(".tt-is-under-cursor").first();return a.length>0?e(a):null},getFirstSuggestion:function(){var a=this._getSuggestions().first();return a.length>0?e(a):null},renderSuggestions:function(b,d){var e,h,i,j,k,l="tt-dataset-"+b.name,m='<div class="tt-suggestion">%body</div>',n=this.$menu.find("."+l);0===n.length&&(h=a(f.suggestionsList).css(g.suggestionsList),n=a("<div></div>").addClass(l).append(b.header).append(h).append(b.footer).appendTo(this.$menu)),d.length>0?(this.isEmpty=!1,this.isOpen&&this._show(),i=document.createElement("div"),j=document.createDocumentFragment(),c.each(d,function(c,d){d.dataset=b.name,e=b.template(d.datum),i.innerHTML=m.replace("%body",e),k=a(i.firstChild).css(g.suggestion).data("suggestion",d),k.children().each(function(){a(this).css(g.suggestionChild)}),j.appendChild(k[0])}),n.show().find(".tt-suggestions").html(j)):this.clearSuggestions(b.name),this.trigger("suggestionsRendered")},clearSuggestions:function(a){var b=a?this.$menu.find(".tt-dataset-"+a):this.$menu.find('[class^="tt-dataset-"]'),c=b.find(".tt-suggestions");b.hide(),c.empty(),0===this._getSuggestions().length&&(this.isEmpty=!0,this._hide())}}),b}(),l=function(){function b(a){var b,d,f;c.bindAll(this),this.$node=e(a.input),this.datasets=a.datasets,this.dir=null,this.eventBus=a.eventBus,b=this.$node.find(".tt-dropdown-menu"),d=this.$node.find(".tt-query"),f=this.$node.find(".tt-hint"),this.dropdownView=new k({menu:b}).on("suggestionSelected",this._handleSelection).on("cursorMoved",this._clearHint).on("cursorMoved",this._setInputValueToSuggestionUnderCursor).on("cursorRemoved",this._setInputValueToQuery).on("cursorRemoved",this._updateHint).on("suggestionsRendered",this._updateHint).on("opened",this._updateHint).on("closed",this._clearHint).on("opened closed",this._propagateEvent),this.inputView=new j({input:d,hint:f}).on("focused",this._openDropdown).on("blured",this._closeDropdown).on("blured",this._setInputValueToQuery).on("enterKeyed tabKeyed",this._handleSelection).on("queryChanged",this._clearHint).on("queryChanged",this._clearSuggestions).on("queryChanged",this._getSuggestions).on("whitespaceChanged",this._updateHint).on("queryChanged whitespaceChanged",this._openDropdown).on("queryChanged whitespaceChanged",this._setLanguageDirection).on("escKeyed",this._closeDropdown).on("escKeyed",this._setInputValueToQuery).on("tabKeyed upKeyed downKeyed",this._managePreventDefault).on("upKeyed downKeyed",this._moveDropdownCursor).on("upKeyed downKeyed",this._openDropdown).on("tabKeyed leftKeyed rightKeyed",this._autocomplete)}function e(b){var c=a(g.wrapper),d=a(g.dropdown),e=a(b),f=a(g.hint);c=c.css(h.wrapper),d=d.css(h.dropdown),f.css(h.hint).css({backgroundAttachment:e.css("background-attachment"),backgroundClip:e.css("background-clip"),backgroundColor:e.css("background-color"),backgroundImage:e.css("background-image"),backgroundOrigin:e.css("background-origin"),backgroundPosition:e.css("background-position"),backgroundRepeat:e.css("background-repeat"),backgroundSize:e.css("background-size")}),e.data("ttAttrs",{dir:e.attr("dir"),autocomplete:e.attr("autocomplete"),spellcheck:e.attr("spellcheck"),style:e.attr("style")}),e.addClass("tt-query").attr({autocomplete:"off",spellcheck:!1}).css(h.query);try{!e.attr("dir")&&e.attr("dir","auto")}catch(i){}return e.wrap(c).parent().prepend(f).append(d)}function f(a){var b=a.find(".tt-query");c.each(b.data("ttAttrs"),function(a,d){c.isUndefined(d)?b.removeAttr(a):b.attr(a,d)}),b.detach().removeData("ttAttrs").removeClass("tt-query").insertAfter(a),a.remove()}var g={wrapper:'<span class="twitter-typeahead"></span>',hint:'<input class="tt-hint" type="text" autocomplete="off" spellcheck="off" disabled>',dropdown:'<span class="tt-dropdown-menu"></span>'},h={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none"},query:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"}};return c.isMsie()&&c.mixin(h.query,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),c.isMsie()&&c.isMsie()<=7&&(c.mixin(h.wrapper,{display:"inline",zoom:"1"}),c.mixin(h.query,{marginTop:"-1px"})),c.mixin(b.prototype,d,{_managePreventDefault:function(a){var b,c,d=a.data,e=!1;switch(a.type){case"tabKeyed":b=this.inputView.getHintValue(),c=this.inputView.getInputValue(),e=b&&b!==c;break;case"upKeyed":case"downKeyed":e=!d.shiftKey&&!d.ctrlKey&&!d.metaKey}e&&d.preventDefault()},_setLanguageDirection:function(){var a=this.inputView.getLanguageDirection();a!==this.dir&&(this.dir=a,this.$node.css("direction",a),this.dropdownView.setLanguageDirection(a))},_updateHint:function(){var a,b,d,e,f,g=this.dropdownView.getFirstSuggestion(),h=g?g.value:null,i=this.dropdownView.isVisible(),j=this.inputView.isOverflow();h&&i&&!j&&(a=this.inputView.getInputValue(),b=a.replace(/\s{2,}/g," ").replace(/^\s+/g,""),d=c.escapeRegExChars(b),e=new RegExp("^(?:"+d+")(.*$)","i"),f=e.exec(h),this.inputView.setHintValue(a+(f?f[1]:"")))},_clearHint:function(){this.inputView.setHintValue("")},_clearSuggestions:function(){this.dropdownView.clearSuggestions()},_setInputValueToQuery:function(){this.inputView.setInputValue(this.inputView.getQuery())},_setInputValueToSuggestionUnderCursor:function(a){var b=a.data;this.inputView.setInputValue(b.value,!0)},_openDropdown:function(){this.dropdownView.open()},_closeDropdown:function(a){this.dropdownView["blured"===a.type?"closeUnlessMouseIsOverDropdown":"close"]()},_moveDropdownCursor:function(a){var b=a.data;b.shiftKey||b.ctrlKey||b.metaKey||this.dropdownView["upKeyed"===a.type?"moveCursorUp":"moveCursorDown"]()},_handleSelection:function(a){var b="suggestionSelected"===a.type,d=b?a.data:this.dropdownView.getSuggestionUnderCursor();d&&(this.inputView.setInputValue(d.value),b?this.inputView.focus():a.data.preventDefault(),b&&c.isMsie()?c.defer(this.dropdownView.close):this.dropdownView.close(),this.eventBus.trigger("selected",d.datum,d.dataset))},_getSuggestions:function(){var a=this,b=this.inputView.getQuery();c.isBlankString(b)||c.each(this.datasets,function(c,d){d.getSuggestions(b,function(c){b===a.inputView.getQuery()&&a.dropdownView.renderSuggestions(d,c)})})},_autocomplete:function(a){var b,c,d,e,f;("rightKeyed"!==a.type&&"leftKeyed"!==a.type||(b=this.inputView.isCursorAtEnd(),c="ltr"===this.inputView.getLanguageDirection()?"leftKeyed"===a.type:"rightKeyed"===a.type,b&&!c))&&(d=this.inputView.getQuery(),e=this.inputView.getHintValue(),""!==e&&d!==e&&(f=this.dropdownView.getFirstSuggestion(),this.inputView.setInputValue(f.value),this.eventBus.trigger("autocompleted",f.datum,f.dataset)))},_propagateEvent:function(a){this.eventBus.trigger(a.type)},destroy:function(){this.inputView.destroy(),this.dropdownView.destroy(),f(this.$node),this.$node=null},setQuery:function(a){this.inputView.setQuery(a),this.inputView.setInputValue(a),this._clearHint(),this._clearSuggestions(),this._getSuggestions()}}),b}();!function(){var b,d={},f="ttView";b={initialize:function(b){function g(){var b,d=a(this),g=new e({el:d});b=c.map(h,function(a){return a.initialize()}),d.data(f,new l({input:d,eventBus:g=new e({el:d}),datasets:h})),a.when.apply(a,b).always(function(){c.defer(function(){g.trigger("initialized")})})}var h;return b=c.isArray(b)?b:[b],0===b.length&&a.error("no datasets provided"),h=c.map(b,function(a){var b=d[a.name]?d[a.name]:new i(a);return a.name&&(d[a.name]=b),b}),this.each(g)},destroy:function(){function b(){var b=a(this),c=b.data(f);c&&(c.destroy(),b.removeData(f))}return this.each(b)},setQuery:function(b){function c(){var c=a(this).data(f);c&&c.setQuery(b)}return this.each(c)}},jQuery.fn.typeahead=function(a){return b[a]?b[a].apply(this,[].slice.call(arguments,1)):b.initialize.apply(this,arguments)}}()}(window.jQuery);/*!
 * ZeroClipboard
 * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
 * Copyright (c) 2014 Jon Rohan, James M. Greene
 * Licensed MIT
 * http://zeroclipboard.org/
 * v2.1.6
 */
!function(a,b){"use strict";var c,d,e=a,f=e.document,g=e.navigator,h=e.setTimeout,i=e.encodeURIComponent,j=e.ActiveXObject,k=e.Error,l=e.Number.parseInt||e.parseInt,m=e.Number.parseFloat||e.parseFloat,n=e.Number.isNaN||e.isNaN,o=e.Math.round,p=e.Date.now,q=e.Object.keys,r=e.Object.defineProperty,s=e.Object.prototype.hasOwnProperty,t=e.Array.prototype.slice,u=function(){var a=function(a){return a};if("function"==typeof e.wrap&&"function"==typeof e.unwrap)try{var b=f.createElement("div"),c=e.unwrap(b);1===b.nodeType&&c&&1===c.nodeType&&(a=e.unwrap)}catch(d){}return a}(),v=function(a){return t.call(a,0)},w=function(){var a,c,d,e,f,g,h=v(arguments),i=h[0]||{};for(a=1,c=h.length;c>a;a++)if(null!=(d=h[a]))for(e in d)s.call(d,e)&&(f=i[e],g=d[e],i!==g&&g!==b&&(i[e]=g));return i},x=function(a){var b,c,d,e;if("object"!=typeof a||null==a)b=a;else if("number"==typeof a.length)for(b=[],c=0,d=a.length;d>c;c++)s.call(a,c)&&(b[c]=x(a[c]));else{b={};for(e in a)s.call(a,e)&&(b[e]=x(a[e]))}return b},y=function(a,b){for(var c={},d=0,e=b.length;e>d;d++)b[d]in a&&(c[b[d]]=a[b[d]]);return c},z=function(a,b){var c={};for(var d in a)-1===b.indexOf(d)&&(c[d]=a[d]);return c},A=function(a){if(a)for(var b in a)s.call(a,b)&&delete a[b];return a},B=function(a,b){if(a&&1===a.nodeType&&a.ownerDocument&&b&&(1===b.nodeType&&b.ownerDocument&&b.ownerDocument===a.ownerDocument||9===b.nodeType&&!b.ownerDocument&&b===a.ownerDocument))do{if(a===b)return!0;a=a.parentNode}while(a);return!1},C=function(a){var b;return"string"==typeof a&&a&&(b=a.split("#")[0].split("?")[0],b=a.slice(0,a.lastIndexOf("/")+1)),b},D=function(a){var b,c;return"string"==typeof a&&a&&(c=a.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),c&&c[1]?b=c[1]:(c=a.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),c&&c[1]&&(b=c[1]))),b},E=function(){var a,b;try{throw new k}catch(c){b=c}return b&&(a=b.sourceURL||b.fileName||D(b.stack)),a},F=function(){var a,c,d;if(f.currentScript&&(a=f.currentScript.src))return a;if(c=f.getElementsByTagName("script"),1===c.length)return c[0].src||b;if("readyState"in c[0])for(d=c.length;d--;)if("interactive"===c[d].readyState&&(a=c[d].src))return a;return"loading"===f.readyState&&(a=c[c.length-1].src)?a:(a=E())?a:b},G=function(){var a,c,d,e=f.getElementsByTagName("script");for(a=e.length;a--;){if(!(d=e[a].src)){c=null;break}if(d=C(d),null==c)c=d;else if(c!==d){c=null;break}}return c||b},H=function(){var a=C(F())||G()||"";return a+"ZeroClipboard.swf"},I={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,unavailable:null,deactivated:null,overdue:null,ready:null},J="11.0.0",K={},L={},M=null,N={ready:"Flash communication is established",error:{"flash-disabled":"Flash is disabled or not installed","flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate","flash-overdue":"Flash communication was established but NOT within the acceptable time limit"}},O={swfPath:H(),trustedDomains:a.location.host?[a.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},P=function(a){if("object"==typeof a&&null!==a)for(var b in a)if(s.call(a,b))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(b))O[b]=a[b];else if(null==I.bridge)if("containerId"===b||"swfObjectId"===b){if(!cb(a[b]))throw new Error("The specified `"+b+"` value is not valid as an HTML4 Element ID");O[b]=a[b]}else O[b]=a[b];{if("string"!=typeof a||!a)return x(O);if(s.call(O,a))return O[a]}},Q=function(){return{browser:y(g,["userAgent","platform","appName"]),flash:z(I,["bridge"]),zeroclipboard:{version:Fb.version,config:Fb.config()}}},R=function(){return!!(I.disabled||I.outdated||I.unavailable||I.deactivated)},S=function(a,b){var c,d,e,f={};if("string"==typeof a&&a)e=a.toLowerCase().split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)s.call(a,c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&Fb.on(c,a[c]);if(e&&e.length){for(c=0,d=e.length;d>c;c++)a=e[c].replace(/^on/,""),f[a]=!0,K[a]||(K[a]=[]),K[a].push(b);if(f.ready&&I.ready&&Fb.emit({type:"ready"}),f.error){var g=["disabled","outdated","unavailable","deactivated","overdue"];for(c=0,d=g.length;d>c;c++)if(I[g[c]]===!0){Fb.emit({type:"error",name:"flash-"+g[c]});break}}}return Fb},T=function(a,b){var c,d,e,f,g;if(0===arguments.length)f=q(K);else if("string"==typeof a&&a)f=a.split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)s.call(a,c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&Fb.off(c,a[c]);if(f&&f.length)for(c=0,d=f.length;d>c;c++)if(a=f[c].toLowerCase().replace(/^on/,""),g=K[a],g&&g.length)if(b)for(e=g.indexOf(b);-1!==e;)g.splice(e,1),e=g.indexOf(b,e);else g.length=0;return Fb},U=function(a){var b;return b="string"==typeof a&&a?x(K[a])||null:x(K)},V=function(a){var b,c,d;return a=db(a),a&&!jb(a)?"ready"===a.type&&I.overdue===!0?Fb.emit({type:"error",name:"flash-overdue"}):(b=w({},a),ib.call(this,b),"copy"===a.type&&(d=pb(L),c=d.data,M=d.formatMap),c):void 0},W=function(){if("boolean"!=typeof I.ready&&(I.ready=!1),!Fb.isFlashUnusable()&&null===I.bridge){var a=O.flashLoadTimeout;"number"==typeof a&&a>=0&&h(function(){"boolean"!=typeof I.deactivated&&(I.deactivated=!0),I.deactivated===!0&&Fb.emit({type:"error",name:"flash-deactivated"})},a),I.overdue=!1,nb()}},X=function(){Fb.clearData(),Fb.blur(),Fb.emit("destroy"),ob(),Fb.off()},Y=function(a,b){var c;if("object"==typeof a&&a&&"undefined"==typeof b)c=a,Fb.clearData();else{if("string"!=typeof a||!a)return;c={},c[a]=b}for(var d in c)"string"==typeof d&&d&&s.call(c,d)&&"string"==typeof c[d]&&c[d]&&(L[d]=c[d])},Z=function(a){"undefined"==typeof a?(A(L),M=null):"string"==typeof a&&s.call(L,a)&&delete L[a]},$=function(a){return"undefined"==typeof a?x(L):"string"==typeof a&&s.call(L,a)?L[a]:void 0},_=function(a){if(a&&1===a.nodeType){c&&(xb(c,O.activeClass),c!==a&&xb(c,O.hoverClass)),c=a,wb(a,O.hoverClass);var b=a.getAttribute("title")||O.title;if("string"==typeof b&&b){var d=mb(I.bridge);d&&d.setAttribute("title",b)}var e=O.forceHandCursor===!0||"pointer"===yb(a,"cursor");Cb(e),Bb()}},ab=function(){var a=mb(I.bridge);a&&(a.removeAttribute("title"),a.style.left="0px",a.style.top="-9999px",a.style.width="1px",a.style.top="1px"),c&&(xb(c,O.hoverClass),xb(c,O.activeClass),c=null)},bb=function(){return c||null},cb=function(a){return"string"==typeof a&&a&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(a)},db=function(a){var b;if("string"==typeof a&&a?(b=a,a={}):"object"==typeof a&&a&&"string"==typeof a.type&&a.type&&(b=a.type),b){!a.target&&/^(copy|aftercopy|_click)$/.test(b.toLowerCase())&&(a.target=d),w(a,{type:b.toLowerCase(),target:a.target||c||null,relatedTarget:a.relatedTarget||null,currentTarget:I&&I.bridge||null,timeStamp:a.timeStamp||p()||null});var e=N[a.type];return"error"===a.type&&a.name&&e&&(e=e[a.name]),e&&(a.message=e),"ready"===a.type&&w(a,{target:null,version:I.version}),"error"===a.type&&(/^flash-(disabled|outdated|unavailable|deactivated|overdue)$/.test(a.name)&&w(a,{target:null,minimumVersion:J}),/^flash-(outdated|unavailable|deactivated|overdue)$/.test(a.name)&&w(a,{version:I.version})),"copy"===a.type&&(a.clipboardData={setData:Fb.setData,clearData:Fb.clearData}),"aftercopy"===a.type&&(a=qb(a,M)),a.target&&!a.relatedTarget&&(a.relatedTarget=eb(a.target)),a=fb(a)}},eb=function(a){var b=a&&a.getAttribute&&a.getAttribute("data-clipboard-target");return b?f.getElementById(b):null},fb=function(a){if(a&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(a.type)){var c=a.target,d="_mouseover"===a.type&&a.relatedTarget?a.relatedTarget:b,g="_mouseout"===a.type&&a.relatedTarget?a.relatedTarget:b,h=Ab(c),i=e.screenLeft||e.screenX||0,j=e.screenTop||e.screenY||0,k=f.body.scrollLeft+f.documentElement.scrollLeft,l=f.body.scrollTop+f.documentElement.scrollTop,m=h.left+("number"==typeof a._stageX?a._stageX:0),n=h.top+("number"==typeof a._stageY?a._stageY:0),o=m-k,p=n-l,q=i+o,r=j+p,s="number"==typeof a.movementX?a.movementX:0,t="number"==typeof a.movementY?a.movementY:0;delete a._stageX,delete a._stageY,w(a,{srcElement:c,fromElement:d,toElement:g,screenX:q,screenY:r,pageX:m,pageY:n,clientX:o,clientY:p,x:o,y:p,movementX:s,movementY:t,offsetX:0,offsetY:0,layerX:0,layerY:0})}return a},gb=function(a){var b=a&&"string"==typeof a.type&&a.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(b)},hb=function(a,b,c,d){d?h(function(){a.apply(b,c)},0):a.apply(b,c)},ib=function(a){if("object"==typeof a&&a&&a.type){var b=gb(a),c=K["*"]||[],d=K[a.type]||[],f=c.concat(d);if(f&&f.length){var g,h,i,j,k,l=this;for(g=0,h=f.length;h>g;g++)i=f[g],j=l,"string"==typeof i&&"function"==typeof e[i]&&(i=e[i]),"object"==typeof i&&i&&"function"==typeof i.handleEvent&&(j=i,i=i.handleEvent),"function"==typeof i&&(k=w({},a),hb(i,j,[k],b))}return this}},jb=function(a){var b=a.target||c||null,e="swf"===a._source;delete a._source;var f=["flash-disabled","flash-outdated","flash-unavailable","flash-deactivated","flash-overdue"];switch(a.type){case"error":-1!==f.indexOf(a.name)&&w(I,{disabled:"flash-disabled"===a.name,outdated:"flash-outdated"===a.name,unavailable:"flash-unavailable"===a.name,deactivated:"flash-deactivated"===a.name,overdue:"flash-overdue"===a.name,ready:!1});break;case"ready":var g=I.deactivated===!0;w(I,{disabled:!1,outdated:!1,unavailable:!1,deactivated:!1,overdue:g,ready:!g});break;case"beforecopy":d=b;break;case"copy":var h,i,j=a.relatedTarget;!L["text/html"]&&!L["text/plain"]&&j&&(i=j.value||j.outerHTML||j.innerHTML)&&(h=j.value||j.textContent||j.innerText)?(a.clipboardData.clearData(),a.clipboardData.setData("text/plain",h),i!==h&&a.clipboardData.setData("text/html",i)):!L["text/plain"]&&a.target&&(h=a.target.getAttribute("data-clipboard-text"))&&(a.clipboardData.clearData(),a.clipboardData.setData("text/plain",h));break;case"aftercopy":Fb.clearData(),b&&b!==vb()&&b.focus&&b.focus();break;case"_mouseover":Fb.focus(b),O.bubbleEvents===!0&&e&&(b&&b!==a.relatedTarget&&!B(a.relatedTarget,b)&&kb(w({},a,{type:"mouseenter",bubbles:!1,cancelable:!1})),kb(w({},a,{type:"mouseover"})));break;case"_mouseout":Fb.blur(),O.bubbleEvents===!0&&e&&(b&&b!==a.relatedTarget&&!B(a.relatedTarget,b)&&kb(w({},a,{type:"mouseleave",bubbles:!1,cancelable:!1})),kb(w({},a,{type:"mouseout"})));break;case"_mousedown":wb(b,O.activeClass),O.bubbleEvents===!0&&e&&kb(w({},a,{type:a.type.slice(1)}));break;case"_mouseup":xb(b,O.activeClass),O.bubbleEvents===!0&&e&&kb(w({},a,{type:a.type.slice(1)}));break;case"_click":d=null,O.bubbleEvents===!0&&e&&kb(w({},a,{type:a.type.slice(1)}));break;case"_mousemove":O.bubbleEvents===!0&&e&&kb(w({},a,{type:a.type.slice(1)}))}return/^_(?:click|mouse(?:over|out|down|up|move))$/.test(a.type)?!0:void 0},kb=function(a){if(a&&"string"==typeof a.type&&a){var b,c=a.target||null,d=c&&c.ownerDocument||f,g={view:d.defaultView||e,canBubble:!0,cancelable:!0,detail:"click"===a.type?1:0,button:"number"==typeof a.which?a.which-1:"number"==typeof a.button?a.button:d.createEvent?0:1},h=w(g,a);c&&d.createEvent&&c.dispatchEvent&&(h=[h.type,h.canBubble,h.cancelable,h.view,h.detail,h.screenX,h.screenY,h.clientX,h.clientY,h.ctrlKey,h.altKey,h.shiftKey,h.metaKey,h.button,h.relatedTarget],b=d.createEvent("MouseEvents"),b.initMouseEvent&&(b.initMouseEvent.apply(b,h),b._source="js",c.dispatchEvent(b)))}},lb=function(){var a=f.createElement("div");return a.id=O.containerId,a.className=O.containerClass,a.style.position="absolute",a.style.left="0px",a.style.top="-9999px",a.style.width="1px",a.style.height="1px",a.style.zIndex=""+Db(O.zIndex),a},mb=function(a){for(var b=a&&a.parentNode;b&&"OBJECT"===b.nodeName&&b.parentNode;)b=b.parentNode;return b||null},nb=function(){var a,b=I.bridge,c=mb(b);if(!b){var d=ub(e.location.host,O),g="never"===d?"none":"all",h=sb(O),i=O.swfPath+rb(O.swfPath,O);c=lb();var j=f.createElement("div");c.appendChild(j),f.body.appendChild(c);var k=f.createElement("div"),l="activex"===I.pluginType;k.innerHTML='<object id="'+O.swfObjectId+'" name="'+O.swfObjectId+'" width="100%" height="100%" '+(l?'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"':'type="application/x-shockwave-flash" data="'+i+'"')+">"+(l?'<param name="movie" value="'+i+'"/>':"")+'<param name="allowScriptAccess" value="'+d+'"/><param name="allowNetworking" value="'+g+'"/><param name="menu" value="false"/><param name="wmode" value="transparent"/><param name="flashvars" value="'+h+'"/></object>',b=k.firstChild,k=null,u(b).ZeroClipboard=Fb,c.replaceChild(b,j)}return b||(b=f[O.swfObjectId],b&&(a=b.length)&&(b=b[a-1]),!b&&c&&(b=c.firstChild)),I.bridge=b||null,b},ob=function(){var a=I.bridge;if(a){var b=mb(a);b&&("activex"===I.pluginType&&"readyState"in a?(a.style.display="none",function c(){if(4===a.readyState){for(var d in a)"function"==typeof a[d]&&(a[d]=null);a.parentNode&&a.parentNode.removeChild(a),b.parentNode&&b.parentNode.removeChild(b)}else h(c,10)}()):(a.parentNode&&a.parentNode.removeChild(a),b.parentNode&&b.parentNode.removeChild(b))),I.ready=null,I.bridge=null,I.deactivated=null}},pb=function(a){var b={},c={};if("object"==typeof a&&a){for(var d in a)if(d&&s.call(a,d)&&"string"==typeof a[d]&&a[d])switch(d.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":b.text=a[d],c.text=d;break;case"text/html":case"html":case"air:html":case"flash:html":b.html=a[d],c.html=d;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":b.rtf=a[d],c.rtf=d}return{data:b,formatMap:c}}},qb=function(a,b){if("object"!=typeof a||!a||"object"!=typeof b||!b)return a;var c={};for(var d in a)if(s.call(a,d)){if("success"!==d&&"data"!==d){c[d]=a[d];continue}c[d]={};var e=a[d];for(var f in e)f&&s.call(e,f)&&s.call(b,f)&&(c[d][b[f]]=e[f])}return c},rb=function(a,b){var c=null==b||b&&b.cacheBust===!0;return c?(-1===a.indexOf("?")?"?":"&")+"noCache="+p():""},sb=function(a){var b,c,d,f,g="",h=[];if(a.trustedDomains&&("string"==typeof a.trustedDomains?f=[a.trustedDomains]:"object"==typeof a.trustedDomains&&"length"in a.trustedDomains&&(f=a.trustedDomains)),f&&f.length)for(b=0,c=f.length;c>b;b++)if(s.call(f,b)&&f[b]&&"string"==typeof f[b]){if(d=tb(f[b]),!d)continue;if("*"===d){h.length=0,h.push(d);break}h.push.apply(h,[d,"//"+d,e.location.protocol+"//"+d])}return h.length&&(g+="trustedOrigins="+i(h.join(","))),a.forceEnhancedClipboard===!0&&(g+=(g?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof a.swfObjectId&&a.swfObjectId&&(g+=(g?"&":"")+"swfObjectId="+i(a.swfObjectId)),g},tb=function(a){if(null==a||""===a)return null;if(a=a.replace(/^\s+|\s+$/g,""),""===a)return null;var b=a.indexOf("//");a=-1===b?a:a.slice(b+2);var c=a.indexOf("/");return a=-1===c?a:-1===b||0===c?null:a.slice(0,c),a&&".swf"===a.slice(-4).toLowerCase()?null:a||null},ub=function(){var a=function(a){var b,c,d,e=[];if("string"==typeof a&&(a=[a]),"object"!=typeof a||!a||"number"!=typeof a.length)return e;for(b=0,c=a.length;c>b;b++)if(s.call(a,b)&&(d=tb(a[b]))){if("*"===d){e.length=0,e.push("*");break}-1===e.indexOf(d)&&e.push(d)}return e};return function(b,c){var d=tb(c.swfPath);null===d&&(d=b);var e=a(c.trustedDomains),f=e.length;if(f>0){if(1===f&&"*"===e[0])return"always";if(-1!==e.indexOf(b))return 1===f&&b===d?"sameDomain":"always"}return"never"}}(),vb=function(){try{return f.activeElement}catch(a){return null}},wb=function(a,b){if(!a||1!==a.nodeType)return a;if(a.classList)return a.classList.contains(b)||a.classList.add(b),a;if(b&&"string"==typeof b){var c=(b||"").split(/\s+/);if(1===a.nodeType)if(a.className){for(var d=" "+a.className+" ",e=a.className,f=0,g=c.length;g>f;f++)d.indexOf(" "+c[f]+" ")<0&&(e+=" "+c[f]);a.className=e.replace(/^\s+|\s+$/g,"")}else a.className=b}return a},xb=function(a,b){if(!a||1!==a.nodeType)return a;if(a.classList)return a.classList.contains(b)&&a.classList.remove(b),a;if("string"==typeof b&&b){var c=b.split(/\s+/);if(1===a.nodeType&&a.className){for(var d=(" "+a.className+" ").replace(/[\n\t]/g," "),e=0,f=c.length;f>e;e++)d=d.replace(" "+c[e]+" "," ");a.className=d.replace(/^\s+|\s+$/g,"")}}return a},yb=function(a,b){var c=e.getComputedStyle(a,null).getPropertyValue(b);return"cursor"!==b||c&&"auto"!==c||"A"!==a.nodeName?c:"pointer"},zb=function(){var a,b,c,d=1;return"function"==typeof f.body.getBoundingClientRect&&(a=f.body.getBoundingClientRect(),b=a.right-a.left,c=f.body.offsetWidth,d=o(b/c*100)/100),d},Ab=function(a){var b={left:0,top:0,width:0,height:0};if(a.getBoundingClientRect){var c,d,g,h=a.getBoundingClientRect();"pageXOffset"in e&&"pageYOffset"in e?(c=e.pageXOffset,d=e.pageYOffset):(g=zb(),c=o(f.documentElement.scrollLeft/g),d=o(f.documentElement.scrollTop/g));var i=f.documentElement.clientLeft||0,j=f.documentElement.clientTop||0;b.left=h.left+c-i,b.top=h.top+d-j,b.width="width"in h?h.width:h.right-h.left,b.height="height"in h?h.height:h.bottom-h.top}return b},Bb=function(){var a;if(c&&(a=mb(I.bridge))){var b=Ab(c);w(a.style,{width:b.width+"px",height:b.height+"px",top:b.top+"px",left:b.left+"px",zIndex:""+Db(O.zIndex)})}},Cb=function(a){I.ready===!0&&(I.bridge&&"function"==typeof I.bridge.setHandCursor?I.bridge.setHandCursor(a):I.ready=!1)},Db=function(a){if(/^(?:auto|inherit)$/.test(a))return a;var b;return"number"!=typeof a||n(a)?"string"==typeof a&&(b=Db(l(a,10))):b=a,"number"==typeof b?b:"auto"},Eb=function(a){function b(a){var b=a.match(/[\d]+/g);return b.length=3,b.join(".")}function c(a){return!!a&&(a=a.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(a)||"chrome.plugin"===a.slice(-13))}function d(a){a&&(i=!0,a.version&&(l=b(a.version)),!l&&a.description&&(l=b(a.description)),a.filename&&(k=c(a.filename)))}var e,f,h,i=!1,j=!1,k=!1,l="";if(g.plugins&&g.plugins.length)e=g.plugins["Shockwave Flash"],d(e),g.plugins["Shockwave Flash 2.0"]&&(i=!0,l="2.0.0.11");else if(g.mimeTypes&&g.mimeTypes.length)h=g.mimeTypes["application/x-shockwave-flash"],e=h&&h.enabledPlugin,d(e);else if("undefined"!=typeof a){j=!0;try{f=new a("ShockwaveFlash.ShockwaveFlash.7"),i=!0,l=b(f.GetVariable("$version"))}catch(n){try{f=new a("ShockwaveFlash.ShockwaveFlash.6"),i=!0,l="6.0.21"}catch(o){try{f=new a("ShockwaveFlash.ShockwaveFlash"),i=!0,l=b(f.GetVariable("$version"))}catch(p){j=!1}}}}I.disabled=i!==!0,I.outdated=l&&m(l)<m(J),I.version=l||"0.0.0",I.pluginType=k?"pepper":j?"activex":i?"netscape":"unknown"};Eb(j);var Fb=function(){return this instanceof Fb?void("function"==typeof Fb._createClient&&Fb._createClient.apply(this,v(arguments))):new Fb};r(Fb,"version",{value:"2.1.6",writable:!1,configurable:!0,enumerable:!0}),Fb.config=function(){return P.apply(this,v(arguments))},Fb.state=function(){return Q.apply(this,v(arguments))},Fb.isFlashUnusable=function(){return R.apply(this,v(arguments))},Fb.on=function(){return S.apply(this,v(arguments))},Fb.off=function(){return T.apply(this,v(arguments))},Fb.handlers=function(){return U.apply(this,v(arguments))},Fb.emit=function(){return V.apply(this,v(arguments))},Fb.create=function(){return W.apply(this,v(arguments))},Fb.destroy=function(){return X.apply(this,v(arguments))},Fb.setData=function(){return Y.apply(this,v(arguments))},Fb.clearData=function(){return Z.apply(this,v(arguments))},Fb.getData=function(){return $.apply(this,v(arguments))},Fb.focus=Fb.activate=function(){return _.apply(this,v(arguments))},Fb.blur=Fb.deactivate=function(){return ab.apply(this,v(arguments))},Fb.activeElement=function(){return bb.apply(this,v(arguments))};var Gb=0,Hb={},Ib=0,Jb={},Kb={};w(O,{autoActivate:!0});var Lb=function(a){var b=this;b.id=""+Gb++,Hb[b.id]={instance:b,elements:[],handlers:{}},a&&b.clip(a),Fb.on("*",function(a){return b.emit(a)}),Fb.on("destroy",function(){b.destroy()}),Fb.create()},Mb=function(a,b){var c,d,e,f={},g=Hb[this.id]&&Hb[this.id].handlers;if("string"==typeof a&&a)e=a.toLowerCase().split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)s.call(a,c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&this.on(c,a[c]);if(e&&e.length){for(c=0,d=e.length;d>c;c++)a=e[c].replace(/^on/,""),f[a]=!0,g[a]||(g[a]=[]),g[a].push(b);if(f.ready&&I.ready&&this.emit({type:"ready",client:this}),f.error){var h=["disabled","outdated","unavailable","deactivated","overdue"];for(c=0,d=h.length;d>c;c++)if(I[h[c]]){this.emit({type:"error",name:"flash-"+h[c],client:this});break}}}return this},Nb=function(a,b){var c,d,e,f,g,h=Hb[this.id]&&Hb[this.id].handlers;if(0===arguments.length)f=q(h);else if("string"==typeof a&&a)f=a.split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)s.call(a,c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&this.off(c,a[c]);if(f&&f.length)for(c=0,d=f.length;d>c;c++)if(a=f[c].toLowerCase().replace(/^on/,""),g=h[a],g&&g.length)if(b)for(e=g.indexOf(b);-1!==e;)g.splice(e,1),e=g.indexOf(b,e);else g.length=0;return this},Ob=function(a){var b=null,c=Hb[this.id]&&Hb[this.id].handlers;return c&&(b="string"==typeof a&&a?c[a]?c[a].slice(0):[]:x(c)),b},Pb=function(a){if(Ub.call(this,a)){"object"==typeof a&&a&&"string"==typeof a.type&&a.type&&(a=w({},a));var b=w({},db(a),{client:this});Vb.call(this,b)}return this},Qb=function(a){a=Wb(a);for(var b=0;b<a.length;b++)if(s.call(a,b)&&a[b]&&1===a[b].nodeType){a[b].zcClippingId?-1===Jb[a[b].zcClippingId].indexOf(this.id)&&Jb[a[b].zcClippingId].push(this.id):(a[b].zcClippingId="zcClippingId_"+Ib++,Jb[a[b].zcClippingId]=[this.id],O.autoActivate===!0&&Xb(a[b]));var c=Hb[this.id]&&Hb[this.id].elements;-1===c.indexOf(a[b])&&c.push(a[b])}return this},Rb=function(a){var b=Hb[this.id];if(!b)return this;var c,d=b.elements;a="undefined"==typeof a?d.slice(0):Wb(a);for(var e=a.length;e--;)if(s.call(a,e)&&a[e]&&1===a[e].nodeType){for(c=0;-1!==(c=d.indexOf(a[e],c));)d.splice(c,1);var f=Jb[a[e].zcClippingId];if(f){for(c=0;-1!==(c=f.indexOf(this.id,c));)f.splice(c,1);0===f.length&&(O.autoActivate===!0&&Yb(a[e]),delete a[e].zcClippingId)}}return this},Sb=function(){var a=Hb[this.id];return a&&a.elements?a.elements.slice(0):[]},Tb=function(){this.unclip(),this.off(),delete Hb[this.id]},Ub=function(a){if(!a||!a.type)return!1;if(a.client&&a.client!==this)return!1;var b=Hb[this.id]&&Hb[this.id].elements,c=!!b&&b.length>0,d=!a.target||c&&-1!==b.indexOf(a.target),e=a.relatedTarget&&c&&-1!==b.indexOf(a.relatedTarget),f=a.client&&a.client===this;return d||e||f?!0:!1},Vb=function(a){if("object"==typeof a&&a&&a.type){var b=gb(a),c=Hb[this.id]&&Hb[this.id].handlers["*"]||[],d=Hb[this.id]&&Hb[this.id].handlers[a.type]||[],f=c.concat(d);if(f&&f.length){var g,h,i,j,k,l=this;for(g=0,h=f.length;h>g;g++)i=f[g],j=l,"string"==typeof i&&"function"==typeof e[i]&&(i=e[i]),"object"==typeof i&&i&&"function"==typeof i.handleEvent&&(j=i,i=i.handleEvent),"function"==typeof i&&(k=w({},a),hb(i,j,[k],b))}return this}},Wb=function(a){return"string"==typeof a&&(a=[]),"number"!=typeof a.length?[a]:a},Xb=function(a){if(a&&1===a.nodeType){var b=function(a){(a||(a=e.event))&&("js"!==a._source&&(a.stopImmediatePropagation(),a.preventDefault()),delete a._source)},c=function(c){(c||(c=e.event))&&(b(c),Fb.focus(a))};a.addEventListener("mouseover",c,!1),a.addEventListener("mouseout",b,!1),a.addEventListener("mouseenter",b,!1),a.addEventListener("mouseleave",b,!1),a.addEventListener("mousemove",b,!1),Kb[a.zcClippingId]={mouseover:c,mouseout:b,mouseenter:b,mouseleave:b,mousemove:b}}},Yb=function(a){if(a&&1===a.nodeType){var b=Kb[a.zcClippingId];if("object"==typeof b&&b){for(var c,d,e=["move","leave","enter","out","over"],f=0,g=e.length;g>f;f++)c="mouse"+e[f],d=b[c],"function"==typeof d&&a.removeEventListener(c,d,!1);delete Kb[a.zcClippingId]}}};Fb._createClient=function(){Lb.apply(this,v(arguments))},Fb.prototype.on=function(){return Mb.apply(this,v(arguments))},Fb.prototype.off=function(){return Nb.apply(this,v(arguments))},Fb.prototype.handlers=function(){return Ob.apply(this,v(arguments))},Fb.prototype.emit=function(){return Pb.apply(this,v(arguments))},Fb.prototype.clip=function(){return Qb.apply(this,v(arguments))},Fb.prototype.unclip=function(){return Rb.apply(this,v(arguments))},Fb.prototype.elements=function(){return Sb.apply(this,v(arguments))},Fb.prototype.destroy=function(){return Tb.apply(this,v(arguments))},Fb.prototype.setText=function(a){return Fb.setData("text/plain",a),this},Fb.prototype.setHtml=function(a){return Fb.setData("text/html",a),this},Fb.prototype.setRichText=function(a){return Fb.setData("application/rtf",a),this},Fb.prototype.setData=function(){return Fb.setData.apply(this,v(arguments)),this},Fb.prototype.clearData=function(){return Fb.clearData.apply(this,v(arguments)),this},Fb.prototype.getData=function(){return Fb.getData.apply(this,v(arguments))},"function"==typeof define&&define.amd?define(function(){return Fb}):"object"==typeof module&&module&&"object"==typeof module.exports&&module.exports?module.exports=Fb:a.ZeroClipboard=Fb}(function(){return this||window}());
//# sourceMappingURL=ZeroClipboard.min.map