(function(n,h,q){if(n[h]===q)n[h]={};h=n[h];var s=n.document,y=location,p=function(a,c,d,e){if(!c||!a)return a;if(d===q)d=true;var f,g,l;if(e&&(l=e.length))for(f=0;f<l;f++){g=e[f];if(g in c)if(d||!(g in a))a[g]=c[g]}else for(g in c)if(d||!(g in a))a[g]=c[g];return a},z=false,u=[],w=false,A=/^#?([\w-]+)$/,B=0;p(h,{version:"1.1.5",__init:function(){this.Env={mods:{},_loadQueue:{}};var a=s.getElementsByTagName("script");this.Config={debug:"",base:a[a.length-1].src.replace(/^(.*)(seed|kissy).*$/i,
"$1"),timeout:10}},ready:function(a){w||this._bindReady();z?a.call(n,this):u.push(a);return this},_bindReady:function(){var a=this,c=s.documentElement.doScroll,d=c?"onreadystatechange":"DOMContentLoaded",e=function(){a._fireReady()};w=true;if(s.readyState==="complete")return e();if(s.addEventListener){var f=function(){s.removeEventListener(d,f,false);e()};s.addEventListener(d,f,false);n.addEventListener("load",e,false)}else{var g=function(){if(s.readyState==="complete"){s.detachEvent(d,g);e()}};s.attachEvent(d,
g);n.attachEvent("onload",e);if(n==n.top){var l=function(){try{c("left");e()}catch(t){setTimeout(l,1)}};l()}}},_fireReady:function(){if(!z){z=true;if(u){for(var a,c=0;a=u[c++];)a.call(n,this);u=null}}},available:function(a,c){if((a=(a+"").match(A)[1])&&h.isFunction(c))var d=1,e=h.later(function(){if(s.getElementById(a)&&(c()||1)||++d>500)e.cancel()},40,true)},mix:p,merge:function(){var a={},c,d=arguments.length;for(c=0;c<d;++c)p(a,arguments[c]);return a},augment:function(){var a=arguments,c=a.length-
2,d=a[0],e=a[c],f=a[c+1],g=1;if(!h.isArray(f)){e=f;f=q;c++}if(!h.isBoolean(e)){e=q;c++}for(;g<c;g++)p(d.prototype,a[g].prototype||a[g],e,f);return d},extend:function(a,c,d,e){if(!c||!a)return a;var f=Object.prototype,g=c.prototype,l=function(t){function o(){}o.prototype=t;return new o}(g);a.prototype=l;l.constructor=a;a.superclass=g;if(c!==Object&&g.constructor===f.constructor)g.constructor=c;d&&p(l,d);e&&p(a,e);return a},namespace:function(){var a=arguments,c=a.length,d=null,e,f,g,l=a[c-1]===true&&
c--;for(e=0;e<c;++e){g=(""+a[e]).split(".");d=l?n:this;for(f=n[g[0]]===d?1:0;f<g.length;++f)d=d[g[f]]=d[g[f]]||{}}return d},app:function(a,c){var d=h.isString(a),e=d?n[a]||{}:a;p(e,this,true,h.__APP_MEMBERS);e.__init();p(e,h.isFunction(c)?c():c);d&&(n[a]=e);return e},log:function(a,c,d){if(h.Config.debug){if(d)a=d+": "+a;if(n.console!==q&&console.log)console[c&&console[c]?c:"log"](a)}},error:function(a){if(h.Config.debug)throw a;},guid:function(a){var c=B++ +"";return a?a+c:c}});h.__init();h.__APP_MEMBERS=
["__init","namespace"];if(y&&(y.search||"").indexOf("ks-debug")!==-1)h.Config.debug=true})(window,"KISSY");
(function(n,h,q){function s(b){var i=typeof b;return b===null||i!=="object"&&i!=="function"}function y(b){return u.slice.call(b)}var p=document,z=p.documentElement,u=Array.prototype,w=u.indexOf,A=u.lastIndexOf,B=u.filter,a=String.prototype.trim,c=Object.prototype.toString,d=encodeURIComponent,e=decodeURIComponent,f=d("[]"),g=/^\s+|\s+$/g,l=/^(\w+)\[\]$/,t=/\S/;h.mix(h,{isUndefined:function(b){return b===q},isBoolean:function(b){return c.call(b)==="[object Boolean]"},isString:function(b){return c.call(b)===
"[object String]"},isNumber:function(b){return c.call(b)==="[object Number]"&&isFinite(b)},isPlainObject:function(b){return b&&c.call(b)==="[object Object]"&&!b.nodeType&&!b.setInterval},isEmptyObject:function(b){for(var i in b)return false;return true},isFunction:function(b){return c.call(b)==="[object Function]"},isArray:function(b){return c.call(b)==="[object Array]"},trim:a?function(b){return b==q?"":a.call(b)}:function(b){return b==q?"":b.toString().replace(g,"")},substitute:function(b,i,j){if(!h.isString(b)||
!h.isPlainObject(i))return b;return b.replace(j||/\\?\{([^{}]+)\}/g,function(k,m){if(k.charAt(0)==="\\")return k.slice(1);return i[m]!==q?i[m]:""})},each:function(b,i,j){var k,m=0,r=b.length,v=r===q||h.isFunction(b);j=j||n;if(v)for(k in b){if(i.call(j,b[k],k,b)===false)break}else for(k=b[0];m<r&&i.call(j,k,m,b)!==false;k=b[++m]);return b},indexOf:w?function(b,i){return w.call(i,b)}:function(b,i){for(var j=0,k=i.length;j<k;++j)if(i[j]===b)return j;return-1},lastIndexOf:A?function(b,i){return A.call(i,
b)}:function(b,i){for(var j=i.length-1;j>=0;j--)if(i[j]===b)break;return j},unique:function(b,i){i&&b.reverse();for(var j=b.slice(),k=0,m,r;k<j.length;){for(r=j[k];(m=h.lastIndexOf(r,j))!==k;)j.splice(m,1);k+=1}i&&j.reverse();return j},inArray:function(b,i){return h.indexOf(b,i)>-1},makeArray:function(b){if(b===null||b===q)return[];if(h.isArray(b))return b;if(typeof b.length!=="number"||h.isString(b)||h.isFunction(b))return[b];return y(b)},filter:B?function(b,i,j){return B.call(b,i,j)}:function(b,
i,j){var k=[];h.each(b,function(m,r,v){i.call(j,m,r,v)&&k.push(m)});return k},param:function(b,i){if(!h.isPlainObject(b))return"";i=i||"&";var j=[],k,m;for(k in b){m=b[k];k=d(k);if(s(m))j.push(k,"=",d(m+""),i);else if(h.isArray(m)&&m.length)for(var r=0,v=m.length;r<v;++r)s(m[r])&&j.push(k,f+"=",d(m[r]+""),i)}j.pop();return j.join("")},unparam:function(b,i){if(typeof b!=="string"||(b=h.trim(b)).length===0)return{};for(var j={},k=b.split(i||"&"),m,r,v,x,C=0,D=k.length;C<D;++C){m=k[C].split("=");r=e(m[0]);
try{v=e(m[1]||"")}catch(E){v=m[1]||""}if((x=r.match(l))&&x[1]){j[x[1]]=j[x[1]]||[];j[x[1]].push(v)}else j[r]=v}return j},later:function(b,i,j,k,m){i=i||0;k=k||{};var r=b,v=h.makeArray(m),x;if(h.isString(b))r=k[b];r||h.error("method undefined");b=function(){r.apply(k,v)};x=j?setInterval(b,i):setTimeout(b,i);return{id:x,interval:j,cancel:function(){this.interval?clearInterval(x):clearTimeout(x)}}},clone:function(b){var i=b,j,k;if(b&&((j=h.isArray(b))||h.isPlainObject(b))){i=j?[]:{};for(k in b)if(b.hasOwnProperty(k))i[k]=
h.clone(b[k])}return i},now:function(){return(new Date).getTime()},globalEval:function(b){if(b&&t.test(b)){var i=p.getElementsByTagName("head")[0]||z,j=p.createElement("script");j.text=b;i.insertBefore(j,i.firstChild);i.removeChild(j)}}});try{y(z.childNodes)}catch(o){y=function(b){for(var i=[],j=b.length-1;j>=0;j--)i[j]=b[j];return i}}})(window,KISSY);
(function(n,h,q){var s=n.document,y=s.getElementsByTagName("head")[0]||s.documentElement,p=2,z=3,u=4,w=h.mix,A=s.createElement("script").readyState?function(a,c){var d=a.onreadystatechange;a.onreadystatechange=function(){var e=a.readyState;if(e==="loaded"||e==="complete"){a.onreadystatechange=null;d&&d();c.call(this)}}}:function(a,c){a.addEventListener("load",c,false)},B=/\.css(?:\?|$)/i;n={add:function(a,c,d){var e=this.Env.mods,f;if(h.isString(a)&&!d&&h.isPlainObject(c)){f={};f[a]=c;a=f}if(h.isPlainObject(a)){h.each(a,
function(g,l){g.name=l;e[l]&&w(g,e[l],false)});w(e,a)}else{d=d||{};f=e[a]||{};a=d.host||f.host||a;f=e[a]||{};w(f,{name:a,status:p});if(!f.fns)f.fns=[];c&&f.fns.push(c);w(e[a]=f,d);f.attach!==false&&this.__isAttached(f.requires)&&this.__attachMod(f)}return this},use:function(a,c,d){a=a.replace(/\s+/g,"").split(",");d=d||{};var e=this,f=e.Env.mods,g=(d||0).global,l,t=a.length,o,b,i;g&&e.__mixMods(g);if(e.__isAttached(a))c&&c(e);else{for(l=0;l<t&&(o=f[a[l]]);l++)if(o.status!==u){if(d.order&&l>0){if(!o.requires)o.requires=
[];o._requires=o.requires.concat();b=a[l-1];if(!h.inArray(b,o.requires)&&!h.inArray(o.name,f[b].requires||[]))o.requires.push(b)}e.__attach(o,function(){if(!i&&e.__isAttached(a)){i=true;if(o._requires)o.requires=o._requires;c&&c(e)}},g)}return e}},__attach:function(a,c,d){function e(){if(f.__isAttached(g)){a.status===p&&f.__attachMod(a);a.status===u&&c()}}for(var f=this,g=a.requires||[],l=0,t=g.length;l<t;l++)f.__attach(f.Env.mods[g[l]],e,d);f.__buildPath(a);f.__load(a,e,d)},__mixMods:function(a){var c=
this.Env.mods,d=a.Env.mods,e;for(e in d)this.__mixMod(c,d,e,a)},__mixMod:function(a,c,d,e){var f=a[d]||{},g=f.status;h.mix(f,h.clone(c[d]));if(g)f.status=g;e&&this.__buildPath(f,e.Config.base);a[d]=f},__attachMod:function(a){var c=this;if(a.fns){h.each(a.fns,function(d){d&&d(c)});a.fns=q}a.status=u},__isAttached:function(a){for(var c=this.Env.mods,d,e=(a=h.makeArray(a)).length-1;e>=0&&(d=c[a[e]]);e--)if(d.status!==u)return false;return true},__load:function(a,c,d){function e(){l[g]=p;if(a.status!==
z){d&&f.__mixMod(f.Env.mods,d.Env.mods,a.name,d);if(a.status!==u)a.status=p;c()}}var f=this,g=a.fullpath,l=h.Env._loadQueue,t=l[g];a.status=a.status||0;if(a.status<1&&t)a.status=t.nodeName?1:p;if(h.isString(a.cssfullpath)){f.getScript(a.cssfullpath);a.cssfullpath=p}if(a.status<1&&g){a.status=1;t=f.getScript(g,{success:function(){KISSY.log(a.name+" is loaded.","info");e()},error:function(){a.status=z;l[g]=p},charset:a.charset});B.test(g)||(l[g]=t)}else a.status===1?A(t,e):c()},__buildPath:function(a,
c){function d(f,g){if(!a[g]&&a[f])a[g]=(c||e.base)+a[f];if(a[g]&&e.debug)a[g]=a[g].replace(/-min/g,"")}var e=this.Config;d("path","fullpath");a.cssfullpath!==p&&d("csspath","cssfullpath")},getScript:function(a,c,d){var e=B.test(a),f=s.createElement(e?"link":"script"),g=c,l,t,o;if(h.isPlainObject(g)){c=g.success;l=g.error;t=g.timeout;d=g.charset}if(e){f.href=a;f.rel="stylesheet"}else{f.src=a;f.async=true}if(d)f.charset=d;if(h.isFunction(c))e?c.call(f):A(f,function(){if(o){o.cancel();o=q}c.call(f)});
if(h.isFunction(l))o=h.later(function(){o=q;l()},(t||this.Config.timeout)*1E3);y.insertBefore(f,y.firstChild);return f}};w(h,n);h.each(n,function(a,c){h.__APP_MEMBERS.push(c)})})(window,KISSY);(function(n){var h={core:{path:"packages/core-min.js",charset:"utf-8"}};n.each(["sizzle","datalazyload","flash","switchable","suggest","overlay","imagezoom","calendar"],function(q){h[q]={path:q+"/"+q+"-pkg-min.js",requires:["core"],charset:"utf-8"}});h.calendar.csspath="calendar/default-min.css";n.add(h)})(KISSY);
/* tb.js for Taobao Shop & Detail by yunqian@taobao.com */
(function(){var c=KISSY,d=g_config.assetsHost||"a.tbcdn.cn",b="s/kissy/1.1.5/packages/core-min.js,",a="s/kissy/1.1.5/datalazyload/datalazyload-pkg.js,s/kissy/1.1.5/suggest/suggest-pkg-min.js,s/kissy/1.1.5/switchable/switchable-pkg-min.js,s/kissy/1.1.5/overlay/overlay-pkg-min.js,s/kissy/1.1.5/imagezoom/imagezoom-pkg-min.js,s/kissy/1.1.5/flash/flash-pkg-min.js,p/global/global-min.js?t=20101213.js";KISSY.app("TB");TB.namespace("mods");TB.add({"tb-core":{fullpath:d+"/??"+(c.DOM?"":b)+a},"mod~global":{requires:["tb-core"]}})})();
/* tshop.js for Taobao Shop & Detail by yunqian@taobao.com */
(function(){var S=KISSY,T,map,doc=document,assetsHost=g_config.assetsHost||"http://a.tbcdn.cn",tshopPath=assetsHost+"/p/tshop/??",modsPath=assetsHost+"/mods/??",isDetail=1===g_config.appId,b,debug=false,u=S.unparam(location.search.slice(1)),l="ks-local" in u,d="ks-debug" in u,p=u["ks-local"]||".";if(S.Config.debug=debug=l||d,l){b="http://test.taobao.com/combo.php?";tshopPath=b+"b="+p+"/assets/p/tshop&f=";modsPath=b+"b="+p+"/assets/mods&f="}S.app("TShop");T=TShop;T.namespace("mods","widgets");map={"tb-core":{fullpath:TB.Env.mods["tb-core"].fullpath}};if(isDetail){S.mix(map,{"tshop-core":{fullpath:tshopPath+"tshop-loader-min.js,tshop-widget-ajaxlistloader-min.js,tshop-init-min.js,tshop-isv-min.js,tshop-tbskip-min.js,tshop-hubble-min.js"+(debug?"":"?t=20110114.js"),requires:["tb-core"]},"static-mods":{fullpath:modsPath+"slide/slide-min.js,c2c-head/c2c-head-min.js,sku/sku-min.js,rank/rank-min.js,switch/switch-min.js,top/top-min.js,guide400/guide400-min.js,b2c-head/b2c-head-min.js,b-usetips/b-usetips-min.js,deal-record/deal-record-min.js,recommendation/recommendation-min.js,tabbar/tabbar-min.js,relative/relative-min.js,reviews/reviews-min.js,guestbook/guestbook-min.js,other-info/other-info-min.js,service/service-min.js,b-sellerinfo/b-sellerinfo-min.js"+(debug?"":"?t=20110117.js"),requires:["tshop-core"]}});S.each(["init","loader","isv","hubble","tbskip","widget~ajax-list-loader"],function(modName){map[modName]={requires:["tshop-core"]}});S.each(["slide","c2c-head","rank","switch","top","guide","b2c-head","b-usetips","recommendation","tabbar","relative","reviews","deal-record","guestbook","other-info","service","sku","b-sellerinfo"],function(modName){map["mod~"+modName]={requires:["static-mods"]}})}else{S.mix(map,{"tshop-fp":{fullpath:tshopPath+"tshop-fp-min.js,tshop-isv-min.js",requires:["tb-core"]},"tshop-hd":{fullpath:modsPath+"c2c-head/c2c-head-min.js,b2c-head/b2c-head-min.js",requires:["tb-core"]},"tshop-mods":{fullpath:modsPath+"rank/rank-min.js,service/service-min.js",requires:["tb-core"]}});


S.each(["c2c-head","b2c-head"],function(modName){map["mod~"+modName]={requires:["tshop-hd"]}});


S.each(["initFP","isv"],function(modName){map[modName]={requires:["tshop-fp"]}});S.each(["rank","service"],function(modName){map["mod~"+modName]={requires:["tshop-mods"]}})}if(debug){S.each(map,function(m){if(m.fullpath){m.fullpath=m.fullpath.replace(/-min/g,"")}})}T.add(map);S.mix(T,{isDetail:function(){return 1===g_config.appId},isMall:function(){var cont=document.getElementById("content"),isMall=((cont||{}).className||"").indexOf("ark")>-1;return cont?(T.isMall=function(){return isMall})():null},addTimeStamp:function(){var now=S.now();return function(url){return url+(url.indexOf("?")===-1?"?":"&")+"t="+now}}(),sendClick:function(type){if(!T.isMall()){new Image().src="http://www.atpanel.com/jsclick?cache="+S.now()+"&auc_detail="+type}else{new Image().src="http://www.atpanel.com/jsclick?cache="+S.now()+"&auc_detail="+type}},renderDesc:function(html){var descEl=doc.getElementById("J_DivItemDesc"),d,win=window;var rate=window.g_config["p"]||1,enableLazyLoad=window.g_config["enable"]||true,re=/(<img[^>]*)(src *= *("[^"]*"|'[^']*'|[^ >]*))/g,imgCount,count=0;imgCount=html.match(re)?html.match(re).length:0;html=html.replace(re,function(m,p1,p2,p3){count++;if(!T.isMall()&&rate&&(rate>0)&&((count/imgCount)>rate)){return[p1,'src="http://a.tbcdn.cn/kissy/1.0.0/build/imglazyload/spaceball.gif"'].join("")}if(!enableLazyLoad||count<6){return m}return[p1,'src="http://a.tbcdn.cn/kissy/1.0.0/build/imglazyload/spaceball.gif" data-ks-lazyload=',p3].join("")});win.g_hubble_item_desc_beforeRender=new Date();(function(){
/*@cc_on
                descEl.innerHTML = html;
                return;
                @*/
d=descEl.cloneNode(false);d.innerHTML=html;descEl.parentNode.replaceChild(d,descEl)})();win.g_hubble_item_desc_rendered=new Date();T.use("tb-core",function(){S.DataLazyload(doc.getElementById("J_DivItemDesc"),{mod:"manual",diff:200})})}});TB.namespace("Detail")})();


