(function(n,t){function l(n){return!u(n)&&n instanceof Object&&(u(n.__proto__)?!u(n.call):!u(n.__proto__.call))}function b(n,t,r){for(var u in t)Object.prototype.hasOwnProperty.call(t,u)===i&&r.call(n,u,t[u])}function a(n,t,i,f){return f=!!f,u(n.addEventListener)?v&&(f=r,n.attachEvent(t,i)):n.addEventListener(t,i,f),f}function y(n,t,i,f){return f=!!f,u(n.removeEventListener)?v&&(f=r,n.detachEvent(t,i)):n.addEventListener(t,i,f),f}function f(n,t,r){return(n=new h(n,t,r),n.a===i)?0:(c[n.id]=n,n.id)}function k(t){n.setTimeout(function(){c[t]=e;delete c[t]},0)}function tt(){return i}function p(t,f,e,o){var s=r;u(f)&&(f=n);try{s=t.call(f)}catch(h){if(e===i)throw Error(o).k=h,h;}return s}function h(n,t,f){var s,h;if("ready"===n)n=tt;else if(!l(n))throw Error("defer:01");if(!l(t))throw Error("defer:02");s=f||{};this.id=rt++;this.i=n;this.g=t;s.e=f.interval||50;s.timeout=f.timeout||15e3;this.options=s;this.c=u(f.testDOMReady)?i:!!f.testDOMReady;this.d=this.b=e;this.j=this.a=r;this.c===i&&o===i&&(h=this.test());h===i?this.f(h):this.setTimeout();delete h}function it(){b(this,c,function(n,t){u(t)||t.a!==r||t.j!==i||t.setTimeout()})}function d(n){var t=!!o;return n===i&&(o=i,t!=o&&it()),delete t,o}function s(t){var h=n.document,c;if(o===i||"complete"===h.readyState)return i;if(!u(t)&&!u(t.type)){c=r;switch(t.type){case"DOMContentLoaded":case"load":c=t.returnValue===i;break;case"readystatechange":"complete"===t.readyState&&(c=i)}return c===i&&(y(h,v?"DOMContentLoaded":"onreadystatechange",s,r),y(n,"load",s,r)),c}if(a(n,"load",s,r),h.addEventListener)a(h,"DOMContentLoaded",s,r);else if(v){a(h,"onreadystatechange",s,r);t=r;try{t=n.frameElement===e}catch(l){}t===i&&f(function(){return h.documentElement.doScroll("left"),i},function(){d(i)},{c:r})}return r}function g(n){var e=r,t,o;if("ready"===n.predicate||"ready"===n.p)t="ready";else if(u(n.predicate)){if(u(n.p))return e;t=n.p}else t=n.predicate;if(u(n.handler)){if(u(n.h))return e;o=n.h}else o=n.handler;if(u(n.options)){if(u(n.o))return e;n=n.o}else n=n.options;return f(t,o,n),i}function u(n){return void 0===n||n===e}function nt(n){return o===i?i:d(s(n))}var i=!0,e=null,r=!1,c={},rt=100,o=r,v=!!n.document.detachEvent,w;for(h.prototype.test=function(){return p(this.i,e,r,"")},h.prototype.f=function(n){if(n===i){this.clearTimeout();try{p(this.g,this.options.handlerContext,i,"defer:04:"+this.id)}catch(t){throw t;}this.a=i;k(this.id)}else this.clearTimeout(),this.b=this.setTimeout()},h.prototype.setTimeout=function(){var t=this,i=t.options.timeout;void 0==i||isNaN(i)||((t.d===e&&(t.d=+new Date+i),t.d>+new Date)?t.a===r&&(t.b=n.setTimeout(function(){t.f(t.test())},t.options.e)):(i=t.options.onFail,l(i)&&p(i,e,r,""),k(t.id)))},h.prototype.clearTimeout=function(){isNaN(this.b)||n.clearTimeout(this.b)},f.isFunction=l,f.isNil=u,f.log=function(){},f.forOwnIn=b,f.cancel=function(n){var t=r,n=c[n];return u(n)||(t=n.a=i),t},f.appendScript=function(n,t){var i=document.createElement("script");i&&(i.type="text/javascript",i.src=n,u(t)||"async"!==t&&"defer"!==t||(i[t]=t),document.body.appendChild(i))},f.addEventListener=a,f.removeEventListener=y,f.isReady=nt,f.version=function(){return"1.1"},f(function(){return!!n.document},nt,{e:10,c:r}),t=t||[];0<t.length;)for(w=0;w<t.length;w++)g(t.shift());f.push=g;n.defer=f})(window,window.defer)