/*
Copyright 2010, KISSY UI Library v1.1.5
MIT Licensed
build time: Sep 19 17:41
*/
(function(c,s,v){if(c[s]===v)c[s]={};s=c[s];var d=c.document,g=location,e=function(h,q,n,o){if(!q||!h)return h;if(n===v)n=true;var p,a,b;if(o&&(b=o.length))for(p=0;p<b;p++){a=o[p];if(a in q)if(n||!(a in h))h[a]=q[a]}else for(a in q)if(n||!(a in h))h[a]=q[a];return h},i=false,l=[],u=false,r=/^#?([\w-]+)$/,m=0;e(s,{version:"1.1.5",__init:function(){this.Env={mods:{},_loadQueue:{}};var h=d.getElementsByTagName("script");this.Config={debug:"",base:h[h.length-1].src.replace(/^(.*)(seed|kissy).*$/i,
"$1"),timeout:10}},ready:function(h){u||this._bindReady();i?h.call(c,this):l.push(h);return this},_bindReady:function(){var h=this,q=d.documentElement.doScroll,n=q?"onreadystatechange":"DOMContentLoaded",o=function(){h._fireReady()};u=true;if(d.readyState==="complete")return o();if(d.addEventListener){var p=function(){d.removeEventListener(n,p,false);o()};d.addEventListener(n,p,false);c.addEventListener("load",o,false)}else{var a=function(){if(d.readyState==="complete"){d.detachEvent(n,a);o()}};d.attachEvent(n,
a);c.attachEvent("onload",o);if(c==c.top){var b=function(){try{q("left");o()}catch(f){setTimeout(b,1)}};b()}}},_fireReady:function(){if(!i){i=true;if(l){for(var h,q=0;h=l[q++];)h.call(c,this);l=null}}},available:function(h,q){if((h=(h+"").match(r)[1])&&s.isFunction(q))var n=1,o=s.later(function(){if(d.getElementById(h)&&(q()||1)||++n>500)o.cancel()},40,true)},mix:e,merge:function(){var h={},q,n=arguments.length;for(q=0;q<n;++q)e(h,arguments[q]);return h},augment:function(){var h=arguments,q=h.length-
2,n=h[0],o=h[q],p=h[q+1],a=1;if(!s.isArray(p)){o=p;p=v;q++}if(!s.isBoolean(o)){o=v;q++}for(;a<q;a++)e(n.prototype,h[a].prototype||h[a],o,p);return n},extend:function(h,q,n,o){if(!q||!h)return h;var p=Object.prototype,a=q.prototype,b=function(f){function k(){}k.prototype=f;return new k}(a);h.prototype=b;b.constructor=h;h.superclass=a;if(q!==Object&&a.constructor===p.constructor)a.constructor=q;n&&e(b,n);o&&e(h,o);return h},namespace:function(){var h=arguments,q=h.length,n=null,o,p,a,b=h[q-1]===true&&
q--;for(o=0;o<q;++o){a=(""+h[o]).split(".");n=b?c:this;for(p=c[a[0]]===n?1:0;p<a.length;++p)n=n[a[p]]=n[a[p]]||{}}return n},app:function(h,q){var n=s.isString(h),o=n?c[h]||{}:h;e(o,this,true,s.__APP_MEMBERS);o.__init();e(o,s.isFunction(q)?q():q);n&&(c[h]=o);return o},log:function(h,q,n){if(s.Config.debug){if(n)h=n+": "+h;if(c.console!==v&&console.log)console[q&&console[q]?q:"log"](h)}},error:function(h){if(s.Config.debug)throw h;},guid:function(h){var q=m++ +"";return h?h+q:q}});s.__init();s.__APP_MEMBERS=
["__init","namespace"];if(g&&(g.search||"").indexOf("ks-debug")!==-1)s.Config.debug=true})(window,"KISSY");
(function(c,s,v){function d(j){var t=typeof j;return j===null||t!=="object"&&t!=="function"}function g(j){return l.slice.call(j)}var e=document,i=e.documentElement,l=Array.prototype,u=l.indexOf,r=l.lastIndexOf,m=l.filter,h=String.prototype.trim,q=Object.prototype.toString,n=encodeURIComponent,o=decodeURIComponent,p=n("[]"),a=/^\s+|\s+$/g,b=/^(\w+)\[\]$/,f=/\S/;s.mix(s,{isUndefined:function(j){return j===v},isBoolean:function(j){return q.call(j)==="[object Boolean]"},isString:function(j){return q.call(j)===
"[object String]"},isNumber:function(j){return q.call(j)==="[object Number]"&&isFinite(j)},isPlainObject:function(j){return j&&q.call(j)==="[object Object]"&&!j.nodeType&&!j.setInterval},isEmptyObject:function(j){for(var t in j)return false;return true},isFunction:function(j){return q.call(j)==="[object Function]"},isArray:function(j){return q.call(j)==="[object Array]"},trim:h?function(j){return j==v?"":h.call(j)}:function(j){return j==v?"":j.toString().replace(a,"")},substitute:function(j,t,x){if(!s.isString(j)||
!s.isPlainObject(t))return j;return j.replace(x||/\\?\{([^{}]+)\}/g,function(w,y){if(w.charAt(0)==="\\")return w.slice(1);return t[y]!==v?t[y]:""})},each:function(j,t,x){var w,y=0,z=j.length,A=z===v||s.isFunction(j);x=x||c;if(A)for(w in j){if(t.call(x,j[w],w,j)===false)break}else for(w=j[0];y<z&&t.call(x,w,y,j)!==false;w=j[++y]);return j},indexOf:u?function(j,t){return u.call(t,j)}:function(j,t){for(var x=0,w=t.length;x<w;++x)if(t[x]===j)return x;return-1},lastIndexOf:r?function(j,t){return r.call(t,
j)}:function(j,t){for(var x=t.length-1;x>=0;x--)if(t[x]===j)break;return x},unique:function(j,t){t&&j.reverse();for(var x=j.slice(),w=0,y,z;w<x.length;){for(z=x[w];(y=s.lastIndexOf(z,x))!==w;)x.splice(y,1);w+=1}t&&x.reverse();return x},inArray:function(j,t){return s.indexOf(j,t)>-1},makeArray:function(j){if(j===null||j===v)return[];if(s.isArray(j))return j;if(typeof j.length!=="number"||s.isString(j)||s.isFunction(j))return[j];return g(j)},filter:m?function(j,t,x){return m.call(j,t,x)}:function(j,
t,x){var w=[];s.each(j,function(y,z,A){t.call(x,y,z,A)&&w.push(y)});return w},param:function(j,t){if(!s.isPlainObject(j))return"";t=t||"&";var x=[],w,y;for(w in j){y=j[w];w=n(w);if(d(y))x.push(w,"=",n(y+""),t);else if(s.isArray(y)&&y.length)for(var z=0,A=y.length;z<A;++z)d(y[z])&&x.push(w,p+"=",n(y[z]+""),t)}x.pop();return x.join("")},unparam:function(j,t){if(typeof j!=="string"||(j=s.trim(j)).length===0)return{};for(var x={},w=j.split(t||"&"),y,z,A,B,D=0,C=w.length;D<C;++D){y=w[D].split("=");z=o(y[0]);
try{A=o(y[1]||"")}catch(E){A=y[1]||""}if((B=z.match(b))&&B[1]){x[B[1]]=x[B[1]]||[];x[B[1]].push(A)}else x[z]=A}return x},later:function(j,t,x,w,y){t=t||0;w=w||{};var z=j,A=s.makeArray(y),B;if(s.isString(j))z=w[j];z||s.error("method undefined");j=function(){z.apply(w,A)};B=x?setInterval(j,t):setTimeout(j,t);return{id:B,interval:x,cancel:function(){this.interval?clearInterval(B):clearTimeout(B)}}},clone:function(j){var t=j,x,w;if(j&&((x=s.isArray(j))||s.isPlainObject(j))){t=x?[]:{};for(w in j)if(j.hasOwnProperty(w))t[w]=
s.clone(j[w])}return t},now:function(){return(new Date).getTime()},globalEval:function(j){if(j&&f.test(j)){var t=e.getElementsByTagName("head")[0]||i,x=e.createElement("script");x.text=j;t.insertBefore(x,t.firstChild);t.removeChild(x)}}});try{g(i.childNodes)}catch(k){g=function(j){for(var t=[],x=j.length-1;x>=0;x--)t[x]=j[x];return t}}})(window,KISSY);
(function(c,s,v){var d=c.document,g=d.getElementsByTagName("head")[0]||d.documentElement,e=2,i=3,l=4,u=s.mix,r=d.createElement("script").readyState?function(h,q){var n=h.onreadystatechange;h.onreadystatechange=function(){var o=h.readyState;if(o==="loaded"||o==="complete"){h.onreadystatechange=null;n&&n();q.call(this)}}}:function(h,q){h.addEventListener("load",q,false)},m=/\.css(?:\?|$)/i;c={add:function(h,q,n){var o=this.Env.mods,p;if(s.isString(h)&&!n&&s.isPlainObject(q)){p={};p[h]=q;h=p}if(s.isPlainObject(h)){s.each(h,
function(a,b){a.name=b;o[b]&&u(a,o[b],false)});u(o,h)}else{n=n||{};p=o[h]||{};h=n.host||p.host||h;p=o[h]||{};u(p,{name:h,status:e});if(!p.fns)p.fns=[];q&&p.fns.push(q);u(o[h]=p,n);p.attach!==false&&this.__isAttached(p.requires)&&this.__attachMod(p)}return this},use:function(h,q,n){h=h.replace(/\s+/g,"").split(",");n=n||{};var o=this,p=o.Env.mods,a=(n||0).global,b,f=h.length,k,j,t;a&&o.__mixMods(a);if(o.__isAttached(h))q&&q(o);else{for(b=0;b<f&&(k=p[h[b]]);b++)if(k.status!==l){if(n.order&&b>0){if(!k.requires)k.requires=
[];k._requires=k.requires.concat();j=h[b-1];if(!s.inArray(j,k.requires)&&!s.inArray(k.name,p[j].requires||[]))k.requires.push(j)}o.__attach(k,function(){if(!t&&o.__isAttached(h)){t=true;if(k._requires)k.requires=k._requires;q&&q(o)}},a)}return o}},__attach:function(h,q,n){function o(){if(p.__isAttached(a)){h.status===e&&p.__attachMod(h);h.status===l&&q()}}for(var p=this,a=h.requires||[],b=0,f=a.length;b<f;b++)p.__attach(p.Env.mods[a[b]],o,n);p.__buildPath(h);p.__load(h,o,n)},__mixMods:function(h){var q=
this.Env.mods,n=h.Env.mods,o;for(o in n)this.__mixMod(q,n,o,h)},__mixMod:function(h,q,n,o){var p=h[n]||{},a=p.status;s.mix(p,s.clone(q[n]));if(a)p.status=a;o&&this.__buildPath(p,o.Config.base);h[n]=p},__attachMod:function(h){var q=this;if(h.fns){s.each(h.fns,function(n){n&&n(q)});h.fns=v}h.status=l},__isAttached:function(h){for(var q=this.Env.mods,n,o=(h=s.makeArray(h)).length-1;o>=0&&(n=q[h[o]]);o--)if(n.status!==l)return false;return true},__load:function(h,q,n){function o(){b[a]=e;if(h.status!==
i){n&&p.__mixMod(p.Env.mods,n.Env.mods,h.name,n);if(h.status!==l)h.status=e;q()}}var p=this,a=h.fullpath,b=s.Env._loadQueue,f=b[a];h.status=h.status||0;if(h.status<1&&f)h.status=f.nodeName?1:e;if(s.isString(h.cssfullpath)){p.getScript(h.cssfullpath);h.cssfullpath=e}if(h.status<1&&a){h.status=1;f=p.getScript(a,{success:function(){KISSY.log(h.name+" is loaded.","info");o()},error:function(){h.status=i;b[a]=e},charset:h.charset});m.test(a)||(b[a]=f)}else h.status===1?r(f,o):q()},__buildPath:function(h,
q){function n(p,a){if(!h[a]&&h[p])h[a]=(q||o.base)+h[p];if(h[a]&&o.debug)h[a]=h[a].replace(/-min/g,"")}var o=this.Config;n("path","fullpath");h.cssfullpath!==e&&n("csspath","cssfullpath")},getScript:function(h,q,n){var o=m.test(h),p=d.createElement(o?"link":"script"),a=q,b,f,k;if(s.isPlainObject(a)){q=a.success;b=a.error;f=a.timeout;n=a.charset}if(o){p.href=h;p.rel="stylesheet"}else{p.src=h;p.async=true}if(n)p.charset=n;if(s.isFunction(q))o?q.call(p):r(p,function(){if(k){k.cancel();k=v}q.call(p)});
if(s.isFunction(b))k=s.later(function(){k=v;b()},(f||this.Config.timeout)*1E3);g.insertBefore(p,g.firstChild);return p}};u(s,c);s.each(c,function(h,q){s.__APP_MEMBERS.push(q)})})(window,KISSY);(function(c){var s={core:{path:"packages/core-min.js",charset:"utf-8"}};c.each(["sizzle","datalazyload","flash","switchable","suggest","overlay","imagezoom","calendar"],function(v){s[v]={path:v+"/"+v+"-pkg-min.js",requires:["core"],charset:"utf-8"}});s.calendar.csspath="calendar/default-min.css";c.add(s)})(KISSY);
KISSY.add("ua",function(c){var s=navigator.userAgent,v="",d="",g,e={},i=function(l){var u=0;return parseFloat(l.replace(/\./g,function(){return u++===0?".":""}))};if((g=s.match(/AppleWebKit\/([\d.]*)/))&&g[1]){e[v="webkit"]=i(g[1]);if((g=s.match(/Chrome\/([\d.]*)/))&&g[1])e[d="chrome"]=i(g[1]);else if((g=s.match(/\/([\d.]*) Safari/))&&g[1])e[d="safari"]=i(g[1]);if(/ Mobile\//.test(s))e.mobile="apple";else if(g=s.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))e.mobile=g[0].toLowerCase()}else if((g=
s.match(/Presto\/([\d.]*)/))&&g[1]){e[v="presto"]=i(g[1]);if((g=s.match(/Opera\/([\d.]*)/))&&g[1]){e[d="opera"]=i(g[1]);if((g=s.match(/Opera\/.* Version\/([\d.]*)/))&&g[1])e[d]=i(g[1]);if((g=s.match(/Opera Mini[^;]*/))&&g)e.mobile=g[0].toLowerCase();else if((g=s.match(/Opera Mobi[^;]*/))&&g)e.mobile=g[0]}}else if((g=s.match(/MSIE\s([^;]*)/))&&g[1]){e[v="trident"]=0.1;e[d="ie"]=i(g[1]);if((g=s.match(/Trident\/([\d.]*)/))&&g[1])e[v]=i(g[1])}else if(g=s.match(/Gecko/)){e[v="gecko"]=0.1;if((g=s.match(/rv:([\d.]*)/))&&
g[1])e[v]=i(g[1]);if((g=s.match(/Firefox\/([\d.]*)/))&&g[1])e[d="firefox"]=i(g[1])}e.core=v;e.shell=d;e._numberify=i;c.UA=e});
KISSY.add("ua-extra",function(c){var s=c.UA,v=navigator.userAgent,d,g,e={},i=s._numberify;if(v.match(/360SE/))e[g="se360"]=3;else if(v.match(/Maxthon/)&&(d=window.external)){g="maxthon";try{e[g]=i(d.max_version)}catch(l){e[g]=0.1}}else if(d=v.match(/TencentTraveler\s([\d.]*)/))e[g="tt"]=d[1]?i(d[1]):0.1;else if(v.match(/TheWorld/))e[g="theworld"]=3;else if(d=v.match(/SE\s([\d.]*)/))e[g="sougou"]=d[1]?i(d[1]):0.1;g&&(e.shell=g);c.mix(s,e)});
KISSY.add("dom",function(c,s){function v(d,g){return d&&d.nodeType===g}c.DOM={_isElementNode:function(d){return v(d,1)},_isKSNode:function(d){return c.Node&&v(d,c.Node.TYPE)},_getWin:function(d){return d&&"scrollTo"in d&&d.document?d:v(d,9)?d.defaultView||d.parentWindow:d===s?window:false},_nodeTypeIs:v}});
KISSY.add("selector",function(c,s){function v(a,b){var f,k,j=[],t;b=d(b);if(c.isString(a)){a=c.trim(a);if(o.test(a)){if(k=g(a.slice(1),b))j=[k]}else if(f=p.exec(a)){k=f[1];t=f[2];f=f[3];if(b=k?g(k,b):b)if(f)if(!k||a.indexOf(m)!==-1)j=i(f,t,b);else{if((k=g(k,b))&&r.hasClass(k,f))j=[k]}else if(t)j=e(t,b)}else if(c.ExternalSelector)return c.ExternalSelector(a,b);else l(a)}else if(a&&(a[q]||a[n]))j=a[q]?[a[q]()]:a[n]();else if(a&&(c.isArray(a)||a&&!a.nodeType&&a.item&&a!=window))j=a;else if(a)j=[a];if(j&&
!j.nodeType&&j.item&&j!=window)j=c.makeArray(j);j.each=function(x,w){return c.each(j,x,w)};return j}function d(a){if(a===s)a=u;else if(c.isString(a)&&o.test(a))a=g(a.slice(1),u);else if(a&&a.nodeType!==1&&a.nodeType!==9)a=null;return a}function g(a,b){if(b.nodeType!==9)b=b.ownerDocument;return b.getElementById(a)}function e(a,b){return b.getElementsByTagName(a)}function i(a,b,f){f=a=f.getElementsByClassName(a);var k=0,j=0,t=a.length,x;if(b&&b!==h){f=[];for(b=b.toUpperCase();k<t;++k){x=a[k];if(x.tagName===
b)f[j++]=x}}return f}function l(a){c.error("Unsupported selector: "+a)}var u=document,r=c.DOM,m=" ",h="*",q="getDOMNode",n=q+"s",o=/^#[\w-]+$/,p=/^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/;(function(){var a=u.createElement("div");a.appendChild(u.createComment(""));if(a.getElementsByTagName(h).length>0)e=function(b,f){var k=f.getElementsByTagName(b);if(b===h){for(var j=[],t=0,x=0,w;w=k[t++];)if(w.nodeType===1)j[x++]=w;k=j}return k}})();u.getElementsByClassName||(i=u.querySelectorAll?function(a,b,
f){return f.querySelectorAll((b?b:"")+"."+a)}:function(a,b,f){b=f.getElementsByTagName(b||h);f=[];var k=0,j=0,t=b.length,x,w;for(a=m+a+m;k<t;++k){x=b[k];if((w=x.className)&&(m+w+m).indexOf(a)>-1)f[j++]=x}return f});c.query=v;c.get=function(a,b){return v(a,b)[0]||null};c.mix(r,{query:v,get:c.get,filter:function(a,b){var f=v(a),k,j,t,x=[];if(c.isString(b)&&(k=p.exec(b))&&!k[1]){j=k[2];t=k[3];b=function(w){return!(j&&w.tagName!==j.toUpperCase()||t&&!r.hasClass(w,t))}}if(c.isFunction(b))x=c.filter(f,
b);else if(b&&c.ExternalSelector)x=c.ExternalSelector._filter(a,b);else l(b);return x},test:function(a,b){var f=v(a);return r.filter(f,b).length===f.length}})});
KISSY.add("dom-data",function(c,s){var v=window,d=c.DOM,g="_ks_data_"+c.now(),e={},i={},l={EMBED:1,OBJECT:1,APPLET:1};c.mix(d,{data:function(u,r,m){if(c.isPlainObject(r))for(var h in r)d.data(u,h,r[h]);else if(m===s){u=c.get(u);var q;if(!(!u||l[u.nodeName])){if(u==v)u=i;q=(h=u&&u.nodeType)?e:u;u=q[h?u[g]:g];if(c.isString(r)&&u)return u[r];return u}}else c.query(u).each(function(n){if(!(!n||l[n.nodeName])){if(n==v)n=i;var o=e,p;if(n&&n.nodeType){if(!(p=n[g]))p=n[g]=c.guid()}else{p=g;o=n}if(r&&m!==
s){o[p]||(o[p]={});o[p][r]=m}}})},removeData:function(u,r){c.query(u).each(function(m){if(m){if(m==v)m=i;var h,q=e,n,o=m&&m.nodeType;if(o)h=m[g];else{q=m;h=g}if(h){n=q[h];if(r){if(n){delete n[r];c.isEmptyObject(n)&&d.removeData(m)}}else{if(o)m.removeAttribute&&m.removeAttribute(g);else try{delete m[g]}catch(p){}o&&delete q[h]}}}})}})});
KISSY.add("dom-class",function(c,s){function v(i,l,u,r){if(!(l=c.trim(l)))return r?false:s;i=c.query(i);var m=0,h=i.length;l=l.split(g);for(var q;m<h;m++){q=i[m];if(d._isElementNode(q)){q=u(q,l,l.length);if(q!==s)return q}}if(r)return false}var d=c.DOM,g=/[\.\s]\s*\.?/,e=/[\n\t]/g;c.mix(d,{hasClass:function(i,l){return v(i,l,function(u,r,m){if(u=u.className){u=" "+u+" ";for(var h=0,q=true;h<m;h++)if(u.indexOf(" "+r[h]+" ")<0){q=false;break}if(q)return true}},true)},addClass:function(i,l){v(i,l,function(u,
r,m){var h=u.className;if(h){var q=" "+h+" ";h=h;for(var n=0;n<m;n++)if(q.indexOf(" "+r[n]+" ")<0)h+=" "+r[n];u.className=c.trim(h)}else u.className=l})},removeClass:function(i,l){v(i,l,function(u,r,m){var h=u.className;if(h)if(m){h=(" "+h+" ").replace(e," ");for(var q=0,n;q<m;q++)for(n=" "+r[q]+" ";h.indexOf(n)>=0;)h=h.replace(n," ");u.className=c.trim(h)}else u.className=""})},replaceClass:function(i,l,u){d.removeClass(i,l);d.addClass(i,u)},toggleClass:function(i,l,u){var r=c.isBoolean(u),m;v(i,
l,function(h,q,n){for(var o=0,p;o<n;o++){p=q[o];m=r?!u:d.hasClass(h,p);d[m?"removeClass":"addClass"](h,p)}})}})});
KISSY.add("dom-attr",function(c,s){var v=c.UA,d=v.ie,g=d&&d<8,e=document.documentElement.textContent!==s?"textContent":"innerText",i=c.DOM,l=i._isElementNode,u=/href|src|style/,r=/href|src|colspan|rowspan/,m=/\r/g,h=/radio|checkbox/,q={readonly:"readOnly"},n={val:1,css:1,html:1,text:1,data:1,width:1,height:1,offset:1};g&&c.mix(q,{"for":"htmlFor","class":"className"});c.mix(i,{attr:function(o,p,a,b){if(c.isPlainObject(p)){b=a;for(var f in p)i.attr(o,f,p[f],b)}else if(p=c.trim(p)){p=p.toLowerCase();
if(b&&n[p])return i[p](o,a);p=q[p]||p;if(a===s){o=c.get(o);if(!l(o))return s;var k;u.test(p)||(k=o[p]);if(k===s)k=o.getAttribute(p);if(g)if(r.test(p))k=o.getAttribute(p,2);else if(p==="style")k=o.style.cssText;return k===null?s:k}c.each(c.query(o),function(j){if(l(j))if(p==="style")j.style.cssText=a;else{if(p==="checked")j[p]=!!a;j.setAttribute(p,""+a)}})}},removeAttr:function(o,p){c.each(c.query(o),function(a){if(l(a)){i.attr(a,p,"");a.removeAttribute(p)}})},val:function(o,p){if(p===s){var a=c.get(o);
if(!l(a))return s;if(a&&a.nodeName.toUpperCase()==="option".toUpperCase())return(a.attributes.value||{}).specified?a.value:a.text;if(a&&a.nodeName.toUpperCase()==="select".toUpperCase()){var b=a.selectedIndex,f=a.options;if(b<0)return null;else if(a.type==="select-one")return i.val(f[b]);a=[];for(var k=0,j=f.length;k<j;++k)f[k].selected&&a.push(i.val(f[k]));return a}if(v.webkit&&h.test(a.type))return a.getAttribute("value")===null?"on":a.value;return(a.value||"").replace(m,"")}c.each(c.query(o),function(t){if(t&&
t.nodeName.toUpperCase()==="select".toUpperCase()){if(c.isNumber(p))p+="";var x=c.makeArray(p),w=t.options,y;k=0;for(j=w.length;k<j;++k){y=w[k];y.selected=c.inArray(i.val(y),x)}if(!x.length)t.selectedIndex=-1}else if(l(t))t.value=p})},text:function(o,p){if(p===s){var a=c.get(o);if(l(a))return a[e]||"";else if(i._nodeTypeIs(a,3))return a.nodeValue}else c.each(c.query(o),function(b){if(l(b))b[e]=p;else if(i._nodeTypeIs(b,3))b.nodeValue=p})}})});
KISSY.add("dom-style",function(c,s){function v(a,b){var f=c.get(a),k=b===u?f.offsetWidth:f.offsetHeight;c.each(b===u?["Left","Right"]:["Top","Bottom"],function(j){k-=parseFloat(g._getComputedStyle(f,"padding"+j))||0;k-=parseFloat(g._getComputedStyle(f,"border"+j+"Width"))||0});return k}function d(a,b,f){var k=f;if(f===r&&h.test(b)){k=0;if(g.css(a,"position")==="absolute"){f=a[b==="left"?"offsetLeft":"offsetTop"];if(e.ie===8||e.opera)f-=m(g.css(a.offsetParent,"border-"+b+"-width"))||0;k=f-(m(g.css(a,
"margin-"+b))||0)}}return k}var g=c.DOM,e=c.UA,i=document,l=i.documentElement,u="width",r="auto",m=parseInt,h=/^left|top$/,q=/width|height|top|left|right|bottom|margin|padding/i,n=/-([a-z])/ig,o=function(a,b){return b.toUpperCase()},p={};c.mix(g,{_CUSTOM_STYLES:p,_getComputedStyle:function(a,b){var f="",k=a.ownerDocument;if(a.style)f=k.defaultView.getComputedStyle(a,null)[b];return f},css:function(a,b,f){if(c.isPlainObject(b))for(var k in b)g.css(a,k,b[k]);else{if(b.indexOf("-")>0)b=b.replace(n,o);
b=p[b]||b;if(f===s){a=c.get(a);k="";if(a&&a.style){k=b.get?b.get(a):a.style[b];if(k===""&&!b.get)k=d(a,b,g._getComputedStyle(a,b))}return k===s?"":k}else{if(f===null||f==="")f="";else if(!isNaN(new Number(f))&&q.test(b))f+="px";(b===u||b==="height")&&parseFloat(f)<0||c.each(c.query(a),function(j){if(j&&j.style){b.set?b.set(j,f):j.style[b]=f;if(f==="")j.style.cssText||j.removeAttribute("style")}})}}},width:function(a,b){if(b===s)return v(a,u);else g.css(a,u,b)},height:function(a,b){if(b===s)return v(a,
"height");else g.css(a,"height",b)},show:function(a){c.query(a).each(function(b){if(b)b.style.display=g.data(b,"display")||""})},hide:function(a){c.query(a).each(function(b){if(b){var f=b.style,k=f.display;if(k!=="none"){k&&g.data(b,"display",k);f.display="none"}}})},toggle:function(a){c.query(a).each(function(b){if(b)b.style.display==="none"?g.show(b):g.hide(b)})},addStyleSheet:function(a,b){var f;if(b)f=c.get("#"+b);if(!f){f=g.create("<style>",{id:b});c.get("head").appendChild(f);if(f.styleSheet)f.styleSheet.cssText=
a;else f.appendChild(i.createTextNode(a))}}});if(l.style.cssFloat!==s)p["float"]="cssFloat";else if(l.style.styleFloat!==s)p["float"]="styleFloat"});
KISSY.add("dom-style-ie",function(c,s){if(c.UA.ie){var v=c.DOM,d=document,g=d.documentElement,e=v._CUSTOM_STYLES,i=/^-?\d+(?:px)?$/i,l=/^-?\d/,u=/^width|height$/;try{if(g.style.opacity===s&&g.filters)e.opacity={get:function(m){var h=100;try{h=m.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(q){try{h=m.filters("alpha").opacity}catch(n){}}return h/100+""},set:function(m,h){var q=m.style,n=(m.currentStyle||0).filter||"";q.zoom=1;if(n)if(n=n.replace(/alpha\(opacity=.+\)/ig,""))n+=", ";q.filter=
n+"alpha(opacity="+h*100+")"}}}catch(r){}if(!(d.defaultView||{}).getComputedStyle&&g.currentStyle)v._getComputedStyle=function(m,h){var q=m.style,n=m.currentStyle[h];if(u.test(h))n=v[h](m)+"px";else if(!i.test(n)&&l.test(n)){var o=q.left,p=m.runtimeStyle.left;m.runtimeStyle.left=m.currentStyle.left;q.left=h==="fontSize"?"1em":n||0;n=q.pixelLeft+"px";q.left=o;m.runtimeStyle.left=p}return n}}});
KISSY.add("dom-offset",function(c,s){function v(k){var j=0,t=0,x=r(k[n]);if(k[f]){k=k[f]();j=k[o];t=k[p];if(g.mobile!=="apple"){j+=d[a](x);t+=d[b](x)}}return{left:j,top:t}}var d=c.DOM,g=c.UA,e=window,i=document,l=d._isElementNode,u=d._nodeTypeIs,r=d._getWin,m=i.compatMode==="CSS1Compat",h=Math.max,q=parseInt,n="ownerDocument",o="left",p="top",a="scrollLeft",b="scrollTop",f="getBoundingClientRect";c.mix(d,{offset:function(k,j){if(!(k=c.get(k))||!k[n])return null;if(j===s)return v(k);var t=k;if(d.css(t,
"position")==="static")t.style.position="relative";var x=v(t),w={},y,z;for(z in j){y=q(d.css(t,z),10)||0;w[z]=y+j[z]-x[z]}d.css(t,w)},scrollIntoView:function(k,j,t,x){if((k=c.get(k))&&k[n]){x=x===s?true:!!x;t=t===s?true:!!t;if(!j||j===e)return k.scrollIntoView(t);j=c.get(j);if(u(j,9))j=r(j);var w=j&&"scrollTo"in j&&j.document,y=d.offset(k),z=w?{left:d.scrollLeft(j),top:d.scrollTop(j)}:d.offset(j),A={left:y[o]-z[o],top:y[p]-z[p]};y=w?d.viewportHeight(j):j.clientHeight;z=w?d.viewportWidth(j):j.clientWidth;
var B=d[a](j),D=d[b](j),C=B+z,E=D+y,G=k.offsetHeight;k=k.offsetWidth;var H=A.left+B-(q(d.css(j,"borderLeftWidth"))||0);A=A.top+D-(q(d.css(j,"borderTopWidth"))||0);var I=H+k,K=A+G,F,J;if(G>y||A<D||t)F=A;else if(K>E)F=K-y;if(x)if(k>z||H<B||t)J=H;else if(I>C)J=I-z;if(w){if(F!==s||J!==s)j.scrollTo(J,F)}else{if(F!==s)j[b]=F;if(J!==s)j[a]=J}}}});c.each(["Left","Top"],function(k,j){var t="scroll"+k;d[t]=function(x){var w=0,y=r(x),z;if(y&&(z=y.document))w=y[j?"pageYOffset":"pageXOffset"]||z.documentElement[t]||
z.body[t];else if(l(x=c.get(x)))w=x[t];return w}});c.each(["Width","Height"],function(k){d["doc"+k]=function(j){j=j||i;return h(m?j.documentElement["scroll"+k]:j.body["scroll"+k],d["viewport"+k](j))};d["viewport"+k]=function(j){var t="inner"+k;j=r(j);var x=j.document;return t in j?j[t]:m?x.documentElement["client"+k]:x.body["client"+k]}})});
KISSY.add("dom-traversal",function(c,s){function v(i,l,u,r){if(!(i=c.get(i)))return null;if(l===s)l=1;var m=null,h,q;if(c.isNumber(l)&&l>=0){if(l===0)return i;h=0;q=l;l=function(){return++h===q}}for(;i=i[u];)if(e(i)&&(!l||g.test(i,l))&&(!r||r(i))){m=i;break}return m}function d(i,l,u){var r=[];var m=i=c.get(i);if(i&&u)m=i.parentNode;if(m){u=0;for(m=m.firstChild;m;m=m.nextSibling)if(e(m)&&m!==i&&(!l||g.test(m,l)))r[u++]=m}return r}var g=c.DOM,e=g._isElementNode;c.mix(g,{parent:function(i,l){return v(i,
l,"parentNode",function(u){return u.nodeType!=11})},next:function(i,l){return v(i,l,"nextSibling")},prev:function(i,l){return v(i,l,"previousSibling")},siblings:function(i,l){return d(i,l,true)},children:function(i,l){return d(i,l)},contains:function(i,l){var u=false;if((i=c.get(i))&&(l=c.get(l)))if(i.contains)return i.contains(l);else if(i.compareDocumentPosition)return!!(i.compareDocumentPosition(l)&16);else for(;!u&&(l=l.parentNode);)u=l==i;return u}})});
KISSY.add("dom-create",function(c,s){function v(w){var y=w.cloneNode(true);if(l.ie<8)y.innerHTML=w.innerHTML;return y}function d(w,y,z,A){if(z){var B=c.guid("ks-tmp-"),D=RegExp(o);y+='<span id="'+B+'"></span>';c.available(B,function(){var C=c.get("head"),E,G,H,I,K,F;for(D.lastIndex=0;E=D.exec(y);)if((H=(G=E[1])?G.match(a):false)&&H[2]){E=e.createElement("script");E.src=H[2];if((I=G.match(b))&&I[2])E.charset=I[2];E.async=true;C.appendChild(E)}else if((F=E[2])&&F.length>0)c.globalEval(F);(K=e.getElementById(B))&&
i.remove(K);c.isFunction(A)&&A()});g(w,y)}else{g(w,y);c.isFunction(A)&&A()}}function g(w,y){y=(y+"").replace(o,"");try{w.innerHTML=y}catch(z){for(;w.firstChild;)w.removeChild(w.firstChild);y&&w.appendChild(i.create(y))}}var e=document,i=c.DOM,l=c.UA,u=l.ie,r=i._nodeTypeIs,m=i._isElementNode,h=i._isKSNode,q=e.createElement("div"),n=/<(\w+)/,o=/<script([^>]*)>([\s\S]*?)<\/script>/ig,p=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,a=/\ssrc=(['"])(.*?)\1/i,b=/\scharset=(['"])(.*?)\1/i;c.mix(i,{create:function(w,y,z){if(r(w,
1)||r(w,3))return v(w);if(h(w))return v(w[0]);if(!(w=c.trim(w)))return null;var A=null;A=i._creators;var B,D="div",C;if(B=p.exec(w))A=(z||e).createElement(B[1]);else{if((B=n.exec(w))&&(C=B[1])&&c.isFunction(A[C=C.toLowerCase()]))D=C;w=A[D](w,z).childNodes;if(w.length===1)z=w[0].parentNode.removeChild(w[0]);else{w=w;C=z||e;z=null;if(w&&(w.push||w.item)&&w[0]){C=C||w[0].ownerDocument;z=C.createDocumentFragment();if(w.item)w=c.makeArray(w);C=0;for(A=w.length;C<A;C++)z.appendChild(w[C])}z=z}A=z}z=A;m(z)&&
c.isPlainObject(y)&&i.attr(z,y,true);return z},_creators:{div:function(w,y){var z=y?y.createElement("div"):q;z.innerHTML=w;return z}},html:function(w,y,z,A){if(y===s){w=c.get(w);if(m(w))return w.innerHTML}else c.each(c.query(w),function(B){m(B)&&d(B,y,z,A)})},remove:function(w){c.each(c.query(w),function(y){m(y)&&y.parentNode&&y.parentNode.removeChild(y)})}});if(l.gecko||u){var f=i._creators,k=i.create,j=/(?:\/(?:thead|tfoot|caption|col|colgroup)>)+\s*<tbody/,t={option:"select",td:"tr",tr:"tbody",
tbody:"table",col:"colgroup",legend:"fieldset"},x;for(x in t)(function(w){f[x]=function(y,z){return k("<"+w+">"+y+"</"+w+">",null,z)}})(t[x]);if(u){f.script=function(w,y){var z=y?y.createElement("div"):q;z.innerHTML="-"+w;z.removeChild(z.firstChild);return z};if(u<8)f.tbody=function(w,y){var z=k("<table>"+w+"</table>",null,y),A=z.children.tags("tbody")[0];z.children.length>1&&A&&!j.test(w)&&A.parentNode.removeChild(A);return z}}c.mix(f,{optgroup:f.option,th:f.td,thead:f.tbody,tfoot:f.tbody,caption:f.tbody,
colgroup:f.tbody})}});KISSY.add("dom-insertion",function(c){c.mix(c.DOM,{insertBefore:function(s,v){if((s=c.get(s))&&(v=c.get(v))&&v.parentNode)v.parentNode.insertBefore(s,v);return s},insertAfter:function(s,v){if((s=c.get(s))&&(v=c.get(v))&&v.parentNode)v.nextSibling?v.parentNode.insertBefore(s,v.nextSibling):v.parentNode.appendChild(s);return s}})});
KISSY.add("event",function(c,s){function v(o,p,a,b,f){if(c.isString(p))p=c.query(p);if(c.isArray(p)){c.each(p,function(k){n[o](k,a,b,f)});return true}if((a=c.trim(a))&&a.indexOf(m)>0){c.each(a.split(m),function(k){n[o](p,k,b,f)});return true}}function d(o,p){g(o)&&i.data(o,r,p)}function g(o){return o&&o.nodeType!==3&&o.nodeType!==8}var e=document,i=c.DOM,l=e.addEventListener?function(o,p,a,b){o.addEventListener&&o.addEventListener(p,a,!!b)}:function(o,p,a){o.attachEvent&&o.attachEvent("on"+p,a)},
u=e.removeEventListener?function(o,p,a,b){o.removeEventListener&&o.removeEventListener(p,a,!!b)}:function(o,p,a){o.detachEvent&&o.detachEvent("on"+p,a)},r="ksEventTargetId",m=" ",h=c.now(),q={},n={EVENT_GUID:r,special:{},add:function(o,p,a,b){if(!v("add",o,p,a,b)){var f=g(o)?i.data(o,r):-1,k,j,t,x,w;if(!(f===-1||!p||!c.isFunction(a))){if(!f){d(o,f=h++);q[f]={target:o,events:{}}}j=q[f].events;if(!j[p]){k=((f=!o.isCustomEventTarget)||o._supportSpecialEvent)&&n.special[p]||{};t=function(y,z){if(!y||
!y.fixed){y=new c.EventObject(o,y,p);c.isPlainObject(z)&&c.mix(y,z)}k.setup&&k.setup(y);return(k.handle||n._handle)(o,y,j[p].listeners)};j[p]={handle:t,listeners:[]};x=k.fix||p;w=k.capture;if(f)l(o,x,t,w);else o._addEvent&&o._addEvent(x,t,w)}j[p].listeners.push({fn:a,scope:b||o})}}},remove:function(o,p,a,b){if(!v("remove",o,p,a,b)){var f=g(o)?i.data(o,r):-1,k,j,t,x,w,y,z;if(f!==-1)if(f&&(k=q[f]))if(k.target===o){b=b||o;k=k.events||{};if(j=k[p]){t=j.listeners;y=t.length;if(c.isFunction(a)&&y){w=x=
0;for(z=[];x<y;++x)if(a!==t[x].fn||b!==t[x].scope)z[w++]=t[x];j.listeners=z;y=z.length}if(a===s||y===0){if(o.isCustomEventTarget)o._addEvent&&o._removeEvent(p,j.handle);else{a=n.special[p]||{};u(o,a.fix||p,j.handle)}delete k[p]}}if(p===s||c.isEmptyObject(k)){for(p in k)n.remove(o,p);delete q[f];i.removeData(o,r)}}}},_handle:function(o,p,a){a=a.slice(0);for(var b,f=0,k=a.length;f<k;++f){b=a[f];b=b.fn.call(b.scope||o,p);if(b===false&&o.isCustomEventTarget||p.isImmediatePropagationStopped)break}return b},
_getCache:function(o){return q[o]},_simpleAdd:l,_simpleRemove:u};n.on=n.add;c.Event=n});
KISSY.add("event-object",function(c,s){function v(e,i,l){this.currentTarget=e;this.originalEvent=i||{};if(i){this.type=i.type;this._fix()}else{this.type=l;this.target=e}this.currentTarget=e;this.fixed=true}var d=document,g="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(" ");c.augment(v,
{_fix:function(){var e=this.originalEvent,i=g.length,l,u=this.currentTarget;for(u=u.nodeType===9?u:u.ownerDocument||d;i;){l=g[--i];this[l]=e[l]}if(!this.target)this.target=this.srcElement||d;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===s&&this.clientX!==s){e=u.documentElement;i=u.body;this.pageX=this.clientX+(e&&e.scrollLeft||i&&i.scrollLeft||
0)-(e&&e.clientLeft||i&&i.clientLeft||0);this.pageY=this.clientY+(e&&e.scrollTop||i&&i.scrollTop||0)-(e&&e.clientTop||i&&i.clientTop||0)}if(this.which===s)this.which=this.charCode!==s?this.charCode:this.keyCode;if(this.metaKey===s)this.metaKey=this.ctrlKey;if(!this.which&&this.button!==s)this.which=this.button&1?1:this.button&2?3:this.button&4?2:0},preventDefault:function(){var e=this.originalEvent;if(e.preventDefault)e.preventDefault();else e.returnValue=false;this.isDefaultPrevented=true},stopPropagation:function(){var e=
this.originalEvent;if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;this.isPropagationStopped=true},stopImmediatePropagation:function(){var e=this.originalEvent;e.stopImmediatePropagation?e.stopImmediatePropagation():this.stopPropagation();this.isImmediatePropagationStopped=true},halt:function(e){e?this.stopImmediatePropagation():this.stopPropagation();this.preventDefault()}});c.EventObject=v});
KISSY.add("event-target",function(c,s){var v=c.Event;c.EventTarget={isCustomEventTarget:true,fire:function(d,g){var e=c.DOM.data(this,v.EVENT_GUID)||-1;if((e=((v._getCache(e)||{}).events||{})[d])&&c.isFunction(e.handle))return e.handle(s,g);return this},on:function(d,g,e){v.add(this,d,g,e);return this},detach:function(d,g,e){v.remove(this,d,g,e);return this}}});
KISSY.add("event-mouseenter",function(c){var s=c.Event;c.UA.ie||c.each([{name:"mouseenter",fix:"mouseover"},{name:"mouseleave",fix:"mouseout"}],function(v){s.special[v.name]={fix:v.fix,setup:function(d){d.type=v.name},handle:function(d,g,e){if(c.DOM._isKSNode(d))d=d[0];var i=g.relatedTarget;try{for(;i&&i!==d;)i=i.parentNode;i!==d&&s._handle(d,g,e)}catch(l){}}}})});
KISSY.add("event-focusin",function(c){var s=c.Event;document.addEventListener&&c.each([{name:"focusin",fix:"focus"},{name:"focusout",fix:"blur"}],function(v){s.special[v.name]={fix:v.fix,capture:true,setup:function(d){d.type=v.name}}})});
KISSY.add("node",function(c){function s(g,e,i){var l;if(!(this instanceof s))return new s(g,e,i);if(g){if(c.isString(g))l=v.create(g,e,i);else if(d(g,1)||d(g,3))l=g;else if(g instanceof s)return g;this[0]=l}else this.length=0}var v=c.DOM,d=v._nodeTypeIs;s.TYPE="-ks-Node";c.augment(s,{length:1,getDOMNode:function(){return this[0]},nodeType:s.TYPE});c.one=function(g,e){var i=c.get(g,e);return i?new s(i):null};c.Node=s});
KISSY.add("nodelist",function(c){function s(g){if(!(this instanceof s))return new s(g);d.push.apply(this,g||[])}var v=c.DOM,d=Array.prototype;c.mix(s.prototype,{length:0,item:function(g){var e=null;if(v._isElementNode(this[g]))e=new c.Node(this[g]);return e},getDOMNodes:function(){return d.slice.call(this)},each:function(g,e){var i=this.length,l=0,u;for(u=new c.Node(this[0]);l<i&&g.call(e||u,u,l,this)!==false;u=new c.Node(this[++l]));return this}});c.all=function(g,e){return new s(c.query(g,e,true))};
c.NodeList=s});
KISSY.add("node-attach",function(c,s){function v(p,a,b,f){p=[this[p?h:m]()].concat(c.makeArray(a));if(a[b]===s)return f.apply(g,p);else{f.apply(g,p);return this}}function d(p,a){c.each(p,function(b){c.each([u,r],function(f,k){f[b]=function(j){switch(a){case q:return function(){return v.call(this,k,arguments,1,j)};case n:return function(){return v.call(this,k,arguments,0,j)};case o:return function(){var t=this[k?h:m]();return(t=j.apply(g,[t].concat(c.makeArray(arguments))))?new (c[c.isArray(t)?"NodeList":
"Node"])(t):null};default:return function(){var t=this[k?h:m]();t=j.apply(g,[t].concat(c.makeArray(arguments)));return t===s?this:t}}}(g[b])})})}var g=c.DOM,e=c.Event,i=g._nodeTypeIs,l=g._isKSNode,u=c.Node.prototype,r=c.NodeList.prototype,m="getDOMNode",h=m+"s",q=1,n=2,o=4;c.mix(u,{one:function(p){return c.one(p,this[0])},all:function(p){return c.all(p,this[0])}});d(["data","removeData"],q);d(["hasClass","addClass","removeClass","replaceClass","toggleClass"]);d(["attr","removeAttr"],q);d(["val","text"],
n);d(["css"],q);d(["width","height"],n);d(["offset"],n);d(["scrollIntoView"]);d(["parent","next","prev","siblings","children"],o);d(["contains"]);d(["html"],n);d(["remove"]);c.each(["insertBefore","insertAfter"],function(p){u[p]=function(a){g[p].call(g,this[0],a);return this}});c.each([u,r],function(p,a){c.mix(p,{append:function(b){b&&c.each(this,function(f){var k;if(a||c.isString(b))k=g.create(b);else{if(i(b,1)||i(b,3))k=b;if(l(b))k=b[0]}f.appendChild(k)});return this},appendTo:function(b){if((b=
c.get(b))&&b.appendChild)c.each(this,function(f){b.appendChild(f)});return this}})});c.each([u,r],function(p){c.mix(p,c.EventTarget);p._supportSpecialEvent=true;p._addEvent=function(a,b,f){for(var k=0,j=this.length;k<j;k++)e._simpleAdd(this[k],a,b,f)};p._removeEvent=function(a,b,f){for(var k=0,j=this.length;k<j;k++)e._simpleRemove(this[k],a,b,f)};delete p.fire})});
KISSY.add("cookie",function(c){var s=document,v=encodeURIComponent,d=decodeURIComponent;c.Cookie={get:function(g){var e;if(c.isString(g)&&g!=="")if(g=s.cookie.match("(?:^| )"+g+"(?:(?:=([^;]*))|;|$)"))e=g[1]?d(g[1]):"";return e},set:function(g,e,i,l,u,r){e=v(e);var m=i;if(typeof m==="number"){m=new Date;m.setTime(m.getTime()+i*864E5)}if(m instanceof Date)e+="; expires="+m.toUTCString();if(c.isString(l)&&l!=="")e+="; domain="+l;if(c.isString(u)&&u!=="")e+="; path="+u;if(r)e+="; secure";s.cookie=g+
"="+e},remove:function(g,e,i,l){this.set(g,"",0,e,i,l)}}});
KISSY.add("json",function(c){function s(m){return m<10?"0"+m:m}function v(m){e.lastIndex=0;return e.test(m)?'"'+m.replace(e,function(h){var q=u[h];return typeof q==="string"?q:"\\u"+("0000"+h.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+m+'"'}function d(m,h){var q,n,o,p,a=i,b,f=h[m];if(f&&typeof f==="object"&&typeof f.toJSON==="function")f=f.toJSON(m);if(typeof r==="function")f=r.call(h,m,f);switch(typeof f){case "string":return v(f);case "number":return isFinite(f)?String(f):"null";case "boolean":case "null":return String(f);
case "object":if(!f)return"null";i+=l;b=[];if(Object.prototype.toString.apply(f)==="[object Array]"){p=f.length;for(q=0;q<p;q+=1)b[q]=d(q,f)||"null";o=b.length===0?"[]":i?"[\n"+i+b.join(",\n"+i)+"\n"+a+"]":"["+b.join(",")+"]";i=a;return o}if(r&&typeof r==="object"){p=r.length;for(q=0;q<p;q+=1){n=r[q];if(typeof n==="string")if(o=d(n,f))b.push(v(n)+(i?": ":":")+o)}}else for(n in f)if(Object.hasOwnProperty.call(f,n))if(o=d(n,f))b.push(v(n)+(i?": ":":")+o);o=b.length===0?"{}":i?"{\n"+i+b.join(",\n"+i)+
"\n"+a+"}":"{"+b.join(",")+"}";i=a;return o}}c=c.JSON=window.JSON||{};if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+s(this.getUTCMonth()+1)+"-"+s(this.getUTCDate())+"T"+s(this.getUTCHours())+":"+s(this.getUTCMinutes())+":"+s(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var g=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i,l,u={"":"\\b","\t":"\\t","\n":"\\n","":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},r;if(typeof c.stringify!=="function")c.stringify=function(m,h,q){var n;l=i="";if(typeof q==="number")for(n=0;n<q;n+=1)l+=" ";else if(typeof q==="string")l=q;if((r=h)&&typeof h!=="function"&&(typeof h!=="object"||typeof h.length!=="number"))throw Error("JSON.stringify");return d("",{"":m})};if(typeof c.parse!==
"function")c.parse=function(m,h){function q(o,p){var a,b,f=o[p];if(f&&typeof f==="object")for(a in f)if(Object.hasOwnProperty.call(f,a)){b=q(f,a);if(b!==undefined)f[a]=b;else delete f[a]}return h.call(o,p,f)}var n;m=String(m);g.lastIndex=0;if(g.test(m))m=m.replace(g,function(o){return"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(m.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,
""))){n=eval("("+m+")");return typeof h==="function"?q({"":n},""):n}throw new SyntaxError("JSON.parse");}});
KISSY.add("anim-easing",function(c){var s=Math,v=s.PI,d=s.pow,g=s.sin,e=1.70158,i={easeNone:function(l){return l},easeIn:function(l){return l*l},easeOut:function(l){return(2-l)*l},easeBoth:function(l){return(l*=2)<1?0.5*l*l:0.5*(1- --l*(l-2))},easeInStrong:function(l){return l*l*l*l},easeOutStrong:function(l){return 1- --l*l*l*l},easeBothStrong:function(l){return(l*=2)<1?0.5*l*l*l*l:0.5*(2-(l-=2)*l*l*l)},elasticIn:function(l){if(l===0||l===1)return l;return-(d(2,10*(l-=1))*g((l-0.075)*2*v/0.3))},
elasticOut:function(l){if(l===0||l===1)return l;return d(2,-10*l)*g((l-0.075)*2*v/0.3)+1},elasticBoth:function(l){if(l===0||(l*=2)===2)return l;if(l<1)return-0.5*d(2,10*(l-=1))*g((l-0.1125)*2*v/0.45);return d(2,-10*(l-=1))*g((l-0.1125)*2*v/0.45)*0.5+1},backIn:function(l){if(l===1)l-=0.0010;return l*l*((e+1)*l-e)},backOut:function(l){return(l-=1)*l*((e+1)*l+e)+1},backBoth:function(l){if((l*=2)<1)return 0.5*l*l*(((e*=1.525)+1)*l-e);return 0.5*((l-=2)*l*(((e*=1.525)+1)*l+e)+2)},bounceIn:function(l){return 1-
i.bounceOut(1-l)},bounceOut:function(l){return l<1/2.75?7.5625*l*l:l<2/2.75?7.5625*(l-=1.5/2.75)*l+0.75:l<2.5/2.75?7.5625*(l-=2.25/2.75)*l+0.9375:7.5625*(l-=2.625/2.75)*l+0.984375},bounceBoth:function(l){if(l<0.5)return i.bounceIn(l*2)*0.5;return i.bounceOut(l*2-1)*0.5+0.5}};c.Easing=i});
KISSY.add("anim",function(c,s){function v(n,o,p,a,b){if(n=c.get(n)){if(!(this instanceof v))return new v(n,o,p,a,b);var f=c.isPlainObject(p);o=o;this.domEl=n;if(c.isPlainObject(o))o=c.param(o,";").replace(/=/g,":");var k={},j=m.length,t;r.innerHTML='<div style="'+o+'"></div>';for(n=r.firstChild.style;j--;)if(t=n[m[j]])k[m[j]]=d(t);this.props=k;this.targetStyle=o;if(f)f=c.merge(q,p);else{f=c.clone(q);p&&(f.duration=u(p,10)||1);c.isString(a)&&(a=l[a]);c.isFunction(a)&&(f.easing=a);c.isFunction(b)&&
(f.complete=b)}this.config=f;c.isFunction(b)&&this.on(h,b)}}function d(n){var o=u(n);n=(n+"").replace(/^[-\d\.]+/,"");return isNaN(o)?{v:n,u:"",f:e}:{v:o,u:n,f:g}}function g(n,o,p){return(n+(o-n)*p).toFixed(3)}function e(n,o,p){for(var a=2,b,f,k=[],j=[];b=3,f=arguments[a-1],a--;)if(f.substr(0,4)==="rgb(")for(f=f.match(/\d+/g);b--;)k.push(~~f[b]);else if(f.substr(0,1)==="#"){if(f.length===4)f="#"+f.substr(1,1)+f.substr(1,1)+f.substr(2,1)+f.substr(2,1)+f.substr(3,1)+f.substr(3,1);for(;b--;)k.push(parseInt(f.substr(1+
b*2,2),16))}else return o;for(;b--;){a=~~(k[b+3]+(k[b]-k[b+3])*p);j.push(a<0?0:a>255?255:a)}return"rgb("+j.join(",")+")"}var i=c.DOM,l=c.Easing,u=parseFloat,r=i.create("<div>"),m="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(" "),
h="complete",q={duration:1,easing:l.easeNone};c.augment(v,c.EventTarget,{run:function(){var n=this,o=n.config,p=n.domEl,a=o.duration*1E3,b=o.easing,f=c.now(),k=f+a,j=n.props,t={},x;for(x in j)t[x]=d(i.css(p,x));if(n.fire("start")!==false){n.stop();n.timer=c.later(o=function(){var w=c.now(),y=w>k?1:(w-f)/a,z,A,B;for(x in j){z=t[x];A=j[x];if(A.v==0)A.u=z.u;if(z.u!==A.u)z.v=0;i.css(p,x,A.f(z.v,A.v,b(y))+A.u)}if(n.fire("step")===false||(B=w>k)){n.stop();B&&n.fire(h)}},13,true);o();return n}},stop:function(n){var o=
this.domEl,p=this.targetStyle;if(this.timer){this.timer.cancel();this.timer=s}if(n){c.UA.ie&&p.indexOf("opacity")>-1&&i.css(o,"opacity",this.props.opacity.v);o.style.cssText+=";"+p;this.fire(h)}return this}});c.Anim=v});
KISSY.add("anim-node-plugin",function(c,s){function v(o,p,a,b,f){if(p==="toggle")p=(f=d.css(o,e)===i?1:0)?"show":"hide";if(f)d.css(o,e,d.data(o,e)||"");var k={};c.each(n[p],function(j){if(j===l)d.css(o,l,u);else if(j===r){k.opacity=f?1:0;f&&d.css(o,r,0)}else if(j===m){k.height=f?d.css(o,m)||o.naturalHeight:0;f&&d.css(o,m,0)}else if(j===h){k.width=f?d.css(o,h)||o.naturalWidth:0;f&&d.css(o,h,0)}});(new c.Anim(o,k,a,"easeOut",function(){if(!f){var j=o.style,t=j[e];if(t!==i){t&&d.data(o,e,t);j[e]=i}d.css(o,
{height:q,width:q,overflow:q,opacity:1})}b&&c.isFunction(b)&&b()})).run()}var d=c.DOM,g=c.Anim,e="display",i="none",l="overflow",u="hidden",r="opacity",m="height",h="width",q="auto",n={show:[l,r,m,h],fade:[r],slide:[l,m]};c.each([c.Node.prototype,c.NodeList.prototype],function(o){o.animate=function(){var p=c.makeArray(arguments);c.each(this,function(a){g.apply(s,[a].concat(p)).run()});return this};c.each({show:["show",1],hide:["hide",0],toggle:["toggle"],fadeIn:["fade",1],fadeOut:["fade",0],slideDown:["slide",
1],slideUp:["slide",0]},function(p,a){o[a]=function(b,f){d[a]&&arguments.length===0?d[a](this):c.each(this,function(k){v(k,p[0],b,f,p[1])});return this}})})});KISSY.add("core");
(function(){function c(a,b,f,k,j,t){j=0;for(var x=k.length;j<x;j++){var w=k[j];if(w){w=w[a];for(var y=false;w;){if(w.sizcache===f){y=k[w.sizset];break}if(w.nodeType===1&&!t){w.sizcache=f;w.sizset=j}if(w.nodeName.toLowerCase()===b){y=w;break}w=w[a]}k[j]=y}}}function s(a,b,f,k,j,t){j=0;for(var x=k.length;j<x;j++){var w=k[j];if(w){w=w[a];for(var y=false;w;){if(w.sizcache===f){y=k[w.sizset];break}if(w.nodeType===1){if(!t){w.sizcache=f;w.sizset=j}if(typeof b!=="string"){if(w===b){y=true;break}}else if(l.filter(b,
[w]).length>0){y=w;break}}w=w[a]}k[j]=y}}}var v=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,g=Object.prototype.toString,e=false,i=true;[0,0].sort(function(){i=false;return 0});var l=function(a,b,f,k){f=f||[];var j=b=b||document;if(b.nodeType!==1&&b.nodeType!==9)return[];if(!a||typeof a!=="string")return f;var t=[],x,w,y,z,A=true,B=l.isXML(b),D=a,C;do{v.exec("");if(x=v.exec(D)){D=x[3];t.push(x[1]);if(x[2]){z=
x[3];break}}}while(x);if(t.length>1&&r.exec(a))if(t.length===2&&u.relative[t[0]])w=p(t[0]+t[1],b);else for(w=u.relative[t[0]]?[b]:l(t.shift(),b);t.length;){a=t.shift();if(u.relative[a])a+=t.shift();w=p(a,w)}else{if(!k&&t.length>1&&b.nodeType===9&&!B&&u.match.ID.test(t[0])&&!u.match.ID.test(t[t.length-1])){x=l.find(t.shift(),b,B);b=x.expr?l.filter(x.expr,x.set)[0]:x.set[0]}if(b){x=k?{expr:t.pop(),set:q(k)}:l.find(t.pop(),t.length===1&&(t[0]==="~"||t[0]==="+")&&b.parentNode?b.parentNode:b,B);w=x.expr?
l.filter(x.expr,x.set):x.set;if(t.length>0)y=q(w);else A=false;for(;t.length;){x=C=t.pop();if(u.relative[C])x=t.pop();else C="";if(x==null)x=b;u.relative[C](y,x,B)}}else y=[]}y||(y=w);y||l.error(C||a);if(g.call(y)==="[object Array]")if(A)if(b&&b.nodeType===1)for(a=0;y[a]!=null;a++){if(y[a]&&(y[a]===true||y[a].nodeType===1&&l.contains(b,y[a])))f.push(w[a])}else for(a=0;y[a]!=null;a++)y[a]&&y[a].nodeType===1&&f.push(w[a]);else f.push.apply(f,y);else q(y,f);if(z){l(z,j,f,k);l.uniqueSort(f)}return f};
l.uniqueSort=function(a){if(o){e=i;a.sort(o);if(e)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a};l.matches=function(a,b){return l(a,null,null,b)};l.find=function(a,b,f){var k;if(!a)return[];for(var j=0,t=u.order.length;j<t;j++){var x=u.order[j],w;if(w=u.leftMatch[x].exec(a)){var y=w[1];w.splice(1,1);if(y.substr(y.length-1)!=="\\"){w[1]=(w[1]||"").replace(/\\/g,"");k=u.find[x](w,b,f);if(k!=null){a=a.replace(u.match[x],"");break}}}}k||(k=b.getElementsByTagName("*"));return{set:k,
expr:a}};l.filter=function(a,b,f,k){for(var j=a,t=[],x=b,w,y,z=b&&b[0]&&l.isXML(b[0]);a&&b.length;){for(var A in u.filter)if((w=u.leftMatch[A].exec(a))!=null&&w[2]){var B=u.filter[A],D,C;C=w[1];y=false;w.splice(1,1);if(C.substr(C.length-1)!=="\\"){if(x===t)t=[];if(u.preFilter[A])if(w=u.preFilter[A](w,x,f,t,k,z)){if(w===true)continue}else y=D=true;if(w)for(var E=0;(C=x[E])!=null;E++)if(C){D=B(C,w,E,x);var G=k^!!D;if(f&&D!=null)if(G)y=true;else x[E]=false;else if(G){t.push(C);y=true}}if(D!==undefined){f||
(x=t);a=a.replace(u.match[A],"");if(!y)return[];break}}}if(a===j)if(y==null)l.error(a);else break;j=a}return x};l.error=function(a){throw"Syntax error, unrecognized expression: "+a;};var u=l.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b){var f=typeof b==="string",k=f&&!/\W/.test(b);f=f&&!k;if(k)b=b.toLowerCase();k=0;for(var j=a.length,t;k<j;k++)if(t=a[k]){for(;(t=t.previousSibling)&&t.nodeType!==1;);a[k]=f||t&&t.nodeName.toLowerCase()===
b?t||false:t===b}f&&l.filter(b,a,true)},">":function(a,b){var f=typeof b==="string",k,j=0,t=a.length;if(f&&!/\W/.test(b))for(b=b.toLowerCase();j<t;j++){if(k=a[j]){f=k.parentNode;a[j]=f.nodeName.toLowerCase()===b?f:false}}else{for(;j<t;j++)if(k=a[j])a[j]=f?k.parentNode:k.parentNode===b;f&&l.filter(b,a,true)}},"":function(a,b,f){var k=d++,j=s,t;if(typeof b==="string"&&!/\W/.test(b)){t=b=b.toLowerCase();j=c}j("parentNode",b,k,a,t,f)},"~":function(a,b,f){var k=d++,j=s,t;if(typeof b==="string"&&!/\W/.test(b)){t=
b=b.toLowerCase();j=c}j("previousSibling",b,k,a,t,f)}},find:{ID:function(a,b,f){if(typeof b.getElementById!=="undefined"&&!f)return(a=b.getElementById(a[1]))?[a]:[]},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){for(var f=[],k=b.getElementsByName(a[1]),j=0,t=k.length;j<t;j++)k[j].getAttribute("name")===a[1]&&f.push(k[j]);return f.length===0?null:f}},TAG:function(a,b){return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,f,k,j,t){a=" "+a[1].replace(/\\/g,"")+" ";if(t)return a;
t=0;for(var x;(x=b[t])!=null;t++)if(x)if(j^(x.className&&(" "+x.className+" ").replace(/[\t\n]/g," ").indexOf(a)>=0))f||k.push(x);else if(f)b[t]=false;return false},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a){return a[1].toLowerCase()},CHILD:function(a){if(a[1]==="nth"){var b=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}a[0]=d++;return a},ATTR:function(a,b,f,k,j,t){b=a[1].replace(/\\/g,
"");if(!t&&u.attrMap[b])a[1]=u.attrMap[b];if(a[2]==="~=")a[4]=" "+a[4]+" ";return a},PSEUDO:function(a,b,f,k,j){if(a[1]==="not")if((v.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=l(a[3],null,null,b);else{a=l.filter(a[3],b,f,true^j);f||k.push.apply(k,a);return false}else if(u.match.POS.test(a[0])||u.match.CHILD.test(a[0]))return true;return a},POS:function(a){a.unshift(true);return a}},filters:{enabled:function(a){return a.disabled===false&&a.type!=="hidden"},disabled:function(a){return a.disabled===
true},checked:function(a){return a.checked===true},selected:function(a){return a.selected===true},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,f){return!!l(f[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===
a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,f,k){return b===k.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,f){return b<f[3]-0},gt:function(a,b,f){return b>f[3]-0},nth:function(a,b,f){return f[3]-
0===b},eq:function(a,b,f){return f[3]-0===b}},filter:{PSEUDO:function(a,b,f,k){var j=b[1],t=u.filters[j];if(t)return t(a,f,b,k);else if(j==="contains")return(a.textContent||a.innerText||l.getText([a])||"").indexOf(b[3])>=0;else if(j==="not"){b=b[3];f=0;for(k=b.length;f<k;f++)if(b[f]===a)return false;return true}else l.error("Syntax error, unrecognized expression: "+j)},CHILD:function(a,b){var f=b[1],k=a;switch(f){case "only":case "first":for(;k=k.previousSibling;)if(k.nodeType===1)return false;if(f===
"first")return true;k=a;case "last":for(;k=k.nextSibling;)if(k.nodeType===1)return false;return true;case "nth":f=b[2];var j=b[3];if(f===1&&j===0)return true;var t=b[0],x=a.parentNode;if(x&&(x.sizcache!==t||!a.nodeIndex)){var w=0;for(k=x.firstChild;k;k=k.nextSibling)if(k.nodeType===1)k.nodeIndex=++w;x.sizcache=t}k=a.nodeIndex-j;return f===0?k===0:k%f===0&&k/f>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===
b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var f=b[1];f=u.attrHandle[f]?u.attrHandle[f](a):a[f]!=null?a[f]:a.getAttribute(f);var k=f+"",j=b[2],t=b[4];return f==null?j==="!=":j==="="?k===t:j==="*="?k.indexOf(t)>=0:j==="~="?(" "+k+" ").indexOf(t)>=0:!t?k&&f!==false:j==="!="?k!==t:j==="^="?k.indexOf(t)===0:j==="$="?k.substr(k.length-t.length)===t:j==="|="?k===t||k.substr(0,t.length+1)===t+"-":false},POS:function(a,b,f,k){var j=u.setFilters[b[2]];
if(j)return j(a,f,b,k)}}},r=u.match.POS,m=function(a,b){return"\\"+(b-0+1)},h;for(h in u.match){u.match[h]=RegExp(u.match[h].source+/(?![^\[]*\])(?![^\(]*\))/.source);u.leftMatch[h]=RegExp(/(^(?:.|\r|\n)*?)/.source+u.match[h].source.replace(/\\(\d+)/g,m))}var q=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(n){q=function(a,b){var f=b||[],k=0;if(g.call(a)==="[object Array]")Array.prototype.push.apply(f,
a);else if(typeof a.length==="number")for(var j=a.length;k<j;k++)f.push(a[k]);else for(;a[k];k++)f.push(a[k]);return f}}var o;if(document.documentElement.compareDocumentPosition)o=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b)e=true;return a.compareDocumentPosition?-1:1}var f=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(f===0)e=true;return f};else if("sourceIndex"in document.documentElement)o=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b)e=true;return a.sourceIndex?
-1:1}var f=a.sourceIndex-b.sourceIndex;if(f===0)e=true;return f};else if(document.createRange)o=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b)e=true;return a.ownerDocument?-1:1}var f=a.ownerDocument.createRange(),k=b.ownerDocument.createRange();f.setStart(a,0);f.setEnd(a,0);k.setStart(b,0);k.setEnd(b,0);f=f.compareBoundaryPoints(Range.START_TO_END,k);if(f===0)e=true;return f};l.getText=function(a){for(var b="",f,k=0;a[k];k++){f=a[k];if(f.nodeType===3||f.nodeType===4)b+=f.nodeValue;
else if(f.nodeType!==8)b+=l.getText(f.childNodes)}return b};(function(){var a=document.createElement("div"),b="script"+(new Date).getTime();a.innerHTML="<a name='"+b+"'/>";var f=document.documentElement;f.insertBefore(a,f.firstChild);if(document.getElementById(b)){u.find.ID=function(k,j,t){if(typeof j.getElementById!=="undefined"&&!t)return(j=j.getElementById(k[1]))?j.id===k[1]||typeof j.getAttributeNode!=="undefined"&&j.getAttributeNode("id").nodeValue===k[1]?[j]:undefined:[]};u.filter.ID=function(k,
j){var t=typeof k.getAttributeNode!=="undefined"&&k.getAttributeNode("id");return k.nodeType===1&&t&&t.nodeValue===j}}f.removeChild(a);f=a=null})();(function(){var a=document.createElement("div");a.appendChild(document.createComment(""));if(a.getElementsByTagName("*").length>0)u.find.TAG=function(b,f){var k=f.getElementsByTagName(b[1]);if(b[1]==="*"){for(var j=[],t=0;k[t];t++)k[t].nodeType===1&&j.push(k[t]);k=j}return k};a.innerHTML="<a href='#'></a>";if(a.firstChild&&typeof a.firstChild.getAttribute!==
"undefined"&&a.firstChild.getAttribute("href")!=="#")u.attrHandle.href=function(b){return b.getAttribute("href",2)};a=null})();document.querySelectorAll&&function(){var a=l,b=document.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!(b.querySelectorAll&&b.querySelectorAll(".TEST").length===0)){l=function(k,j,t,x){j=j||document;if(!x&&j.nodeType===9&&!l.isXML(j))try{return q(j.querySelectorAll(k),t)}catch(w){}return a(k,j,t,x)};for(var f in a)l[f]=a[f];b=null}}();(function(){var a=document.createElement("div");
a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!a.getElementsByClassName||a.getElementsByClassName("e").length===0)){a.lastChild.className="e";if(a.getElementsByClassName("e").length!==1){u.order.splice(1,0,"CLASS");u.find.CLASS=function(b,f,k){if(typeof f.getElementsByClassName!=="undefined"&&!k)return f.getElementsByClassName(b[1])};a=null}}})();l.contains=document.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(a,b){return a!==b&&
(a.contains?a.contains(b):true)};l.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?a.nodeName!=="HTML":false};var p=function(a,b){for(var f=[],k="",j,t=b.nodeType?[b]:b;j=u.match.PSEUDO.exec(a);){k+=j[0];a=a.replace(u.match.PSEUDO,"")}a=u.relative[a]?a+"*":a;j=0;for(var x=t.length;j<x;j++)l(a,t[j],f);return l.filter(k,f)};KISSY.add("sizzle",function(a){a.ExternalSelector=l;a.ExternalSelector._filter=function(b,f){return l.matches(f,a.query(b))}},{requires:["core"]})})();
KISSY.add("datalazyload",function(c,s){function v(m,h){if(!(this instanceof v))return new v(m,h);if(h===s){h=m;m=[i]}c.isArray(m)||(m=[c.get(m)||i]);this.containers=m;this.config=c.merge(r,h);this.callbacks={els:[],fns:[]};this._init()}var d=c.DOM,g=c.Event,e=window,i=document,l="scroll",u="resize",r={mod:"manual",diff:"default",placeholder:"none"};c.augment(v,{_init:function(){this.threshold=this._getThreshold();this._filterItems();this._initLoadEvent()},_filterItems:function(){var m=this.containers,
h,q,n,o=[],p=[];h=0;for(q=m.length;h<q;++h){n=c.query("img",m[h]);o=o.concat(c.filter(n,this._filterImg,this));n=c.query("textarea",m[h]);p=p.concat(c.filter(n,this._filterArea,this))}this.images=o;this.areaes=p},_filterImg:function(m){var h=m.getAttribute("data-ks-lazyload"),q=this.threshold,n=this.config.placeholder;if(this.config.mod==="manual"){if(h){if(n!=="none")m.src=n;return true}}else if(d.offset(m).top>q&&!h){d.attr(m,"data-ks-lazyload",m.src);if(n!=="none")m.src=n;else m.removeAttribute("src");
return true}},_filterArea:function(m){return d.hasClass(m,"ks-datalazyload")},_initLoadEvent:function(){function m(){q||(q=c.later(function(){h();q=null},100))}function h(){n._loadItems();if(n._getItemsLength()===0){g.remove(e,l,m);g.remove(e,u,m)}}var q,n=this;g.on(e,l,m);g.on(e,u,function(){n.threshold=n._getThreshold();m()});n._getItemsLength()&&c.ready(function(){h()})},_loadItems:function(){this._loadImgs();this._loadAreas();this._fireCallbacks()},_loadImgs:function(){this.images=c.filter(this.images,
this._loadImg,this)},_loadImg:function(m){var h=this.threshold+d.scrollTop();if(d.offset(m).top<=h)this._loadImgSrc(m);else return true},_loadImgSrc:function(m,h){h=h||"data-ks-lazyload";var q=m.getAttribute(h);if(q&&m.src!=q){m.src=q;m.removeAttribute(h)}},_loadAreas:function(){this.areaes=c.filter(this.areaes,this._loadArea,this)},_loadArea:function(m){var h=d.css(m,"display")==="none";if(d.offset(h?m.parentNode:m).top<=this.threshold+d.scrollTop())this._loadAreaData(m.parentNode,m);else return true},
_loadAreaData:function(m,h){h.style.display="none";h.className="";var q=d.create("<div>");m.insertBefore(q,h);d.html(q,h.value,true)},_fireCallbacks:function(){var m=this.callbacks,h=m.els,q=m.fns,n=this.threshold+d.scrollTop(),o,p,a,b=[],f=[];for(o=0;(p=h[o])&&(a=q[o++]);)if(d.offset(p).top<=n)a.call(p);else{b.push(p);f.push(a)}m.els=b;m.fns=f},addCallback:function(m,h){var q=this.callbacks;if((m=c.get(m))&&c.isFunction(h)){q.els.push(m);q.fns.push(h)}},_getThreshold:function(){var m=this.config.diff,
h=d.viewportHeight();return m==="default"?2*h:h+ +m},_getItemsLength:function(){return this.images.length+this.areaes.length+this.callbacks.els.length},loadCustomLazyData:function(m,h){var q=this,n,o;c.isArray(m)||(m=[c.get(m)]);c.each(m,function(p){switch(h){case "img-src":o=p.nodeName==="IMG"?[p]:c.query("img",p);c.each(o,function(a){q._loadImgSrc(a,"data-ks-lazyload-custom")});break;default:(n=c.get("textarea",p))&&d.hasClass(n,"ks-datalazyload-custom")&&q._loadAreaData(p,n)}})}});c.mix(v,v.prototype,
true,["loadCustomLazyData","_loadImgSrc","_loadAreaData"]);c.DataLazyload=v},{requires:["core"]});KISSY.add("flash",function(c){c.Flash={swfs:{},length:0}},{requires:["core"]});
KISSY.add("flash-ua",function(c){function s(l){var u=c.isString(l)?l.match(/(\d)+/g):l;l=l;if(c.isArray(u))l=parseFloat(u[0]+"."+v(u[1],3)+v(u[2],5));return l||0}function v(l,u){for(var r=(l+"").length;r++<u;)l="0"+l;return l}var d=c.UA,g,e,i=true;d.fpv=function(l){if(l||i){i=false;var u;if(navigator.plugins&&navigator.mimeTypes.length)u=(navigator.plugins["Shockwave Flash"]||0).description;else if(window.ActiveXObject)try{u=(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(r){}g=
u?u.match(/(\d)+/g):void 0;e=s(g)}return g};d.fpvGEQ=function(l,u){i&&d.fpv(u);return!!e&&e>=s(l)}},{host:"flash"});
KISSY.add("flash-embed",function(c){function s(r,m,h){var q=d.create("<param>");d.attr(q,{name:m,value:h});r.appendChild(q)}var v=c.UA,d=c.DOM,g=c.Flash,e=/object|embed/i,i=encodeURIComponent,l={wmode:"",allowscriptaccess:"",allownetworking:"",allowfullscreen:"",play:"false",loop:"",menu:"",quality:"",scale:"",salign:"",bgcolor:"",devicefont:"",base:"",swliveconnect:"",seamlesstabbing:""},u={params:{},attrs:{width:215,height:138},version:9};c.mix(g,{fpv:v.fpv,fpvGEQ:v.fpvGEQ,add:function(r,m,h){var q,
n;m=g._normalize(m);m=c.merge(u,m);m.attrs=c.merge(u.attrs,m.attrs);if(r=c.get(r)){if(!r.id)r.id=c.guid("ks-flash-");n=m.attrs.id=r.id;if(v.fpv()){if(!v.fpvGEQ(m.version)){this._callback(h,0,n,r);if(!((q=m.xi)&&c.isString(q)))return;m.src=q}if(e.test(r.nodeName))this._register(r,m,h);else m.src?this._embed(r,m,h):this._callback(h,-3,n,r)}else this._callback(h,-1,n,r)}else this._callback(h,-2)},get:function(r){return g.swfs[r]},remove:function(r){if(r=g.get("#"+r)){d.remove(r);delete g.swfs[r.id];
g.length-=1}},contains:function(r){var m=g.swfs,h,q=false;if(c.isString(r))q=r in m;else for(h in m)if(m[h]===r){q=true;break}return q},_register:function(r,m,h){m=m.attrs.id;if(v.gecko||v.opera)r=c.query("object",r)[0]||r;g._addSWF(m,r);g._callback(h,1,m,r)},_embed:function(r,m,h){var q=g._createSWF(m.src,m.attrs,m.params);if(v.ie)r.outerHTML=q.outerHTML;else r.parentNode.replaceChild(q,r);r=c.get("#"+r.id);g._register(r,m,h)},_callback:function(r,m,h,q){m&&c.isFunction(r)&&r({status:m,id:h,swf:q})},
_addSWF:function(r,m){if(r&&m){g.swfs[r]=m;g.length+=1}},_createSWF:function(r,m,h){var q=d.create("<object>"),n;d.attr(q,m);if(v.ie){d.attr(q,"classid","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");s(q,"movie",r)}else d.attr(q,{type:"application/x-shockwave-flash",data:r,name:m.id});for(n in h)n in l&&s(q,n,h[n]);h.flashvars&&s(q,"flashvars",g.toFlashVars(h.flashvars));return q},_normalize:function(r){var m,h,q,n=r;if(c.isPlainObject(r)){n={};for(q in r){m=q.toLowerCase();h=r[q];if(m!=="flashvars")h=
g._normalize(h);n[m]=h}}return n},toFlashVars:function(r){if(!c.isPlainObject(r))return"";var m,h,q=[];for(m in r){h=r[m];if(c.isString(h))h=i(h);else{h=c.JSON.stringify(h);if(!h)continue;h=h.replace(/:"([^"]+)/g,function(n,o){return':"'+i(o)})}q.push(m+"="+h)}return q.join("&").replace(/\"/g,"'")}})},{host:"flash"});
KISSY.add("switchable",function(c,s){function v(e,i){i=i||{};if(!("markupType"in i))if(i.panelCls)i.markupType=1;else if(i.panels)i.markupType=2;i=c.merge(v.Config,i);this.container=c.get(e);this.config=i;this.activeIndex=i.activeIndex;this._init()}var d=c.DOM,g=c.Event;v.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:[]};v.Plugins=[];c.augment(v,c.EventTarget,{_init:function(){var e=this,i=e.config;e._parseMarkup();i.switchTo&&e.switchTo(i.switchTo);i.hasTriggers&&e._bindTriggers();c.each(v.Plugins,function(l){l.init&&l.init(e)});e.fire("init")},_parseMarkup:function(){var e=this.container,i=this.config,l,u=[],r=[];switch(i.markupType){case 0:if(l=c.get("."+i.navCls,e))u=d.children(l);l=c.get("."+i.contentCls,e);r=d.children(l);break;case 1:u=c.query("."+i.triggerCls,
e);r=c.query("."+i.panelCls,e);break;case 2:u=i.triggers;r=i.panels}e=r.length;this.length=e/i.steps;if(i.hasTriggers&&e>0&&u.length===0)u=this._generateTriggersMarkup(this.length);this.triggers=c.makeArray(u);this.panels=c.makeArray(r);this.content=l||r[0].parentNode},_generateTriggersMarkup:function(e){var i=this.config,l=d.create("<ul>"),u,r;l.className=i.navCls;for(r=0;r<e;r++){u=d.create("<li>");if(r===this.activeIndex)u.className=i.activeTriggerCls;u.innerHTML=r+1;l.appendChild(u)}this.container.appendChild(l);
return d.children(l)},_bindTriggers:function(){var e=this,i=e.config,l=e.triggers,u,r,m=l.length;for(r=0;r<m;r++)(function(h){u=l[h];g.on(u,"click",function(){e._onFocusTrigger(h)});if(i.triggerType==="mouse"){g.on(u,"mouseenter",function(){e._onMouseEnterTrigger(h)});g.on(u,"mouseleave",function(){e._onMouseLeaveTrigger(h)})}})(r)},_onFocusTrigger:function(e){if(this._triggerIsValid(e)){this._cancelSwitchTimer();this.switchTo(e)}},_onMouseEnterTrigger:function(e){var i=this;if(i._triggerIsValid(e))i.switchTimer=
c.later(function(){i.switchTo(e)},i.config.delay*1E3)},_onMouseLeaveTrigger:function(){this._cancelSwitchTimer()},_triggerIsValid:function(e){return this.activeIndex!==e},_cancelSwitchTimer:function(){if(this.switchTimer){this.switchTimer.cancel();this.switchTimer=s}},switchTo:function(e,i){var l=this.config,u=this.triggers,r=this.panels,m=this.activeIndex,h=l.steps,q=m*h,n=e*h;if(!this._triggerIsValid(e))return this;if(this.fire("beforeSwitch",{toIndex:e})===false)return this;if(l.hasTriggers)this._switchTrigger(m>
-1?u[m]:null,u[e]);if(i===s)i=e>m?"forward":"backward";this._switchView(r.slice(q,q+h),r.slice(n,n+h),e,i);this.activeIndex=e;return this},_switchTrigger:function(e,i){var l=this.config.activeTriggerCls;e&&d.removeClass(e,l);d.addClass(i,l)},_switchView:function(e,i,l){d.css(e,"display","none");d.css(i,"display","block");this._fireOnSwitch(l)},_fireOnSwitch:function(e){this.fire("switch",{currentIndex:e})},prev:function(){var e=this.activeIndex;this.switchTo(e>0?e-1:this.length-1,"backward")},next:function(){var e=
this.activeIndex;this.switchTo(e<this.length-1?e+1:0,"forward")}});c.Switchable=v},{requires:["core"]});
KISSY.add("autoplay",function(c,s){var v=c.Event,d=c.Switchable;c.mix(d.Config,{autoplay:false,interval:5,pauseOnHover:true});d.Plugins.push({name:"autoplay",init:function(g){function e(){u=c.later(function(){g.paused||g.switchTo(g.activeIndex<g.length-1?g.activeIndex+1:0,"forward")},l,true)}var i=g.config,l=i.interval*1E3,u;if(i.autoplay){if(i.pauseOnHover){v.on(g.container,"mouseenter",function(){if(u){u.cancel();u=s}g.paused=true});v.on(g.container,"mouseleave",function(){g.paused=false;e()})}e()}}})},
{host:"switchable"});
KISSY.add("effect",function(c,s){var v=c.DOM,d=c.Anim,g=c.Switchable,e;c.mix(g.Config,{effect:"none",duration:0.5,easing:"easeNone"});g.Effects={none:function(i,l,u){v.css(i,"display","none");v.css(l,"display","block");u()},fade:function(i,l,u){i.length!==1&&c.error("fade effect only supports steps == 1.");var r=this,m=r.config,h=i[0],q=l[0];r.anim&&r.anim.stop(true);v.css(q,"opacity",1);r.anim=(new d(h,{opacity:0},m.duration,m.easing,function(){r.anim=s;v.css(q,"z-index",9);v.css(h,"z-index",1);
u()})).run()},scroll:function(i,l,u,r){var m=this;i=m.config;l=i.effect==="scrollx";var h={};h[l?"left":"top"]=-(m.viewSize[l?0:1]*r)+"px";m.anim&&m.anim.stop();m.anim=(new d(m.content,h,i.duration,i.easing,function(){m.anim=s;u()})).run()}};e=g.Effects;e.scrollx=e.scrolly=e.scroll;g.Plugins.push({name:"effect",init:function(i){var l=i.config,u=l.effect,r=i.panels,m=i.content,h=l.steps,q=i.activeIndex,n=r.length;i.viewSize=[l.viewSize[0]||r[0].offsetWidth*h,l.viewSize[1]||r[0].offsetHeight*h];if(u!==
"none"){c.each(r,function(b){v.css(b,"display","block")});switch(u){case "scrollx":case "scrolly":v.css(m,"position","absolute");v.css(m.parentNode,"position","relative");if(u==="scrollx"){v.css(r,"float","left");v.width(m,i.viewSize[0]*(n/h))}break;case "fade":var o=q*h,p=o+h-1,a;c.each(r,function(b,f){a=f>=o&&f<=p;v.css(b,{opacity:a?1:0,position:"absolute",zIndex:a?9:1})})}}}});c.augment(g,{_switchView:function(i,l,u,r){var m=this,h=m.config.effect;(c.isFunction(h)?h:e[h]).call(m,i,l,function(){m._fireOnSwitch(u)},
u,r)}})},{host:"switchable"});
KISSY.add("circular",function(c,s){function v(a,b,f,k,j){var t=this;a=t.config;b=t.length;var x=t.activeIndex,w=a.scrollType===o,y=w?u:r,z=t.viewSize[w?0:1];w=-z*k;var A={},B,D=j===n;if(B=D&&x===0&&k===b-1||j===q&&x===b-1&&k===0)w=d.call(t,t.panels,k,D,y,z);A[y]=w+h;t.anim&&t.anim.stop();t.anim=(new c.Anim(t.content,A,a.duration,a.easing,function(){B&&g.call(t,t.panels,k,D,y,z);t.anim=s;f()})).run()}function d(a,b,f,k,j){var t=this.config.steps;b=this.length;var x=f?b-1:0,w=(x+1)*t;for(t=x*t;t<w;t++){e.css(a[t],
i,l);e.css(a[t],k,(f?-1:1)*j*b)}return f?j:-j*b}function g(a,b,f,k,j){var t=this.config.steps;b=this.length;var x=f?b-1:0,w=(x+1)*t;for(t=x*t;t<w;t++){e.css(a[t],i,m);e.css(a[t],k,m)}e.css(this.content,k,f?-j*(b-1):m)}var e=c.DOM,i="position",l="relative",u="left",r="top",m="",h="px",q="forward",n="backward",o="scrollx",p=c.Switchable;c.mix(p.Config,{circular:false});p.Plugins.push({name:"circular",init:function(a){a=a.config;if(a.circular&&(a.effect===o||a.effect==="scrolly")){a.scrollType=a.effect;
a.effect=v}}})},{host:"switchable"});
KISSY.add("lazyload",function(c){var s=c.DOM,v="beforeSwitch",d="img-src",g="area-data",e={},i=c.Switchable;e[d]="data-ks-lazyload-custom";e[g]="ks-datalazyload-custom";c.mix(i.Config,{lazyDataType:g});i.Plugins.push({name:"lazyload",init:function(l){function u(n){var o=m.steps;n=n.toIndex*o;r.loadCustomLazyData(l.panels.slice(n,n+o),h);a:{var p,a;if(n=(o=h===d)?"img":h===g?"textarea":""){n=c.query(n,l.container);p=0;for(a=n.length;p<a;p++)if(o?s.attr(n[p],q):s.hasClass(n[p],q)){o=false;break a}}o=
true}o&&l.detach(v,u)}var r=c.DataLazyload,m=l.config,h=m.lazyDataType,q=e[h];!r||!h||!q||l.on(v,u)}})},{host:"switchable"});KISSY.add("autorender",function(c){c.Switchable.autoRender=function(s,v){s="."+(s||"KS_Widget");c.query(s,v).each(function(d){var g=d.getAttribute("data-widget-type"),e;if(g&&"Switchable Tabs Slide Carousel Accordion".indexOf(g)>-1)try{if(e=d.getAttribute("data-widget-config"))e=e.replace(/'/g,'"');new c[g](d,c.JSON.parse(e))}catch(i){}})}},{host:"switchable"});
KISSY.add("tabs",function(c){function s(v,d){if(!(this instanceof s))return new s(v,d);s.superclass.constructor.call(this,v,d)}c.extend(s,c.Switchable);c.Tabs=s},{host:"switchable"});KISSY.add("slide",function(c){function s(d,g){if(!(this instanceof s))return new s(d,g);s.superclass.constructor.call(this,d,c.merge(v,g))}var v={autoplay:true,circular:true};c.extend(s,c.Switchable);c.Slide=s},{host:"switchable"});
KISSY.add("carousel",function(c,s){function v(m,h){var q=this;if(!(q instanceof v))return new v(m,h);q.on("init",function(){d(q)});v.superclass.constructor.call(q,m,c.merge(r,h))}function d(m){var h=m.config,q=h.disableBtnCls;c.each(["prev","next"],function(n){var o=m[n+"Btn"]=c.get(i+h[n+"BtnCls"],m.container);e.on(o,"click",function(p){p.preventDefault();g.hasClass(o,q)||m[n]()})});h.circular||m.on("switch",function(n){n=n.currentIndex;n=n===0?m[l]:n===m.length-1?m[u]:s;g.removeClass([m[l],m[u]],
q);n&&g.addClass(n,q)});e.on(m.panels,"click focus",function(){m.fire("itemSelected",{item:this})})}var g=c.DOM,e=c.Event,i=".",l="prevBtn",u="nextBtn",r={circular:true,prevBtnCls:"ks-switchable-prev-btn",nextBtnCls:"ks-switchable-next-btn",disableBtnCls:"ks-switchable-disable-btn"};c.extend(v,c.Switchable);c.Carousel=v},{host:"switchable"});
KISSY.add("accordion",function(c){function s(g,e){if(!(this instanceof s))return new s(g,e);s.superclass.constructor.call(this,g,c.merge(d,e));if(this.config.multiple)this._switchTrigger=function(){}}var v=c.DOM,d={markupType:1,triggerType:"click",multiple:false};c.extend(s,c.Switchable);c.Accordion=s;c.augment(s,{_triggerIsValid:function(g){return this.activeIndex!==g||this.config.multiple},_switchView:function(g,e,i){var l=this.config,u=e[0];if(l.multiple){v.toggleClass(this.triggers[i],l.activeTriggerCls);
v.css(u,"display",u.style.display=="none"?"block":"none");this._fireOnSwitch(i)}else s.superclass._switchView.call(this,g,e,i)}})},{host:"switchable"});
KISSY.add("mask",function(c,s){function v(m){if(!(this instanceof v))return new v(m);m=c.merge(r,m);var h=m.shim,q=h?u:l+m.style,n=h?0:m.opacity,o=d("<iframe>",q,n,!h);if(!h&&e)this.layer=d("<div>",q,n,true);this.config=m;this.iframe=o}function d(m,h,q,n){m=g.create(m);g.attr(m,"style",h);g.css(m,"opacity",q);if(n){g.height(m,g.docHeight());i&&g.width(m,g.docWidth())}document.body.appendChild(m);return m}var g=c.DOM,e=c.UA.ie,i=e===6,l="position:absolute;left:0;top:0;width:100%;border:0;background:black;z-index:9998;display:none;",
u="position:absolute;z-index:9997;border:0;display:none;",r={shim:false,opacity:0.6,style:""};c.augment(v,{show:function(){g.show([this.iframe,this.layer])},hide:function(){g.hide([this.iframe,this.layer])},toggle:function(){this[g.css(this.iframe,"display")!=="none"?"hide":"show"]()},setSize:function(m,h){var q=this.iframe;if(q){g.width(q,m);g.height(q,h)}if(q=this.layer){g.width(q,m);g.height(q,h)}},setOffset:function(m,h){var q=m;if(h!==s)q={left:m,top:h};g.offset([this.iframe,this.layer],q)}});
c.Mask=v});
KISSY.add("overlay",function(c,s){function v(r,m){m=m||{};if(c.isPlainObject(r))m=r;else m.container=r;this.container=c.get(m.container);this.trigger=c.get(m.trigger);m.align=c.merge(c.clone(l.align),m.align);this.config=c.merge(l,m);this._init()}var d=document,g=c.DOM,e=c.Event,i={TL:"tl",TC:"tc",TR:"tr",LC:"cl",CC:"cc",RC:"cr",BL:"bl",BC:"bc",BR:"br"},l={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:[i.CC,i.CC],offset:[0,0]},mask:false,shim:c.UA.ie===6},u;c.augment(v,c.EventTarget,{_init:function(){this.trigger&&this._bindTrigger()},_bindTrigger:function(){this.config.triggerType==="mouse"?this._bindTriggerMouse():this._bindTriggerClick()},_bindTriggerMouse:function(){var r=this,m=r.trigger,h;e.on(m,"mouseenter",function(){r._clearHiddenTimer();h=c.later(function(){r.show();h=s},100)});e.on(m,"mouseleave",function(){if(h){h.cancel();h=s}r._setHiddenTimer()})},_bindContainerMouse:function(){var r=
this;e.on(r.container,"mouseleave",function(){r._setHiddenTimer()});e.on(r.container,"mouseenter",function(){r._clearHiddenTimer()})},_setHiddenTimer:function(){var r=this;r._hiddenTimer=c.later(function(){r.hide()},120)},_clearHiddenTimer:function(){if(this._hiddenTimer){this._hiddenTimer.cancel();this._hiddenTimer=s}},_bindTriggerClick:function(){var r=this;e.on(r.trigger,"click",function(m){m.halt();r.show()})},show:function(){this._firstShow()},_firstShow:function(){this._prepareMarkup();this._realShow();
this._firstShow=this._realShow},_realShow:function(){this._setPosition();this._toggle(false)},_toggle:function(r){g.css(this.container,"visibility",r?"hidden":"");this.shim&&this.shim.toggle();if(this.config.mask)u[r?"hide":"show"]();this[r?"_unbindUI":"_bindUI"]();this.fire(r?"hide":"show")},hide:function(){this._toggle(true)},_prepareMarkup:function(){var r=this.config,m=this.container;if(r.mask&&!u)u=new c.Mask;if(r.shim)this.shim=new c.Mask({shim:true});if(m){this.body=c.get("."+r.bdCls,m)||m;
m.style.cssText+="visibility:hidden;position:absolute;"}else{m=this.container=g.create(c.substitute('<div class="{containerCls}" style="visibility:hidden;position:absolute;"><div class="{bdCls}">{content}</div></div>',r));this.body=g.children(m)[0];d.body.appendChild(m)}g.css(m,"zIndex",r.zIndex);this.setBody(r.content);this._setSize();r.triggerType==="mouse"&&this._bindContainerMouse()},_setSize:function(r,m){var h=this.config;r=r||h.width;m=m||h.height;r&&g.width(this.container,r);m&&g.height(this.container,
m);this.shim&&this.shim.setSize(r,m)},_setDisplay:function(){g.css(this.container,"display")==="none"&&g.css(this.container,"display","block")},_setPosition:function(){var r=this.config.xy;if(r)this.move(r);else{this._setDisplay();this.align()}},move:function(r,m){var h;if(c.isArray(r)){m=r[1];r=r[0]}h={left:r,top:m};g.offset(this.container,h);this.shim&&this.shim.setOffset(h)},align:function(r,m,h){var q=this.config.align;r=r||q.node;r=r==="trigger"?this.trigger:c.get(r);m=m||q.points;h=h===s?q.offset:
h;q=g.offset(this.container);r=this._getAlignOffset(r,m[0]);m=this._getAlignOffset(this.container,m[1]);m=[m.left-r.left,m.top-r.top];this.move(q.left-m[0]+ +h[0],q.top-m[1]+ +h[1])},_getAlignOffset:function(r,m){var h=m.charAt(0),q=m.charAt(1),n,o,p,a;if(r){n=g.offset(r);o=r.offsetWidth;p=r.offsetHeight}else{n={left:g.scrollLeft(),top:g.scrollTop()};o=g.viewportWidth();p=g.viewportHeight()}a=n.left;n=n.top;if(h==="c")n+=p/2;else if(h==="b")n+=p;if(q==="c")a+=o/2;else if(q==="r")a+=o;return{left:a,
top:n}},center:function(){this.move((g.viewportWidth()-g.width(this.container))/2+g.scrollLeft(),(g.viewportHeight()-g.height(this.container))/2+g.scrollTop())},_bindUI:function(){e.on(d,"keydown",this._esc,this)},_unbindUI:function(){e.remove(d,"keydown",this._esc,this)},_esc:function(r){r.keyCode===27&&this.hide()},setBody:function(r){this._setContent("body",r)},_setContent:function(r,m){c.isString(m)&&g.html(this[r],m)}});c.Overlay=v});
KISSY.add("popup",function(c){function s(d,g){if(!(this instanceof s))return new s(d,g);g=g||{};if(c.isPlainObject(d))g=d;else g.container=d;g.align=c.merge(c.clone(v.align),g.align);s.superclass.constructor.call(this,c.merge(v,g))}var v={triggerType:"mouse",align:{node:"trigger",points:["cr","ct"],offset:[10,0]}};c.extend(s,c.Overlay);c.Popup=s},{host:"overlay"});
KISSY.add("dialog",function(c){function s(e,i){if(!(this instanceof s))return new s(e,i);i=i||{};if(c.isPlainObject(e))i=e;else i.container=e;i.align=c.merge(c.clone(g.align),i.align);s.superclass.constructor.call(this,c.merge(g,i));this.manager=c.DialogManager;this.manager.register(this)}var v=c.DOM,d=c.Event,g={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(s,
c.Overlay);c.Dialog=s;c.augment(s,c.EventTarget,{_prepareMarkup:function(){var e=this.config;s.superclass._prepareMarkup.call(this);this.header=c.get("."+e.hdCls,this.container);if(!this.header){this.header=v.create("<div>",{"class":e.hdCls});v.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=v.create("<div>",{"class":e.ftCls});this.container.appendChild(this.footer)}this.setFooter(e.footer)}e.closable&&
this._initClose()},_initClose:function(){var e=this,i=v.create("<div>",{"class":e.config.closeBtnCls});v.html(i,"close");d.on(i,"click",function(l){l.halt();e.hide()});e.header.appendChild(i)},setHeader:function(e){this._setContent("header",e)},setFooter:function(e){this._setContent("footer",e)}});c.DialogManager={register:function(e){e instanceof s&&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(s,v){s="."+(s||"KS_Widget");c.query(s,v).each(function(d){var g=d.getAttribute("data-widget-type"),e;if(g&&"Dialog Popup".indexOf(g)>-1)try{if(e=d.getAttribute("data-widget-config"))e=e.replace(/'/g,'"');new c[g](d,c.JSON.parse(e))}catch(i){}})}},{host:"overlay"});
KISSY.add("suggest",function(c,s){function v(b,f,k){if(!(this instanceof v))return new v(b,f,k);this.textInput=c.get(b);this.config=k=c.merge(a,k);f+=f.indexOf("?")===-1?"?":"&";this.dataSource=f+k.callbackName+"="+(b=k.callbackFn);if(b!==q){k=b;b=k.split(".");f=b.length;if(f>1){k=k.replace(/^(.*)\..+$/,"$1");k=c.namespace(k,true);k[b[f-1]]=g}else l[k]=g}this.queryParams=this.query=n;this._dataCache={};this._init()}function d(b,f){if(f.nodeType===1){e.html(b,n);b.appendChild(f)}else e.html(b,f)}function g(b){v.focusInstance&&
c.later(function(){v.focusInstance._handleResponse(b)},0)}var e=c.DOM,i=c.Event,l=window,u=document,r,m=c.get("head"),h=c.UA.ie,q="KISSY.Suggest.callback",n="",o=parseInt,p=/^(input|button|a)$/i,a={containerCls:n,resultFormat:"%result%",closeBtnText:"\u5173\u95ed",shim:h===6,submitOnSelect:true,offset:-1,charset:"utf-8",callbackName:"callback",callbackFn:q,queryName:"q"};c.augment(v,c.EventTarget,{_init:function(){r=u.body;this._initTextInput();this._initContainer();this.config.shim&&this._initShim();this._initStyle();
this._initEvent()},_initTextInput:function(){var b=this,f=b.textInput,k=false,j=0;e.attr(f,"autocomplete","off");b.config.autoFocus&&f.focus();i.on(f,"keydown",function(t){var x=t.keyCode;if(x===27){b.hide();f.value=b.query}else if(x>32&&x<41)if(f.value){if(x===40||x===38){if(j++===0){b._isRunning&&b.stop();k=true;b._selectItem(x===40)}else if(j==3)j=0;t.preventDefault()}}else f.blur();else if(x===13){f.blur();if(k)if(f.value==b._getSelectedItemKey())if(b.fire("itemSelect")===false)return;b._submitForm()}else{b._isRunning||
b.start();k=false}});i.on(f,"keyup",function(){j=0});i.on(f,"blur",function(){b.stop();c.later(function(){b._focusing||b.hide()},0)})},_initContainer:function(){var b=e.create("<div>",{"class":"ks-suggest-container "+this.config.containerCls,style:"position:absolute;visibility:hidden"}),f=e.create("<div>",{"class":"ks-suggest-content"}),k=e.create("<div>",{"class":"ks-suggest-footer"});b.appendChild(f);b.appendChild(k);r.insertBefore(b,r.firstChild);this.container=b;this.content=f;this.footer=k;this._initContainerEvent()},
_setContainerRegion:function(){var b=this.config,f=this.textInput,k=e.offset(f),j=this.container;e.offset(j,{left:k.left,top:k.top+f.offsetHeight+b.offset});e.width(j,b.containerWidth||f.offsetWidth-2)},_initContainerEvent:function(){var b=this,f=b.textInput,k=b.container,j=b.content,t=b.footer,x,w;i.on(j,"mousemove",function(y){y=y.target;if(y.nodeName!=="LI")y=e.parent(y,"li");if(e.contains(j,y))if(y!==b.selectedItem){b._removeSelectedItem();b._setSelectedItem(y)}});i.on(j,"mousedown",function(y){y=
y.target;if(y.nodeName!=="LI")y=e.parent(y,"li");x=y});i.on(k,"mousedown",function(y){if(!p.test(y.target.nodeName)){f.onbeforedeactivate=function(){l.event.returnValue=false;f.onbeforedeactivate=null};y.preventDefault()}});i.on(j,"mouseup",function(y){var z=y.target;if(!(y.which>2)){if(z.nodeName!=="LI")z=e.parent(z,"li");if(z==x)if(e.contains(j,z)){b._updateInputFromSelectItem(z);if(b.fire("itemSelect")!==false){f.blur();b._submitForm()}}}});i.on(t,"focusin",function(){b._focusing=true;b._removeSelectedItem();
w=false});i.on(t,"focusout",function(){b._focusing=false;c.later(function(){if(w)b.hide();else b._focusing||b.textInput.focus()},0)});i.on(b.container,"mouseleave",function(){w=true});i.on(t,"click",function(y){e.hasClass(y.target,"ks-suggest-closebtn")&&b.hide()})},_submitForm:function(){if(this.config.submitOnSelect){var b=this.textInput.form;if(b)if(this.fire("beforeSubmit",{form:b})!==false){if(u.createEvent){var f=u.createEvent("MouseEvents");f.initEvent("submit",true,false);b.dispatchEvent(f)}else u.createEventObject&&
b.fireEvent("onsubmit");b.submit()}}},_initShim:function(){var b=e.create("<iframe>",{src:"about:blank","class":"ks-suggest-shim",style:"position:absolute;visibility:hidden;border:none"});this.container.shim=b;r.insertBefore(b,r.firstChild)},_setShimRegion:function(){var b=this.container,f=b.style,k=b.shim;k&&e.css(k,{left:o(f.left)-2,top:f.top,width:o(f.width)+2,height:e.height(b)-2})},_initStyle:function(){c.get("#ks-suggest-style")||e.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 b=this;i.on(l,"resize",function(){b._setContainerRegion();b._setShimRegion()})},start:function(){var b=this;if(b.fire("beforeStart")!==false){v.focusInstance=b;b._timer=c.later(function(){b._updateContent();b._timer=c.later(arguments.callee,200)},200);b._isRunning=true}},stop:function(){v.focusInstance=s;this._timer&&this._timer.cancel();this._isRunning=false},show:function(){if(!this.isVisible()){var b=this.container,f=b.shim;this._setContainerRegion();
b.style.visibility=n;if(f){this._setShimRegion();f.style.visibility=n}}},hide:function(){if(this.isVisible()){var b=this.container,f=b.shim;if(f)f.style.visibility="hidden";b.style.visibility="hidden"}},isVisible:function(){return this.container.style.visibility!="hidden"},_updateContent:function(){var b=this.textInput;if(b.value!=this.query){b=this.query=b.value;if(c.trim(b))if(this._dataCache[b]!==s){this._fillContainer(this._dataCache[b]);this._displayContainer()}else this._requestData();else{this._fillContainer();
this.hide()}}},_requestData:function(){var b=this,f=b.config,k;if(!h)b.dataScript=s;if(!b.dataScript){k=u.createElement("script");k.charset=f.charset;k.async=true;m.insertBefore(k,m.firstChild);b.dataScript=k;if(!h){var j=c.now();b._latestScriptTime=j;e.attr(k,"data-time",j);i.on(k,"load",function(){b._scriptDataIsOut=e.attr(k,"data-time")!=b._latestScriptTime})}}b.queryParams=f.queryName+"="+encodeURIComponent(b.query);if(b.fire("beforeDataRequest")!==false)b.dataScript.src=b.dataSource+"&"+b.queryParams},
_handleResponse:function(b){var f=n,k,j,t,x;if(!this._scriptDataIsOut){this.returnedData=b;if(this.fire("dataReturn",{data:b})!==false){b=this._formatData(this.returnedData);if((k=b.length)>0){j=e.create("<ol>");for(f=0;f<k;++f){t=b[f];t=this._formatItem(x=t.key,t.result);e.attr(t,"key",x);e.addClass(t,f%2?"ks-even":"ks-odd");j.appendChild(t)}f=j}this._fillContainer(f);if(this.fire("beforeShow")!==false){this._dataCache[this.query]=e.html(this.content);this._displayContainer()}}}},_formatData:function(b){var f=
[],k,j,t,x=0;if(!b)return f;if(c.isArray(b.result))b=b.result;if(!(k=b.length))return f;for(t=0;t<k;++t){j=b[t];if(c.isString(j))f[x++]={key:j};else if(c.isArray(j)&&j.length>1)f[x++]={key:j[0],result:j[1]}}return f},_formatItem:function(b,f){var k=e.create("<li>"),j;k.appendChild(e.create("<span>",{"class":"ks-suggest-key",html:b}));if(f){j=this.config.resultFormat.replace("%result%",f);c.trim(j)&&k.appendChild(e.create("<span>",{"class":"ks-suggest-result",html:j}))}return k},_fillContainer:function(b,
f){this._fillContent(b||n);this._fillFooter(f||n)},_fillContent:function(b){d(this.content,b);this.selectedItem=s},_fillFooter:function(b){var f=this.config,k=this.footer;d(k,b);f.closeBtn&&k.appendChild(e.create("<a>",{"class":"ks-suggest-closebtn",text:f.closeBtnText,href:"javascript: void(0)",target:"_self"}));this.fire("updateFooter",{footer:k,query:this.query});e.css(k,"display",e.text(k)?n:"none")},_displayContainer:function(){c.trim(e.text(this.container))?this.show():this.hide()},_selectItem:function(b){var f=
c.query("li",this.container);if(f.length!==0)if(this.isVisible()){if(this.selectedItem){b=e[b?"next":"prev"](this.selectedItem);if(!b)this.textInput.value=this.query}else b=f[b?0:f.length-1];this._removeSelectedItem();if(b){this._setSelectedItem(b);this._updateInputFromSelectItem()}}else this.show()},_removeSelectedItem:function(){e.removeClass(this.selectedItem,"ks-selected");this.selectedItem=s},_setSelectedItem:function(b){e.addClass(b,"ks-selected");this.selectedItem=b;this.textInput.focus()},
_getSelectedItemKey:function(){if(!this.selectedItem)return n;return e.attr(this.selectedItem,"key")},_updateInputFromSelectItem:function(){this.textInput.value=this._getSelectedItemKey(this.selectedItem)||this.query}});v.version=1.1;v.callback=g;c.Suggest=v},{requires:["core"]});
KISSY.add("imagezoom",function(c,s){function v(n,o){var p=this,a;if(!(p instanceof v))return new v(n,o);if(p.image=n=c.get(n)){p.config=o=c.merge(q,o);if(!o.bigImageSrc)if((a=i.attr(n,"data-ks-imagezoom"))&&r.test(a))o.bigImageSrc=a;o.offset=c.makeArray(o.offset);if(o.preload)(new Image).src=o.bigImageSrc;d(n,function(){p._init()})}}function d(n,o){n.complete?o():l.on(n,"load",o)}function g(n){return i.create(u,{"class":n,style:"position:absolute"})}var e=document,i=c.DOM,l=c.Event,u="<div>",r=/^.+\.(jpg|png|gif)$/i,
m=Math.round,h=["top","right","bottom","left","inner"],q={type:"standard",bigImageSrc:"",bigImageSize:[800,800],position:"right",offset:10,preload:true,timeout:120,timeoutMsg:"\u56fe\u7247\u6682\u4e0d\u53ef\u7528",zoomSize:["auto","auto"],lensIcon:true,zoomCls:""};c.augment(v,c.EventTarget,{_init:function(){this._renderUI();this._bindUI()},_renderUI:function(){var n=this.config,o=this.image;this._imgRegion=c.merge(i.offset(o),{width:o.clientWidth,height:o.clientHeight});n.lensIcon&&this._renderIcon()},_renderIcon:function(){var n=
this._imgRegion,o=g("ks-imagezoom-icon");e.body.appendChild(o);i.offset(o,{left:n.left+n.width-i.width(o),top:n.top+n.height-i.height(o)});this.lensIcon=o},_bindUI:function(){var n=this,o;l.on(n.image,"mouseenter",function(){o=c.later(function(){var p=n.config.bigImageSrc;if(n.viewer){if(n._cacheBigImageSrc&&n._cacheBigImageSrc!==p){i.attr(n.bigImage,"src",p);n._cacheBigImageSrc=p;n._updateViewerOnLoad()}}else n._createViewer();n.show()},100)});l.on(n.image,"mouseleave",function(){if(o){o.cancel();
o=s}})},_createViewer:function(){var n=this.config,o;this._renderLens();o=g("ks-imagezoom-viewer "+n.zoomCls);n=i.create("<img>",{src:n.bigImageSrc});o.appendChild(n);e.body.appendChild(o);this.bigImage=n;this.viewer=o;this._setViewerRegion();this._updateViewerOnLoad()},_updateViewerOnLoad:function(){var n=this,o=n.config,p,a=n.bigImage;if(!a.complete){p=c.later(function(){a.complete||n._showTimeoutMsg();p=s},o.timeout*1E3);d(a,function(){if(p){p.cancel();p=s}n._setViewerRegion()})}},_renderLens:function(){var n=
g("ks-imagezoom-lens");i.hide(n);e.body.appendChild(n);this.lens=n},_setViewerRegion:function(){var n=this.config,o=this.viewer,p=this._imgRegion,a=n.zoomSize,b,f,k;this._bigImageSize=f=(k=this.bigImage)?{width:n.bigImageSize[0],height:n.bigImageSize[1]}:{width:k.clientWidth,height:k.clientHeight};k=a[0];if(k==="auto")k=p.width;a=a[1];if(a==="auto")a=p.height;b=m(k*p.width/f.width);f=m(a*p.height/f.height);this._lensSize=[b,f];var j=this.lens;i.width(j,b);i.height(j,f);i.offset(this.lens,{left:p.left+
(p.width-b)/2,top:p.top+(p.height-f)/2});b=p.left+(n.offset[0]||0);f=p.top+(n.offset[1]||0);switch(n.position){case h[0]:f-=a;break;case h[1]:b+=p.width;break;case h[2]:f+=p.height;break;case h[3]:b-=k;break;case h[4]:k=p.width;a=p.height;i.css(o,"cursor","move")}i.offset(o,{left:b,top:f});n=a;i.width(o,k);i.height(o,n)},_onMouseMove:function(n){var o=this.viewer,p=this.lens,a=this._imgRegion,b=a.left,f=a.top,k=a.width;a=a.height;var j=this._lensSize,t=j[0],x=j[1];if(n.pageX>b&&n.pageX<b+k&&n.pageY>
f&&n.pageY<f+a){j=n.pageX-t/2;n=n.pageY-x/2;if(j<=b)j=b;else if(j>=k+b-t)j=k+b-t;if(n<=f)n=f;else if(n>=a+f-x)n=a+f-x;p&&i.offset(p,{left:j,top:n});o.scrollLeft=m((j-b)*this._bigImageSize.width/k);o.scrollTop=m((n-f)*this._bigImageSize.height/a)}else this.hide()},_showTimeoutMsg:function(){var n=this.config,o=this.viewer,p=c.get("p",o);if(!p){p=i.create("<p>");o.appendChild(p)}i.html(p,n.timeoutMsg)},show:function(){i.show(this.config.position!==h[4]?[this.lens,this.viewer]:this.viewer);i.hide(this.lensIcon);
l.on(e.body,"mousemove",this._onMouseMove,this)},hide:function(){i.hide([this.lens,this.viewer]);i.show(this.lensIcon);l.remove(e.body,"mousemove",this._onMouseMove,this)},set:function(n,o){if(n==="bigImageSrc")if(o&&r.test(o)){this._cacheBigImageSrc=this.config.bigImageSrc;this.config.bigImageSrc=o}}});c.ImageZoom=v});
KISSY.add("autorender",function(c){c.ImageZoom.autoRender=function(s,v){s="."+(s||"KS_Widget");c.query(s,v).each(function(d){var g=d.getAttribute("data-widget-type"),e;if(g==="ImageZoom")try{if(e=d.getAttribute("data-widget-config"))e=e.replace(/'/g,'"');new c[g](d,c.JSON.parse(e))}catch(i){}})}},{host:"imagezoom"});
KISSY.add("date",function(c){var s=function(){var v=/w{1}|d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,d=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,g=/[^-+\dA-Z]/g,e=function(u,r){u=String(u);for(r=r||2;u.length<r;)u="0"+u;return u},i={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",longTime:"h:MM:ss TT Z",
isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUTCDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",localShortDate:"yy\u5e74mm\u6708dd\u65e5",localShortDateTime:"yy\u5e74mm\u6708dd\u65e5 hh:MM:ss TT",localLongDate:"yyyy\u5e74mm\u6708dd\u65e5",localLongDateTime:"yyyy\u5e74mm\u6708dd\u65e5 hh:MM:ss TT",localFullDate:"yyyy\u5e74mm\u6708dd\u65e5 w",localFullDateTime:"yyyy\u5e74mm\u6708dd\u65e5 w hh:MM:ss TT"},l={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94",
"\u661f\u671f\u516d"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};return function(u,r,m){if(arguments.length==1&&Object.prototype.toString.call(u)=="[object String]"&&!/\d/.test(u)){r=u;u=undefined}u=u?new Date(u):new Date;if(isNaN(u))throw SyntaxError("invalid date");r=String(i[r]||r||i["default"]);if(r.slice(0,4)=="UTC:"){r=r.slice(4);m=true}var h=m?"getUTC":"get",
q=u[h+"Date"](),n=u[h+"Day"](),o=u[h+"Month"](),p=u[h+"FullYear"](),a=u[h+"Hours"](),b=u[h+"Minutes"](),f=u[h+"Seconds"]();h=u[h+"Milliseconds"]();var k=m?0:u.getTimezoneOffset(),j={d:q,dd:e(q),ddd:l.dayNames[n],dddd:l.dayNames[n+7],w:l.dayNames[n+14],m:o+1,mm:e(o+1),mmm:l.monthNames[o],mmmm:l.monthNames[o+12],yy:String(p).slice(2),yyyy:p,h:a%12||12,hh:e(a%12||12),H:a,HH:e(a),M:b,MM:e(b),s:f,ss:e(f),l:e(h,3),L:e(h>99?Math.round(h/10):h),t:a<12?"a":"p",tt:a<12?"am":"pm",T:a<12?"A":"P",TT:a<12?"AM":
"PM",Z:m?"UTC":(String(u).match(d)||[""]).pop().replace(g,""),o:(k>0?"-":"+")+e(Math.floor(Math.abs(k)/60)*100+Math.abs(k)%60,4),S:["th","st","nd","rd"][q%10>3?0:(q%100-q%10!=10)*q%10]};return r.replace(v,function(t){return t in j?j[t]:t.slice(1,t.length-1)})}}();c.Date={format:function(v,d,g){return s(v,d,g)},parse:function(v){var d=null;if(d instanceof Date)v=d;else{d=new Date(v);v=d instanceof Date&&d!="Invalid Date"&&!isNaN(d)?d:null}return v}}});
KISSY.add("calendar",function(c,s){function v(d,g){this._init(d,g)}c.augment(v,{_init:function(d,g){var e=c.one(d);this.id=this.C_Id=this._stamp(e);this._buildParam(g);if(this.popup){this.trigger=e;this.con=c.Node("<div></div>");c.one("body").append(this.con);this.C_Id=this._stamp(this.con);this.con.css({top:"0px",position:"absolute",background:"white",visibility:"hidden"})}else this.con=e;e=new Function;c.augment(e,c.EventTarget);e=new e;c.mix(this,e);this.render();this._buildEvent();return this},
render:function(d){var g=0,e,i;d=d||{};this._parseParam(d);this.ca=[];this.con.addClass("ks-cal-call ks-clearfix multi-"+this.pages);this.con.html("");g=0;for(i=[this.year,this.month];g<this.pages;g++){if(g==0)d=true;else{d=false;i=this._computeNextMonth(i)}e=g==this.pages-1;this.ca.push(new this.Page({year:i[0],month:i[1],prevArrow:d,nextArrow:e,showTime:this.showTime},this));this.ca[g].render()}return this},_stamp:function(d){if(d.attr("id")==s||d.attr("id")=="")d.attr("id","K_"+c.now());return d.attr("id")},
_showdate:function(d,g){var e=new Date(g-0+d*864E5);e=e.getFullYear()+"/"+(e.getMonth()+1)+"/"+e.getDate();return new Date(e)},_buildEvent:function(){var d=this;if(!d.popup)return this;for(var g=0;g<d.EV.length;g++)d.EV[g]!==s&&d.EV[g].detach();d.EV[0]=c.one("body").on("click",function(e){e.target=c.Node(e.target);if(e.target.attr("id")!=d.C_Id)if(!((e.target.hasClass("ks-next")||e.target.hasClass("ks-prev"))&&e.target[0].tagName=="A"))if(e.target.attr("id")!=d.id)c.DOM.contains(c.one("#"+d.C_Id),
e.target)||d.hide()});for(g=0;g<d.triggerType.length;g++)d.EV[1]=c.one("#"+d.id).on(d.triggerType[g],function(e){e.target=c.Node(e.target);e.preventDefault();var i=d.triggerType;if(c.inArray("click",i)&&c.inArray("focus",i))e.type=="focus"&&d.toggle();else if(c.inArray("click",i)&&!c.inArray("focus",i))e.type=="click"&&d.toggle();else!c.inArray("click",i)&&c.inArray("focus",i)?setTimeout(function(){d.toggle()},170):d.toggle()});return this},toggle:function(){this.con.css("visibility")=="hidden"?this.show():
this.hide()},show:function(){this.con.css("visibility","");var d=this.trigger.offset().left,g=this.trigger[0].offsetHeight||this.trigger.height();g=this.trigger.offset().top+g;this.con.css("left",d.toString()+"px");this.con.css("top",g.toString()+"px");return this},hide:function(){this.con.css("visibility","hidden");return this},_buildParam:function(d){function g(u,r){var m=d[r];e[r]=m===s||m==null?u:m}var e=this;if(d===s||d==null)d={};c.each({date:new Date,startDay:0,pages:1,closable:false,rangeSelect:false,
minDate:false,maxDate:false,multiSelect:false,navigator:true,popup:false,showTime:false,triggerType:["click"]},g);if(typeof d.triggerType==="string")d.triggerType=[d.triggerType];g(e.date,"selected");if(d.startDay)e.startDay=(7-d.startDay)%7;if(d.range!==s&&d.range!=null){var i=e._showdate(1,new Date(d.range.start.getFullYear()+"/"+(d.range.start.getMonth()+1)+"/"+d.range.start.getDate())),l=e._showdate(1,new Date(d.range.end.getFullYear()+"/"+(d.range.end.getMonth()+1)+"/"+d.range.end.getDate()));
e.range={start:i,end:l}}else e.range={start:null,end:null};e.EV=[];return this},_parseParam:function(d){var g;if(d===s||d==null)d={};for(g in d)this[g]=d[g];this._handleDate();return this},_templetShow:function(d,g){var e,i,l,u;if(g instanceof Array){e="";for(i=0;i<g.length;i++)e+=arguments.callee(d,g[i]);d=e}else{e=d.match(/{\$(.*?)}/g);if(g!==s&&e!=null){i=0;for(l=e.length;i<l;i++){u=e[i].replace(/({\$)|}/g,"");u=g[u]!==s?g[u]:"";d=d.replace(e[i],u)}}}return d},_handleDate:function(){var d=this.date;
this.weekday=d.getDay()+1;this.day=d.getDate();this.month=d.getMonth();this.year=d.getFullYear();return this},_getHeadStr:function(d,g){return d.toString()+"\u5e74"+(Number(g)+1).toString()+"\u6708"},_monthAdd:function(){if(this.month==11){this.year++;this.month=0}else this.month++;this.date=new Date(this.year.toString()+"/"+(this.month+1).toString()+"/"+this.day.toString());return this},_monthMinus:function(){if(this.month==0){this.year--;this.month=11}else this.month--;this.date=new Date(this.year.toString()+
"/"+(this.month+1).toString()+"/"+this.day.toString());return this},_computeNextMonth:function(d){var g=d[0];d=d[1];if(d==11){g++;d=0}else d++;return[g,d]},_handleOffset:function(){var d=["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],g=this.startDay,e="";e=[];for(var i=0;i<7;i++)e[i]={day:d[(i-g+7)%7]};e=this._templetShow("<span>{$day}</span>",e);return{day_html:e}},_handleRange:function(d){if(this.range.start==null&&this.range.end==null||this.range.start!=null&&this.range.end!=null){this.range.start=d;this.range.end=
null;this.render()}else if(this.range.start!=null&&this.range.end==null){this.range.end=d;if(this.range.start.getTime()>this.range.end.getTime()){d=this.range.start;this.range.start=this.range.end;this.range.end=d}this.fire("rangeSelect",this.range);this.render()}return this}});c.Calendar=v},{requires:["core"]});
KISSY.add("calendar-page",function(c){c.augment(c.Calendar,{Page:function(s,v){this.father=v;this.month=Number(s.month);this.year=Number(s.year);this.prevArrow=s.prevArrow;this.nextArrow=s.nextArrow;this.timmer=this.node=null;this.id="";this.EV=[];this.html=['<div class="ks-cal-box" id="{$id}"><div class="ks-cal-hd"><a href="javascript:void(0);" class="ks-prev {$prev}"><</a><a href="javascript:void(0);" class="ks-title">{$title}</a><a href="javascript:void(0);" class="ks-next {$next}">></a></div><div class="ks-cal-bd"><div class="ks-whd">',
v._handleOffset().day_html,'</div><div class="ks-dbd ks-clearfix">{$ds}</div></div><div class="ks-setime hidden"></div><div class="ks-cal-ft {$showtime}"><div class="ks-cal-time">\u65f6\u95f4\uff1a00:00 &hearts;</div></div><div class="ks-selectime hidden"></div></div><!--#ks-cal-box--\>'].join("");this.nav_html='<p>\u6708<select value="{$the_month}"><option class="m1" value="1">01</option><option class="m2" value="2">02</option><option class="m3" value="3">03</option><option class="m4" value="4">04</option><option class="m5" value="5">05</option><option class="m6" value="6">06</option><option class="m7" value="7">07</option><option class="m8" value="8">08</option><option class="m9" value="9">09</option><option class="m10" value="10">10</option><option class="m11" value="11">11</option><option class="m12" value="12">12</option></select></p><p>\u5e74<input type="text" value="{$the_year}" onfocus="this.select()"/></p><p><button class="ok">\u786e\u5b9a</button><button class="cancel">\u53d6\u6d88</button></p>';
this.Verify=function(){return{isDay:function(d){if(!/\d+/i.test(d))return false;d=Number(d);return!(d<1||d>31)},isYear:function(d){if(!/\d+/i.test(d))return false;d=Number(d);return!(d<100||d>1E4)},isMonth:function(d){if(!/\d+/i.test(d))return false;d=Number(d);return!(d<1||d>12)}}};this._renderUI=function(){var d={};this.HTML="";d.prev="";d.next="";d.title="";d.ds="";if(!this.prevArrow)d.prev="hidden";if(!this.nextArrow)d.next="hidden";if(!this.father.showtime)d.showtime="hidden";d.id=this.id="ks-cal-"+
Math.random().toString().replace(/.\./i,"");d.title=this.father._getHeadStr(this.year,this.month);this.createDS();d.ds=this.ds;this.father.con.append(this.father._templetShow(this.html,d));this.node=c.one("#"+this.id);if(this.father.showTime){d=this.node.one(".ks-cal-ft");d.removeClass("hidden");this.timmer=new this.father.TimeSelector(d,this.father)}return this};this._buildEvent=function(){var d=this,g,e=c.one("#"+d.id);for(g=0;g<d.EV.length;g++)typeof d.EV[g]!="undefined"&&d.EV[g].detach();d.EV[0]=
e.one("div.ks-dbd").on("click",function(i){i.preventDefault();i.target=c.Node(i.target);if(!i.target.hasClass("null"))if(!i.target.hasClass("disabled")){i=Number(i.target.html());var l=new Date;l.setDate(i);l.setMonth(d.month);l.setYear(d.year);d.father.dt_date=l;d.father.fire("select",{date:l});d.father.popup&&d.father.closable&&d.father.hide();d.father.rangeSelect&&d.father._handleRange(l);d.father.render({selected:l})}});d.EV[1]=e.one("a.ks-prev").on("click",function(i){i.preventDefault();d.father._monthMinus().render();
d.father.fire("monthChange",{date:new Date(d.father.year+"/"+(d.father.month+1)+"/01")})});d.EV[2]=e.one("a.ks-next").on("click",function(i){i.preventDefault();d.father._monthAdd().render();d.father.fire("monthChange",{date:new Date(d.father.year+"/"+(d.father.month+1)+"/01")})});if(d.father.navigator){d.EV[3]=e.one("a.ks-title").on("click",function(i){try{d.timmer.hidePopup();i.preventDefault()}catch(l){}i.target=c.Node(i.target);i=e.one(".ks-setime");i.html("");var u=d.father._templetShow(d.nav_html,
{the_month:d.month+1,the_year:d.year});i.html(u);i.removeClass("hidden");e.one("input").on("keydown",function(r){r.target=c.Node(r.target);if(r.keyCode==38){r.target.val(Number(r.target.val())+1);r.target[0].select()}if(r.keyCode==40){r.target.val(Number(r.target.val())-1);r.target[0].select()}if(r.keyCode==13){r=e.one(".ks-setime").one("select").val();var m=e.one(".ks-setime").one("input").val();e.one(".ks-setime").addClass("hidden");if(d.Verify().isYear(m))if(d.Verify().isMonth(r)){d.father.render({date:new Date(m+
"/"+r+"/01")});d.father.fire("monthChange",{date:new Date(m+"/"+r+"/01")})}}})});d.EV[4]=e.one(".ks-setime").on("click",function(i){i.preventDefault();i.target=c.Node(i.target);if(i.target.hasClass("ok")){i=e.one(".ks-setime").one("select").val();var l=e.one(".ks-setime").one("input").val();e.one(".ks-setime").addClass("hidden");if(d.Verify().isYear(l))if(d.Verify().isMonth(i)){d.father.render({date:new Date(l+"/"+i+"/01")});d.father.fire("monthChange",{date:new Date(l+"/"+i+"/01")})}}else i.target.hasClass("cancel")&&
e.one(".ks-setime").addClass("hidden")})}return this};this._getNode=function(){return this.node};this._getNumOfDays=function(d,g){return 32-(new Date(d,g-1,32)).getDate()};this.createDS=function(){var d="",g=((new Date(this.year+"/"+(this.month+1)+"/01")).getDay()+this.father.startDay+7)%7,e=this._getNumOfDays(this.year,this.month+1)+g,i,l;for(i=0;i<e;i++){l=/532/.test(c.UA.webkit)?new Date(this.year+"/"+Number(this.month+1)+"/"+(i+1-g).toString()):new Date(this.year+"/"+Number(this.month+1)+"/"+
(i+2-g).toString());var u=new Date(this.year+"/"+Number(this.month+1)+"/"+(i+1-g).toString());d+=i<g?'<a href="javascript:void(0);" class="ks-null">0</a>':this.father.minDate instanceof Date&&(new Date(this.year+"/"+(this.month+1)+"/"+(i+2-g))).getTime()<this.father.minDate.getTime()+1?'<a href="javascript:void(0);" class="ks-disabled">'+(i-g+1)+"</a>":this.father.maxDate instanceof Date&&(new Date(this.year+"/"+(this.month+1)+"/"+(i+1-g))).getTime()>this.father.maxDate.getTime()?'<a href="javascript:void(0);" class="ks-disabled">'+
(i-g+1)+"</a>":this.father.range.start!=null&&this.father.range.end!=null&&l.getTime()>=this.father.range.start.getTime()&&u.getTime()<this.father.range.end.getTime()?i==g+(new Date).getDate()-1&&(new Date).getFullYear()==this.year&&(new Date).getMonth()==this.month?'<a href="javascript:void(0);" class="ks-range ks-today">'+(i-g+1)+"</a>":'<a href="javascript:void(0);" class="ks-range">'+(i-g+1)+"</a>":i==g+(new Date).getDate()-1&&(new Date).getFullYear()==this.year&&(new Date).getMonth()==this.month?
'<a href="javascript:void(0);" class="ks-today">'+(i-g+1)+"</a>":i==g+this.father.selected.getDate()-1&&this.month==this.father.selected.getMonth()&&this.year==this.father.selected.getFullYear()?'<a href="javascript:void(0);" class="ks-selected">'+(i-g+1)+"</a>":'<a href="javascript:void(0);">'+(i-g+1)+"</a>"}if(e%7!=0)for(i=0;i<7-e%7;i++)d+='<a href="javascript:void(0);" class="ks-null">0</a>';this.ds=d;return this};this.render=function(){this._renderUI();this._buildEvent();return this}}})},{host:"calendar"});
KISSY.add("calendar-time",function(c){c.augment(c.Calendar,{TimeSelector:function(s,v){this.father=v;this.fcon=s.parent(".ks-cal-box");this.popupannel=this.fcon.one(".ks-selectime");if(typeof v._time=="undefined")v._time=new Date;this.time=v._time;this.status="s";this.ctime=c.Node('<div class="ks-cal-time">\u65f6\u95f4\uff1a<span class="h">h</span>:<span class="m">m</span>:<span class="s">s</span><!--{{arrow--\><div class="cta"><button class="u"></button><button class="d"></button></div><!--arrow}}--\></div>');
this.button=c.Node('<button class="ct-ok">\u786e\u5b9a</button>');this.h_a=["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"];this.m_a=["00","10","20","30","40","50"];this.s_a=["00","10","20","30","40","50"];this.parseSubHtml=function(d){for(var g="",e=0;e<d.length;e++)g+='<a href="javascript:void(0);" class="item">'+d[e]+"</a>";g+='<a href="javascript:void(0);" class="x">x</a>';return g};this.showPopup=function(d){this.popupannel.html(d);
this.popupannel.removeClass("hidden");d=this.status;this.ctime.all("span").removeClass("on");switch(d){case "h":this.ctime.all(".h").addClass("on");break;case "m":this.ctime.all(".m").addClass("on");break;case "s":this.ctime.all(".s").addClass("on")}};this.hidePopup=function(){this.popupannel.addClass("hidden")};this.render=function(){var d=this.get("h"),g=this.get("m"),e=this.get("s");this.father._time=this.time;this.ctime.all(".h").html(d);this.ctime.all(".m").html(g);this.ctime.all(".s").html(e);
return this};this.set=function(d,g){g=Number(g);switch(d){case "h":this.time.setHours(g);break;case "m":this.time.setMinutes(g);break;case "s":this.time.setSeconds(g)}this.render()};this.get=function(d){var g=this.time;switch(d){case "h":return g.getHours();case "m":return g.getMinutes();case "s":return g.getSeconds()}};this.add=function(){var d=this.status,g=this.get(d);g++;this.set(d,g)};this.minus=function(){var d=this.status,g=this.get(d);g--;this.set(d,g)};this._init=function(){var d=this;s.html("").append(d.ctime);
s.append(d.button);d.render();d.popupannel.on("click",function(g){g=c.Node(g.target);if(g.hasClass("x"))d.hidePopup();else if(g.hasClass("item")){g=Number(g.html());d.set(d.status,g);d.hidePopup()}});d.button.on("click",function(){var g=typeof d.father.dt_date=="undefined"?d.father.date:d.father.dt_date;g.setHours(d.get("h"));g.setMinutes(d.get("m"));g.setSeconds(d.get("s"));d.father.fire("timeSelect",{date:g});d.father.popup&&d.father.closable&&d.father.hide()});d.ctime.on("keyup",function(g){if(g.keyCode==
38||g.keyCode==37){g.preventDefault();d.add()}if(g.keyCode==40||g.keyCode==39){g.preventDefault();d.minus()}});d.ctime.one(".u").on("click",function(){d.hidePopup();d.add()});d.ctime.one(".d").on("click",function(){d.hidePopup();d.minus()});d.ctime.one(".h").on("click",function(){var g=d.parseSubHtml(d.h_a);d.status="h";d.showPopup(g)});d.ctime.one(".m").on("click",function(){var g=d.parseSubHtml(d.m_a);d.status="m";d.showPopup(g)});d.ctime.one(".s").on("click",function(){var g=d.parseSubHtml(d.s_a);
d.status="s";d.showPopup(g)})};this._init()}})},{host:"calendar"});