TShop.add("initFP",function(i){function m(){var a=c.get("#J_SCollCount"),b;if(a&&(b=f.unparam(a.getAttribute("data-info")))){f.getScript(i.addTimeStamp(b.countUrl)+"&keys="+b.param+"&callback=TShop.setShopStat");i.setShopStat=function(e){e=parseInt(e[b.param],10);if(e>0)a.innerHTML='<span>\u6536\u85cf\u4eba\u6c14\uff1a</span> <a href="'+b.mecuryUrl+'">'+e+"</a>"}}}function n(a){if(a=c.get(a)){var b=a.parentNode,e=function(){""!==a.value?c.addClass(b,"focus"):c.removeClass(b,"focus")};l.on(a,"focus",function(){c.addClass(b,
"focus")});l.on(a,"blur",e);setTimeout(e,0)}}function o(){var a=c.get("#J_HeadCatsPopup");a&&f.Popup(c.get("#content").appendChild(a),{trigger:"#J_HeadCats",delay:0.2,align:{points:["bc","tl"],offset:[-47,4]}})}function p(){var a=c.get("#J_Shopsearch"),b=c.get("#J_ShopSearchInLine");if(a&&b){a.innerHTML=b.innerHTML;a.style.display="block"}a=c.get("#J_Shoppromotions");if((b=c.get("div.shop-basic"))&&a){c.insertAfter(a,b.parentNode);c.removeClass(a,"hidden")}}function q(){var a,b,e=location.hostname.indexOf("tmall.com")!==
-1||location.hostname.indexOf("tmall.net")!==-1;a=c.create('<div id="popupPanel">');k.body.appendChild(a);f.each(c.query(".J_TDialogTrigger"),function(h){var j=h.getAttribute("data-width"),g=h.getAttribute("data-height");b=f.Dialog(a,{trigger:h,width:j,height:g,closable:false,shim:false});b.on("show",function(){var d='<a class="close-btn" href="javascript:void(KISSY.DialogManager.hideAll())"style="position: absolute; top: 5px; right: 4px; outline: none;display: block; width: 15px; height: 15px; background: url(http://a.tbcdn.cn/app/tc/img/close_btn.png) no-repeat; text-decoration: none; text-indent: -99999px">X</a><iframe src="'+
(i.addTimeStamp(h.href)+(e?"&isTmall=1":""))+'" width="'+j+'" height="'+g+'" name="popupIframe" frameborder="0" scrolling="no"></iframe>';this._setSize(j,g);this.center();this.setBody(d);c.hasClass(this.trigger,"tb-favorite")&&i.sendClick("c_collect_item")})})}function r(){var a=k.createElement("div"),b=/[\r\n]+/g,e=[],h,j;f.each([["display","none"],["visibility","hidden"],["width","0"],["text-indent","-\\d{3,}"]],function(g){e.push(g[0]+"\\s*:\\s*"+g[1])});h="<.+(?:"+e.join("|")+").+>";j=new RegExp(h,
"mi");l.on("#content","copy",function(g){var d;if(window.getSelection)d=window.getSelection();else if(k.selection)d=k.selection.createRange();d=d.htmlText||d.getRangeAt(0).cloneContents();if("string"!==typeof d){a.appendChild(d);d=a.innerHTML}d=d.replace(b,"");if(j.test(d)){alert("\u5305\u542b\u6076\u610f\u4ee3\u7801");g.halt()}})}var f=KISSY,c=f.DOM,l=f.Event,k=document;i.initFP=function(){f.Switchable.autoRender("J_TWidget","#content");q();try{var a=document.domain.split(".");document.domain=a.slice(a.length-2).join(".")}catch(b){}TB.namespace("app.popDialog");
TB.app.popDialog.hide=function(){f.DialogManager.hideAll()};i.isMall()?p():o();f.ready(function(){r();n("#J_ShopSKey");m()})}});
TShop.add("isv",function(o){TB.namespace("ISV");o.namespace("ISV");var p=[{isvParam:"u_name/u_visitor/u_item_id/u_item_num_id/u_aload_id/u_session/u_preurl/u_curl/u_title/u_time",isvUrl:"http://data.taobao.linezing.com/log.php"},{isvParam:"u_name/u_visitor/u_item_id/u_item_num_id/u_aload_id/u_session/u_preurl/u_curl/u_title/u_time",isvUrl:"http://tblog.tj.haodianpu.com/tj/tblog.php"},{isvParam:"u_name/u_template_name/u_template_id/u_preurl/u_title",isvUrl:"http://c10.taobao.fenxi001.com/c"}],k=KISSY,
f=window,c=document;o.ISV.Stat=function(){var a={},q=/^http\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?$/,g=function(b){true===a.debugMode&&alert(b);return false},t=function(b){if(0<c.cookie.length){b=c.cookie.match(new RegExp("(^| )"+b+"=([^;]*)(;|$)"));return null===b?"":b[2]}return""},u=function(){return Math.ceil(Math.random()*1E9).toString()},r=function(){return(+new Date).toString().substring(0,10)},v=function(){var b="";try{if(""!==c.referrer)b=c.referrer;else if(null!==f.opener&&undefined!==
f.opener)b=(f.opener.document||0).URL||"";else if(null!==f.parent){b=f.parent.document.URL;if(b===c.URL)b=c.referrer}}catch(d){}return b},w=function(){var b=r();return[u(),"0",b].join("_")},s=function(b){for(var d={u_name:a.nickName.toString(),u_item_id:a.itemId.toString(),u_item_num_id:a.itemNumId.toString(),u_template_name:a.templateName.toString(),u_template_id:a.templateId.toString(),u_visitor:t(a.cnaCookieName),u_session:w(b),u_preurl:encodeURIComponent(v()),u_curl:encodeURIComponent(c.URL),
u_title:encodeURIComponent(c.title),u_aload_id:f.acookie_load_id||"",u_time:r()},i=[],e=0,x=b.length;e<x;e++){var h=b[e];if(String===h.isvUrl.constructor&&String===h.isvParam.constructor)if(true===q.test(h.isvUrl)&&false!==h.isvParam.indexOf("_")){var l=h.isvParam.toLowerCase().replace(/\s+/g,"").split("/");if(0<l.length){for(var j="",m=0,y=l.length;m<y;m++){var n=l[m];if(undefined!==d[n])j+="&"+n+"="+d[n]}if(""!==j){j=j.replace("&","?");i[e]=new Image(1,1);i[e].src=h.isvUrl+j;i[e].onload=function(){return g("Send Successfully")}}}}}},
z=function(){if("-1"===a.shopStats||"-2"==a.shopStats||isNaN(a.shopStats)){k.log(a.validatorUrl+"?nickName="+a.nickName.toString()+"&userId="+a.userId.toString()+"&itemNumId="+a.itemNumId.toString()+"&shopId="+a.shopId.toString()+"&siteId="+a.siteId.toString()+"&shopStats="+a.shopStats.toString());k.getScript(a.validatorUrl+"?nickName="+a.nickName.toString()+"&userId="+a.userId.toString()+"&itemNumId="+a.itemNumId.toString()+"&shopId="+a.shopId.toString()+"&siteId="+a.siteId.toString()+"&shopStats="+
a.shopStats.toString(),function(){if(undefined===TB.ISV.Data||Array!==TB.ISV.Data.constructor||0===TB.ISV.Data.length)return g("Cannot get the valid data");var e=TB.ISV.Data;delete TB.ISV.Data;s(e)})}else if(a.shopStats>0){var b=[],d,i=parseInt(a.shopStats);for(d=0;d<p.length;d++)(i&Math.pow(2,d))>0&&b.push(p[d]);s(b)}};return{init:function(b){a=b||{};k.mix(a,{nickName:"",userId:"",shopId:"",templateName:"",templateId:"",itemId:"",itemNumId:"",siteId:"",shopStats:"-2",cnaCookieName:"cna",sessionLife:1400,
validatorUrl:"http://store.taobao.com/tadget/shop_stats.htm",debugMode:false},false);if(""===a.itemId&&-1!==c.URL.indexOf("?taomi=")){b=$("J_FrmBid");if(null!==b&&b.elements.item_id)a.itemId=b.elements.item_id.value}switch(true){case ""===a.nickName&&""===a.userId&&""===a.shopId:return g("nickName and userId and shopId are all null");case ""===a.cnaCookieName:return g("cnaCookieName is null");case Number!==a.sessionLife.constructor:return g("sessionLife is not a number");case false===q.test(a.validatorUrl):return g("validatorUrl is not a valid url")}z()}}}()});


