/*
Copyright 2010, KISSY UI Library v1.1.0
MIT Licensed
build time: Aug 2 23:09
*/
(function(c,i,h){if(c[i]===h)c[i]={};i=c[i];var p=c.document,m=function(o,g,n,t){if(!g||!o)return o;if(n===h)n=true;var x,y,s;if(t&&(s=t.length))for(x=0;x<s;x++){y=t[x];if(y in g)if(n||!(y in o))o[y]=g[y]}else for(y in g)if(n||!(y in o))o[y]=g[y];return o},j=false,e=[],k=false,r=/^#?([\w-]+)$/;m(i,{version:"1.1.0",_init:function(){this.Env={mods:{},guid:0}},add:function(o,g){this.Env.mods[o]={name:o,fn:g};g(this);return this},ready:function(o){k||this._bindReady();j?o.call(c,this):e.push(o);return this},
_bindReady:function(){var o=this,g=p.documentElement.doScroll,n=g?"onreadystatechange":"DOMContentLoaded",t=function(){o._fireReady()};k=true;if(p.readyState==="complete")return t();if(p.addEventListener){var x=function(){p.removeEventListener(n,x,false);t()};p.addEventListener(n,x,false);c.addEventListener("load",t,false)}else{var y=function(){if(p.readyState==="complete"){p.detachEvent(n,y);t()}};p.attachEvent(n,y);c.attachEvent("onload",t);if(c==c.top){var s=function(){try{g("left");t()}catch(a){setTimeout(s,
1)}};s()}}},_fireReady:function(){if(!j){j=true;if(e){for(var o,g=0;o=e[g++];)o.call(c,this);e=null}}},available:function(o,g){if((o=(o+"").match(r)[1])&&i.isFunction(g))var n=1,t=i.later(function(){if(p.getElementById(o)&&(g()||1)||++n>500)t.cancel()},40,true)},mix:m,merge:function(){var o={},g,n=arguments.length;for(g=0;g<n;++g)m(o,arguments[g]);return o},augment:function(){var o=arguments,g=o.length-2,n=o[0],t=o[g],x=o[g+1],y=1;if(!i.isArray(x)){t=x;x=h;g++}if(!i.isBoolean(t)){t=h;g++}for(;y<g;y++)m(n.prototype,
o[y].prototype||o[y],t,x);return n},extend:function(o,g,n,t){if(!g||!o)return o;var x=Object.prototype,y=g.prototype,s=function(a){function b(){}b.prototype=a;return new b}(y);o.prototype=s;s.constructor=o;o.superclass=y;if(g!==Object&&y.constructor===x.constructor)y.constructor=g;n&&m(s,n);t&&m(o,t);return o},namespace:function(){var o=arguments.length,g=null,n,t,x;for(n=0;n<o;++n){x=(""+arguments[n]).split(".");g=this;for(t=c[x[0]]===g?1:0;t<x.length;++t)g=g[x[t]]=g[x[t]]||{}}return g},app:function(o,
g){var n=c[o]||{};m(n,this,true,["_init","add","namespace"]);n._init();return m(c[o]=n,typeof g==="function"?g():g)},log:function(o,g,n){if(this.Config.debug){if(n)o=n+": "+o;if(c.console!==h&&console.log)console[g&&console[g]?g:"log"](o)}return this},error:function(o){if(this.Config.debug)throw o;},guid:function(o){var g=this.Env.guid++ +"";return o?o+g:g}});i._init();i.Config={debug:""}})(window,"KISSY");
KISSY.add("kissy-lang",function(c,i){function h(a){var b=typeof a;return a===null||b!=="object"&&b!=="function"}var p=window,m=document,j=location,e=Array.prototype,k=e.indexOf,r=e.filter,o=String.prototype.trim,g=Object.prototype.toString,n=encodeURIComponent,t=decodeURIComponent,x=/^\s+|\s+$/g,y=/^(\w+)\[\]$/,s=/\S/;c.mix(c,{isUndefined:function(a){return a===i},isBoolean:function(a){return typeof a==="boolean"},isString:function(a){return typeof a==="string"},isNumber:function(a){return typeof a===
"number"&&isFinite(a)},isPlainObject:function(a){return a&&g.call(a)==="[object Object]"&&!a.nodeType&&!a.setInterval},isEmptyObject:function(a){for(var b in a)return false;return true},isFunction:function(a){return g.call(a)==="[object Function]"},isArray:function(a){return g.call(a)==="[object Array]"},trim:o?function(a){return a==i?"":o.call(a)}:function(a){return a==i?"":a.toString().replace(x,"")},each:function(a,b,d){for(var f=a&&a.length||0,q=0;q<f;++q)b.call(d||p,a[q],q,a)},indexOf:k?function(a,
b){return k.call(b,a)}:function(a,b){for(var d=0,f=b.length;d<f;++d)if(b[d]===a)return d;return-1},inArray:function(a,b){return c.indexOf(a,b)>-1},makeArray:function(a){if(a===null||a===i)return[];if(c.isArray(a))return a;if(typeof a.length!=="number"||typeof a==="string"||c.isFunction(a))return[a];if(a.item&&c.UA.ie){for(var b=[],d=0,f=a.length;d<f;++d)b[d]=a[d];return b}return e.slice.call(a)},filter:r?function(a,b,d){return r.call(a,b,d)}:function(a,b,d){var f=[];c.each(a,function(q,l,v){b.call(d,
q,l,v)&&f.push(q)});return f},param:function(a,b){if(!c.isPlainObject(a))return"";b=b||"&";var d=[],f,q;for(f in a){q=a[f];f=n(f);if(h(q))d.push(f,"=",n(q+""),b);else if(c.isArray(q)&&q.length)for(var l=0,v=q.length;l<v;++l)h(q[l])&&d.push(f,"[]=",n(q[l]+""),b)}d.pop();return d.join("")},unparam:function(a,b){if(typeof a!=="string"||(a=c.trim(a)).length===0)return{};var d={};a=a.split(b||"&");for(var f,q,l,v=0,z=a.length;v<z;++v){b=a[v].split("=");f=t(b[0]);try{q=t(b[1]||"")}catch(A){q=b[1]||""}if((l=
f.match(y))&&l[1]){d[l[1]]=d[l[1]]||[];d[l[1]].push(q)}else d[f]=q}return d},later:function(a,b,d,f,q){b=b||0;f=f||{};var l=a,v=c.makeArray(q),z;if(typeof a==="string")l=f[a];l||c.error("method undefined");a=function(){l.apply(f,v)};z=d?setInterval(a,b):setTimeout(a,b);return{id:z,interval:d,cancel:function(){this.interval?clearInterval(z):clearTimeout(z)}}},clone:function(a){var b=a,d,f;if(a&&((d=c.isArray(a))||c.isPlainObject(a))){b=d?[]:{};for(f in a)if(a.hasOwnProperty(f))b[f]=c.clone(a[f])}return b},
now:function(){return(new Date).getTime()},globalEval:function(a){if(a&&s.test(a)){var b=m.getElementsByTagName("head")[0]||m.documentElement,d=m.createElement("script");d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}}});if(j&&j.search&&j.search.indexOf("ks-debug")!==-1)c.Config.debug=true});
KISSY.add("kissy-ua",function(c){var i=navigator.userAgent,h,p={webkit:0,chrome:0,safari:0,gecko:0,firefox:0,ie:0,opera:0,mobile:""},m=function(j){var e=0;return parseFloat(j.replace(/\./g,function(){return e++===0?".":""}))};if((h=i.match(/AppleWebKit\/([\d.]*)/))&&h[1]){p.webkit=m(h[1]);if((h=i.match(/Chrome\/([\d.]*)/))&&h[1])p.chrome=m(h[1]);else if((h=i.match(/\/([\d.]*) Safari/))&&h[1])p.safari=m(h[1]);if(/ Mobile\//.test(i))p.mobile="Apple";else if(h=i.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))p.mobile=
h[0]}else if((h=i.match(/Opera\/.* Version\/([\d.]*)/))&&h[1]){p.opera=m(h[1]);if(i.match(/Opera Mini[^;]*/))p.mobile=h[0]}else if((h=i.match(/MSIE\s([^;]*)/))&&h[1])p.ie=m(h[1]);else if(h=i.match(/Gecko/)){p.gecko=1;if((h=i.match(/rv:([\d.]*)/))&&h[1])p.gecko=m(h[1]);if((h=i.match(/Firefox\/([\d.]*)/))&&h[1])p.firefox=m(h[1])}c.UA=p});
KISSY.add("dom",function(c){var i={_isSupportedNode:function(h){return i._isElementNode(h)||i._isTextNode(h)},_isElementNode:function(h){return h&&h.nodeType===1},_isTextNode:function(h){return h&&h.nodeType===3},_isKSNode:function(h){return h&&c.Node&&h.nodeType===c.Node.TYPE}};c.DOM=i});
KISSY.add("selector",function(c,i){function h(a,b){var d,f=[],q,l;b=p(b);if(c.isString(a)){a=c.trim(a);if(y.test(a)){if(a=m(a.slice(1),b))f=[a]}else if(d=s.exec(a)){q=d[1];l=d[2];d=d[3];if(b=q?m(q,b):b)if(d)if(!q||a.indexOf(g)!==-1)f=e(d,l,b);else{if((a=m(q,b))&&o.hasClass(a,d))f=[a]}else if(l)f=j(l,b)}else if(c.ExternalSelector)return c.ExternalSelector(a,b);else k(a)}else if(a&&(a[t]||a[x]))f=a[t]?[a[t]()]:a[x]();else if(a&&a.nodeType)f=[a];else if(a&&(c.isArray(a)||a.item))f=a;if(f.item)f=c.makeArray(f);
return f}function p(a){if(a===i)a=r;else if(c.isString(a)&&y.test(a))a=m(a.slice(1),r);else if(a&&a.nodeType!==1&&a.nodeType!==9)a=null;return a}function m(a,b){if(b.nodeType!==9)b=b.ownerDocument;return b.getElementById(a)}function j(a,b){return b.getElementsByTagName(a)}function e(a,b,d){d=a=d.getElementsByClassName(a);var f=0,q=0,l=a.length,v;if(b&&b!==n){d=[];for(b=b.toUpperCase();f<l;++f){v=a[f];if(v.tagName===b)d[q++]=v}}return d}function k(a){c.error("Unsupported selector: "+a)}var r=document,
o=c.DOM,g=" ",n="*",t="getDOMNode",x=t+"s",y=/^#[\w-]+$/,s=/^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/;(function(){var a=r.createElement("div");a.appendChild(r.createComment(""));if(a.getElementsByTagName(n).length>0)j=function(b,d){d=d.getElementsByTagName(b);if(b===n){b=[];for(var f=0,q=0,l;l=d[f++];)if(l.nodeType===1)b[q++]=l;d=b}return d}})();r.getElementsByClassName||(e=r.querySelectorAll?function(a,b,d){return d.querySelectorAll((b?b:"")+"."+a)}:function(a,b,d){b=d.getElementsByTagName(b||
n);d=[];var f=0,q=0,l=b.length,v,z;for(a=g+a+g;f<l;++f){v=b[f];if((z=v.className)&&(g+z+g).indexOf(a)>-1)d[q++]=v}return d});c.query=h;c.get=function(a,b){return h(a,b)[0]||null};c.mix(o,{query:h,get:c.get,filter:function(a,b){var d=h(a),f,q,l,v=[];if(c.isString(b)&&(f=s.exec(b))&&!f[1]){q=f[2];l=f[3];b=function(z){return!(q&&z.tagName!==q.toUpperCase()||l&&!o.hasClass(z,l))}}if(c.isFunction(b))v=c.filter(d,b);else if(b&&c.ExternalSelector)v=c.ExternalSelector._filter(a,b);else k(b);return v},test:function(a,
b){a=h(a);return o.filter(a,b).length===a.length}})});
KISSY.add("dom-class",function(c,i){function h(e,k,r,o){if(!(k=c.trim(k)))return o?false:i;e=c.query(e);var g=0,n=e.length;k=k.split(m);for(var t;g<n;g++){t=e[g];if(p._isElementNode(t)){t=r(t,k,k.length);if(t!==i)return t}}if(o)return false}var p=c.DOM,m=/[\.\s]\s*\.?/,j=/[\n\t]/g;c.mix(p,{hasClass:function(e,k){return h(e,k,function(r,o,g){if(r=r.className){r=" "+r+" ";for(var n=0,t=true;n<g;n++)if(r.indexOf(" "+o[n]+" ")<0){t=false;break}if(t)return true}},true)},addClass:function(e,k){h(e,k,function(r,
o,g){var n=r.className;if(n){var t=" "+n+" ";n=n;for(var x=0;x<g;x++)if(t.indexOf(" "+o[x]+" ")<0)n+=" "+o[x];r.className=c.trim(n)}else r.className=k})},removeClass:function(e,k){h(e,k,function(r,o,g){var n=r.className;if(n)if(g){n=(" "+n+" ").replace(j," ");for(var t=0,x;t<g;t++)for(x=" "+o[t]+" ";n.indexOf(x)>=0;)n=n.replace(x," ");r.className=c.trim(n)}else r.className=""})},replaceClass:function(e,k,r){p.removeClass(e,k);p.addClass(e,r)},toggleClass:function(e,k,r){var o=c.isBoolean(r),g;h(e,
k,function(n,t,x){for(var y=0,s;y<x;y++){s=t[y];g=o?!r:p.hasClass(n,s);p[g?"removeClass":"addClass"](n,s)}})}})});
KISSY.add("dom-attr",function(c,i){function h(s,a){return a&&a.nodeName.toUpperCase()===s.toUpperCase()}var p=c.UA,m=p.ie,j=m&&m<8,e=document.documentElement.textContent!==i?"textContent":"innerText",k=c.DOM,r=k._isElementNode,o=k._isTextNode,g=/href|src|style/,n=/href|src|colspan|rowspan/,t=/\r/g,x=/radio|checkbox/,y={readonly:"readOnly"};j&&c.mix(y,{"for":"htmlFor","class":"className"});c.mix(k,{attr:function(s,a,b){if(c.isPlainObject(a))for(var d in a)k.attr(s,d,a[d]);else if(a=c.trim(a)){a=a.toLowerCase();
a=y[a]||a;if(b===i){s=c.get(s);if(!r(s))return i;var f;g.test(a)||(f=s[a]);if(f===i)f=s.getAttribute(a);if(j)if(n.test(a))f=s.getAttribute(a,2);else if(a==="style")f=s.style.cssText;return f===null?i:f}c.each(c.query(s),function(q){if(r(q))if(j&&a==="style")q.style.cssText=b;else{if(a==="checked")q[a]=!!b;q.setAttribute(a,""+b)}})}},removeAttr:function(s,a){c.each(c.query(s),function(b){if(r(b)){k.attr(b,a,"");b.removeAttribute(a)}})},val:function(s,a){if(a===i){var b=c.get(s);if(!r(b))return i;if(h("option",
b))return(b.attributes.value||{}).specified?b.value:b.text;if(h("select",b)){var d=b.selectedIndex;s=b.options;if(d<0)return null;else if(b.type==="select-one")return k.val(s[d]);b=[];for(var f=0,q=s.length;f<q;++f)s[f].selected&&b.push(k.val(s[f]));return b}if(p.webkit&&x.test(b.type))return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(t,"")}c.each(c.query(s),function(l){if(h("select",l)){if(c.isNumber(a))a+="";var v=c.makeArray(a),z=l.options,A;f=0;for(q=z.length;f<q;++f){A=
z[f];A.selected=c.inArray(k.val(A),v)}if(!v.length)l.selectedIndex=-1}else if(r(l))l.value=a})},text:function(s,a){if(a===i){s=c.get(s);if(r(s))return s[e]||"";else if(o(s))return s.nodeValue}else c.each(c.query(s),function(b){if(r(b))b[e]=a;else if(o(b))b.nodeValue=a})}})});
KISSY.add("dom-style",function(c,i){function h(a,b){var d=c.get(a),f=b===r?d.offsetWidth:d.offsetHeight;c.each(b===r?["Left","Right"]:["Top","Bottom"],function(q){f-=parseFloat(m._getComputedStyle(d,"padding"+q))||0;f-=parseFloat(m._getComputedStyle(d,"border"+q+"Width"))||0});return f}function p(a,b,d){var f=d;if(d===o&&n.test(b)){f=0;if(m.css(a,"position")==="absolute"){d=a[b==="left"?"offsetLeft":"offsetTop"];if(j.ie===8||j.opera)d-=g(m.css(a.offsetParent,"border-"+b+"-width"))||0;f=d-(g(m.css(a,
"margin-"+b))||0)}}return f}var m=c.DOM,j=c.UA,e=document,k=e.documentElement,r="width",o="auto",g=parseInt,n=/^left|top$/,t=/width|height|top|left|right|bottom|margin|padding/i,x=/-([a-z])/ig,y=function(a,b){return b.toUpperCase()},s={};c.mix(m,{_CUSTOM_STYLES:s,_getComputedStyle:function(a,b){var d="",f=a.ownerDocument;if(a.style)d=f.defaultView.getComputedStyle(a,null)[b];return d},css:function(a,b,d){if(c.isPlainObject(b))for(var f in b)m.css(a,f,b[f]);else{if(b.indexOf("-")>0)b=b.replace(x,y);
b=s[b]||b;if(d===i){a=c.get(a);f="";if(a&&a.style){f=b.get?b.get(a):a.style[b];if(f===""&&!b.get)f=p(a,b,m._getComputedStyle(a,b))}return f===i?"":f}else{if(d===null||d==="")d="";else if(!isNaN(new Number(d))&&t.test(b))d+="px";(b===r||b==="height")&&parseFloat(d)<0||c.each(c.query(a),function(q){if(q&&q.style){b.set?b.set(q,d):(q.style[b]=d);if(d==="")q.style.cssText||q.removeAttribute("style")}})}}},width:function(a,b){if(b===i)return h(a,r);else m.css(a,r,b)},height:function(a,b){if(b===i)return h(a,
"height");else m.css(a,"height",b)},addStyleSheet:function(a,b){var d;if(b)d=c.get(b);d||(d=m.create("<style>",{id:b}));c.get("head").appendChild(d);if(d.styleSheet)d.styleSheet.cssText=a;else d.appendChild(e.createTextNode(a))}});if(k.style.cssFloat!==i)s["float"]="cssFloat";else if(k.style.styleFloat!==i)s["float"]="styleFloat"});
KISSY.add("dom-style-ie",function(c,i){if(c.UA.ie){var h=c.DOM,p=document,m=p.documentElement,j=h._CUSTOM_STYLES,e=/^-?\d+(?:px)?$/i,k=/^-?\d/,r=/^width|height$/;try{if(m.style.opacity===i&&m.filters)j.opacity={get:function(g){var n=100;try{n=g.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(t){try{n=g.filters("alpha").opacity}catch(x){}}return n/100+""},set:function(g,n){g=g.style;g.zoom=1;g.filter="alpha(opacity="+n*100+")"}}}catch(o){c.log("IE filters ActiveX is disabled. ex = "+o)}if(!(p.defaultView||
{}).getComputedStyle&&m.currentStyle)h._getComputedStyle=function(g,n){var t=g.style,x=g.currentStyle[n];if(r.test(n))x=h[n](g)+"px";else if(!e.test(x)&&k.test(x)){var y=t.left,s=g.runtimeStyle.left;g.runtimeStyle.left=g.currentStyle.left;t.left=n==="fontSize"?"1em":x||0;x=t.pixelLeft+"px";t.left=y;g.runtimeStyle.left=s}return x}}});
KISSY.add("dom-offset",function(c,i){function h(l){var v=0,z=0,A=m(l[s]);if(l[q]){l=l[q]();v=l[a]+j[d](A);z=l[b]+j[f](A)}return{left:v,top:z}}function p(l,v){if(j.css(l,t)==="static")l.style[t]=x;var z=h(l),A={},u,w;for(w in v){u=n(j.css(l,w),10)||0;A[w]=u+v[w]-z[w]}j.css(l,A)}function m(l){return l&&"scrollTo"in l&&l[y]?l:l&&l.nodeType===9?l.defaultView||l.parentWindow:false}var j=c.DOM,e=window,k=document,r=j._isElementNode,o=k.compatMode==="CSS1Compat",g=Math.max,n=parseInt,t="position",x="relative",
y="document",s="ownerDocument",a="left",b="top",d="scrollLeft",f="scrollTop",q="getBoundingClientRect";c.mix(j,{offset:function(l,v){if(!(l=c.get(l))||!l[s])return null;if(v===i)return h(l);p(l,v)},scrollIntoView:function(l,v,z,A){if((l=c.get(l))&&l[s]){v=c.get(v);A=A===i?true:!!A;z=z===i?true:!!z;if(!r(v))return l.scrollIntoView(z);var u=j.offset(l),w=j.offset(v),B={left:u[a]-w[a],top:u[b]-w[b]};u=v.clientHeight;w=v.clientWidth;var C=j[d](v),D=j[f](v),G=C+w,F=D+u,E=l.offsetHeight;l=l.offsetWidth;
var H=B.left+C-(n(j.css(v,"borderLeftWidth"))||0);B=B.top+D-(n(j.css(v,"borderTopWidth"))||0);var I=H+l,J=B+E;if(E>u||B<D||z)v[f]=B;else if(J>F)v[f]=J-u;if(A)if(l>w||H<C||z)v[d]=H;else if(I>G)v[d]=I-w}}});c.each(["Left","Top"],function(l,v){var z="scroll"+l;j[z]=function(A){var u=0,w=A===i?e:m(A),B;if(w&&(B=w[y]))u=w[v?"pageYOffset":"pageXOffset"]||B.documentElement[z]||B.body[z];else if(r(A=c.get(A)))u=A[z];return u}});c.each(["Width","Height"],function(l){j["doc"+l]=function(v){v=v||k;return g(o?
v.documentElement["scroll"+l]:v.body["scroll"+l],j["viewport"+l](v))};j["viewport"+l]=function(v){var z="inner"+l;v=m(v)||e;var A=v[y];return z in v?v[z]:o?A.documentElement["client"+l]:A.body["client"+l]}})});
KISSY.add("dom-traversal",function(c,i){function h(e,k,r,o){if(!(e=c.get(e)))return null;if(k===i)k=1;var g=null,n,t;if(c.isNumber(k)&&k>=0){if(k===0)return e;n=0;t=k;k=function(){return++n===t}}for(;e=e[r];)if(j(e)&&(!k||m.test(e,k))&&(!o||o(e))){g=e;break}return g}function p(e,k,r){var o=[];var g=e=c.get(e);if(e&&r)g=e.parentNode;if(g){r=0;for(g=g.firstChild;g;g=g.nextSibling)if(j(g)&&g!==e&&(!k||m.test(g,k)))o[r++]=g}return o}var m=c.DOM,j=m._isElementNode;c.mix(m,{parent:function(e,k){return h(e,
k,"parentNode",function(r){return r.nodeType!=11})},next:function(e,k){return h(e,k,"nextSibling")},prev:function(e,k){return h(e,k,"previousSibling")},siblings:function(e,k){return p(e,k,true)},children:function(e,k){return p(e,k)},contains:function(e,k){var r=false;if((e=c.get(e))&&(k=c.get(k)))if(e.contains)return e.contains(k);else if(e.compareDocumentPosition)return!!(e.compareDocumentPosition(k)&16);else for(;!r&&(k=k.parentNode);)r=k==e;return r}})});
KISSY.add("dom-create",function(c,i){function h(u,w){t(u)&&c.isPlainObject(w)&&r.attr(u,w);return u}function p(u,w){var B=null,C;if(u&&(u.push||u.item)&&u[0]){w=w||u[0].ownerDocument;B=w.createDocumentFragment();if(u.item)u=c.makeArray(u);w=0;for(C=u.length;w<C;w++)B.appendChild(u[w])}else c.log("Unable to convert "+u+" to fragment.");return B}function m(u){var w=u.cloneNode(true);if(o.ie<8)w.innerHTML=u.innerHTML;return w}function j(u,w,B,C){if(B){var D=c.guid("ks-tmp-"),G=new RegExp(a);w+='<span id="'+
D+'"></span>';c.available(D,function(){var F=c.get("head"),E,H,I,J,L,K;for(G.lastIndex=0;E=G.exec(w);)if((I=(H=E[1])?H.match(d):false)&&I[2]){E=k.createElement("script");E.src=I[2];if((J=H.match(f))&&J[2])E.charset=J[2];E.async=true;F.appendChild(E)}else if((K=E[2])&&K.length>0)c.globalEval(K);(L=k.getElementById(D))&&r.remove(L);c.isFunction(C)&&C()});e(u,w)}else{e(u,w);c.isFunction(C)&&C()}}function e(u,w){w=w.replace(a,"");try{u.innerHTML=w}catch(B){for(;u.firstChild;)u.removeChild(u.firstChild);
w&&u.appendChild(r.create(w))}}var k=document,r=c.DOM,o=c.UA,g=o.ie,n=r._isSupportedNode,t=r._isElementNode,x=r._isKSNode,y=k.createElement("div"),s=/<(\w+)/,a=/<script([^>]*)>([\s\S]*?)<\/script>/ig,b=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,d=/\ssrc=(['"])(.*?)\1/i,f=/\scharset=(['"])(.*?)\1/i;c.mix(r,{create:function(u,w,B){if(n(u))return m(u);if(x(u))return m(u[0]);if(!(u=c.trim(u)))return null;var C=null;C=r._creators;var D,G="div",F;if(D=b.exec(u))C=(B||k).createElement(D[1]);else{if((D=s.exec(u))&&(F=
D[1])&&c.isFunction(C[F=F.toLowerCase()]))G=F;u=C[G](u,B).childNodes;C=u.length===1?u[0].parentNode.removeChild(u[0]):p(u,B||k)}return h(C,w)},_creators:{div:function(u,w){w=w?w.createElement("div"):y;w.innerHTML=u;return w}},html:function(u,w,B,C){if(w===i){u=c.get(u);if(t(u))return u.innerHTML}else c.each(c.query(u),function(D){t(D)&&j(D,w,B,C)})},remove:function(u){c.each(c.query(u),function(w){t(w)&&w.parentNode&&w.parentNode.removeChild(w)})}});if(o.gecko||g){var q=r._creators,l=r.create,v=/(?:\/(?:thead|tfoot|caption|col|colgroup)>)+\s*<tbody/,
z={option:"select",td:"tr",tr:"tbody",tbody:"table",col:"colgroup",legend:"fieldset"};for(var A in z)(function(u){q[A]=function(w,B){return l("<"+u+">"+w+"</"+u+">",null,B)}})(z[A]);if(g){q.script=function(u,w){w=w?w.createElement("div"):y;w.innerHTML="-"+u;w.removeChild(w.firstChild);return w};if(g<8)q.tbody=function(u,w){w=l("<table>"+u+"</table>",null,w);var B=w.children.tags("tbody")[0];w.children.length>1&&B&&!v.test(u)&&B.parentNode.removeChild(B);return w}}c.mix(q,{optgroup:q.option,th:q.td,
thead:q.tbody,tfoot:q.tbody,caption:q.tbody,colgroup:q.tbody})}});KISSY.add("dom-insertion",function(c){c.mix(c.DOM,{insertBefore:function(i,h){if((i=c.get(i))&&(h=c.get(h))&&h.parentNode)h.parentNode.insertBefore(i,h);return i},insertAfter:function(i,h){if((i=c.get(i))&&(h=c.get(h))&&h.parentNode)h.nextSibling?h.parentNode.insertBefore(i,h.nextSibling):h.parentNode.appendChild(i);return i}})});
KISSY.add("event",function(c,i){function h(a,b,d,f,q){if(c.isString(b))b=c.query(b);if(c.isArray(b)){c.each(b,function(l){s[a](l,d,f,q)});return true}if((d=c.trim(d))&&d.indexOf(t)>0){c.each(d.split(t),function(l){s[a](b,l,f,q)});return true}}function p(a){return e(a)?a[n]:-1}function m(a,b){if(!e(a))return c.error("Text or comment node is not valid event target.");try{a[n]=b}catch(d){c.error(d)}}function j(a){try{a[n]=i;delete a[n]}catch(b){}}function e(a){return a&&a.nodeType!==3&&a.nodeType!==
8}var k=window,r=document,o=r.addEventListener?function(a,b,d,f){a.addEventListener&&a.addEventListener(b,d,!!f)}:function(a,b,d){a.attachEvent&&a.attachEvent("on"+b,d)},g=r.removeEventListener?function(a,b,d,f){a.removeEventListener&&a.removeEventListener(b,d,!!f)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)},n="ksEventTargetId",t=" ",x=c.now(),y={},s={EVENT_GUID:n,special:{},add:function(a,b,d,f){if(!h("add",a,b,d,f)){var q=p(a),l,v;if(!(q===-1||!b||!c.isFunction(d))){if(!q){m(a,q=x++);
y[q]={target:a,events:{}}}v=y[q].events;l=!a.isCustomEventTarget&&s.special[b]||{};if(!v[b]){q=function(z,A){if(!z||!z.fixed){z=new c.EventObject(a,z,b);c.isPlainObject(A)&&c.mix(z,A)}l.setup&&l.setup(z);return(l.handle||s._handle)(a,z,v[b].listeners)};v[b]={handle:q,listeners:[]};if(a.isCustomEventTarget)a._addEvent&&a._addEvent(b,q);else o(a,l.fix||b,q,l.capture)}v[b].listeners.push({fn:d,scope:f})}}},remove:function(a,b,d){if(!h("remove",a,b,d)){var f=p(a),q,l,v,z,A,u;if(f!==-1)if(f&&(q=y[f]))if(q.target===
a){q=q.events||{};if(l=q[b]){v=l.listeners;A=v.length;if(c.isFunction(d)&&A&&c.inArray(d,v)){u=[];for(z=0;z<A;++z)d!==v[z]&&u.push(v[z]);A=u.length}if(d===i||A===0){if(a.isCustomEventTarget)a._addEvent&&a._removeEvent(b,l.handle);else g(a,b,l.handle);delete q[b]}}if(b===i||c.isEmptyObject(q)){for(b in q)s.remove(a,b);delete y[f];j(a)}}}},_handle:function(a,b,d){d=d.slice(0);for(var f,q=0,l=d.length;q<l;++q){f=d[q];f=f.fn.call(f.scope||a,b);if(f===false&&a.isCustomEventTarget||b.isImmediatePropagationStopped)break}return f},
_getCache:function(a){return y[a]},_simpleAdd:o,_simpleRemove:g};s.on=s.add;c.Event=s;k.attachEvent&&!k.addEventListener&&k.attachEvent("onunload",function(){var a,b;for(a in y)if(b=y[a].target)try{s.remove(b)}catch(d){}})});
KISSY.add("event-object",function(c,i){function h(j,e,k){this.currentTarget=j;this.originalEvent=e||{};if(e){this.type=e.type;this._fix()}else{this.type=k;this.target=j}this.fixed=true}var p=document,m="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.mix(h.prototype,
{_fix:function(){for(var j=this.originalEvent,e=m.length,k;e;){k=m[--e];this[k]=j[k]}if(!this.target)this.target=this.srcElement||p;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===i&&this.clientX!==i){j=p.documentElement;e=p.body;this.pageX=this.clientX+(j&&j.scrollLeft||e&&e.scrollLeft||0)-(j&&j.clientLeft||e&&e.clientLeft||0);this.pageY=this.clientY+
(j&&j.scrollTop||e&&e.scrollTop||0)-(j&&j.clientTop||e&&e.clientTop||0)}if(this.which===i)this.which=this.charCode!==i?this.charCode:this.keyCode;if(this.metaKey===i)this.metaKey=this.ctrlKey;if(!this.which&&this.button!==i)this.which=this.button&1?1:this.button&2?3:this.button&4?2:0},preventDefault:function(){var j=this.originalEvent;if(j.preventDefault)j.preventDefault();else j.returnValue=false;this.isDefaultPrevented=true},stopPropagation:function(){var j=this.originalEvent;if(j.stopPropagation)j.stopPropagation();
else j.cancelBubble=true;this.isPropagationStopped=true},stopImmediatePropagation:function(){var j=this.originalEvent;j.stopImmediatePropagation?j.stopImmediatePropagation():this.stopPropagation();this.isImmediatePropagationStopped=true},halt:function(j){j?this.stopImmediatePropagation():this.stopPropagation();this.preventDefault()}});c.EventObject=h});
KISSY.add("event-target",function(c,i){var h=c.Event,p=h.EVENT_GUID;c.EventTarget={isCustomEventTarget:true,fire:function(m,j){if((m=((h._getCache(this[p]||-1)||{}).events||{})[m])&&c.isFunction(m.handle))return m.handle(i,j)},on:function(m,j,e){h.add(this,m,j,e)},detach:function(m,j){h.remove(this,m,j)}}});
KISSY.add("event-mouseenter",function(c){var i=c.Event;c.UA.ie||c.each([{name:"mouseenter",fix:"mouseover"},{name:"mouseleave",fix:"mouseout"}],function(h){i.special[h.name]={fix:h.fix,setup:function(p){p.type=h.name},handle:function(p,m,j){var e=m.relatedTarget;try{for(;e&&e!==p;)e=e.parentNode;e!==p&&i._handle(p,m,j)}catch(k){}}}})});
KISSY.add("event-focusin",function(c){var i=c.Event;document.addEventListener&&c.each([{name:"focusin",fix:"focus"},{name:"focusout",fix:"blur"}],function(h){i.special[h.name]={fix:h.fix,capture:true,setup:function(p){p.type=h.name}}})});
KISSY.add("node",function(c){function i(p,m,j){var e;if(!(this instanceof i))return new i(p,m,j);if(p){if(h._isSupportedNode(p))e=p;else if(typeof p==="string")e=h.create(p,m,j);this[0]=e}else this.length=0}var h=c.DOM;i.TYPE="-ks-Node";c.augment(i,{length:1,getDOMNode:function(){return this[0]},nodeType:i.TYPE});c.one=function(p,m){return(p=c.get(p,m))?new i(p):null};c.Node=i});
KISSY.add("nodelist",function(c){function i(m){if(!(this instanceof i))return new i(m);p.push.apply(this,m||[])}var h=c.DOM,p=Array.prototype;c.mix(i.prototype,{length:0,item:function(m){var j=null;if(h._isElementNode(this[m]))j=new c.Node(this[m]);return j},getDOMNodes:function(){return p.slice.call(this)},each:function(m,j){for(var e=this.length,k=0,r;k<e;++k){r=new c.Node(this[k]);m.call(j||r,r,k,this)}return this}});c.all=function(m,j){return new i(c.query(m,j,true))};c.NodeList=i});
KISSY.add("node-attach",function(c,i){function h(x,arguments,y,s){var a=[this[x?o:r]()].concat(c.makeArray(arguments));if(arguments[y]===i)return s.apply(m,a);else{s.apply(m,a);return this}}function p(x,y){c.each(x,function(s){c.each([e,k],function(a,b){a[s]=function(d){switch(y){case g:return function(){return h.call(this,b,arguments,1,d)};case n:return function(){return h.call(this,b,arguments,0,d)};case t:return function(){var f=this[b?o:r]();return(f=d.apply(m,[f].concat(c.makeArray(arguments))))?
new (c[c.isArray(f)?"NodeList":"Node"])(f):null};default:return function(){var f=this[b?o:r]();f=d.apply(m,[f].concat(c.makeArray(arguments)));return f===i?this:f}}}(m[s])})})}var m=c.DOM,j=c.Event,e=c.Node.prototype,k=c.NodeList.prototype,r="getDOMNode",o=r+"s",g=1,n=2,t=4;c.mix(e,{one:function(x){return c.one(x,this[0])},all:function(x){return c.all(x,this[0])}});p(["hasClass","addClass","removeClass","replaceClass","toggleClass"]);p(["attr","removeAttr"],g);p(["val","text"],n);p(["css"],g);p(["width",
"height"],n);p(["offset"],n);p(["scrollIntoView"]);p(["parent","next","prev","siblings","children"],t);p(["contains"]);p(["html"],n);p(["remove"]);c.each(["insertBefore","insertAfter"],function(x){e[x]=function(y){m[x].call(m,this[0],y);return this}});c.each([e,k],function(x){c.mix(x,{append:function(y){y&&c.each(this,function(s){s.appendChild(m.create(y))});return this},appendTo:function(y){if((y=c.get(y))&&y.appendChild)c.each(this,function(s){y.appendChild(s)});return this}})});c.each([e,k],function(x){c.mix(x,
c.EventTarget);x._addEvent=function(y,s){for(var a=0,b=this.length;a<b;a++)j._simpleAdd(this[a],y,s)};x._removeEvent=function(y,s){for(var a=0,b=this.length;a<b;a++)j._simpleRemove(this[a],y,s)};delete x.fire})});
KISSY.add("ajax",function(c){var i=document,h=i.createElement("script").readyState?function(p,m){p.onreadystatechange=function(){var j=p.readyState;if(j==="loaded"||j==="complete"){p.onreadystatechange=null;m.call(this)}}}:function(p,m){p.onload=m};c.mix(c,{getScript:function(p,m,j){var e=c.get("head")||i.documentElement,k=i.createElement("script");k.src=p;if(j)k.charset=j;k.async=true;c.isFunction(m)&&h(k,m);e.appendChild(k)}})});
KISSY.add("cookie",function(c){function i(j){return c.isString(j)&&j!==""}var h=document,p=encodeURIComponent,m=decodeURIComponent;c.Cookie={get:function(j){var e;if(i(j))if(j=h.cookie.match("(?:^| )"+j+"(?:(?:=([^;]*))|;|$)"))e=j[1]?m(j[1]):"";return e},set:function(j,e,k,r,o,g){e=p(e);var n=k;if(typeof n==="number"){n=new Date;n.setTime(n.getTime()+k*864E5)}if(n instanceof Date)e+="; expires="+n.toUTCString();if(i(r))e+="; domain="+r;if(i(o))e+="; path="+o;if(g)e+="; secure";h.cookie=j+"="+e},remove:function(j,
e,k,r){this.set(j,"",0,e,k,r)}}});

