KISSY.add("mui/datalazyload",function(t,e,n,a,o){var i=t.Env.host,r=i.document,c="data-ks-lazyload",l="ks-datalazyload",u="-custom",f="default",s="none",d="scroll",g="touchmove",m="resize",h=100,_=0;function v(t){var e,n,a=[],o;return function(i,r){if(r!==0&&!r){r=1}if(r&1&&!n){n=true;t(function(t){e=t;while(o=a.shift()){try{o&&o.apply(null,[e])}catch(n){setTimeout(function(){throw n},0)}}})}if(e){i&&i.apply(null,[e]);return e}if(!(r&2)){i&&a.push(i)}return e}}function p(e,n,a){var o,i=0,r=0,n=n||150;function c(){if(o){o.cancel();o=0}i=t.now();e.apply(a||this,arguments);r=t.now()}return t.mix(function(){if(!i||r>=i&&t.now()-r>n||rn*8){c()}else{if(o){o.cancel()}o=t.later(c,n,0,null,arguments)}},{stop:function(){if(o){o.cancel();o=0}}})}var y=function(e,n,a,o){n=n||c;var i=e.getAttribute(n),r={type:"img",elem:e,src:i},l=!t.isFunction(a)||a(r)!==false;if(l&&r.src){function u(t){if(e.src!=t){e.src=t}e.removeAttribute(n)}if(t.isFunction(o)){t.use("mui/datalazyload/webp",function(t,e){e.isSupport(function(t){u(t?o(r.src):r.src)})})}else{u(r.src)}}};function b(n,a,o){n.style.display=s;n.className="";var i=e.create("
");n.parentNode.insertBefore(i,n);var r=n.value;if(t.isFunction(o)){var c=o({type:"textarea",elem:n,value:r});if(c){r=c}}e.html(i,r,a);return i}function k(t){if(t._ks_lazy_width){return t._ks_lazy_width}return t._ks_lazy_width=e.outerWidth(t)}function w(t){if(t._ks_lazy_height){return t._ks_lazy_height}return t._ks_lazy_height=e.outerHeight(t)}function F(t,n,a){if(!t.offsetWidth){return false}var o=e.offset(t),i=true,r,c=o.left,l=o.top,u={left:c,top:l,right:c+k(t),bottom:l+w(t)};r=z(n,u);if(r&&a){i=z(a,u)}return i&&r}function x(e,n){var a=this;if(!(a instanceof x)){return new x(e,n)}var o=e;if(!t.isPlainObject(o)){o=n||{};if(e){o.container=e}}x.superclass.constructor.call(a,o);a._callbacks={};a._containerIsNotDocument=a.get("container").nodeType!=9;if(t.isArray(o.container)){a._backCompact=1}a["_initLoadEvent"]();a.addElements(o.container);a._loadFn();t.ready(function(){a._loadFn()});a.resume()}x.ATTRS={diff:{value:f},placeholder:{value:"http://g.tbcdn.cn/s.gif"},execScript:{value:true},container:{setter:function(n){n=n||r;if(t.isWindow(n)){n=n.document}else{n=e.get(n);if(e.nodeName(n)=="body"){n=n.ownerDocument}}return n},valueFn:function(){return r}},autoDestroy:{value:true},onStart:{value:null}};function z(t,e){var n={};n.top=Math.max(t.top,e.top);n.bottom=Math.min(t.bottom,e.bottom);n.left=Math.max(t.left,e.left);n.right=Math.min(t.right,e.right);return n.bottom>=n.top&&n.right>=n.left}t.extend(x,a,{_initLoadEvent:function(){var e=this,n=e.get("autoDestroy");e.imgHandle=function(){y(this,e.get("imgFlag"),e.get("onStart"),e.get("webpReplacer"))};e.textareaHandle=function(){e.addElements(b(this,e.get("execScript"),e.get("onStart")))};e._loadFn=p(function(){if(n&&e._counter==0&&t.isEmptyObject(e._callbacks)){e.destroy()}e["_loadItems"]()},h,e)},refresh:function(){this._loadFn()},_loadItems:function(){var e=this,n=e.get("container");if(e._containerIsNotDocument&&!n.offsetWidth){return}e._windowRegion=e["_getBoundingRect"]();if(!e._backCompact&&e._containerIsNotDocument){e._containerRegion=e["_getBoundingRect"](e.get("container"))}t.each(e._callbacks,function(t,n){t&&e._loadItem(n,t)})},_loadItem:function(t,e){var n=this,e=e||n._callbacks[t];if(!e){return true}var a=e.el,o=false,i=e.fn;if(n.get("force")||F(a,n._windowRegion,n._containerRegion)){try{o=i.call(a)}catch(r){setTimeout(function(){throw r},0)}}if(o!==false){delete n._callbacks[t]}return o},addCallback:function(n,a){n=e.get(n);var o=this,i=o._callbacks,r={el:n||document,fn:a||t.noop},c=++_;i[c]=r;if(o._windowRegion){o._loadItem(c,r)}else{o.refresh()}},removeCallback:function(n,a){n=e.get(n);var o=this._callbacks;t.each(o,function(t,e){if(t.el==n&&(a?t.fn==a:1)){delete o[e]}})},getElements:function(){var e=this,n=[],a=[],o=e._callbacks;t.each(o,function(t){if(t.fn==e.imgHandle){n.push(t.el)}if(t.fn==e.textareaHandle){a.push(t.el)}});return{images:this._images,textareas:this._textareas}},addElements:function(n,a){if(typeof n=="string"){n=e.query(n)}else if(!t.isArray(n)){n=[n]}var o=this;o._counter=o._counter||0;t.each(n,function(n){if(!a||a==="img"){t.each(t.filter([n].concat(e.query("img",n)),function(t){return t.getAttribute&&t.getAttribute(o.get("imgFlag")||c)},o),function(t){o.onPlaceHolder=o.onPlaceHolder||v(function(t){var e=new Image,n=o.get("placeholder");e.src=n;e.onload=e.onerror=function(){t(n)}});if(t.offsetWidth){o.addCallback(t,o.imgHandle)}else{o._counter++;t.onload=function(){o._counter--;o.addCallback(t,o.imgHandle)};if(!t.src){o.onPlaceHolder(function(e){if(!t.src){t.src=e}})}}})}if(!a||a==="textarea"){t.each(e.query("textarea."+(o.get("areaFlag")||l),n),function(t){o.addCallback(t,o.textareaHandle)})}})},removeElements:function(n){if(typeof n=="string"){n=e.query(n)}else if(!t.isArray(n)){n=[n]}var a=this,o=a._callbacks;t.each(o,function(e,a){if(t.inArray(e.el,n)){delete o[a]}})},_getBoundingRect:function(n){var a,i,r,c;if(n!==o){a=e.outerHeight(n);i=e.outerWidth(n);var l=e.offset(n);r=l.left;c=l.top}else{a=e.viewportHeight();i=e.viewportWidth();r=e.scrollLeft();c=e.scrollTop()}var u=this.get("diff"),s=u===f?i:u,d=0,g=s,m=u===f?a:u,h=0,_=m,v=r+i,p=c+a;if(t.isObject(u)){d=u.left||0;g=u.right||0;h=u.top||0;_=u.bottom||0}r-=d;v+=g;c-=h;p+=_;return{left:r,top:c,right:v,bottom:p}},pause:function(){var t=this,e=t._loadFn;if(t._destroyed){return}n.remove(i,d,e);n.remove(i,g,e);n.remove(i,m,e);e.stop();if(t._containerIsNotDocument){var a=t.get("container");n.remove(a,d,e);n.remove(a,g,e)}},resume:function(){var t=this,e=t._loadFn;if(t._destroyed){return}n.on(i,d,e);n.on(i,g,e);n.on(i,m,e);if(t._containerIsNotDocument){var a=t.get("container");n.on(a,d,e);n.on(a,g,e)}},destroy:function(){var e=this;e.pause();e._callbacks={};t.log("datalazyload is destroyed!");e.fire("destroy");e._destroyed=1}});function H(n,a,o,i){if(a==="img-src"){a="img"}if(!t.isArray(n)){n=[e.get(n)]}var f=new x(r,{});f.set("imgFlag",o||c+u);f.set("areaFlag",o||l+u);f.set("onStart",i);f.set("force",true);f.addElements(n,a)}x.loadCustomLazyData=H;t.DataLazyload=x;return x},{requires:["dom","event","base"]});KISSY.add("mui/code-tracker",function(n){var e=n.unparam(document.location.search.substring(1));var o="disableSampling"in e;var t="debug"in e;var c=window.g_config||{};var a=window["mmstat"]=new Image;return{configData:{numLev:13,url:document.location.href},config:function(e){return this.configData=n.merge(this.configData,e)},send:function(n){if(!n)return;a.src=n},sendTrack:function(e,a,i,r){var m=this,d=m.configData.numLev,u=n.now()-(r||c&&c.startTime||0);e=Math.max(e,d+4);var s=Math.round(Math.pow(2,e-d));if(!o&&Math.floor(Math.random()*s)>0){return}var l=["[u"+m.configData.url+"]","[t"+u+"]","[c"+a+"]","[r"+s+"]"].join("")+(i||"");var f="",g;try{g=/_nk_=([^;]+)/.exec(document.cookie);if(g){f=decodeURIComponent(g[1])}}catch(h){}if(t){console&&console.log({name:a,time:u+"ms",sampling:"1/"+s,desc:i})}m.send("http://gm.mmstat.com/ued.1.1.2?"+["type=9","id=jstracker","v=0.01","nick="+encodeURIComponent(f),"islogin=0","msg="+encodeURIComponent(l),"file="+encodeURIComponent(m.config.url),"line="+s,"scrolltop="+(document.documentElement&&document.documentElement.scrollTop||document.body&&document.body.scrollTop||0),"screen="+screen.width+"x"+screen.height,"t="+(new Date).valueOf()].join("&"))}}});