/*
Copyright 2010, KISSY UI Library v1.1.5
MIT Licensed
build time: Oct 19 22:24
*/
KISSY.add("ua",function(a){var n=navigator.userAgent,p="",j="",b,h={},i=function(d){var q=0;return parseFloat(d.replace(/\./g,function(){return q++===0?".":""}))};if((b=n.match(/AppleWebKit\/([\d.]*)/))&&b[1]){h[p="webkit"]=i(b[1]);if((b=n.match(/Chrome\/([\d.]*)/))&&b[1])h[j="chrome"]=i(b[1]);else if((b=n.match(/\/([\d.]*) Safari/))&&b[1])h[j="safari"]=i(b[1]);if(/ Mobile\//.test(n))h.mobile="apple";else if(b=n.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))h.mobile=b[0].toLowerCase()}else if((b=
n.match(/Presto\/([\d.]*)/))&&b[1]){h[p="presto"]=i(b[1]);if((b=n.match(/Opera\/([\d.]*)/))&&b[1]){h[j="opera"]=i(b[1]);if((b=n.match(/Opera\/.* Version\/([\d.]*)/))&&b[1])h[j]=i(b[1]);if((b=n.match(/Opera Mini[^;]*/))&&b)h.mobile=b[0].toLowerCase();else if((b=n.match(/Opera Mobi[^;]*/))&&b)h.mobile=b[0]}}else if((b=n.match(/MSIE\s([^;]*)/))&&b[1]){h[p="trident"]=0.1;h[j="ie"]=i(b[1]);if((b=n.match(/Trident\/([\d.]*)/))&&b[1])h[p]=i(b[1])}else if(b=n.match(/Gecko/)){h[p="gecko"]=0.1;if((b=n.match(/rv:([\d.]*)/))&&
b[1])h[p]=i(b[1]);if((b=n.match(/Firefox\/([\d.]*)/))&&b[1])h[j="firefox"]=i(b[1])}h.core=p;h.shell=j;h._numberify=i;a.UA=h});
KISSY.add("ua-extra",function(a){var n=a.UA,p=navigator.userAgent,j,b,h={},i=n._numberify;if(p.match(/360SE/))h[b="se360"]=3;else if(p.match(/Maxthon/)&&(j=window.external)){b="maxthon";try{h[b]=i(j.max_version)}catch(d){h[b]=0.1}}else if(j=p.match(/TencentTraveler\s([\d.]*)/))h[b="tt"]=j[1]?i(j[1]):0.1;else if(p.match(/TheWorld/))h[b="theworld"]=3;else if(j=p.match(/SE\s([\d.]*)/))h[b="sougou"]=j[1]?i(j[1]):0.1;b&&(h.shell=b);a.mix(n,h)});
KISSY.add("dom",function(a,n){function p(j,b){return j&&j.nodeType===b}a.DOM={_isElementNode:function(j){return p(j,1)},_isKSNode:function(j){return a.Node&&p(j,a.Node.TYPE)},_getWin:function(j){return j&&"scrollTo"in j&&j.document?j:p(j,9)?j.defaultView||j.parentWindow:j===n?window:false},_nodeTypeIs:p}});
KISSY.add("selector",function(a,n){function p(c,f){var e,g,k=[],r;f=j(f);if(a.isString(c)){c=a.trim(c);if(m.test(c)){if(g=b(c.slice(1),f))k=[g]}else if(e=l.exec(c)){g=e[1];r=e[2];e=e[3];if(f=g?b(g,f):f)if(e)if(!g||c.indexOf(o)!==-1)k=i(e,r,f);else{if((g=b(g,f))&&x.hasClass(g,e))k=[g]}else if(r)k=h(r,f)}else if(a.ExternalSelector)return a.ExternalSelector(c,f);else d(c)}else if(c&&(c[t]||c[u]))k=c[t]?[c[t]()]:c[u]();else if(c&&(a.isArray(c)||c&&!c.nodeType&&c.item&&c!=window))k=c;else if(c)k=[c];if(k&&
!k.nodeType&&k.item&&k!=window)k=a.makeArray(k);k.each=function(w,s){return a.each(k,w,s)};return k}function j(c){if(c===n)c=q;else if(a.isString(c)&&m.test(c))c=b(c.slice(1),q);else if(c&&c.nodeType!==1&&c.nodeType!==9)c=null;return c}function b(c,f){if(f.nodeType!==9)f=f.ownerDocument;return f.getElementById(c)}function h(c,f){return f.getElementsByTagName(c)}function i(c,f,e){e=c=e.getElementsByClassName(c);var g=0,k=0,r=c.length,w;if(f&&f!==v){e=[];for(f=f.toUpperCase();g<r;++g){w=c[g];if(w.tagName===
f)e[k++]=w}}return e}function d(c){a.error("Unsupported selector: "+c)}var q=document,x=a.DOM,o=" ",v="*",t="getDOMNode",u=t+"s",m=/^#[\w-]+$/,l=/^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/;(function(){var c=q.createElement("div");c.appendChild(q.createComment(""));if(c.getElementsByTagName(v).length>0)h=function(f,e){var g=e.getElementsByTagName(f);if(f===v){for(var k=[],r=0,w=0,s;s=g[r++];)if(s.nodeType===1)k[w++]=s;g=k}return g}})();q.getElementsByClassName||(i=q.querySelectorAll?function(c,f,
e){return e.querySelectorAll((f?f:"")+"."+c)}:function(c,f,e){f=e.getElementsByTagName(f||v);e=[];var g=0,k=0,r=f.length,w,s;for(c=o+c+o;g<r;++g){w=f[g];if((s=w.className)&&(o+s+o).indexOf(c)>-1)e[k++]=w}return e});a.query=p;a.get=function(c,f){return p(c,f)[0]||null};a.mix(x,{query:p,get:a.get,filter:function(c,f){var e=p(c),g,k,r,w=[];if(a.isString(f)&&(g=l.exec(f))&&!g[1]){k=g[2];r=g[3];f=function(s){return!(k&&s.tagName!==k.toUpperCase()||r&&!x.hasClass(s,r))}}if(a.isFunction(f))w=a.filter(e,
f);else if(f&&a.ExternalSelector)w=a.ExternalSelector._filter(c,f);else d(f);return w},test:function(c,f){var e=p(c);return x.filter(e,f).length===e.length}})});
KISSY.add("dom-data",function(a,n){var p=window,j=a.DOM,b="_ks_data_"+a.now(),h={},i={},d={EMBED:1,OBJECT:1,APPLET:1};a.mix(j,{data:function(q,x,o){if(a.isPlainObject(x))for(var v in x)j.data(q,v,x[v]);else if(o===n){q=a.get(q);var t;if(!(!q||d[q.nodeName])){if(q==p)q=i;t=(v=q&&q.nodeType)?h:q;q=t[v?q[b]:b];if(a.isString(x)&&q)return q[x];return q}}else a.query(q).each(function(u){if(!(!u||d[u.nodeName])){if(u==p)u=i;var m=h,l;if(u&&u.nodeType){if(!(l=u[b]))l=u[b]=a.guid()}else{l=b;m=u}if(x&&o!==
n){m[l]||(m[l]={});m[l][x]=o}}})},removeData:function(q,x){a.query(q).each(function(o){if(o){if(o==p)o=i;var v,t=h,u,m=o&&o.nodeType;if(m)v=o[b];else{t=o;v=b}if(v){u=t[v];if(x){if(u){delete u[x];a.isEmptyObject(u)&&j.removeData(o)}}else{if(m)o.removeAttribute&&o.removeAttribute(b);else try{delete o[b]}catch(l){}m&&delete t[v]}}}})}})});
KISSY.add("dom-class",function(a,n){function p(i,d,q,x){if(!(d=a.trim(d)))return x?false:n;i=a.query(i);var o=0,v=i.length;d=d.split(b);for(var t;o<v;o++){t=i[o];if(j._isElementNode(t)){t=q(t,d,d.length);if(t!==n)return t}}if(x)return false}var j=a.DOM,b=/[\.\s]\s*\.?/,h=/[\n\t]/g;a.mix(j,{hasClass:function(i,d){return p(i,d,function(q,x,o){if(q=q.className){q=" "+q+" ";for(var v=0,t=true;v<o;v++)if(q.indexOf(" "+x[v]+" ")<0){t=false;break}if(t)return true}},true)},addClass:function(i,d){p(i,d,function(q,
x,o){var v=q.className;if(v){var t=" "+v+" ";v=v;for(var u=0;u<o;u++)if(t.indexOf(" "+x[u]+" ")<0)v+=" "+x[u];q.className=a.trim(v)}else q.className=d})},removeClass:function(i,d){p(i,d,function(q,x,o){var v=q.className;if(v)if(o){v=(" "+v+" ").replace(h," ");for(var t=0,u;t<o;t++)for(u=" "+x[t]+" ";v.indexOf(u)>=0;)v=v.replace(u," ");q.className=a.trim(v)}else q.className=""})},replaceClass:function(i,d,q){j.removeClass(i,d);j.addClass(i,q)},toggleClass:function(i,d,q){var x=a.isBoolean(q),o;p(i,
d,function(v,t,u){for(var m=0,l;m<u;m++){l=t[m];o=x?!q:j.hasClass(v,l);j[o?"removeClass":"addClass"](v,l)}})}})});
KISSY.add("dom-attr",function(a,n){var p=a.UA,j=p.ie,b=j&&j<8,h=document.documentElement.textContent!==n?"textContent":"innerText",i=a.DOM,d=i._isElementNode,q=/^(?:href|src|style)/,x=/^(?:href|src|colspan|rowspan)/,o=/\r/g,v=/^(?:radio|checkbox)/,t={readonly:"readOnly"},u={val:1,css:1,html:1,text:1,data:1,width:1,height:1,offset:1};b&&a.mix(t,{"for":"htmlFor","class":"className"});a.mix(i,{attr:function(m,l,c,f){if(a.isPlainObject(l)){f=c;for(var e in l)i.attr(m,e,l[e],f)}else if(l=a.trim(l)){l=
l.toLowerCase();if(f&&u[l])return i[l](m,c);l=t[l]||l;if(c===n){m=a.get(m);if(!d(m))return n;var g;q.test(l)||(g=m[l]);if(g===n)g=m.getAttribute(l);if(b)if(x.test(l))g=m.getAttribute(l,2);else if(l==="style")g=m.style.cssText;return g===null?n:g}a.each(a.query(m),function(k){if(d(k))if(l==="style")k.style.cssText=c;else{if(l==="checked")k[l]=!!c;k.setAttribute(l,""+c)}})}},removeAttr:function(m,l){a.each(a.query(m),function(c){if(d(c)){i.attr(c,l,"");c.removeAttribute(l)}})},val:function(m,l){if(l===
n){var c=a.get(m);if(!d(c))return n;if(c&&c.nodeName.toUpperCase()==="option".toUpperCase())return(c.attributes.value||{}).specified?c.value:c.text;if(c&&c.nodeName.toUpperCase()==="select".toUpperCase()){var f=c.selectedIndex,e=c.options;if(f<0)return null;else if(c.type==="select-one")return i.val(e[f]);c=[];for(var g=0,k=e.length;g<k;++g)e[g].selected&&c.push(i.val(e[g]));return c}if(p.webkit&&v.test(c.type))return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(o,"")}a.each(a.query(m),
function(r){if(r&&r.nodeName.toUpperCase()==="select".toUpperCase()){if(a.isNumber(l))l+="";var w=a.makeArray(l),s=r.options,y;g=0;for(k=s.length;g<k;++g){y=s[g];y.selected=a.inArray(i.val(y),w)}if(!w.length)r.selectedIndex=-1}else if(d(r))r.value=l})},text:function(m,l){if(l===n){var c=a.get(m);if(d(c))return c[h]||"";else if(i._nodeTypeIs(c,3))return c.nodeValue}else a.each(a.query(m),function(f){if(d(f))f[h]=l;else if(i._nodeTypeIs(f,3))f.nodeValue=l})}})});
KISSY.add("dom-style",function(a,n){function p(f,e){var g=a.get(f),k=e===q?g.offsetWidth:g.offsetHeight;a.each(e===q?["Left","Right"]:["Top","Bottom"],function(r){k-=parseFloat(b._getComputedStyle(g,"padding"+r))||0;k-=parseFloat(b._getComputedStyle(g,"border"+r+"Width"))||0});return k}function j(f,e,g){var k=g;if(g===x&&v.test(e)){k=0;if(b.css(f,"position")==="absolute"){g=f[e==="left"?"offsetLeft":"offsetTop"];if(h.ie===8||h.opera)g-=o(b.css(f.offsetParent,"border-"+e+"-width"))||0;k=g-(o(b.css(f,
"margin-"+e))||0)}}return k}var b=a.DOM,h=a.UA,i=document,d=i.documentElement,q="width",x="auto",o=parseInt,v=/^(?:left|top)/,t=/^(?:width|height|top|left|right|bottom|margin|padding)/i,u=/-([a-z])/ig,m=function(f,e){return e.toUpperCase()},l={},c={};a.mix(b,{_CUSTOM_STYLES:l,_getComputedStyle:function(f,e){var g="",k=f.ownerDocument;if(f.style)g=k.defaultView.getComputedStyle(f,null)[e];return g},css:function(f,e,g){if(a.isPlainObject(e))for(var k in e)b.css(f,k,e[k]);else{if(e.indexOf("-")>0)e=
e.replace(u,m);e=l[e]||e;if(g===n){f=a.get(f);k="";if(f&&f.style){k=e.get?e.get(f):f.style[e];if(k===""&&!e.get)k=j(f,e,b._getComputedStyle(f,e))}return k===n?"":k}else{if(g===null||g==="")g="";else if(!isNaN(new Number(g))&&t.test(e))g+="px";(e===q||e==="height")&&parseFloat(g)<0||a.each(a.query(f),function(r){if(r&&r.style){e.set?e.set(r,g):r.style[e]=g;if(g==="")r.style.cssText||r.removeAttribute("style")}})}}},width:function(f,e){if(e===n)return p(f,q);else b.css(f,q,e)},height:function(f,e){if(e===
n)return p(f,"height");else b.css(f,"height",e)},show:function(f){a.query(f).each(function(e){if(e){e.style.display=b.data(e,"display")||"";if(b.css(e,"display")==="none"){var g=e.tagName,k=c[g],r;if(!k){r=i.createElement(g);i.body.appendChild(r);k=b.css(r,"display");b.remove(r);c[g]=k}b.data(e,"display",k);e.style.display=k}}})},hide:function(f){a.query(f).each(function(e){if(e){var g=e.style,k=g.display;if(k!=="none"){k&&b.data(e,"display",k);g.display="none"}}})},toggle:function(f){a.query(f).each(function(e){if(e)e.style.display===
"none"?b.show(e):b.hide(e)})},addStyleSheet:function(f,e){var g;if(e)g=a.get("#"+e);if(!g){g=b.create("<style>",{id:e});a.get("head").appendChild(g);if(g.styleSheet)g.styleSheet.cssText=f;else g.appendChild(i.createTextNode(f))}}});if(d.style.cssFloat!==n)l["float"]="cssFloat";else if(d.style.styleFloat!==n)l["float"]="styleFloat"});
KISSY.add("dom-style-ie",function(a,n){if(a.UA.ie){var p=a.DOM,j=document,b=j.documentElement,h=p._CUSTOM_STYLES,i=/^-?\d+(?:px)?$/i,d=/^-?\d/,q=/^(?:width|height)$/;try{if(b.style.opacity===n&&b.filters)h.opacity={get:function(o){var v=100;try{v=o.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(t){try{v=o.filters("alpha").opacity}catch(u){}}return v/100+""},set:function(o,v){var t=o.style,u=(o.currentStyle||0).filter||"";t.zoom=1;if(u)if(u=u.replace(/alpha\(opacity=.+\)/ig,""))u+=", ";
t.filter=u+"alpha(opacity="+v*100+")"}}}catch(x){}if(!(j.defaultView||{}).getComputedStyle&&b.currentStyle)p._getComputedStyle=function(o,v){var t=o.style,u=o.currentStyle[v];if(q.test(v))u=p[v](o)+"px";else if(!i.test(u)&&d.test(u)){var m=t.left,l=o.runtimeStyle.left;o.runtimeStyle.left=o.currentStyle.left;t.left=v==="fontSize"?"1em":u||0;u=t.pixelLeft+"px";t.left=m;o.runtimeStyle.left=l}return u}}});
KISSY.add("dom-offset",function(a,n){function p(g){var k=0,r=0,w=x(g[u]);if(g[e]){g=g[e]();k=g[m];r=g[l];if(b.mobile!=="apple"){k+=j[c](w);r+=j[f](w)}}return{left:k,top:r}}var j=a.DOM,b=a.UA,h=window,i=document,d=j._isElementNode,q=j._nodeTypeIs,x=j._getWin,o=i.compatMode==="CSS1Compat",v=Math.max,t=parseInt,u="ownerDocument",m="left",l="top",c="scrollLeft",f="scrollTop",e="getBoundingClientRect";a.mix(j,{offset:function(g,k){if(!(g=a.get(g))||!g[u])return null;if(k===n)return p(g);var r=g;if(j.css(r,
"position")==="static")r.style.position="relative";var w=p(r),s={},y,z;for(z in k){y=t(j.css(r,z),10)||0;s[z]=y+k[z]-w[z]}j.css(r,s)},scrollIntoView:function(g,k,r,w){if((g=a.get(g))&&g[u]){w=w===n?true:!!w;r=r===n?true:!!r;if(!k||k===h)return g.scrollIntoView(r);k=a.get(k);if(q(k,9))k=x(k);var s=k&&"scrollTo"in k&&k.document,y=j.offset(g),z=s?{left:j.scrollLeft(k),top:j.scrollTop(k)}:j.offset(k),A={left:y[m]-z[m],top:y[l]-z[l]};y=s?j.viewportHeight(k):k.clientHeight;z=s?j.viewportWidth(k):k.clientWidth;
var C=j[c](k),D=j[f](k),B=C+z,E=D+y,H=g.offsetHeight;g=g.offsetWidth;var G=A.left+C-(t(j.css(k,"borderLeftWidth"))||0);A=A.top+D-(t(j.css(k,"borderTopWidth"))||0);var I=G+g,K=A+H,F,J;if(H>y||A<D||r)F=A;else if(K>E)F=K-y;if(w)if(g>z||G<C||r)J=G;else if(I>B)J=I-z;if(s){if(F!==n||J!==n)k.scrollTo(J,F)}else{if(F!==n)k[f]=F;if(J!==n)k[c]=J}}}});a.each(["Left","Top"],function(g,k){var r="scroll"+g;j[r]=function(w){var s=0,y=x(w),z;if(y&&(z=y.document))s=y[k?"pageYOffset":"pageXOffset"]||z.documentElement[r]||
z.body[r];else if(d(w=a.get(w)))s=w[r];return s}});a.each(["Width","Height"],function(g){j["doc"+g]=function(k){k=k||i;return v(o?k.documentElement["scroll"+g]:k.body["scroll"+g],j["viewport"+g](k))};j["viewport"+g]=function(k){var r="inner"+g;k=x(k);var w=k.document;return r in k?k[r]:o?w.documentElement["client"+g]:w.body["client"+g]}})});
KISSY.add("dom-traversal",function(a,n){function p(i,d,q,x){if(!(i=a.get(i)))return null;if(d===n)d=1;var o=null,v,t;if(a.isNumber(d)&&d>=0){if(d===0)return i;v=0;t=d;d=function(){return++v===t}}for(;i=i[q];)if(h(i)&&(!d||b.test(i,d))&&(!x||x(i))){o=i;break}return o}function j(i,d,q){var x=[];var o=i=a.get(i);if(i&&q)o=i.parentNode;if(o){q=0;for(o=o.firstChild;o;o=o.nextSibling)if(h(o)&&o!==i&&(!d||b.test(o,d)))x[q++]=o}return x}var b=a.DOM,h=b._isElementNode;a.mix(b,{parent:function(i,d){return p(i,
d,"parentNode",function(q){return q.nodeType!=11})},next:function(i,d){return p(i,d,"nextSibling")},prev:function(i,d){return p(i,d,"previousSibling")},siblings:function(i,d){return j(i,d,true)},children:function(i,d){return j(i,d)},contains:function(i,d){var q=false;if((i=a.get(i))&&(d=a.get(d)))if(i.contains)return i.contains(d);else if(i.compareDocumentPosition)return!!(i.compareDocumentPosition(d)&16);else for(;!q&&(d=d.parentNode);)q=d==i;return q}})});
KISSY.add("dom-create",function(a,n){function p(s){var y=s.cloneNode(true);if(d.ie<8)y.innerHTML=s.innerHTML;return y}function j(s,y,z,A){if(z){var C=a.guid("ks-tmp-"),D=RegExp(m);y+='<span id="'+C+'"></span>';a.available(C,function(){var B=a.get("head"),E,H,G,I,K,F;for(D.lastIndex=0;E=D.exec(y);)if((G=(H=E[1])?H.match(c):false)&&G[2]){E=h.createElement("script");E.src=G[2];if((I=H.match(f))&&I[2])E.charset=I[2];E.async=true;B.appendChild(E)}else if((F=E[2])&&F.length>0)a.globalEval(F);(K=h.getElementById(C))&&
i.remove(K);a.isFunction(A)&&A()});b(s,y)}else{b(s,y);a.isFunction(A)&&A()}}function b(s,y){y=(y+"").replace(m,"");try{s.innerHTML=y}catch(z){for(;s.firstChild;)s.removeChild(s.firstChild);y&&s.appendChild(i.create(y))}}var h=document,i=a.DOM,d=a.UA,q=d.ie,x=i._nodeTypeIs,o=i._isElementNode,v=i._isKSNode,t=h.createElement("div"),u=/<(\w+)/,m=/<script([^>]*)>([^<]*(?:(?!<\/script>)<[^<]*)*)<\/script>/ig,l=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,c=/\ssrc=(['"])(.*?)\1/i,f=/\scharset=(['"])(.*?)\1/i;a.mix(i,{create:function(s,
y,z){if(x(s,1)||x(s,3))return p(s);if(v(s))return p(s[0]);if(!(s=a.trim(s)))return null;var A=null;A=i._creators;var C,D="div",B;if(C=l.exec(s))A=(z||h).createElement(C[1]);else{if((C=u.exec(s))&&(B=C[1])&&a.isFunction(A[B=B.toLowerCase()]))D=B;s=A[D](s,z).childNodes;if(s.length===1)z=s[0].parentNode.removeChild(s[0]);else{s=s;B=z||h;z=null;if(s&&(s.push||s.item)&&s[0]){B=B||s[0].ownerDocument;z=B.createDocumentFragment();if(s.item)s=a.makeArray(s);B=0;for(A=s.length;B<A;B++)z.appendChild(s[B])}z=
z}A=z}z=A;o(z)&&a.isPlainObject(y)&&i.attr(z,y,true);return z},_creators:{div:function(s,y){var z=y?y.createElement("div"):t;z.innerHTML=s;return z}},html:function(s,y,z,A){if(y===n){s=a.get(s);if(o(s))return s.innerHTML}else a.each(a.query(s),function(C){o(C)&&j(C,y,z,A)})},remove:function(s){a.each(a.query(s),function(y){o(y)&&y.parentNode&&y.parentNode.removeChild(y)})}});if(d.gecko||q){var e=i._creators,g=i.create,k=/(?:\/(?:thead|tfoot|caption|col|colgroup)>)+\s*<tbody/,r={option:"select",td:"tr",
tr:"tbody",tbody:"table",col:"colgroup",legend:"fieldset"},w;for(w in r)(function(s){e[w]=function(y,z){return g("<"+s+">"+y+"</"+s+">",null,z)}})(r[w]);if(q){e.script=function(s,y){var z=y?y.createElement("div"):t;z.innerHTML="-"+s;z.removeChild(z.firstChild);return z};if(q<8)e.tbody=function(s,y){var z=g("<table>"+s+"</table>",null,y),A=z.children.tags("tbody")[0];z.children.length>1&&A&&!k.test(s)&&A.parentNode.removeChild(A);return z}}a.mix(e,{optgroup:e.option,th:e.td,thead:e.tbody,tfoot:e.tbody,
caption:e.tbody,colgroup:e.tbody})}});KISSY.add("dom-insertion",function(a){a.mix(a.DOM,{insertBefore:function(n,p){if((n=a.get(n))&&(p=a.get(p))&&p.parentNode)p.parentNode.insertBefore(n,p);return n},insertAfter:function(n,p){if((n=a.get(n))&&(p=a.get(p))&&p.parentNode)p.nextSibling?p.parentNode.insertBefore(n,p.nextSibling):p.parentNode.appendChild(n);return n}})});
KISSY.add("event",function(a,n){function p(m,l,c,f,e){if(a.isString(l))l=a.query(l);if(a.isArray(l)){a.each(l,function(g){u[m](g,c,f,e)});return true}if((c=a.trim(c))&&c.indexOf(o)>0){a.each(c.split(o),function(g){u[m](l,g,f,e)});return true}}function j(m,l){b(m)&&i.data(m,x,l)}function b(m){return m&&m.nodeType!==3&&m.nodeType!==8}var h=document,i=a.DOM,d=h.addEventListener?function(m,l,c,f){m.addEventListener&&m.addEventListener(l,c,!!f)}:function(m,l,c){m.attachEvent&&m.attachEvent("on"+l,c)},
q=h.removeEventListener?function(m,l,c,f){m.removeEventListener&&m.removeEventListener(l,c,!!f)}:function(m,l,c){m.detachEvent&&m.detachEvent("on"+l,c)},x="ksEventTargetId",o=" ",v=a.now(),t={},u={EVENT_GUID:x,special:{},add:function(m,l,c,f){if(!p("add",m,l,c,f)){var e=b(m)?i.data(m,x):-1,g,k,r,w,s;if(!(e===-1||!l||!a.isFunction(c))){if(!e){j(m,e=v++);t[e]={target:m,events:{}}}k=t[e].events;if(!k[l]){g=((e=!m.isCustomEventTarget)||m._supportSpecialEvent)&&u.special[l]||{};r=function(y,z){if(!y||
!y.fixed){y=new a.EventObject(m,y,l);a.isPlainObject(z)&&a.mix(y,z)}g.setup&&g.setup(y);return(g.handle||u._handle)(m,y,k[l].listeners)};k[l]={handle:r,listeners:[]};w=g.fix||l;s=g.capture;if(e)d(m,w,r,s);else m._addEvent&&m._addEvent(w,r,s)}k[l].listeners.push({fn:c,scope:f||m})}}},remove:function(m,l,c,f){if(!p("remove",m,l,c,f)){var e=b(m)?i.data(m,x):-1,g,k,r,w,s,y,z;if(e!==-1)if(e&&(g=t[e]))if(g.target===m){f=f||m;g=g.events||{};if(k=g[l]){r=k.listeners;y=r.length;if(a.isFunction(c)&&y){s=w=
0;for(z=[];w<y;++w)if(c!==r[w].fn||f!==r[w].scope)z[s++]=r[w];k.listeners=z;y=z.length}if(c===n||y===0){if(m.isCustomEventTarget)m._addEvent&&m._removeEvent(l,k.handle);else{c=u.special[l]||{};q(m,c.fix||l,k.handle)}delete g[l]}}if(l===n||a.isEmptyObject(g)){for(l in g)u.remove(m,l);delete t[e];i.removeData(m,x)}}}},_handle:function(m,l,c){c=c.slice(0);for(var f,e=0,g=c.length;e<g;++e){f=c[e];f=f.fn.call(f.scope||m,l);if(f===false&&m.isCustomEventTarget||l.isImmediatePropagationStopped)break}return f},
_getCache:function(m){return t[m]},_simpleAdd:d,_simpleRemove:q};u.on=u.add;a.Event=u});
KISSY.add("event-object",function(a,n){function p(h,i,d){this.currentTarget=h;this.originalEvent=i||{};if(i){this.type=i.type;this._fix()}else{this.type=d;this.target=h}this.currentTarget=h;this.fixed=true}var j=document,b="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" ");a.augment(p,
{_fix:function(){var h=this.originalEvent,i=b.length,d,q=this.currentTarget;for(q=q.nodeType===9?q:q.ownerDocument||j;i;){d=b[--i];this[d]=h[d]}if(!this.target)this.target=this.srcElement||j;if(this.target.nodeType===3)this.target=this.target.parentNode;if(!this.relatedTarget&&this.fromElement)this.relatedTarget=this.fromElement===this.target?this.toElement:this.fromElement;if(this.pageX===n&&this.clientX!==n){h=q.documentElement;i=q.body;this.pageX=this.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||
0)-(h&&h.clientLeft||i&&i.clientLeft||0);this.pageY=this.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}if(this.which===n)this.which=this.charCode!==n?this.charCode:this.keyCode;if(this.metaKey===n)this.metaKey=this.ctrlKey;if(!this.which&&this.button!==n)this.which=this.button&1?1:this.button&2?3:this.button&4?2:0},preventDefault:function(){var h=this.originalEvent;if(h.preventDefault)h.preventDefault();else h.returnValue=false;this.isDefaultPrevented=true},stopPropagation:function(){var h=
this.originalEvent;if(h.stopPropagation)h.stopPropagation();else h.cancelBubble=true;this.isPropagationStopped=true},stopImmediatePropagation:function(){var h=this.originalEvent;h.stopImmediatePropagation?h.stopImmediatePropagation():this.stopPropagation();this.isImmediatePropagationStopped=true},halt:function(h){h?this.stopImmediatePropagation():this.stopPropagation();this.preventDefault()}});a.EventObject=p});
KISSY.add("event-target",function(a,n){var p=a.Event;a.EventTarget={isCustomEventTarget:true,fire:function(j,b){var h=a.DOM.data(this,p.EVENT_GUID)||-1;if((h=((p._getCache(h)||{}).events||{})[j])&&a.isFunction(h.handle))return h.handle(n,b);return this},on:function(j,b,h){p.add(this,j,b,h);return this},detach:function(j,b,h){p.remove(this,j,b,h);return this}}});
KISSY.add("event-mouseenter",function(a){var n=a.Event;a.UA.ie||a.each([{name:"mouseenter",fix:"mouseover"},{name:"mouseleave",fix:"mouseout"}],function(p){n.special[p.name]={fix:p.fix,setup:function(j){j.type=p.name},handle:function(j,b,h){if(a.DOM._isKSNode(j))j=j[0];var i=b.relatedTarget;try{for(;i&&i!==j;)i=i.parentNode;i!==j&&n._handle(j,b,h)}catch(d){}}}})});
KISSY.add("event-focusin",function(a){var n=a.Event;document.addEventListener&&a.each([{name:"focusin",fix:"focus"},{name:"focusout",fix:"blur"}],function(p){n.special[p.name]={fix:p.fix,capture:true,setup:function(j){j.type=p.name}}})});
KISSY.add("node",function(a){function n(j,b,h){if(!(this instanceof n))return new n(j,b,h);if(j){if(a.isString(j)){j=p.create(j,b,h);if(j.nodeType===11)return new a.NodeList(j.childNodes)}else if(j instanceof n)return j;else j=j;this[0]=j}else this.length=0}var p=a.DOM;n.TYPE="-ks-Node";a.augment(n,{length:1,getDOMNode:function(){return this[0]},nodeType:n.TYPE});a.one=function(j,b){var h=a.get(j,b);return h?new n(h):null};a.Node=n});
KISSY.add("nodelist",function(a){function n(b){if(!(this instanceof n))return new n(b);j.push.apply(this,a.makeArray(b)||[])}var p=a.DOM,j=Array.prototype;a.mix(n.prototype,{length:0,item:function(b){var h=null;if(p._isElementNode(this[b]))h=new a.Node(this[b]);return h},getDOMNodes:function(){return j.slice.call(this)},each:function(b,h){var i=this.length,d=0,q;for(q=new a.Node(this[0]);d<i&&b.call(h||q,q,d,this)!==false;q=new a.Node(this[++d]));return this}});a.all=function(b,h){return new n(a.query(b,
h,true))};a.NodeList=n});
KISSY.add("node-attach",function(a,n){function p(l,c,f,e){l=[this[l?v:o]()].concat(a.makeArray(c));if(c[f]===n)return e.apply(b,l);else{e.apply(b,l);return this}}function j(l,c){a.each(l,function(f){a.each([q,x],function(e,g){e[f]=function(k){switch(c){case t:return function(){return p.call(this,g,arguments,1,k)};case u:return function(){return p.call(this,g,arguments,0,k)};case m:return function(){var r=this[g?v:o]();return(r=k.apply(b,[r].concat(a.makeArray(arguments))))?new (a[a.isArray(r)?"NodeList":
"Node"])(r):null};default:return function(){var r=this[g?v:o]();r=k.apply(b,[r].concat(a.makeArray(arguments)));return r===n?this:r}}}(b[f])})})}var b=a.DOM,h=a.Event,i=b._nodeTypeIs,d=b._isKSNode,q=a.Node.prototype,x=a.NodeList.prototype,o="getDOMNode",v=o+"s",t=1,u=2,m=4;a.mix(q,{one:function(l){return a.one(l,this[0])},all:function(l){return a.all(l,this[0])}});j(["data","removeData"],t);j(["hasClass","addClass","removeClass","replaceClass","toggleClass"]);j(["attr","removeAttr"],t);j(["val","text"],
u);j(["css"],t);j(["width","height"],u);j(["offset"],u);j(["scrollIntoView"]);j(["parent","next","prev","siblings","children"],m);j(["contains"]);j(["html"],u);j(["remove"]);a.each(["insertBefore","insertAfter"],function(l){q[l]=function(c){b[l].call(b,this[0],c);return this}});a.each([q,x],function(l,c){a.mix(l,{append:function(f){f&&a.each(this,function(e){var g;if(c||a.isString(f))g=b.create(f);else{if(i(f,1)||i(f,3))g=f;if(d(f))g=f[0]}e.appendChild(g)});return this},appendTo:function(f){if((f=
a.get(f))&&f.appendChild)a.each(this,function(e){f.appendChild(e)});return this}})});a.each([q,x],function(l){a.mix(l,a.EventTarget);l._supportSpecialEvent=true;l._addEvent=function(c,f,e){for(var g=0,k=this.length;g<k;g++)h._simpleAdd(this[g],c,f,e)};l._removeEvent=function(c,f,e){for(var g=0,k=this.length;g<k;g++)h._simpleRemove(this[g],c,f,e)};delete l.fire})});
KISSY.add("cookie",function(a){var n=document,p=encodeURIComponent,j=decodeURIComponent;a.Cookie={get:function(b){var h;if(a.isString(b)&&b!=="")if(b=n.cookie.match("(?:^| )"+b+"(?:(?:=([^;]*))|;|$)"))h=b[1]?j(b[1]):"";return h},set:function(b,h,i,d,q,x){h=p(h);var o=i;if(typeof o==="number"){o=new Date;o.setTime(o.getTime()+i*864E5)}if(o instanceof Date)h+="; expires="+o.toUTCString();if(a.isString(d)&&d!=="")h+="; domain="+d;if(a.isString(q)&&q!=="")h+="; path="+q;if(x)h+="; secure";n.cookie=b+
"="+h},remove:function(b,h,i,d){this.set(b,"",0,h,i,d)}}});
KISSY.add("json",function(a){function n(o){return o<10?"0"+o:o}function p(o){h.lastIndex=0;return h.test(o)?'"'+o.replace(h,function(v){var t=q[v];return typeof t==="string"?t:"\\u"+("0000"+v.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+o+'"'}function j(o,v){var t,u,m,l,c=i,f,e=v[o];if(e&&typeof e==="object"&&typeof e.toJSON==="function")e=e.toJSON(o);if(typeof x==="function")e=x.call(v,o,e);switch(typeof e){case "string":return p(e);case "number":return isFinite(e)?String(e):"null";case "boolean":case "null":return String(e);
case "object":if(!e)return"null";i+=d;f=[];if(Object.prototype.toString.apply(e)==="[object Array]"){l=e.length;for(t=0;t<l;t+=1)f[t]=j(t,e)||"null";m=f.length===0?"[]":i?"[\n"+i+f.join(",\n"+i)+"\n"+c+"]":"["+f.join(",")+"]";i=c;return m}if(x&&typeof x==="object"){l=x.length;for(t=0;t<l;t+=1){u=x[t];if(typeof u==="string")if(m=j(u,e))f.push(p(u)+(i?": ":":")+m)}}else for(u in e)if(Object.hasOwnProperty.call(e,u))if(m=j(u,e))f.push(p(u)+(i?": ":":")+m);m=f.length===0?"{}":i?"{\n"+i+f.join(",\n"+i)+
"\n"+c+"}":"{"+f.join(",")+"}";i=c;return m}}a=a.JSON=window.JSON||{};if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+n(this.getUTCMonth()+1)+"-"+n(this.getUTCDate())+"T"+n(this.getUTCHours())+":"+n(this.getUTCMinutes())+":"+n(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
h=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i,d,q={"":"\\b","\t":"\\t","\n":"\\n","":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},x;if(typeof a.stringify!=="function")a.stringify=function(o,v,t){var u;d=i="";if(typeof t==="number")for(u=0;u<t;u+=1)d+=" ";else if(typeof t==="string")d=t;if((x=v)&&typeof v!=="function"&&(typeof v!=="object"||typeof v.length!=="number"))throw Error("JSON.stringify");return j("",{"":o})};if(typeof a.parse!==
"function")a.parse=function(o,v){function t(m,l){var c,f,e=m[l];if(e&&typeof e==="object")for(c in e)if(Object.hasOwnProperty.call(e,c)){f=t(e,c);if(f!==undefined)e[c]=f;else delete e[c]}return v.call(m,l,e)}var u;o=String(o);b.lastIndex=0;if(b.test(o))o=o.replace(b,function(m){return"\\u"+("0000"+m.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(o.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,
""))){u=eval("("+o+")");return typeof v==="function"?t({"":u},""):u}throw new SyntaxError("JSON.parse");}});
KISSY.add("anim-easing",function(a){var n=Math,p=n.PI,j=n.pow,b=n.sin,h=1.70158,i={easeNone:function(d){return d},easeIn:function(d){return d*d},easeOut:function(d){return(2-d)*d},easeBoth:function(d){return(d*=2)<1?0.5*d*d:0.5*(1- --d*(d-2))},easeInStrong:function(d){return d*d*d*d},easeOutStrong:function(d){return 1- --d*d*d*d},easeBothStrong:function(d){return(d*=2)<1?0.5*d*d*d*d:0.5*(2-(d-=2)*d*d*d)},elasticIn:function(d){if(d===0||d===1)return d;return-(j(2,10*(d-=1))*b((d-0.075)*2*p/0.3))},
elasticOut:function(d){if(d===0||d===1)return d;return j(2,-10*d)*b((d-0.075)*2*p/0.3)+1},elasticBoth:function(d){if(d===0||(d*=2)===2)return d;if(d<1)return-0.5*j(2,10*(d-=1))*b((d-0.1125)*2*p/0.45);return j(2,-10*(d-=1))*b((d-0.1125)*2*p/0.45)*0.5+1},backIn:function(d){if(d===1)d-=0.0010;return d*d*((h+1)*d-h)},backOut:function(d){return(d-=1)*d*((h+1)*d+h)+1},backBoth:function(d){if((d*=2)<1)return 0.5*d*d*(((h*=1.525)+1)*d-h);return 0.5*((d-=2)*d*(((h*=1.525)+1)*d+h)+2)},bounceIn:function(d){return 1-
i.bounceOut(1-d)},bounceOut:function(d){return d<1/2.75?7.5625*d*d:d<2/2.75?7.5625*(d-=1.5/2.75)*d+0.75:d<2.5/2.75?7.5625*(d-=2.25/2.75)*d+0.9375:7.5625*(d-=2.625/2.75)*d+0.984375},bounceBoth:function(d){if(d<0.5)return i.bounceIn(d*2)*0.5;return i.bounceOut(d*2-1)*0.5+0.5}};i.NativeTimeFunction={easeNone:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeBoth:"ease-in-out",easeInStrong:"cubic-bezier(0.9, 0.0, 0.9, 0.5)",easeOutStrong:"cubic-bezier(0.1, 0.5, 0.1, 1.0)",easeBothStrong:"cubic-bezier(0.9, 0.0, 0.1, 1.0)"};
a.Easing=i});
KISSY.add("anim",function(a,n){function p(c,f,e,g,k,r){if(c=a.get(c)){if(!(this instanceof p))return new p(c,f,e,g,k,r);var w=a.isPlainObject(e);f=f;this.domEl=c;if(a.isPlainObject(f))f=a.param(f,";").replace(/=/g,":");var s={},y=t.length,z;v.innerHTML='<div style="'+f+'"></div>';for(c=v.firstChild.style;y--;)if(z=c[t[y]])s[t[y]]=h(z);this.props=s;this.targetStyle=f;if(w)w=a.merge(l,e);else{w=a.clone(l);if(e)w.duration=o(e)||1;if(a.isString(g)||a.isFunction(g))w.easing=g;if(a.isFunction(k))w.complete=k;
if(r!==n)w.nativeSupport=r}this.config=w;if(w.nativeSupport&&j()&&a.isString(g=w.easing))if(/cubic-bezier\([\s\d.,]+\)/.test(g)||(g=x.NativeTimeFunction[g])){w.easing=g;this.transitionName=j()}a.isFunction(k)&&this.on(m,k)}}function j(){var c="transition",f;if(v.style[c]!==n)f=c;else a.each(["Webkit","Moz","O"],function(e){if(v.style[c=e+"Transition"]!==n){f=c;return false}});j=function(){return f};return f}function b(c,f,e){a.UA.ie&&e.indexOf(u)>-1&&q.css(c,u,f[u].v);c.style.cssText+=";"+e}function h(c){var f=
o(c);c=(c+"").replace(/^[-\d.]+/,"");return isNaN(f)?{v:c,u:"",f:d}:{v:f,u:c,f:i}}function i(c,f,e){return(c+(f-c)*e).toFixed(3)}function d(c,f,e){for(var g=2,k,r,w=[],s=[];k=3,r=arguments[g-1],g--;)if(r.substr(0,4)==="rgb(")for(r=r.match(/\d+/g);k--;)w.push(~~r[k]);else if(r.substr(0,1)==="#"){if(r.length===4)r="#"+r.substr(1,1)+r.substr(1,1)+r.substr(2,1)+r.substr(2,1)+r.substr(3,1)+r.substr(3,1);for(;k--;)w.push(parseInt(r.substr(1+k*2,2),16))}else return f;for(;k--;){g=~~(w[k+3]+(w[k]-w[k+3])*
e);s.push(g<0?0:g>255?255:g)}return"rgb("+s.join(",")+")"}var q=a.DOM,x=a.Easing,o=parseFloat,v=q.create("<div>"),t="backgroundColor borderBottomColor borderBottomWidth borderBottomStyle borderLeftColor borderLeftWidth borderLeftStyle borderRightColor borderRightWidth borderRightStyle borderSpacing borderTopColor borderTopWidth borderTopStyle bottom color font fontFamily fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex".split(" "),
u="opacity",m="complete",l={duration:1,easing:"easeNone",nativeSupport:true};a.augment(p,a.EventTarget,{run:function(){var c=this,f=c.config,e=c.domEl,g,k,r,w,s=c.props,y={},z;for(z in s)y[z]=h(q.css(e,z));if(c.fire("start")!==false){c.stop();if(c.transitionName)c._nativeRun();else{g=f.duration*1E3;r=a.now();w=r+g;k=f.easing;if(a.isString(k))k=x[k]||x.easeNone;c.timer=a.later(f=function(){var A=a.now(),C=A>w?1:(A-r)/g,D,B,E;for(z in s){D=y[z];B=s[z];if(B.v==0)B.u=D.u;if(D.u!==B.u)D.v=0;q.css(e,z,
B.f(D.v,B.v,k(C))+B.u)}if(c.fire("step")===false||(E=A>w)){c.stop();E&&c.fire(m)}},13,true);f()}return c}},_nativeRun:function(){var c=this,f=c.config,e=c.domEl,g=c.props,k=f.duration*1E3;f=f.easing;var r=c.transitionName,w={};w[r+"Property"]="all";w[r+"Duration"]=k+"ms";w[r+"TimingFunction"]=f;q.css(e,w);a.later(function(){b(e,g,c.targetStyle)},0);a.later(function(){c.stop(true)},k)},stop:function(c){if(this.transitionName)this._nativeStop(c);else{if(this.timer){this.timer.cancel();this.timer=n}if(c){b(this.domEl,
this.props,this.targetStyle);this.fire(m)}}return this},_nativeStop:function(c){var f=this.domEl,e=this.transitionName,g=this.props,k;if(c){q.css(f,e+"Property","none");this.fire(m)}else{for(k in g)q.css(f,k,q._getComputedStyle(f,k));q.css(f,e+"Property","none")}}});p.supportTransition=function(){return!!j()};a.Anim=p});
KISSY.add("anim-node-plugin",function(a,n){function p(m,l,c,f,e){if(l==="toggle"){e=j.css(m,h)===i?1:0;l="show"}if(e)j.css(m,h,j.data(m,h)||"");var g={};a.each(u[l],function(k){if(k===d)j.css(m,d,q);else if(k===x){g.opacity=e?1:0;e&&j.css(m,x,0)}else if(k===o){g.height=e?j.css(m,o)||m.naturalHeight:0;e&&j.css(m,o,0)}else if(k===v){g.width=e?j.css(m,v)||m.naturalWidth:0;e&&j.css(m,v,0)}});(new a.Anim(m,g,c,"easeOut",function(){if(!e){var k=m.style,r=k[h];if(r!==i){r&&j.data(m,h,r);k[h]=i}j.css(m,{height:t,
width:t,overflow:t,opacity:1})}f&&a.isFunction(f)&&f()})).run()}var j=a.DOM,b=a.Anim,h="display",i="none",d="overflow",q="hidden",x="opacity",o="height",v="width",t="auto",u={show:[d,x,o,v],fade:[x],slide:[d,o]};a.each([a.Node.prototype,a.NodeList.prototype],function(m){m.animate=function(){var l=a.makeArray(arguments);a.each(this,function(c){b.apply(n,[c].concat(l)).run()});return this};a.each({show:["show",1],hide:["show",0],toggle:["toggle"],fadeIn:["fade",1],fadeOut:["fade",0],slideDown:["slide",
1],slideUp:["slide",0]},function(l,c){m[c]=function(f,e){j[c]&&arguments.length===0?j[c](this):a.each(this,function(g){p(g,l[0],f,e,l[1])});return this}})})});
KISSY.add("attribute",function(a,n){function p(){}function j(b){b+="";return b.charAt(0).toUpperCase()+b.substring(1)}a.augment(p,{__initAttrs:function(){if(!this.__attrs){this.__attrs={};this.__attrVals={}}},addAttr:function(b,h){this.__initAttrs();this.__attrs[b]=a.clone(h||{});return this},addAttrs:function(b,h){var i=this;a.each(b,function(d,q){if(q in h)d.value=h[q];i.addAttr(q,d)});return i},hasAttr:function(b){return b&&b in(this.__attrs||{})},removeAttr:function(b){if(this.hasAttr(b)){delete this.__attrs.name;
delete this.__attrVals.name}return this},set:function(b,h){var i=this.get(b);if(i!==h)if(false!==this.__fireAttrChange("before",b,i,h)){this.__set(b,h);this.__fireAttrChange("after",b,i,this.__attrVals[b]);return this}},__fireAttrChange:function(b,h,i,d){return this.fire(b+j(h)+"Change",{attrName:h,prevVal:i,newVal:d})},__set:function(b,h){var i,d=this.__attrs[b];if(d=d&&d.setter)i=d.call(this,h);if(i!==n)h=i;this.__attrVals[b]=h},get:function(b){var h;this.__initAttrs();h=(h=this.__attrs[b])&&h.getter;
b=b in this.__attrVals?this.__attrVals[b]:this.__getDefAttrVal(b);if(h)b=h.call(this,b);return b},__getDefAttrVal:function(b){b=this.__attrs[b];var h;if(b){if(h=b.valueFn){h=h.call(this);if(h!==n)b.value=h;delete b.valueFn}return b.value}},reset:function(b){if(this.hasAttr(b))return this.set(b,this.__getDefAttrVal(b));for(b in this.__attrs)this.hasAttr(b)&&this.reset(b);return this}});a.Attribute=p});
KISSY.add("base",function(a){function n(p){for(var j=this.constructor,b,h;j;){if(h=j.ATTRS)for(b in h)h.hasOwnProperty(b)&&!this.hasAttr(b)&&this.addAttr(b,h[b]);j=j.superclass?j.superclass.constructor:null}if(p)for(b in p)p.hasOwnProperty(b)&&this.__set(b,p[b])}a.augment(n,a.EventTarget,a.Attribute);a.Base=n});KISSY.add("core");
/*
Copyright 2010, KISSY UI Library v1.1.5
MIT Licensed
build time: Oct 15 14:07
*/
/**
 * 数据延迟加载组件
 * @module   datalazyload
 * @creator  玉伯<lifesinger@gmail.com>
 */
KISSY.add('datalazyload', function(S, undefined) {

    var DOM = S.DOM, Event = S.Event,
        win = window, doc = document,

        IMG_SRC_DATA = 'data-ks-lazyload',
        AREA_DATA_CLS = 'ks-datalazyload',
        CUSTOM = '-custom',
        MANUAL = 'manual',
        DISPLAY = 'display', DEFAULT = 'default', NONE = 'none',
        SCROLL = 'scroll', RESIZE = 'resize',

        defaultConfig = {

            /**
             * 懒处理模式
             *   auto   - 自动化。html 输出时，不对 img.src 做任何处理
             *   manual - 输出 html 时，已经将需要延迟加载的图片的 src 属性替换为 IMG_SRC_DATA
             * 注：对于 textarea 数据，只有手动模式
             */
            mod: MANUAL,

            /**
             * 当前视窗往下，diff px 外的 img/textarea 延迟加载
             * 适当设置此值，可以让用户在拖动时感觉数据已经加载好
             * 默认为当前视窗高度（两屏以外的才延迟加载）
             */
            diff: DEFAULT,

            /**
             * 图像的占位图，默认无
             */
            placeholder: NONE
        };

    /**
     * 延迟加载组件
     * @constructor
     */
    function DataLazyload(containers, config) {
        var self = this;

        // factory or constructor
        if (!(self instanceof DataLazyload)) {
            return new DataLazyload(containers, config);
        }

        // 允许仅传递 config 一个参数
        if (config === undefined) {
            config = containers;
            containers = [doc];
        }

        // containers 是一个 HTMLElement 时
        if (!S.isArray(containers)) {
            containers = [S.get(containers) || doc];
        }

        /**
         * 图片所在容器（可以多个），默认为 [doc]
         * @type Array
         */
        self.containers = containers;

        /**
         * 配置参数
         * @type Object
         */
        self.config = S.merge(defaultConfig, config);

        /**
         * 需要延迟下载的图片
         * @type Array
         */
        //self.images

        /**
         * 需要延迟处理的 textarea
         * @type Array
         */
        //self.areaes

        /**
         * 和延迟项绑定的回调函数
         * @type object
         */
        self.callbacks = {els: [], fns: []};

        /**
         * 开始延迟的 Y 坐标
         * @type number
         */
        //self.threshold

        self._init();
    }

    S.augment(DataLazyload, {

        /**
         * 初始化
         * @protected
         */
        _init: function() {
            var self = this;
            self.threshold = self._getThreshold();

            self._filterItems();
            self._initLoadEvent();
        },

        /**
         * 获取并初始化需要延迟的 images 和 areaes
         * @protected
         */
        _filterItems: function() {
            var self = this,
                containers = self.containers,
                n, N, imgs, areaes, i, len, img, area,
                lazyImgs = [], lazyAreas = [];

            for (n = 0,N = containers.length; n < N; ++n) {
                imgs = S.query('img', containers[n]);
                lazyImgs = lazyImgs.concat(S.filter(imgs, self._filterImg, self));

                areaes = S.query('textarea', containers[n]);
                lazyAreas = lazyAreas.concat(S.filter(areaes, self._filterArea, self));
            }

            self.images = lazyImgs;
            self.areaes = lazyAreas;
        },

        /**
         * filter for lazyload image
         */
        _filterImg: function(img) {
            var self = this,
                dataSrc = img.getAttribute(IMG_SRC_DATA),
                threshold = self.threshold,
                placeholder = self.config.placeholder,
                isManualMod = self.config.mod === MANUAL;

            // 手工模式，只处理有 data-src 的图片
            if (isManualMod) {
                if (dataSrc) {
                    if (placeholder !== NONE) {
                        img.src = placeholder;
                    }
                    return true;
                }
            }
            // 自动模式，只处理 threshold 外无 data-src 的图片
            else {
                // 注意：已有 data-src 的项，可能已有其它实例处理过，不用再次处理
                if (DOM.offset(img).top > threshold && !dataSrc) {
                    DOM.attr(img, IMG_SRC_DATA, img.src);
                    if (placeholder !== NONE) {
                        img.src = placeholder;
                    } else {
                        img.removeAttribute('src');
                    }
                    return true;
                }
            }
        },

        /**
         * filter for lazyload textarea
         */
        _filterArea: function(area) {
            return DOM.hasClass(area, AREA_DATA_CLS);
        },

        /**
         * 初始化加载事件
         * @protected
         */
        _initLoadEvent: function() {
            var timer, self = this;

            // scroll 和 resize 时，加载图片
            Event.on(win, SCROLL, loader);
            Event.on(win, RESIZE, function() {
                self.threshold = self._getThreshold();
                loader();
            });

            // 需要立即加载一次，以保证第一屏的延迟项可见
            if (self._getItemsLength()) {
                S.ready(function() {
                    loadItems();
                });
            }

            // 加载函数
            function loader() {
                if (timer) return;
                timer = S.later(function() {
                    loadItems();
                    timer = null;
                }, 100); // 0.1s 内，用户感觉流畅
            }

            // 加载延迟项
            function loadItems() {
                self._loadItems();
                if (self._getItemsLength() === 0) {
                    Event.remove(win, SCROLL, loader);
                    Event.remove(win, RESIZE, loader);
                }
            }
        },

        /**
         * 加载延迟项
         */
        _loadItems: function() {
            var self = this;
            self._loadImgs();
            self._loadAreas();
            self._fireCallbacks();
        },

        /**
         * 加载图片
         * @protected
         */
        _loadImgs: function() {
            var self = this;
            self.images = S.filter(self.images, self._loadImg, self);
        },

        /**
         * 监控滚动，处理图片
         */
        _loadImg: function(img) {
            var self = this,
                scrollTop = DOM.scrollTop(),
                threshold = self.threshold + scrollTop,
                offset = DOM.offset(img);

            if (offset.top <= threshold) {
                self._loadImgSrc(img);
            } else {
                return true;
            }
        },

        /**
         * 加载图片 src
         * @static
         */
        _loadImgSrc: function(img, flag) {
            flag = flag || IMG_SRC_DATA;
            var dataSrc = img.getAttribute(flag);

            if (dataSrc && img.src != dataSrc) {
                img.src = dataSrc;
                img.removeAttribute(flag);
            }
        },

        /**
         * 加载 textarea 数据
         * @protected
         */
        _loadAreas: function() {
            var self = this;
            self.areaes = S.filter(self.areaes, self._loadArea, self);
        },

        /**
         * 监控滚动，处理 textarea
         */
        _loadArea: function(area) {
            var self = this, top,
                isHidden = DOM.css(area, DISPLAY) === NONE;

            // 注：area 可能处于 display: none 状态，DOM.offset(area).top 返回 0
            // 这种情况下用 area.parentNode 的 Y 值来替代
            top = DOM.offset(isHidden ? area.parentNode : area).top;

            if (top <= self.threshold + DOM.scrollTop()) {
                self._loadAreaData(area.parentNode, area);
            } else {
                return true;
            }
        },

        /**
         * 从 textarea 中加载数据
         * @static
         */
        _loadAreaData: function(container, area) {
            //chengyu 大幅重构，使用正则识别 html 字符串里的 script，提高性能
            // 为了通用性，不要搜索 container 内的全部 script dom 节点执行

            // 采用隐藏 textarea 但不去除方式，去除会引发 Chrome 下错乱
            area.style.display = NONE;
            area.className = ''; // clear hook

            var content = DOM.create('<div>');
            container.insertBefore(content, area);
            DOM.html(content, area.value, true);

            //area.value = ''; // bug fix: 注释掉，不能清空，否则 F5 刷新，会丢内容
        },

        /**
         * 触发回调
         */
        _fireCallbacks: function() {
            var self = this,
                callbacks = self.callbacks,
                els = callbacks.els, fns = callbacks.fns,
                scrollTop = DOM.scrollTop(),
                threshold = self.threshold + scrollTop,
                i, el, fn, remainEls = [], remainFns = [];

            for (i = 0; (el = els[i]) && (fn = fns[i++]);) {
                if (DOM.offset(el).top <= threshold) {
                    fn.call(el);
                } else {
                    remainEls.push(el);
                    remainFns.push(fn);
                }

            }
            callbacks.els = remainEls;
            callbacks.fns = remainFns;
        },

        /**
         * 添加回调函数。当 el 即将出现在视图中时，触发 fn
         */
        addCallback: function(el, fn) {
            var callbacks = this.callbacks;
            el = S.get(el);

            if (el && S.isFunction(fn)) {
                callbacks.els.push(el);
                callbacks.fns.push(fn);
            }
        },

        /**
         * 获取阈值
         * @protected
         */
        _getThreshold: function() {
            var diff = this.config.diff,
                vh = DOM['viewportHeight']();

            if (diff === DEFAULT) return 2 * vh; // diff 默认为当前视窗高度（两屏以外的才延迟加载）
            else return vh + (+diff); // 将 diff 转换成数值
        },

        /**
         * 获取当前延迟项的数量
         * @protected
         */
        _getItemsLength: function() {
            var self = this;
            return self.images.length + self.areaes.length + self.callbacks.els.length;
        },

        /**
         * 加载自定义延迟数据
         * @static
         */
        loadCustomLazyData: function(containers, type) {
            var self = this, area, imgs;

            // 支持数组
            if (!S.isArray(containers)) {
                containers = [S.get(containers)];
            }

            // 遍历处理
            S.each(containers, function(container) {
                switch (type) {
                    case 'img-src':
                        if (container.nodeName === 'IMG') { // 本身就是图片
                            imgs = [container];
                        } else {
                            imgs = S.query('img', container);
                        }
                        
                        S.each(imgs, function(img) {
                            self._loadImgSrc(img, IMG_SRC_DATA + CUSTOM);
                        });
                        
                        break;
                    
                    default:
                        area = S.get('textarea', container);
                        if (area && DOM.hasClass(area, AREA_DATA_CLS + CUSTOM)) {
                            self._loadAreaData(container, area);
                        }
                }
            });
        }
    });

    // attach static methods
    S.mix(DataLazyload, DataLazyload.prototype, true, ['loadCustomLazyData', '_loadImgSrc', '_loadAreaData']);

    S.DataLazyload = DataLazyload;

}, { requires: ['core'] });

/**
 * NOTES:
 *
 * 模式为 auto 时：
 *  1. 在 Firefox 下非常完美。脚本运行时，还没有任何图片开始下载，能真正做到延迟加载。
 *  2. 在 IE 下不尽完美。脚本运行时，有部分图片已经与服务器建立链接，这部分 abort 掉，
 *     再在滚动时延迟加载，反而增加了链接数。
 *  3. 在 Safari 和 Chrome 下，因为 webkit 内核 bug，导致无法 abort 掉下载。该
 *     脚本完全无用。
 *  4. 在 Opera 下，和 Firefox 一致，完美。
 *  5. 2010-07-12: 发现在 Firefox 下，也有导致部分 Aborted 链接。
 *
 * 模式为 manual 时：（要延迟加载的图片，src 属性替换为 data-lazyload-src, 并将 src 的值赋为 placeholder ）
 *  1. 在任何浏览器下都可以完美实现。
 *  2. 缺点是不渐进增强，无 JS 时，图片不能展示。
 *
 * 缺点：
 *  1. 对于大部分情况下，需要拖动查看内容的页面（比如搜索结果页），快速滚动时加载有损用
 *     户体验（用户期望所滚即所得），特别是网速不好时。
 *  2. auto 模式不支持 Webkit 内核浏览器；IE 下，有可能导致 HTTP 链接数的增加。
 *
 * 优点：
 *  1. 可以很好的提高页面初始加载速度。
 *  2. 第一屏就跳转，延迟加载图片可以减少流量。
 *
 * 参考资料：
 *  1. http://davidwalsh.name/lazyload MooTools 的图片延迟插件
 *  2. http://vip.qq.com/ 模板输出时，就替换掉图片的 src
 *  3. http://www.appelsiini.net/projects/lazyload jQuery Lazyload
 *  4. http://www.dynamixlabs.com/2008/01/17/a-quick-look-add-a-loading-icon-to-your-larger-images/
 *  5. http://www.nczonline.net/blog/2009/11/30/empty-image-src-can-destroy-your-site/
 *
 * 特别要注意的测试用例:
 *  1. 初始窗口很小，拉大窗口时，图片加载正常
 *  2. 页面有滚动位置时，刷新页面，图片加载正常
 *  3. 手动模式，第一屏有延迟图片时，加载正常
 *
 * 2009-12-17 补充：
 *  1. textarea 延迟加载约定：页面中需要延迟的 dom 节点，放在
 *       <textarea class='ks-datalazysrc invisible'>dom code</textarea>
 *     里。可以添加 hidden 等 class, 但建议用 invisible, 并设定 height = '实际高度'，这样可以保证
 *     滚动时，diff 更真实有效。
 *     注意：textarea 加载后，会替换掉父容器中的所有内容。
 *  2. 延迟 callback 约定：dataLazyload.addCallback(el, fn) 表示当 el 即将出现时，触发 fn.
 *  3. 所有操作都是最多触发一次，比如 callback. 来回拖动滚动条时，只有 el 第一次出现时会触发 fn 回调。
 */

/**
 * zTODO:
 *   - [取消] 背景图片的延迟加载（对于 css 里的背景图片和 sprite 很难处理）
 *   - [取消] 加载时的 loading 图（对于未设定大小的图片，很难完美处理[参考资料 4]）
 */

/**
 * UPDATE LOG:
 *   - 2010-07-31 yubo IMG_SRC_DATA 由 data-lazyload-src 更名为 data-ks-lazyload + 支持 touch 设备
 *   - 2010-07-10 chengyu 重构，使用正则表达式识别 html 中的脚本，使用 EventTarget 自定义事件机制来处理回调
 *   - 2010-05-10 yubo ie6 下，在 dom ready 后执行，会导致 placeholder 重复加载，为比避免此问题，默认为 none, 去掉占位图
 *   - 2010-04-05 yubo 重构，使得对 YUI 的依赖仅限于 YDOM
 *   - 2009-12-17 yubo 将 imglazyload 升级为 datalazyload, 支持 textarea 方式延迟和特定元素即将出现时的回调函数
 */
/*
Copyright 2010, KISSY UI Library v1.1.5
MIT Licensed
build time: Oct 15 14:08
*/
KISSY.add("suggest",function(f,n){function k(a,b,c){if(!(this instanceof k))return new k(a,b,c);this.textInput=f.get(a);this.config=c=f.merge(y,c);b+=b.indexOf("?")===-1?"?":"&";this.dataSource=b+c.callbackName+"="+(a=c.callbackFn);if(a!==u){c=a;a=c.split(".");b=a.length;if(b>1){c=c.replace(/^(.*)\..+$/,"$1");c=f.namespace(c,true);c[a[b-1]]=q}else r[c]=q}this.queryParams=this.query=l;this._dataCache={};this._init()}function v(a,b){if(b.nodeType===1){d.html(a,l);a.appendChild(b)}else d.html(a,b)}function q(a){k.focusInstance&&
f.later(function(){k.focusInstance._handleResponse(a)},0)}var d=f.DOM,j=f.Event,r=window,o=document,p,w=f.get("head"),s=f.UA.ie,u="KISSY.Suggest.callback",l="",x=parseInt,z=/^(?:input|button|a)$/i,y={containerCls:l,resultFormat:"%result%",closeBtnText:"\u5173\u95ed",shim:s===6,submitOnSelect:true,offset:-1,charset:"utf-8",callbackName:"callback",callbackFn:u,queryName:"q"};f.augment(k,f.EventTarget,{_init:function(){p=o.body;this._initTextInput();this._initContainer();this.config.shim&&this._initShim();this._initStyle();
this._initEvent()},_initTextInput:function(){var a=this,b=a.textInput,c=false,e=0;d.attr(b,"autocomplete","off");a.config.autoFocus&&b.focus();j.on(b,"keydown",function(h){var i=h.keyCode;if(i===27){a.hide();b.value=a.query}else if(i>32&&i<41)if(b.value){if(i===40||i===38){if(e++===0){a._isRunning&&a.stop();c=true;a._selectItem(i===40)}else if(e==3)e=0;h.preventDefault()}}else b.blur();else if(i===13){b.blur();if(c)if(b.value==a._getSelectedItemKey())if(a.fire("itemSelect")===false)return;a._submitForm()}else{a._isRunning||
a.start();c=false}});j.on(b,"keyup",function(){e=0});j.on(b,"blur",function(){a.stop();f.later(function(){a._focusing||a.hide()},0)})},_initContainer:function(){var a=d.create("<div>",{"class":"ks-suggest-container "+this.config.containerCls,style:"position:absolute;visibility:hidden"}),b=d.create("<div>",{"class":"ks-suggest-content"}),c=d.create("<div>",{"class":"ks-suggest-footer"});a.appendChild(b);a.appendChild(c);p.insertBefore(a,p.firstChild);this.container=a;this.content=b;this.footer=c;this._initContainerEvent()},
_setContainerRegion:function(){var a=this.config,b=this.textInput,c=d.offset(b),e=this.container;d.offset(e,{left:c.left,top:c.top+b.offsetHeight+a.offset});d.width(e,a.containerWidth||b.offsetWidth-2)},_initContainerEvent:function(){var a=this,b=a.textInput,c=a.container,e=a.content,h=a.footer,i,t;j.on(e,"mousemove",function(g){g=g.target;if(g.nodeName!=="LI")g=d.parent(g,"li");if(d.contains(e,g))if(g!==a.selectedItem){a._removeSelectedItem();a._setSelectedItem(g)}});j.on(e,"mousedown",function(g){g=
g.target;if(g.nodeName!=="LI")g=d.parent(g,"li");i=g});j.on(c,"mousedown",function(g){if(!z.test(g.target.nodeName)){b.onbeforedeactivate=function(){r.event.returnValue=false;b.onbeforedeactivate=null};g.preventDefault()}});j.on(e,"mouseup",function(g){var m=g.target;if(!(g.which>2)){if(m.nodeName!=="LI")m=d.parent(m,"li");if(m==i)if(d.contains(e,m)){a._updateInputFromSelectItem(m);if(a.fire("itemSelect")!==false){b.blur();a._submitForm()}}}});j.on(h,"focusin",function(){a._focusing=true;a._removeSelectedItem();
t=false});j.on(h,"focusout",function(){a._focusing=false;f.later(function(){if(t)a.hide();else a._focusing||a.textInput.focus()},0)});j.on(a.container,"mouseleave",function(){t=true});j.on(h,"click",function(g){d.hasClass(g.target,"ks-suggest-closebtn")&&a.hide()})},_submitForm:function(){if(this.config.submitOnSelect){var a=this.textInput.form;if(a)if(this.fire("beforeSubmit",{form:a})!==false){if(o.createEvent){var b=o.createEvent("MouseEvents");b.initEvent("submit",true,false);a.dispatchEvent(b)}else o.createEventObject&&
a.fireEvent("onsubmit");a.submit()}}},_initShim:function(){var a=d.create("<iframe>",{src:"about:blank","class":"ks-suggest-shim",style:"position:absolute;visibility:hidden;border:none"});this.container.shim=a;p.insertBefore(a,p.firstChild)},_setShimRegion:function(){var a=this.container,b=a.style,c=a.shim;c&&d.css(c,{left:x(b.left)-2,top:b.top,width:x(b.width)+2,height:d.height(a)-2})},_initStyle:function(){f.get("#ks-suggest-style")||d.addStyleSheet(".ks-suggest-container{background:white;border:1px solid #999;z-index:99999}.ks-suggest-shim{z-index:99998}.ks-suggest-container li{color:#404040;padding:1px 0 2px;font-size:12px;line-height:18px;float:left;width:100%}.ks-suggest-container .ks-selected{background-color:#39F;cursor:default}.ks-suggest-key{float:left;text-align:left;padding-left:5px}.ks-suggest-result{float:right;text-align:right;padding-right:5px;color:green}.ks-suggest-container .ks-selected span{color:#FFF;cursor:default}.ks-suggest-footer{padding:0 5px 5px}.ks-suggest-closebtn{float:right}.ks-suggest-container li,.ks-suggest-footer{overflow:hidden;zoom:1;clear:both}.ks-suggest-container{*margin-left:2px;_margin-left:-2px;_margin-top:-3px}",
"ks-suggest-style")},_initEvent:function(){var a=this;j.on(r,"resize",function(){a._setContainerRegion();a._setShimRegion()})},start:function(){var a=this;if(a.fire("beforeStart")!==false){k.focusInstance=a;a._timer=f.later(function(){a._updateContent();a._timer=f.later(arguments.callee,200)},200);a._isRunning=true}},stop:function(){k.focusInstance=n;this._timer&&this._timer.cancel();this._isRunning=false},show:function(){if(!this.isVisible()){var a=this.container,b=a.shim;this._setContainerRegion();
a.style.visibility=l;if(b){this._setShimRegion();b.style.visibility=l}}},hide:function(){if(this.isVisible()){var a=this.container,b=a.shim;if(b)b.style.visibility="hidden";a.style.visibility="hidden"}},isVisible:function(){return this.container.style.visibility!="hidden"},_updateContent:function(){var a=this.textInput;if(a.value!=this.query){a=this.query=a.value;if(f.trim(a))if(this._dataCache[a]!==n){this._fillContainer(this._dataCache[a]);this._displayContainer()}else this._requestData();else{this._fillContainer();
this.hide()}}},_requestData:function(){var a=this,b=a.config,c;if(!s)a.dataScript=n;if(!a.dataScript){c=o.createElement("script");c.charset=b.charset;c.async=true;w.insertBefore(c,w.firstChild);a.dataScript=c;if(!s){var e=f.now();a._latestScriptTime=e;d.attr(c,"data-time",e);j.on(c,"load",function(){a._scriptDataIsOut=d.attr(c,"data-time")!=a._latestScriptTime})}}a.queryParams=b.queryName+"="+encodeURIComponent(a.query);if(a.fire("beforeDataRequest")!==false)a.dataScript.src=a.dataSource+"&"+a.queryParams},
_handleResponse:function(a){var b=l,c,e,h,i;if(!this._scriptDataIsOut){this.returnedData=a;if(this.fire("dataReturn",{data:a})!==false){a=this._formatData(this.returnedData);if((c=a.length)>0){e=d.create("<ol>");for(b=0;b<c;++b){h=a[b];h=this._formatItem(i=h.key,h.result);d.attr(h,"key",i);d.addClass(h,b%2?"ks-even":"ks-odd");e.appendChild(h)}b=e}this._fillContainer(b);if(this.fire("beforeShow")!==false){this._dataCache[this.query]=d.html(this.content);this._displayContainer()}}}},_formatData:function(a){var b=
[],c,e,h,i=0;if(!a)return b;if(f.isArray(a.result))a=a.result;if(!(c=a.length))return b;for(h=0;h<c;++h){e=a[h];if(f.isString(e))b[i++]={key:e};else if(f.isArray(e)&&e.length>1)b[i++]={key:e[0],result:e[1]}}return b},_formatItem:function(a,b){var c=d.create("<li>"),e;c.appendChild(d.create("<span>",{"class":"ks-suggest-key",html:a}));if(b){e=this.config.resultFormat.replace("%result%",b);f.trim(e)&&c.appendChild(d.create("<span>",{"class":"ks-suggest-result",html:e}))}return c},_fillContainer:function(a,
b){this._fillContent(a||l);this._fillFooter(b||l)},_fillContent:function(a){v(this.content,a);this.selectedItem=n},_fillFooter:function(a){var b=this.config,c=this.footer;v(c,a);b.closeBtn&&c.appendChild(d.create("<a>",{"class":"ks-suggest-closebtn",text:b.closeBtnText,href:"javascript: void(0)",target:"_self"}));this.fire("updateFooter",{footer:c,query:this.query});d.css(c,"display",d.text(c)?l:"none")},_displayContainer:function(){f.trim(d.text(this.container))?this.show():this.hide()},_selectItem:function(a){var b=
f.query("li",this.container);if(b.length!==0)if(this.isVisible()){if(this.selectedItem){a=d[a?"next":"prev"](this.selectedItem);if(!a)this.textInput.value=this.query}else a=b[a?0:b.length-1];this._removeSelectedItem();if(a){this._setSelectedItem(a);this._updateInputFromSelectItem()}}else this.show()},_removeSelectedItem:function(){d.removeClass(this.selectedItem,"ks-selected");this.selectedItem=n},_setSelectedItem:function(a){d.addClass(a,"ks-selected");this.selectedItem=a;this.textInput.focus()},
_getSelectedItemKey:function(){if(!this.selectedItem)return l;return d.attr(this.selectedItem,"key")},_updateInputFromSelectItem:function(){this.textInput.value=this._getSelectedItemKey(this.selectedItem)||this.query}});k.version=1.1;k.callback=q;f.Suggest=k},{requires:["core"]});
/*
Copyright 2010, KISSY UI Library v1.1.5
MIT Licensed
build time: Oct 15 14:08
*/
KISSY.add("switchable",function(c,k){function i(a,b){b=b||{};if(!("markupType"in b))if(b.panelCls)b.markupType=1;else if(b.panels)b.markupType=2;b=c.merge(i.Config,b);this.container=c.get(a);this.config=b;this.activeIndex=b.activeIndex;this._init()}var l=c.DOM,g=c.Event;i.Config={markupType:0,navCls:"ks-switchable-nav",contentCls:"ks-switchable-content",triggerCls:"ks-switchable-trigger",panelCls:"ks-switchable-panel",triggers:[],panels:[],hasTriggers:true,triggerType:"mouse",delay:0.1,activeIndex:0,
activeTriggerCls:"ks-active",steps:1,viewSize:[]};i.Plugins=[];c.augment(i,c.EventTarget,{_init:function(){var a=this,b=a.config;a._parseMarkup();b.switchTo&&a.switchTo(b.switchTo);b.hasTriggers&&a._bindTriggers();c.each(i.Plugins,function(d){d.init&&d.init(a)});a.fire("init")},_parseMarkup:function(){var a=this.container,b=this.config,d,f=[],h=[];switch(b.markupType){case 0:if(d=c.get("."+b.navCls,a))f=l.children(d);d=c.get("."+b.contentCls,a);h=l.children(d);break;case 1:f=c.query("."+b.triggerCls,
a);h=c.query("."+b.panelCls,a);break;case 2:f=b.triggers;h=b.panels}a=h.length;this.length=a/b.steps;if(b.hasTriggers&&a>0&&f.length===0)f=this._generateTriggersMarkup(this.length);this.triggers=c.makeArray(f);this.panels=c.makeArray(h);this.content=d||h[0].parentNode},_generateTriggersMarkup:function(a){var b=this.config,d=l.create("<ul>"),f,h;d.className=b.navCls;for(h=0;h<a;h++){f=l.create("<li>");if(h===this.activeIndex)f.className=b.activeTriggerCls;f.innerHTML=h+1;d.appendChild(f)}this.container.appendChild(d);
return l.children(d)},_bindTriggers:function(){var a=this,b=a.config,d=a.triggers,f,h,e=d.length;for(h=0;h<e;h++)(function(j){f=d[j];g.on(f,"click",function(){a._onFocusTrigger(j)});if(b.triggerType==="mouse"){g.on(f,"mouseenter",function(){a._onMouseEnterTrigger(j)});g.on(f,"mouseleave",function(){a._onMouseLeaveTrigger(j)})}})(h)},_onFocusTrigger:function(a){if(this._triggerIsValid(a)){this._cancelSwitchTimer();this.switchTo(a)}},_onMouseEnterTrigger:function(a){var b=this;if(b._triggerIsValid(a))b.switchTimer=
c.later(function(){b.switchTo(a)},b.config.delay*1E3)},_onMouseLeaveTrigger:function(){this._cancelSwitchTimer()},_triggerIsValid:function(a){return this.activeIndex!==a},_cancelSwitchTimer:function(){if(this.switchTimer){this.switchTimer.cancel();this.switchTimer=k}},switchTo:function(a,b){var d=this.config,f=this.triggers,h=this.panels,e=this.activeIndex,j=d.steps,p=e*j,m=a*j;if(!this._triggerIsValid(a))return this;if(this.fire("beforeSwitch",{toIndex:a})===false)return this;if(d.hasTriggers)this._switchTrigger(e>
-1?f[e]:null,f[a]);if(b===k)b=a>e?"forward":"backward";this._switchView(h.slice(p,p+j),h.slice(m,m+j),a,b);this.activeIndex=a;return this},_switchTrigger:function(a,b){var d=this.config.activeTriggerCls;a&&l.removeClass(a,d);l.addClass(b,d)},_switchView:function(a,b,d){l.css(a,"display","none");l.css(b,"display","block");this._fireOnSwitch(d)},_fireOnSwitch:function(a){this.fire("switch",{currentIndex:a})},prev:function(){var a=this.activeIndex;this.switchTo(a>0?a-1:this.length-1,"backward")},next:function(){var a=
this.activeIndex;this.switchTo(a<this.length-1?a+1:0,"forward")}});c.Switchable=i},{requires:["core"]});
KISSY.add("autoplay",function(c,k){var i=c.Event,l=c.Switchable;c.mix(l.Config,{autoplay:false,interval:5,pauseOnHover:true});l.Plugins.push({name:"autoplay",init:function(g){function a(){f=c.later(function(){g.paused||g.switchTo(g.activeIndex<g.length-1?g.activeIndex+1:0,"forward")},d,true)}var b=g.config,d=b.interval*1E3,f;if(b.autoplay){if(b.pauseOnHover){i.on(g.container,"mouseenter",function(){if(f){f.cancel();f=k}g.paused=true});i.on(g.container,"mouseleave",function(){g.paused=false;a()})}a()}}})},
{host:"switchable"});
KISSY.add("effect",function(c,k){var i=c.DOM,l=c.Anim,g=c.Switchable,a;c.mix(g.Config,{effect:"none",duration:0.5,easing:"easeNone",nativeAnim:true});g.Effects={none:function(b,d,f){i.css(b,"display","none");i.css(d,"display","block");f()},fade:function(b,d,f){b.length!==1&&c.error("fade effect only supports steps == 1.");var h=this,e=h.config,j=b[0],p=d[0];h.anim&&h.anim.stop(true);i.css(p,"opacity",1);h.anim=(new l(j,{opacity:0},e.duration,e.easing,function(){h.anim=k;i.css(p,"z-index",9);i.css(j,
"z-index",1);f()},e.nativeAnim)).run()},scroll:function(b,d,f,h){var e=this;b=e.config;d=b.effect==="scrollx";var j={};j[d?"left":"top"]=-(e.viewSize[d?0:1]*h)+"px";e.anim&&e.anim.stop();e.anim=(new l(e.content,j,b.duration,b.easing,function(){e.anim=k;f()},b.nativeAnim)).run()}};a=g.Effects;a.scrollx=a.scrolly=a.scroll;g.Plugins.push({name:"effect",init:function(b){var d=b.config,f=d.effect,h=b.panels,e=b.content,j=d.steps,p=b.activeIndex,m=h.length;b.viewSize=[d.viewSize[0]||h[0].offsetWidth*j,
d.viewSize[1]||h[0].offsetHeight*j];if(f!=="none"){c.each(h,function(q){i.css(q,"display","block")});switch(f){case "scrollx":case "scrolly":i.css(e,"position","absolute");i.css(e.parentNode,"position","relative");if(f==="scrollx"){i.css(h,"float","left");i.width(e,b.viewSize[0]*(m/j))}break;case "fade":var r=p*j,s=r+j-1,o;c.each(h,function(q,t){o=t>=r&&t<=s;i.css(q,{opacity:o?1:0,position:"absolute",zIndex:o?9:1})})}}}});c.augment(g,{_switchView:function(b,d,f,h){var e=this,j=e.config.effect;(c.isFunction(j)?
j:a[j]).call(e,b,d,function(){e._fireOnSwitch(f)},f,h)}})},{host:"switchable"});
KISSY.add("circular",function(c,k){function i(o,q,t,u,w){var n=this;o=n.config;q=n.length;var x=n.activeIndex,v=o.scrollType===r,y=v?f:h,z=n.viewSize[v?0:1];v=-z*u;var B={},C,A=w===m;if(C=A&&x===0&&u===q-1||w===p&&x===q-1&&u===0)v=l.call(n,n.panels,u,A,y,z);B[y]=v+j;n.anim&&n.anim.stop();n.anim=(new c.Anim(n.content,B,o.duration,o.easing,function(){C&&g.call(n,n.panels,u,A,y,z);n.anim=k;t()},o.nativeAnim)).run()}function l(o,q,t,u,w){var n=this.config.steps;q=this.length;var x=t?q-1:0,v=(x+1)*n;for(n=
x*n;n<v;n++){a.css(o[n],b,d);a.css(o[n],u,(t?-1:1)*w*q)}return t?w:-w*q}function g(o,q,t,u,w){var n=this.config.steps;q=this.length;var x=t?q-1:0,v=(x+1)*n;for(n=x*n;n<v;n++){a.css(o[n],b,e);a.css(o[n],u,e)}a.css(this.content,u,t?-w*(q-1):e)}var a=c.DOM,b="position",d="relative",f="left",h="top",e="",j="px",p="forward",m="backward",r="scrollx",s=c.Switchable;c.mix(s.Config,{circular:false});s.Plugins.push({name:"circular",init:function(o){o=o.config;if(o.circular&&(o.effect===r||o.effect==="scrolly")){o.scrollType=
o.effect;o.effect=i}}})},{host:"switchable"});
KISSY.add("lazyload",function(c){var k=c.DOM,i="beforeSwitch",l="img-src",g="area-data",a={},b=c.Switchable;a[l]="data-ks-lazyload-custom";a[g]="ks-datalazyload-custom";c.mix(b.Config,{lazyDataType:g});b.Plugins.push({name:"lazyload",init:function(d){function f(m){var r=e.steps;m=m.toIndex*r;h.loadCustomLazyData(d.panels.slice(m,m+r),j);a:{var s,o;if(m=(r=j===l)?"img":j===g?"textarea":""){m=c.query(m,d.container);s=0;for(o=m.length;s<o;s++)if(r?k.attr(m[s],p):k.hasClass(m[s],p)){r=false;break a}}r=
true}r&&d.detach(i,f)}var h=c.DataLazyload,e=d.config,j=e.lazyDataType,p=a[j];!h||!j||!p||d.on(i,f)}})},{host:"switchable"});KISSY.add("autorender",function(c){c.Switchable.autoRender=function(k,i){k="."+(k||"KS_Widget");c.query(k,i).each(function(l){var g=l.getAttribute("data-widget-type"),a;if(g&&"Switchable Tabs Slide Carousel Accordion".indexOf(g)>-1)try{if(a=l.getAttribute("data-widget-config"))a=a.replace(/'/g,'"');new c[g](l,c.JSON.parse(a))}catch(b){}})}},{host:"switchable"});
KISSY.add("tabs",function(c){function k(i,l){if(!(this instanceof k))return new k(i,l);k.superclass.constructor.call(this,i,l)}c.extend(k,c.Switchable);c.Tabs=k},{host:"switchable"});KISSY.add("slide",function(c){function k(l,g){if(!(this instanceof k))return new k(l,g);k.superclass.constructor.call(this,l,c.merge(i,g))}var i={autoplay:true,circular:true};c.extend(k,c.Switchable);c.Slide=k},{host:"switchable"});
KISSY.add("carousel",function(c,k){function i(e,j){var p=this;if(!(p instanceof i))return new i(e,j);p.on("init",function(){l(p)});i.superclass.constructor.call(p,e,c.merge(h,j))}function l(e){var j=e.config,p=j.disableBtnCls;c.each(["prev","next"],function(m){var r=e[m+"Btn"]=c.get(b+j[m+"BtnCls"],e.container);a.on(r,"click",function(s){s.preventDefault();g.hasClass(r,p)||e[m]()})});j.circular||e.on("switch",function(m){m=m.currentIndex;m=m===0?e[d]:m===e.length-1?e[f]:k;g.removeClass([e[d],e[f]],
p);m&&g.addClass(m,p)});a.on(e.panels,"click focus",function(){e.fire("itemSelected",{item:this})})}var g=c.DOM,a=c.Event,b=".",d="prevBtn",f="nextBtn",h={circular:true,prevBtnCls:"ks-switchable-prev-btn",nextBtnCls:"ks-switchable-next-btn",disableBtnCls:"ks-switchable-disable-btn"};c.extend(i,c.Switchable);c.Carousel=i},{host:"switchable"});
KISSY.add("accordion",function(c){function k(g,a){if(!(this instanceof k))return new k(g,a);k.superclass.constructor.call(this,g,c.merge(l,a));if(this.config.multiple)this._switchTrigger=function(){}}var i=c.DOM,l={markupType:1,triggerType:"click",multiple:false};c.extend(k,c.Switchable);c.Accordion=k;c.augment(k,{_triggerIsValid:function(g){return this.activeIndex!==g||this.config.multiple},_switchView:function(g,a,b){var d=this.config,f=a[0];if(d.multiple){i.toggleClass(this.triggers[b],d.activeTriggerCls);
i.css(f,"display",f.style.display=="none"?"block":"none");this._fireOnSwitch(b)}else k.superclass._switchView.call(this,g,a,b)}})},{host:"switchable"});
/*
Copyright 2010, KISSY UI Library v1.1.5
MIT Licensed
build time: Oct 15 14:07
*/
KISSY.add("mask",function(c,g){function i(a){if(!(this instanceof i))return new i(a);a=c.merge(b,a);var f=a.shim,h=f?o:m+a.style,l=f?0:a.opacity,n=k("<iframe>",h,l,!f);if(!f&&e)this.layer=k("<div>",h,l,true);this.config=a;this.iframe=n}function k(a,f,h,l){a=d.create(a);d.attr(a,"style",f);d.css(a,"opacity",h);if(l){d.height(a,d.docHeight());j&&d.width(a,d.docWidth())}document.body.appendChild(a);return a}var d=c.DOM,e=c.UA.ie,j=e===6,m="position:absolute;left:0;top:0;width:100%;border:0;background:black;z-index:9998;display:none;",
o="position:absolute;z-index:9997;border:0;display:none;",b={shim:false,opacity:0.6,style:""};c.augment(i,{show:function(){d.show([this.iframe,this.layer])},hide:function(){d.hide([this.iframe,this.layer])},toggle:function(){this[d.css(this.iframe,"display")!=="none"?"hide":"show"]()},setSize:function(a,f){var h=this.iframe;if(h){d.width(h,a);d.height(h,f)}if(h=this.layer){d.width(h,a);d.height(h,f)}},setOffset:function(a,f){var h=a;if(f!==g)h={left:a,top:f};d.offset([this.iframe,this.layer],h)}});
c.Mask=i});
KISSY.add("overlay",function(c,g){function i(b,a){a=a||{};if(c.isPlainObject(b))a=b;else a.container=b;this.container=c.get(a.container);this.trigger=c.get(a.trigger);a.align=c.merge(c.clone(m.align),a.align);this.config=c.merge(m,a);this._init()}var k=document,d=c.DOM,e=c.Event,j={TL:"tl",TC:"tc",TR:"tr",LC:"cl",CC:"cc",RC:"cr",BL:"bl",BC:"bc",BR:"br"},m={container:null,containerCls:"ks-overlay",bdCls:"ks-overlay-bd",trigger:null,triggerType:"click",width:0,height:0,zIndex:9999,xy:null,align:{node:null,
points:[j.CC,j.CC],offset:[0,0]},mask:false,shim:c.UA.ie===6},o;c.augment(i,c.EventTarget,{_init:function(){this.trigger&&this._bindTrigger()},_bindTrigger:function(){this.config.triggerType==="mouse"?this._bindTriggerMouse():this._bindTriggerClick()},_bindTriggerMouse:function(){var b=this,a=b.trigger,f;e.on(a,"mouseenter",function(){b._clearHiddenTimer();f=c.later(function(){b.show();f=g},100)});e.on(a,"mouseleave",function(){if(f){f.cancel();f=g}b._setHiddenTimer()})},_bindContainerMouse:function(){var b=
this;e.on(b.container,"mouseleave",function(){b._setHiddenTimer()});e.on(b.container,"mouseenter",function(){b._clearHiddenTimer()})},_setHiddenTimer:function(){var b=this;b._hiddenTimer=c.later(function(){b.hide()},120)},_clearHiddenTimer:function(){if(this._hiddenTimer){this._hiddenTimer.cancel();this._hiddenTimer=g}},_bindTriggerClick:function(){var b=this;e.on(b.trigger,"click",function(a){a.halt();b.show()})},show:function(){this._firstShow()},_firstShow:function(){this._prepareMarkup();this._realShow();
this._firstShow=this._realShow},_realShow:function(){this._setPosition();this._toggle(false)},_toggle:function(b){d.css(this.container,"visibility",b?"hidden":"");this.shim&&this.shim.toggle();if(this.config.mask)o[b?"hide":"show"]();this[b?"_unbindUI":"_bindUI"]();this.fire(b?"hide":"show")},hide:function(){this._toggle(true)},_prepareMarkup:function(){var b=this.config,a=this.container;if(b.mask&&!o)o=new c.Mask;if(b.shim)this.shim=new c.Mask({shim:true});if(a){this.body=c.get("."+b.bdCls,a)||a;
a.style.cssText+="visibility:hidden;position:absolute;"}else{a=this.container=d.create(c.substitute('<div class="{containerCls}" style="visibility:hidden;position:absolute;"><div class="{bdCls}">{content}</div></div>',b));this.body=d.children(a)[0];k.body.appendChild(a)}d.css(a,"zIndex",b.zIndex);this.setBody(b.content);this._setSize();b.triggerType==="mouse"&&this._bindContainerMouse()},_setSize:function(b,a){var f=this.config;b=b||f.width;a=a||f.height;b&&d.width(this.container,b);a&&d.height(this.container,
a);this.shim&&this.shim.setSize(b,a)},_setDisplay:function(){d.css(this.container,"display")==="none"&&d.css(this.container,"display","block")},_setPosition:function(){var b=this.config.xy;if(b)this.move(b);else{this._setDisplay();this.align()}},move:function(b,a){var f;if(c.isArray(b)){a=b[1];b=b[0]}f={left:b,top:a};d.offset(this.container,f);this.shim&&this.shim.setOffset(f)},align:function(b,a,f){var h=this.config.align;b=b||h.node;b=b==="trigger"?this.trigger:c.get(b);a=a||h.points;f=f===g?h.offset:
f;h=d.offset(this.container);b=this._getAlignOffset(b,a[0]);a=this._getAlignOffset(this.container,a[1]);a=[a.left-b.left,a.top-b.top];this.move(h.left-a[0]+ +f[0],h.top-a[1]+ +f[1])},_getAlignOffset:function(b,a){var f=a.charAt(0),h=a.charAt(1),l,n,p,q;if(b){l=d.offset(b);n=b.offsetWidth;p=b.offsetHeight}else{l={left:d.scrollLeft(),top:d.scrollTop()};n=d.viewportWidth();p=d.viewportHeight()}q=l.left;l=l.top;if(f==="c")l+=p/2;else if(f==="b")l+=p;if(h==="c")q+=n/2;else if(h==="r")q+=n;return{left:q,
top:l}},center:function(){this.move((d.viewportWidth()-d.width(this.container))/2+d.scrollLeft(),(d.viewportHeight()-d.height(this.container))/2+d.scrollTop())},_bindUI:function(){e.on(k,"keydown",this._esc,this)},_unbindUI:function(){e.remove(k,"keydown",this._esc,this)},_esc:function(b){b.keyCode===27&&this.hide()},setBody:function(b){this._setContent("body",b)},_setContent:function(b,a){c.isString(a)&&d.html(this[b],a)}});c.Overlay=i});
KISSY.add("popup",function(c){function g(k,d){if(!(this instanceof g))return new g(k,d);d=d||{};if(c.isPlainObject(k))d=k;else d.container=k;d.align=c.merge(c.clone(i.align),d.align);g.superclass.constructor.call(this,c.merge(i,d))}var i={triggerType:"mouse",align:{node:"trigger",points:["cr","ct"],offset:[10,0]}};c.extend(g,c.Overlay);c.Popup=g},{host:"overlay"});
KISSY.add("dialog",function(c){function g(e,j){if(!(this instanceof g))return new g(e,j);j=j||{};if(c.isPlainObject(e))j=e;else j.container=e;j.align=c.merge(c.clone(d.align),j.align);g.superclass.constructor.call(this,c.merge(d,j));this.manager=c.DialogManager;this.manager.register(this)}var i=c.DOM,k=c.Event,d={header:"",footer:"",containerCls:"ks-overlay ks-dialog",hdCls:"ks-dialog-hd",bdCls:"ks-dialog-bd",ftCls:"ks-dialog-ft",closeBtnCls:"ks-dialog-close",width:400,height:300,closable:true};c.extend(g,
c.Overlay);c.Dialog=g;c.augment(g,c.EventTarget,{_prepareMarkup:function(){var e=this.config;g.superclass._prepareMarkup.call(this);this.header=c.get("."+e.hdCls,this.container);if(!this.header){this.header=i.create("<div>",{"class":e.hdCls});i.insertBefore(this.header,this.body)}this.setHeader(e.header);if(e.footer){this.footer=c.get("."+e.ftCls,this.container);if(!this.footer){this.footer=i.create("<div>",{"class":e.ftCls});this.container.appendChild(this.footer)}this.setFooter(e.footer)}e.closable&&
this._initClose()},_initClose:function(){var e=this,j=i.create("<div>",{"class":e.config.closeBtnCls});i.html(j,"close");k.on(j,"click",function(m){m.halt();e.hide()});e.header.appendChild(j)},setHeader:function(e){this._setContent("header",e)},setFooter:function(e){this._setContent("footer",e)}});c.DialogManager={register:function(e){e instanceof g&&this._dialog.push(e)},_dialog:[],hideAll:function(){c.each(this._dialog,function(e){e&&e.hide()})}}},{host:"overlay"});
KISSY.add("autorender",function(c){c.Overlay.autoRender=function(g,i){g="."+(g||"KS_Widget");c.query(g,i).each(function(k){var d=k.getAttribute("data-widget-type"),e;if(d&&"Dialog Popup".indexOf(d)>-1)try{if(e=k.getAttribute("data-widget-config"))e=e.replace(/'/g,'"');new c[d](k,c.JSON.parse(e))}catch(j){}})}},{host:"overlay"});
/*
Copyright 2010, KISSY UI Library v1.1.5
MIT Licensed
build time: Oct 21 14:18
*/
KISSY.add("imagezoom",function(i,n){function o(a,b){var c=this,d;if(!(c instanceof o))return new o(a,b);if(c.image=a=i.get(a)){c.config=b=i.merge(C,b);if(!b.bigImageSrc)if((d=e.attr(a,"data-ks-imagezoom"))&&y.test(d))b.bigImageSrc=d;b.offset=i.makeArray(b.offset);if(b.preload)(new Image).src=b.bigImageSrc;c._isInner=b.position===p[4];c._alignTo();c._bigImageSize={width:b.bigImageSize[0],height:b.bigImageSize[1]};b.hasZoom&&!a.complete&&c._startLoading();c._firstInit=true;q(a,function(){if(b.hasZoom){c._init();
c._finishLoading()}})}}function q(a,b){D(a)&&b();l.on(a,E,b)}function r(a){return{width:a.clientWidth,height:a.clientHeight}}function k(a){return e.create('<div class="'+a+'" style="position:absolute;top:0;left:0">')}function s(a,b,c){i.each(i.makeArray(a),function(d){e.width(d,b);e.height(d,c)})}function D(a){return a&&a.complete&&a.clientWidth?true:false}function z(a,b){a=e.create('<img src="'+a+'" style="position:absolute;top:0;left:0" >');b&&b.appendChild(a);return a}var m=document,e=i.DOM,l=
i.Event,y=/^.+\.(?:jpg|png|gif)$/i,t=Math.round,u=Math.min,A=Math.max,E="load",p=["top","right","bottom","left","inner"],C={type:"standard",bigImageSrc:"",bigImageSize:[800,800],position:"right",offset:10,preload:true,zoomSize:["auto","auto"],lensIcon:true,hasZoom:true,zoomCls:""};i.augment(o,i.EventTarget,{_alignTo:function(){var a=this.config;if(!this._isInner&&a.alignTo)if(a=a.alignTo==="parent"?this.image.offsetParent:i.get(a.alignTo))this._alignToRegion=i.merge(e.offset(a),r(a))},_init:function(){this._renderUI();
this._firstInit&&this._bindUI();this._firstInit=false},_renderUI:function(){var a=this.config,b=this.image;this._imgRegion=i.merge(e.offset(b),r(b));a.lensIcon&&this._renderIcon()},_renderIcon:function(){var a=this._alignToRegion||this._imgRegion,b=this.lensIcon;if(!b){b=k("ks-imagezoom-icon");m.body.appendChild(b);this.lensIcon=b}e.offset(b,{left:a.left+a.width-e.width(b),top:a.top+a.height-e.height(b)})},_bindUI:function(){var a=this,b,c=a.config;l.on(a.image,"mouseenter",function(d){if(c.hasZoom){a._setEv(d);
l.on(m.body,"mousemove",a._setEv,a);b=i.later(function(){a.viewer||a._createViewer();a.show()},300)}});l.on(a.image,"mouseleave",function(){if(c.hasZoom){l.remove(m.body,"mousemove",a._setEv);if(b){b.cancel();b=n}}})},_setEv:function(a){this._ev=a},_createViewer:function(){var a=this,b=a.config,c,d,g,f=a._bigImageSize;c=k("ks-imagezoom-viewer "+b.zoomCls);if(a._isInner){g=z(e.attr(a.image,"src"),c);s(g,f.width,f.height);a._bigImageCopy=g}else a._renderLens();if(b.bigImageSrc){d=z(b.bigImageSrc,c);
a.bigImage=d}m.body.appendChild(c);a.viewer=c;a._setViewerRegion();q(d,function(){if(!a._isInner)a._bigImageSize=r(d);a._setViewerRegion();a._isInner||a._onMouseMove()})},_renderLens:function(){var a=k("ks-imagezoom-lens");e.hide(a);m.body.appendChild(a);this.lens=a},_setViewerRegion:function(){var a=this.config,b=this.viewer,c=this._imgRegion,d=this._alignToRegion||c,g=a.zoomSize,f,h,j;h=this._bigImageSize;j=g[0];if(j==="auto")j=c.width;g=g[1];if(g==="auto")g=c.height;f=u(t(j*c.width/h.width),c.width);
h=u(t(g*c.height/h.height),c.height);this._lensSize=[f,h];this._isInner||s(this.lens,f,h);f=d.left+(a.offset[0]||0);h=d.top+(a.offset[1]||0);switch(a.position){case p[0]:h-=g;break;case p[1]:f+=d.width;break;case p[2]:h+=d.height;break;case p[3]:f-=j;break;case p[4]:j=c.width;g=c.height;break}e.offset(b,{left:f,top:h});s(b,j,g)},_onMouseMove:function(){var a=this.lens,b=this._ev,c=this._imgRegion,d=c.left,g=c.top,f=c.width;c=c.height;var h=this._bigImageSize;if(b.pageX>d&&b.pageX<d+f&&b.pageY>g&&
b.pageY<g+c){if(!(this._isInner&&this._animTimer)){b=this._getLensOffset();!this._isInner&&a&&e.offset(a,b);e.css([this._bigImageCopy,this.bigImage],{marginLeft:-t((b.left-d)*h.width/f),marginTop:-t((b.top-g)*h.height/c)})}}else this.hide()},_getLensOffset:function(){var a=this._imgRegion,b=this._ev,c=a.left,d=a.top,g=a.width;a=a.height;var f=this._lensSize,h=f[0];f=f[1];var j=b.pageX-h/2;b=b.pageY-f/2;if(j<=c)j=c;else if(j>=g+c-h)j=g+c-h;if(b<=d)b=d;else if(b>=a+d-f)b=a+d-f;return{left:j,top:b}},
_anim:function(a,b){var c=this,d,g=1;d=c._ev;var f=c._imgRegion,h=f.width,j=f.height,v=[c.bigImage,c._bigImageCopy],F=d.pageX-f.left,G=d.pageY-f.top,B=c._bigImageSize;c._animTimer&&c._animTimer.cancel();s(v,h,j);c._animTimer=i.later(d=function(){var w=h+(B.width-h)/b*g,x=j+(B.height-j)/b*g;s(v,w,x);e.css(v,{marginLeft:A(u(t(h/2-F*w/h),0),h-w),marginTop:A(u(t(j/2-G*x/j),0),j-x)});if(++g>b){c._animTimer.cancel();c._animTimer=n}},a*1E3/b,true);d()},show:function(){var a=this.lens,b=this.viewer,c=this.config.bigImageSrc;
e.hide(this.lensIcon);if(this._isInner){e.show(b);this._anim(0.5,30)}else{e.show([a,b]);this._onMouseMove()}if(this._refresh){this._setViewerRegion();this._refresh=false}if(this._cacheBigImageSrc&&this._cacheBigImageSrc!==c){e.attr(this.bigImage,"src",c);this._cacheBigImageSrc=c;this._isInner&&e.attr(this._bigImageCopy,"src",e.attr(this.image,"src"))}l.on(m.body,"mousemove",this._onMouseMove,this)},hide:function(){e.hide([this.lens,this.viewer]);e.show(this.lensIcon);l.remove(m.body,"mousemove",this._onMouseMove,
this)},set:function(a,b){var c=this.config;if(a==="bigImageSrc"){if(b&&y.test(b)){this._cacheBigImageSrc=c.bigImageSrc;c.bigImageSrc=b}}else if(a==="hasZoom"){b=!!b;c.hasZoom=b;e[b?"show":"hide"](this.lensIcon)}},_startLoading:function(){e.addClass(this.viewer,"ks-imagezoom-loading")},_finishLoading:function(){e.removeClass(this.viewer,"ks-imagezoom-loading")},changeImageSrc:function(a){e.attr(this.image,"src",a);this._startLoading()},refreshRegion:function(){this._alignTo();this._renderUI();this._refresh=
true}});i.ImageZoom=o});KISSY.add("autorender",function(i){i.ImageZoom.autoRender=function(n,o){n="."+(n||"KS_Widget");i.query(n,o).each(function(q){var r=q.getAttribute("data-widget-type"),k;if(r==="ImageZoom")try{if(k=q.getAttribute("data-widget-config"))k=k.replace(/'/g,'"');new i[r](q,i.JSON.parse(k))}catch(s){}})}},{host:"imagezoom"});
/*
Copyright 2010, KISSY UI Library v1.1.5
MIT Licensed
build time: Oct 19 16:37
*/
KISSY.add("flash",function(e){e.Flash={swfs:{},length:0}},{requires:["core"]});
KISSY.add("flash-ua",function(e){function l(g){var h=e.isString(g)?g.match(/(\d)+/g):g;g=g;if(e.isArray(h))g=parseFloat(h[0]+"."+j(h[1],3)+j(h[2],5));return g||0}function j(g,h){for(var a=(g+"").length;a++<h;)g="0"+g;return g}var k=e.UA,f,n,m=true;k.fpv=function(g){if(g||m){m=false;var h;if(navigator.plugins&&navigator.mimeTypes.length)h=(navigator.plugins["Shockwave Flash"]||0).description;else if(window.ActiveXObject)try{h=(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(a){}f=
h?h.match(/(\d)+/g):void 0;n=l(f)}return f};k.fpvGEQ=function(g,h){m&&k.fpv(h);return!!n&&n>=l(g)}},{host:"flash"});
KISSY.add("flash-embed",function(e){function l(a,b,c){var d=k.create("<param>");k.attr(d,{name:b,value:c});a.appendChild(d)}var j=e.UA,k=e.DOM,f=e.Flash,n=/^(?:object|embed)/i,m=encodeURIComponent,g={wmode:"",allowscriptaccess:"",allownetworking:"",allowfullscreen:"",play:"false",loop:"",menu:"",quality:"",scale:"",salign:"",bgcolor:"",devicefont:"",base:"",swliveconnect:"",seamlesstabbing:""},h={params:{},attrs:{width:215,height:138},version:9};e.mix(f,{fpv:j.fpv,fpvGEQ:j.fpvGEQ,add:function(a,b,
c){var d,i;b=f._normalize(b);b=e.merge(h,b);b.attrs=e.merge(h.attrs,b.attrs);if(a=e.get(a)){if(!a.id)a.id=e.guid("ks-flash-");i=b.attrs.id=a.id;if(j.fpv()){if(!j.fpvGEQ(b.version)){this._callback(c,0,i,a);if(!((d=b.xi)&&e.isString(d)))return;b.src=d}if(n.test(a.nodeName))this._register(a,b,c);else b.src?this._embed(a,b,c):this._callback(c,-3,i,a)}else this._callback(c,-1,i,a)}else this._callback(c,-2)},get:function(a){return f.swfs[a]},remove:function(a){if(a=f.get("#"+a)){k.remove(a);delete f.swfs[a.id];
f.length-=1}},contains:function(a){var b=f.swfs,c,d=false;if(e.isString(a))d=a in b;else for(c in b)if(b[c]===a){d=true;break}return d},_register:function(a,b,c){b=b.attrs.id;if(j.gecko||j.opera)a=e.query("object",a)[0]||a;f._addSWF(b,a);f._callback(c,1,b,a)},_embed:function(a,b,c){var d=f._createSWF(b.src,b.attrs,b.params);if(j.ie)a.outerHTML=d.outerHTML;else a.parentNode.replaceChild(d,a);a=e.get("#"+a.id);f._register(a,b,c)},_callback:function(a,b,c,d){b&&e.isFunction(a)&&a({status:b,id:c,swf:d})},
_addSWF:function(a,b){if(a&&b){f.swfs[a]=b;f.length+=1}},_createSWF:function(a,b,c){var d=k.create("<object>"),i;k.attr(d,b);if(j.ie){k.attr(d,"classid","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");l(d,"movie",a)}else k.attr(d,{type:"application/x-shockwave-flash",data:a,name:b.id});for(i in c)i in g&&l(d,i,c[i]);c.flashvars&&l(d,"flashvars",f.toFlashVars(c.flashvars));return d},_normalize:function(a){var b,c,d,i=a||{};if(e.isPlainObject(a)){i={};for(d in a){b=d.toLowerCase();c=a[d];if(b!=="flashvars")c=
f._normalize(c);i[b]=c}}return i},toFlashVars:function(a){if(!e.isPlainObject(a))return"";var b,c,d=[];for(b in a){c=a[b];if(e.isString(c))c=m(c);else{c=e.JSON.stringify(c);if(!c)continue;c=c.replace(/:"([^"]+)/g,function(i,o){return':"'+m(o)})}d.push(b+"="+c)}return d.join("&").replace(/"/g,"'")}})},{host:"flash"});
TB.add("mod~global",function(){var c=KISSY,j=c.DOM,i=c.Event,f=c.UA,h=document,e=window,d,a,b={siteNav:function(){if(f.ie===6){c.each(j.query("#site-nav div.menu"),function(k){if(k&&j.get("div.menu-bd",k)){i.on(k,"mouseenter mouseleave",function(){j.toggleClass(this.parentNode,"hover")})}})}i.on(document.forms.topSearch,"submit",function(){if(form.q.value==""){form.action="http://list.taobao.com/browse/cat-0.htm"}})},tDog:function(){if((("g_config" in e)&&("appId" in e.g_config)&&e.g_config["appId"]!=-1)||"tstart" in a||"tdog" in a){c.ready(function(){var k="http://"+d+"/p/header/webww-min.js?t=20101201.js";c.getScript(k)})}},tLabs:function(){if(!g("l")){return}c.ready(function(){var k="http://"+d+"/p/tlabs/??tlabs.js,base64.js,cookie.js,validator.js,loader.js,util.js,top.js?t=20101012.js";if("ks-local" in a){k="http://test.taobao.com/code/fed/2010/tlabs/combo.php?b=src&f=tlabs.js,base64.js,cookie.js,validator.js,loader.js,util.js,top.js"}c.getScript(k,function(){if(typeof TLabs!=="undefined"){TLabs.init()}})})},searchMonitor:function(){}};TB.mods.Global={init:function(){var m=location.hostname.split("."),n=m.slice(m.length-2).join(".");d=(n.indexOf("taobao.com")>-1||n.indexOf("tmall.com")>-1)?"a.tbcdn.cn":"assets.daily.taobao.net";a=c.unparam(location.search.substring(1));for(var l in b){b[l]()}}};function g(l){var k=document.cookie.match("(?:^|;)\\s*"+l+"=([^;]*)");return(k&&k[1])?decodeURIComponent(k[1]):""}});
