/*
Copyright 2012, KISSY UI Library v1.30rc
MIT Licensed
build time: Jul 11 21:21
*/
KISSY.add("dom/attr",function(e,a,d,i){function m(a,j){var j=r[j]||j,b=f[j];return b&&b.get?b.get(a,j):a[j]}var d=e.Env.host.document.documentElement,p=!d.hasAttribute,s=d.textContent===i?"innerText":"textContent",u=a.nodeName,g=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,k=/^(?:button|input|object|select|textarea)$/i,q=/^a(?:rea)?$/i,h=/:|^on/,l=/\r/g,c={},b={val:1,css:1,html:1,text:1,data:1,width:1,height:1,offset:1,
scrollTop:1,scrollLeft:1},t={tabindex:{get:function(a){var j=a.getAttributeNode("tabindex");return j&&j.specified?parseInt(j.value,10):k.test(a.nodeName)||q.test(a.nodeName)&&a.href?0:i}},style:{get:function(a){return a.style.cssText},set:function(a,j){a.style.cssText=j}}},r={hidefocus:"hideFocus",tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",
frameborder:"frameBorder",contenteditable:"contentEditable"},D={get:function(b,j){return a.prop(b,j)?j.toLowerCase():i},set:function(b,j,c){!1===j?a.removeAttr(b,c):(j=r[c]||c,j in b&&(b[j]=!0),b.setAttribute(c,c.toLowerCase()));return c}},f={},A={},w={option:{get:function(a){var j=a.attributes.value;return!j||j.specified?a.value:a.text}},select:{get:function(b){var j=b.selectedIndex,c=b.options;if(0>j)return null;if("select-one"===b.type)return a.val(c[j]);for(var b=[],j=0,n=c.length;j<n;++j)c[j].selected&&
b.push(a.val(c[j]));return b},set:function(b,j){var c=e.makeArray(j);e.each(b.options,function(n){n.selected=e.inArray(a.val(n),c)});c.length||(b.selectedIndex=-1);return c}}};p&&(A={get:function(a,j){var b;return(b=a.getAttributeNode(j))&&(b.specified||b.nodeValue)?b.nodeValue:i},set:function(a,b,c){var n=a.getAttributeNode(c);if(n)n.nodeValue=b;else try{var o=a.ownerDocument.createAttribute(c);o.value=b;a.setAttributeNode(o)}catch(f){return a.setAttribute(c,b,0)}}},c=r,t.tabIndex=t.tabindex,e.each("href,src,width,height,colSpan,rowSpan".split(","),
function(a){t[a]={get:function(b){b=b.getAttribute(a,2);return b===null?i:b}}}),w.button=t.value=A);e.each(["radio","checkbox"],function(b){w[b]={get:function(a){return a.getAttribute("value")===null?"on":a.value},set:function(b,c){if(e.isArray(c))return b.checked=e.inArray(a.val(b),c)}}});e.mix(a,{prop:function(b,c,g){b=a.query(b);if(e.isPlainObject(c)){for(var n in c)a.prop(b,n,c[n]);return i}c=r[c]||c;n=f[c];if(g!==i)for(var o=b.length-1;o>=0;o--){var h=b[o];n&&n.set?n.set(h,g,c):h[c]=g}else if(b.length)return m(b[0],
c);return i},hasProp:function(b,c){for(var f=a.query(b),n=0;n<f.length;n++)if(m(f[n],c)!==i)return true;return false},removeProp:function(b,c){for(var c=r[c]||c,f=a.query(b),n=f.length-1;n>=0;n--){var o=f[n];try{o[c]=i;delete o[c]}catch(g){}}},attr:function(f,j,d,n){var o=a.query(f);if(e.isPlainObject(j)){var n=d,l;for(l in j)j.hasOwnProperty(l)&&a.attr(o,l,j[l],n);return i}if(!(j=e.trim(j)))return i;if(n&&b[j])return a[j](f,d);j=j.toLowerCase();if(n&&b[j])return a[j](f,d);j=c[j]||j;n=o[0];f=g.test(j)?
D:h.test(j)?A:t[j];if(d===i){if(n&&n.nodeType===a.ELEMENT_NODE){u(n)=="form"&&(f=A);if(f&&f.get)return f.get(n,j);j=n.getAttribute(j);return j===null?i:j}}else for(l=o.length-1;l>=0;l--)if((n=o[l])&&n.nodeType===a.ELEMENT_NODE){u(n)=="form"&&(f=A);f&&f.set?f.set(n,d,j):n.setAttribute(j,""+d)}return i},removeAttr:function(b,f){var f=f.toLowerCase(),f=c[f]||f,d=a.query(b),n,o;for(o=d.length-1;o>=0;o--){n=d[o];if(n.nodeType==a.ELEMENT_NODE){var h;n.removeAttribute(f);if(g.test(f)&&(h=r[f]||f)in n)n[h]=
false}}},hasAttr:p?function(b,c){for(var c=c.toLowerCase(),f=a.query(b),n=0;n<f.length;n++){var o=f[n].getAttributeNode(c);if(o&&o.specified)return true}return false}:function(b,c){for(var f=a.query(b),n=0;n<f.length;n++)if(f[n].hasAttribute(c))return true;return false},val:function(b,c){var f,n;if(c===i){var o=a.get(b);if(o){if((f=w[u(o)]||w[o.type])&&"get"in f&&(n=f.get(o,"value"))!==i)return n;n=o.value;return typeof n==="string"?n.replace(l,""):n==null?"":n}return i}n=a.query(b);var g;for(g=n.length-
1;g>=0;g--){o=n[g];if(o.nodeType!==1)break;var d=c;d==null?d="":typeof d==="number"?d=d+"":e.isArray(d)&&(d=e.map(d,function(a){return a==null?"":a+""}));f=w[u(o)]||w[o.type];if(!f||!("set"in f)||f.set(o,d,"value")===i)o.value=d}return i},_propHooks:f,text:function(b,c){if(c===i){var f=a.get(b);if(f.nodeType==a.ELEMENT_NODE)return f[s]||"";if(f.nodeType==a.TEXT_NODE)return f.nodeValue}else{var n=a.query(b),o;for(o=n.length-1;o>=0;o--){f=n[o];if(f.nodeType==a.ELEMENT_NODE)f[s]=c;else if(f.nodeType==
a.TEXT_NODE)f.nodeValue=c}}return i}});return a},{requires:["./base","ua"]});
KISSY.add("dom/base",function(e,a,d){var i=e.Env.host,m={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},p={isCustomDomain:function(a){var a=a||i,d=a.document.domain,a=a.location.hostname;return d!=a&&d!="["+a+"]"},getEmptyIframeSrc:function(e){e=e||i;return a.ie&&p.isCustomDomain(e)?"javascript:void(function(){"+encodeURIComponent("document.open();document.domain='"+
e.document.domain+"';document.close();")+"}())":d},NodeTypes:m,_getWin:function(a){return null==a?i:"scrollTo"in a&&a.document?a:a.nodeType==p.DOCUMENT_NODE?a.defaultView||a.parentWindow:!1},_isNodeList:function(a){return a&&!a.nodeType&&a.item&&!a.setTimeout},nodeName:function(d){var e=p.get(d),d=e.nodeName.toLowerCase();a.ie&&(e=e.scopeName)&&"HTML"!=e&&(d=e.toLowerCase()+":"+d);return d}};e.mix(p,m);return p},{requires:["ua"]});
KISSY.add("dom/class",function(e,a,d){function i(i,u,g,k){if(!(u=e.trim(u)))return k?!1:d;for(var i=a.query(i),q=i.length,h=u.split(m),u=[],l=0;l<h.length;l++){var c=e.trim(h[l]);c&&u.push(c)}for(l=0;l<q;l++)if(h=i[l],h.nodeType==a.ELEMENT_NODE&&(h=g(h,u,u.length),h!==d))return h;return k?!1:d}var m=/[\.\s]\s*\.?/,p=/[\n\t]/g;e.mix(a,{hasClass:function(a,d){return i(a,d,function(a,d,e){if(a=a.className){for(var a=(" "+a+" ").replace(p," "),h=0,l=!0;h<e;h++)if(0>a.indexOf(" "+d[h]+" ")){l=!1;break}if(l)return!0}},
!0)},addClass:function(a,m){i(a,m,function(a,d,i){var h=a.className;if(h){for(var l=(" "+h+" ").replace(p," "),c=0;c<i;c++)0>l.indexOf(" "+d[c]+" ")&&(h+=" "+d[c]);a.className=e.trim(h)}else a.className=m},d)},removeClass:function(a,m){i(a,m,function(a,d,i){var h=a.className;if(h)if(i){for(var h=(" "+h+" ").replace(p," "),l=0,c;l<i;l++)for(c=" "+d[l]+" ";0<=h.indexOf(c);)h=h.replace(c," ");a.className=e.trim(h)}else a.className=""},d)},replaceClass:function(d,e,g){a.removeClass(d,e);a.addClass(d,
g)},toggleClass:function(m,p,g){var k=e.isBoolean(g),q;i(m,p,function(d,e,c){for(var b=0,t;b<c;b++)t=e[b],q=k?!g:a.hasClass(d,t),a[q?"removeClass":"addClass"](d,t)},d)}});return a},{requires:["dom/base"]});
KISSY.add("dom/create",function(e,a,d,i){function m(b){var c=e.require("event");c&&c.detach(b);a.removeData(b)}function p(b,c,f){if(c.nodeType==a.DOCUMENT_FRAGMENT_NODE)for(var c=c.childNodes,f=f.childNodes,d=0;c[d];)f[d]&&p(b,c[d],f[d]),d++;else if(c.nodeType==a.ELEMENT_NODE){c=c.getElementsByTagName("*");f=f.getElementsByTagName("*");for(d=0;c[d];)f[d]&&b(c[d],f[d]),d++}}function s(b,c){var f=e.require("event");if(c.nodeType!=a.ELEMENT_NODE||a.hasData(b)){var d=a.data(b),g;for(g in d)a.data(c,g,
d[g]);f&&(f._removeData(c),f._clone(b,c))}}function u(b,c){c.clearAttributes&&c.clearAttributes();c.mergeAttributes&&c.mergeAttributes(b);var f=c.nodeName.toLowerCase(),d=b.childNodes;if("object"===f&&!c.childNodes.length)for(f=0;f<d.length;f++)c.appendChild(d[f].cloneNode(!0));else if("input"===f&&("checkbox"===b.type||"radio"===b.type)){if(b.checked&&(c.defaultChecked=c.checked=b.checked),c.value!==b.value)c.value=b.value}else if("option"===f)c.selected=b.defaultSelected;else if("input"===f||"textarea"===
f)c.defaultValue=b.defaultValue;c.removeAttribute(a.__EXPANDO)}function g(a){var b=null,c,f;if(a&&(a.push||a.item)&&a[0]){b=a[0].ownerDocument;b=b.createDocumentFragment();a=e.makeArray(a);c=0;for(f=a.length;c<f;c++)b.appendChild(a[c])}return b}var k=e.Env.host.document,d=d.ie,q=e.isString,h=k.createElement("div"),l=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,c=/<([\w:]+)/,b=/<tbody/i,t=/^\s+/,r=d&&9>d,D=/<|&#?\w+;/,f="outerHTML"in k.documentElement,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;
e.mix(a,{create:function(b,f,d,h){var j=null;if(!b)return j;if(b.nodeType)return a.clone(b);if(!q(b))return j;h===i&&(h=!0);h&&(b=e.trim(b));var h=a._creators,y,G,d=d||k,v,B="div";if(D.test(b))if(v=A.exec(b))j=d.createElement(v[1]);else{b=b.replace(l,"<$1></$2>");if((v=c.exec(b))&&(y=v[1]))B=y.toLowerCase();y=(h[B]||h.div)(b,d);r&&(G=b.match(t))&&y.insertBefore(d.createTextNode(G[0]),y.firstChild);b=y.childNodes;1===b.length?j=b[0].parentNode.removeChild(b[0]):b.length&&(j=g(b))}else j=d.createTextNode(b);
e.isPlainObject(f)&&(j.nodeType==a.ELEMENT_NODE?a.attr(j,f,!0):j.nodeType==a.DOCUMENT_FRAGMENT_NODE&&a.attr(j.childNodes,f,!0));return j},_creators:{div:function(a,b){var c=b&&b!=k?b.createElement("div"):h;c.innerHTML="m<div>"+a+"</div>";return c.lastChild}},html:function(b,f,d,e){var b=a.query(b),h=b[0];if(h){if(f===i)return h.nodeType==a.ELEMENT_NODE?h.innerHTML:null;var g=!1,l,v,f=f+"";if(!f.match(/<(?:script|style|link)/i)&&(!r||!f.match(t))&&!j[(f.match(c)||["",""])[1].toLowerCase()])try{for(l=
b.length-1;0<=l;l--)v=b[l],v.nodeType==a.ELEMENT_NODE&&(m(v.getElementsByTagName("*")),v.innerHTML=f);g=!0}catch(B){}g||(f=a.create(f,0,h.ownerDocument,0),a.empty(b),a.append(f,b,d));e&&e()}},outerHTML:function(b,c,d){var b=a.query(b),e=b.length,h=b[0];if(h){if(c===i){if(f)return h.outerHTML;c=h.ownerDocument.createElement("div");c.appendChild(a.clone(h,!0));return c.innerHTML}c+="";if(!c.match(/<(?:script|style|link)/i)&&f)for(d=e-1;0<=d;d--)h=b[d],h.nodeType==a.ELEMENT_NODE&&(m(h),m(h.getElementsByTagName("*")),
h.outerHTML=c);else c=a.create(c,0,h.ownerDocument,0),a.insertBefore(c,b,d),a.remove(b)}},remove:function(b,c){var f,d=a.query(b),h;for(h=d.length-1;0<=h;h--){f=d[h];if(!c&&f.nodeType==a.ELEMENT_NODE){var e=f.getElementsByTagName("*");m(e);m(f)}f.parentNode&&f.parentNode.removeChild(f)}},clone:function(b,c,f,d){"object"===typeof c&&(d=c.deepWithDataAndEvent,f=c.withDataAndEvent,c=c.deep);b=a.get(b);if(!b)return null;var h=b.cloneNode(c);if(b.nodeType==a.ELEMENT_NODE||b.nodeType==a.DOCUMENT_FRAGMENT_NODE)b.nodeType==
a.ELEMENT_NODE&&u(b,h),c&&p(u,b,h);f&&(s(b,h),c&&d&&p(s,b,h));return h},empty:function(b){var b=a.query(b),c,f;for(f=b.length-1;0<=f;f--)c=b[f],a.remove(c.childNodes)},nodeListToFragment:g});var w=a._creators,C=a.create,j={option:"select",optgroup:"select",area:"map",thead:"table",td:"tr",th:"tr",tr:"tbody",tbody:"table",tfoot:"table",caption:"table",colgroup:"table",col:"colgroup",legend:"fieldset"},z;for(z in j)(function(a){w[z]=function(b,c){return C("<"+a+">"+b+"</"+a+">",null,c)}})(j[z]);8>d&&
(w.table=function(c,f){var d=w.div(c,f);if(b.test(c))return d;var h=d.firstChild,g=e.makeArray(h.childNodes);e.each(g,function(b){"tbody"==a.nodeName(b)&&!b.childNodes.length&&h.removeChild(b)});return d});return a},{requires:["./base","ua"]});
KISSY.add("dom/data",function(e,a,d){var i=e.Env.host,m="__ks_data_"+e.now(),p={},s={},u={applet:1,object:1,embed:1},g={hasData:function(a,g){if(a)if(g!==d){if(g in a)return!0}else if(!e.isEmptyObject(a))return!0;return!1}},k={hasData:function(a,d){return a==i?k.hasData(s,d):g.hasData(a[m],d)},data:function(a,e,c){if(a==i)return k.data(s,e,c);var b=a[m];if(c!==d)b=a[m]=a[m]||{},b[e]=c;else return e!==d?b&&b[e]:b=a[m]=a[m]||{}},removeData:function(a,g){if(a==i)return k.removeData(s,g);var c=a[m];if(g!==
d)delete c[g],e.isEmptyObject(c)&&k.removeData(a);else try{delete a[m]}catch(b){a[m]=d}}},q={hasData:function(a,d){var c=a[m];return!c?!1:g.hasData(p[c],d)},data:function(a,g,c){if(u[a.nodeName.toLowerCase()])return d;var b=a[m];if(!b){if(g!==d&&c===d)return d;b=a[m]=e.guid()}a=p[b];if(c!==d)a=p[b]=p[b]||{},a[g]=c;else return g!==d?a&&a[g]:a=p[b]=p[b]||{}},removeData:function(a,g){var c=a[m],b;if(c)if(b=p[c],g!==d)delete b[g],e.isEmptyObject(b)&&q.removeData(a);else{delete p[c];try{delete a[m]}catch(t){a[m]=
d}a.removeAttribute&&a.removeAttribute(m)}}};e.mix(a,{__EXPANDO:m,hasData:function(d,g){for(var c=!1,b=a.query(d),e=0;e<b.length&&!(c=b[e],c=c.nodeType?q.hasData(c,g):k.hasData(c,g));e++);return c},data:function(g,i,c){var g=a.query(g),b=g[0];if(e.isPlainObject(i)){for(var t in i)a.data(g,t,i[t]);return d}if(c===d){if(b)return b.nodeType?q.data(b,i,c):k.data(b,i,c)}else for(t=g.length-1;0<=t;t--)b=g[t],b.nodeType?q.data(b,i,c):k.data(b,i,c);return d},removeData:function(d,g){var c=a.query(d),b,e;
for(e=c.length-1;0<=e;e--)b=c[e],b.nodeType?q.removeData(b,g):k.removeData(b,g)}});return a},{requires:["./base"]});KISSY.add("dom",function(e,a){e.mix(e,{DOM:a,get:a.get,query:a.query});return a},{requires:"dom/attr,dom/class,dom/create,dom/data,dom/insertion,dom/offset,dom/style,dom/selector,dom/style-ie,dom/traversal".split(",")});
KISSY.add("dom/insertion",function(e,a,d){function i(a){for(var c=0;c<a.length;c++){var e=a[c];if(e.nodeType==d.DOCUMENT_FRAGMENT_NODE)i(e.childNodes);else if("input"==g(e)){if("checkbox"===e.type||"radio"===e.type)e.defaultChecked=e.checked}else if(e.nodeType==d.ELEMENT_NODE)for(var e=e.getElementsByTagName("input"),h=0;h<e.length;h++)i(e[h])}}function m(a,c){var e=[],i,f,l;for(i=0;a[i];i++)if(f=a[i],l=g(f),f.nodeType==d.DOCUMENT_FRAGMENT_NODE)e.push.apply(e,m(k(f.childNodes),c));else if("script"===
l&&(!f.type||h.test(f.type)))f.parentNode&&f.parentNode.removeChild(f),c&&c.push(f);else{if(f.nodeType==d.ELEMENT_NODE&&!u.test(l)){l=[];var w,C,j=f.getElementsByTagName("script");for(C=0;C<j.length;C++)w=j[C],(!w.type||h.test(w.type))&&l.push(w);q.apply(a,[i+1,0].concat(l))}e.push(f)}return e}function p(a){a.src?e.getScript(a.src):(a=e.trim(a.text||a.textContent||a.innerHTML||""))&&e.globalEval(a)}function s(b,c,g,h){b=d.query(b);h&&(h=[]);b=m(b,h);8>a.ie&&i(b);var c=d.query(c),f=c.length;if((b.length||
h&&h.length)&&f){var b=d.nodeListToFragment(b),k;1<f&&(k=d.clone(b,!0),c=e.makeArray(c));for(var l=0;l<f;l++){var q=c[l];if(b){var j=0<l?d.clone(k,!0):b;g(j,q)}h&&h.length&&e.each(h,p)}}}var u=/^(?:button|input|object|select|textarea)$/i,g=d.nodeName,k=e.makeArray,q=[].splice,h=/\/(java|ecma)script/i;e.mix(d,{insertBefore:function(a,c,d){s(a,c,function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b)},d)},insertAfter:function(a,c,d){s(a,c,function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b.nextSibling)},
d)},appendTo:function(a,c,d){s(a,c,function(a,b){b.appendChild(a)},d)},prependTo:function(a,c,d){s(a,c,function(a,b){b.insertBefore(a,b.firstChild)},d)},wrapAll:function(a,c){c=d.clone(d.get(c),!0);a=d.query(a);a[0].parentNode&&d.insertBefore(c,a[0]);for(var e;(e=c.firstChild)&&1==e.nodeType;)c=e;d.appendTo(a,c)},wrap:function(a,c){a=d.query(a);c=d.get(c);e.each(a,function(a){d.wrapAll(a,c)})},wrapInner:function(a,c){a=d.query(a);c=d.get(c);e.each(a,function(a){var b=a.childNodes;b.length?d.wrapAll(b,
c):a.appendChild(c)})},unwrap:function(a){a=d.query(a);e.each(a,function(a){a=a.parentNode;d.replaceWith(a,a.childNodes)})},replaceWith:function(a,c){var e=d.query(a),c=d.query(c);d.remove(c,!0);d.insertBefore(c,e);d.remove(e)}});var l={prepend:"prependTo",append:"appendTo",before:"insertBefore",after:"insertAfter"},c;for(c in l)d[c]=d[l[c]];return d},{requires:["ua","./create"]});
KISSY.add("dom/offset",function(e,a,d,i){function m(b){var f,e=b.ownerDocument.body,i=g(b[h]);f=b.getBoundingClientRect();b=f[l];f=f[c];b-=u.clientLeft||e.clientLeft;f-=u.clientTop||e.clientTop;"apple"==d.mobile&&(b-=a[t](i),f-=a[r](i));return{left:b,top:f}}function p(c,b){var d={left:0,top:0},e=g(c[h]),i=c,b=b||e;do{var j;if(e==b){var k=i;j=m(k);k=g(k[h]);j.left+=a[t](k);j.top+=a[r](k)}else j=m(i);d.left+=j.left;d.top+=j.top}while(e&&e!=b&&(i=e.frameElement)&&(e=e.parent));return d}var s=e.Env.host,
u=s.document.documentElement,g=a._getWin,k=Math.max,q=parseInt,h="ownerDocument",l="left",c="top",b=e.isNumber,t="scrollLeft",r="scrollTop";e.mix(a,{offset:function(c,b,d){if(b===i){var c=a.get(c),e;c&&(e=p(c,d));return e}d=a.query(c);for(e=d.length-1;0<=e;e--){var c=d[e],g=b;"static"===a.css(c,"position")&&(c.style.position="relative");var j=p(c),h={},k=void 0,l=void 0;for(l in g)k=q(a.css(c,l),10)||0,h[l]=k+g[l]-j[l];a.css(c,h)}return i},scrollIntoView:function(b,d,e,h,k){var j,m,n;if(m=a.get(b)){d&&
(d=a.get(d));d||(d=m.ownerDocument);!0!==k&&(h=h===i?!0:!!h,e=e===i?!0:!!e);d.nodeType==a.DOCUMENT_NODE&&(d=g(d));n=!!g(d);k=a.offset(m);b=a.outerHeight(m);j=a.outerWidth(m);var o,t,p,r;n?(m=d,o=a.height(m),t=a.width(m),r={left:a.scrollLeft(m),top:a.scrollTop(m)},m=k[l]-r[l],n=k[c]-r[c],j=k[l]+j-(r[l]+t),k=k[c]+b-(r[c]+o)):(o=a.offset(d),t=d.clientHeight,p=d.clientWidth,r={left:a.scrollLeft(d),top:a.scrollTop(d)},m=k[l]-o[l]-(q(a.css(d,"borderLeftWidth"))||0),n=k[c]-o[c]-(q(a.css(d,"borderTopWidth"))||
0),j=k[l]+j-(o[l]+p+(q(a.css(d,"borderRightWidth"))||0)),k=k[c]+b-(o[c]+t+(q(a.css(d,"borderBottomWidth"))||0)));if(0>n||0<k)!0===e?a.scrollTop(d,r.top+n):!1===e?a.scrollTop(d,r.top+k):0>n?a.scrollTop(d,r.top+n):a.scrollTop(d,r.top+k);if(h&&(0>m||0<j))!0===e?a.scrollLeft(d,r.left+m):!1===e?a.scrollLeft(d,r.left+j):0>m?a.scrollLeft(d,r.left+m):a.scrollLeft(d,r.left+j)}},docWidth:0,docHeight:0,viewportHeight:0,viewportWidth:0,scrollTop:0,scrollLeft:0});e.each(["Left","Top"],function(c,d){var e="scroll"+
c;a[e]=function(h,k){if(b(h))return arguments.callee(s,h);var h=a.get(h),j,l=g(h);if(l)if(k!==i){var k=parseFloat(k),n="Left"==c?k:a.scrollLeft(l),m="Top"==c?k:a.scrollTop(l);l.scrollTo(n,m)}else j=l["page"+(d?"Y":"X")+"Offset"],b(j)||(l=l.document,j=l.documentElement[e],b(j)||(j=l.body[e]));else h.nodeType==a.ELEMENT_NODE&&(k!==i?h[e]=parseFloat(k):j=h[e]);return j}});e.each(["Width","Height"],function(c){a["doc"+c]=function(b){b=a.get(b);b=g(b).document;return k(b.documentElement["scroll"+c],b.body["scroll"+
c],a["viewport"+c](b))};a["viewport"+c]=function(b){var b=a.get(b),d="client"+c,b=g(b).document,e=b.body,h=b.documentElement[d];return"CSS1Compat"===b.compatMode&&h||e&&e[d]||h}});return a},{requires:["./base","ua"]});
KISSY.add("dom/selector",function(e,a,d){function i(a){var c,b;for(b=0;b<this.length&&!(c=this[b],!1===a(c,b));b++);}function m(a,b){var v,B,g=r(a),h=b===d&&(B=1)?[c]:m(b,d);if(a)if(g)a=z(a),B&&"body"==a?v=[c.body]:1==h.length&&a&&(v=s(a,h[0]));else{if(B)if(a.nodeType||a.setTimeout)v=[a];else{if(a.getDOMNodes)return a;v=t(a)?a:f(a)?e.makeArray(a):[a]}}else v=[];if(!v&&(v=[],a)){for(B=0;B<h.length;B++)w.apply(v,p(a,h[B]));1<v.length&&(1<h.length||g&&-1<a.indexOf(j))&&F(v)}v.each=i;return v}function p(a,
c){var b=r(a);if(b&&a.match(E)||!b)b=u(a,c);else if(b&&-1<a.indexOf(j)){var b=[],d,f=a.split(/\s*,\s*/);for(d=0;d<f.length;d++)w.apply(b,p(f[d],c))}else b=[],(d=e.require("sizzle"))&&d(a,c,b);return b}function s(a,c){var b,d,e,f;if(o.test(a))b=(d=k(a.slice(1),c))?[d]:[];else if(e=E.exec(a)){d=e[1];f=e[2];e=e[3];if(c=d?k(d,c):c)e?!d||-1!=a.indexOf(C)?b=[].concat(x(e,f,c)):(d=k(d,c))&&h(d,e)&&(b=[d]):f&&(b=q(f,c));b=b||[]}return b}function u(a,c){var d;r(a)?d=s(a,c)||[]:t(a)||f(a)?d=b(a,function(a){return g(a,
c)}):g(a,c)&&(d=[a]);return d}function g(b,d){return!b?!1:d==c?!0:a.contains(d,b)}function k(c,b){var d=b;b.nodeType!==a.DOCUMENT_NODE&&(d=b.ownerDocument);(d=d.getElementById(c))&&d.id===c||(d&&d.parentNode?l(d,c)?g(d,b)||(d=null):d=a.filter(n,"#"+c,b)[0]||null:d=null);return d}function q(a,c){return c&&D(c.getElementsByTagName(a))||[]}function h(a,c){var b;return(b=a.className)&&-1!==(" "+b+" ").indexOf(" "+c+" ")}function l(a,c){var b=a.getAttributeNode("id");return b&&b.nodeValue===c}var c=e.Env.host.document,
b=e.filter,t=e.isArray,r=e.isString,D=e.makeArray,f=a._isNodeList,A=a.nodeName,w=Array.prototype.push,C=" ",j=",",z=e.trim,n="*",o=/^#[\w-]+$/,E=/^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/,F=e.noop;(function(){var a,b,d=!0;[0,0].sort(function(){d=!1;return 0});F=function(c){if(a&&(b=d,c.sort(a),b))for(var e=1,f=c.length;e<f;)c[e]===c[e-1]?c.splice(e,1):e++;return c};a=c.documentElement.compareDocumentPosition?function(a,c){return a==c?(b=!0,0):!a.compareDocumentPosition||!c.compareDocumentPosition?
a.compareDocumentPosition?-1:1:a.compareDocumentPosition(c)&4?-1:1}:function(a,c){if(a==c)return b=!0,0;if(a.sourceIndex&&c.sourceIndex)return a.sourceIndex-c.sourceIndex}})();(function(){var a=c.createElement("div");a.appendChild(c.createComment(""));0<a.getElementsByTagName(n).length&&(q=function(a,c){var b=D(c.getElementsByTagName(a));if(a===n){for(var d=[],e=0,f;f=b[e++];)1===f.nodeType&&d.push(f);b=d}return b})})();var x=c.getElementsByClassName?function(a,c,b){if(!b)return[];var a=b.getElementsByClassName(a),
d=0,e=a.length,f;if(c&&c!==n)for(b=[];d<e;++d)f=a[d],A(f)==c&&b.push(f);else b=D(a);return b}:c.querySelectorAll?function(a,c,b){return b&&D(b.querySelectorAll((c?c:"")+"."+a))||[]}:function(a,c,b){if(!b)return[];for(var c=b.getElementsByTagName(c||n),b=[],d=0,e=c.length,f;d<e;++d)f=c[d],h(f,a)&&b.push(f);return b};e.mix(a,{query:m,get:function(a,c){return m(a,c)[0]||null},unique:F,filter:function(a,c,b){var a=m(a,b),b=e.require("sizzle"),d,f,g,k,j=[];if(r(c)&&(c=z(c))&&(d=E.exec(c)))g=d[1],f=d[2],
k=d[3],g?g&&!f&&!k&&(c=function(a){return l(a,g)}):c=function(a){var c=!0,b=!0;f&&(c=A(a)==f);k&&(b=h(a,k));return b&&c};e.isFunction(c)?j=e.filter(a,c):c&&b&&(j=b.matches(c,a));return j},test:function(c,b,d){c=m(c,d);return c.length&&a.filter(c,b,d).length===c.length}});return a},{requires:["./base"]});
KISSY.add("dom/style-ie",function(e,a,d,i){if(!d.ie)return a;var m=e.Env.host.document,p=m.documentElement,s=i._CUSTOM_STYLES,u=/^-?\d+(?:px)?$/i,g=/^-?\d/,k=/opacity=([^)]*)/,q=/alpha\([^)]*\)/i;s.backgroundPosition={get:function(a,b){return b?a.currentStyle.backgroundPositionX+" "+a.currentStyle.backgroundPositionY:a.style.backgroundPosition}};try{null==p.style.opacity&&(s.opacity={get:function(a,b){return k.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/
100+"":b?"1":""},set:function(a,b){var b=parseFloat(b),d=a.style,g=a.currentStyle,h=isNaN(b)?"":"alpha(opacity="+100*b+")",f=e.trim(g&&g.filter||d.filter||"");d.zoom=1;if(1<=b&&""===e.trim(f.replace(q,""))&&(d.removeAttribute("filter"),g&&!g.filter))return;d.filter=q.test(f)?f.replace(q,h):f+(f?", ":"")+h}})}catch(h){}var d=8==d.ie,l={};l.thin=d?"1px":"2px";l.medium=d?"3px":"4px";l.thick=d?"5px":"6px";e.each(["","Top","Left","Right","Bottom"],function(a){var b="border"+a+"Width",d="border"+a+"Style";
s[b]={get:function(a,c){var e=c?a.currentStyle:0,g=e&&""+e[b]||void 0;g&&0>g.indexOf("px")&&(g=l[g]&&"none"!==e[d]?l[g]:0);return g}}});if(!(m.defaultView||{}).getComputedStyle&&p.currentStyle)a._getComputedStyle=function(c,b){var b=a._cssProps[b]||b,d=c.currentStyle&&c.currentStyle[b];if(!u.test(d)&&g.test(d)){var e=c.style,h=e.left,f=c.runtimeStyle&&c.runtimeStyle.left;f&&(c.runtimeStyle.left=c.currentStyle.left);e.left="fontSize"===b?"1em":d||0;d=e.pixelLeft+"px";e.left=h;f&&(c.runtimeStyle.left=
f)}return""===d?"auto":d};return a},{requires:["./base","ua","./style"]});
KISSY.add("dom/style",function(e,a,d,i){function m(a){return a.replace(A,"ms-").replace(w,C)}function p(a,b,d){var e={},f;for(f in b)e[f]=a[c][f],a[c][f]=b[f];d.call(a);for(f in b)a[c][f]=e[f]}function s(a,b,d){var e;if(3===a.nodeType||8===a.nodeType||!(e=a[c]))return i;var b=m(b),g,h=o[b],b=E[b]||b;if(d!==i){null===d||d===z?d=z:!isNaN(Number(d))&&!f[b]&&(d+=n);h&&h.set&&(d=h.set(a,d));if(d!==i){try{e[b]=d}catch(k){}d===z&&e.removeAttribute&&e.removeAttribute(b)}e.cssText||a.removeAttribute("style");
return i}if(!h||!("get"in h&&(g=h.get(a,!1))!==i))g=e[b];return g===i?"":g}function u(a){var b,c=arguments;0!==a.offsetWidth?b=g.apply(i,c):p(a,G,function(){b=g.apply(i,c)});return b}function g(c,d,f){if(e.isWindow(c))return d==b?a.viewportWidth(c):a.viewportHeight(c);if(9==c.nodeType)return d==b?a.docWidth(c):a.docHeight(c);var g=d===b?["Left","Right"]:["Top","Bottom"],h=d===b?c.offsetWidth:c.offsetHeight;if(0<h)return"border"!==f&&e.each(g,function(b){f||(h-=parseFloat(a.css(c,"padding"+b))||0);
h="margin"===f?h+(parseFloat(a.css(c,f+b))||0):h-(parseFloat(a.css(c,"border"+b+"Width"))||0)}),h;h=a._getComputedStyle(c,d);if(null==h||0>Number(h))h=c.style[d]||0;h=parseFloat(h)||0;f&&e.each(g,function(b){h+=parseFloat(a.css(c,"padding"+b))||0;"padding"!==f&&(h+=parseFloat(a.css(c,"border"+b+"Width"))||0);"margin"===f&&(h+=parseFloat(a.css(c,f+b))||0)});return h}var k=e.Env.host,q=k.document,h=q.documentElement,l=d.ie,c="style",b="width",t="display"+e.now(),r=parseInt,D=/^-?\d+(?:px)?$/i,f={fillOpacity:1,
fontWeight:1,lineHeight:1,opacity:1,orphans:1,widows:1,zIndex:1,zoom:1},A=/^-ms-/,w=/-([a-z])/ig,C=function(a,c){return c.toUpperCase()},j=/([A-Z]|^ms)/g,z="",n="px",o={},E={},F={};h[c].cssFloat!==i?E["float"]="cssFloat":h[c].styleFloat!==i&&(E["float"]="styleFloat");var x,y;e.mix(a,{_camelCase:m,_CUSTOM_STYLES:o,_cssProps:E,_getComputedStyle:function(b,d){var e="",f,g=b.ownerDocument,d=d.replace(j,"-$1").toLowerCase();if(f=g.defaultView.getComputedStyle(b,null))e=f.getPropertyValue(d)||f[d];""==
e&&!a.contains(g.documentElement,b)&&(d=E[d]||d,e=b[c][d]);return e},style:function(c,b,d){var c=a.query(c),f=c[0];if(e.isPlainObject(b)){for(var g in b)for(f=c.length-1;0<=f;f--)s(c[f],g,b[g]);return i}if(d===i)return g="",f&&(g=s(f,b,d)),g;for(f=c.length-1;0<=f;f--)s(c[f],b,d);return i},css:function(c,b,d){var c=a.query(c),f=c[0];if(e.isPlainObject(b)){for(var g in b)for(f=c.length-1;0<=f;f--)s(c[f],g,b[g]);return i}b=m(b);g=o[b];if(d===i){d="";if(f&&(!g||!("get"in g&&(d=g.get(f,!0))!==i)))d=a._getComputedStyle(f,
b);return d===i?"":d}for(f=c.length-1;0<=f;f--)s(c[f],b,d);return i},show:function(b){var b=a.query(b),e,f;for(f=b.length-1;0<=f;f--)if(e=b[f],e[c].display=a.data(e,t)||z,"none"===a.css(e,"display")){var g;a:{g=e.tagName.toLowerCase();var h=void 0,k=void 0;if(!F[g]){h=q.body||q.documentElement;k=q.createElement(g);a.prepend(k,h);var j=a.css(k,"display");h.removeChild(k);if("none"==j||""==j){if(x)a.prepend(x,h);else if(x=q.createElement("iframe"),x.frameBorder=x.width=x.height=0,a.prepend(x,h),k=void 0,
k=a.getEmptyIframeSrc())x.src=k;if(!y||!x.createElement)try{y=x.contentWindow.document,y.write(("CSS1Compat"===q.compatMode?"<!doctype html>":"")+"<html><head>"+(d.ie&&a.isCustomDomain()?"<script>document.domain = '"+q.domain+"';<\/script>":"")+"</head><body>"),y.close()}catch(i){g="block";break a}k=y.createElement(g);y.body.appendChild(k);j=a.css(k,"display");h.removeChild(x)}F[g]=j}g=F[g]}a.data(e,t,g);e[c].display=g}},hide:function(b){var b=a.query(b),d,e;for(e=b.length-1;0<=e;e--){d=b[e];var f=
d[c],g=f.display;"none"!==g&&(g&&a.data(d,t,g),f.display="none")}},toggle:function(b){var b=a.query(b),c,d;for(d=b.length-1;0<=d;d--)c=b[d],"none"===a.css(c,"display")?a.show(c):a.hide(c)},addStyleSheet:function(b,c,d){b=b||k;e.isString(b)&&(d=c,c=b,b=k);var b=a.get(b),b=a._getWin(b).document,f;if(d&&(d=d.replace("#",z)))f=a.get("#"+d,b);f||(f=a.create("<style>",{id:d},b),a.get("head",b).appendChild(f),f.styleSheet?f.styleSheet.cssText=c:f.appendChild(b.createTextNode(c)))},unselectable:function(b){var b=
a.query(b),e,f;for(f=b.length-1;0<=f;f--)if(e=b[f],d.gecko)e[c].MozUserSelect="none";else if(d.webkit)e[c].KhtmlUserSelect="none";else if(d.ie||d.opera){var g=0,h=e.getElementsByTagName("*");for(e.setAttribute("unselectable","on");e=h[g++];)switch(e.tagName.toLowerCase()){case "iframe":case "textarea":case "input":case "select":break;default:e.setAttribute("unselectable","on")}}},innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,width:0,height:0});e.each([b,"height"],function(b){a["inner"+(b.charAt(0).toUpperCase()+
b.substring(1))]=function(c){return(c=a.get(c))&&u(c,b,"padding")};a["outer"+(b.charAt(0).toUpperCase()+b.substring(1))]=function(c,d){var e=a.get(c);return e&&u(e,b,d?"margin":"border")};a[b]=function(c,d){var e=a.css(c,b,d);e&&(e=parseFloat(e));return e}});var G={position:"absolute",visibility:"hidden",display:"block"};e.each(["height","width"],function(a){o[a]={get:function(b,c){if(c)return u(b,a)+"px"},set:function(a,b){if(D.test(b)){if(b=parseFloat(b),0<=b)return b+"px"}else return b}}});e.each(["left",
"top"],function(b){o[b]={get:function(c,f){if(f){var g=a._getComputedStyle(c,b);if("auto"===g){g=0;if(e.inArray(a.css(c,"position"),["absolute","fixed"])){g=c["left"===b?"offsetLeft":"offsetTop"];if(l&&9!=q.documentMode||d.opera)g-=c.offsetParent&&c.offsetParent["client"+("left"==b?"Left":"Top")]||0;g-=r(a.css(c,"margin-"+b))||0}g+="px"}return g}}}});return a},{requires:["dom/base","ua"]});
KISSY.add("dom/traversal",function(e,a,d){function i(g,k,i,h,l,c,b){if(!(g=a.get(g)))return null;if(0===k)return g;c||(g=g[i]);if(!g)return null;l=l&&a.get(l)||null;k===d&&(k=1);var c=[],p=e.isArray(k),r,s;e.isNumber(k)&&(r=0,s=k,k=function(){return++r===s});for(;g&&g!=l;){if((g.nodeType==a.ELEMENT_NODE||g.nodeType==a.TEXT_NODE&&b)&&m(g,k)&&(!h||h(g)))if(c.push(g),!p)break;g=g[i]}return p?c:c[0]||null}function m(d,k){if(!k)return!0;if(e.isArray(k))for(var i=0;i<k.length;i++){if(a.test(d,k[i]))return!0}else if(a.test(d,
k))return!0;return!1}function p(d,k,i,h){var l=[],c=d=a.get(d);d&&i&&(c=d.parentNode);c&&(l=e.makeArray(c.childNodes),h||(l=a.filter(l,function(a){return a.nodeType==1})),k&&(l=a.filter(l,k)));return l}var s=e.Env.host.document,u=s.documentElement.contains?function(d,e){if(d.nodeType==a.TEXT_NODE)return!1;var i;if(e.nodeType==a.TEXT_NODE)e=e.parentNode,i=!0;else{if(e.nodeType==a.DOCUMENT_NODE)return!1;i=d!==e}return i&&(d.contains?d.contains(e):!0)}:s.documentElement.compareDocumentPosition?function(a,
d){return!!(a.compareDocumentPosition(d)&16)}:0;e.mix(a,{closest:function(d,e,m,h){return i(d,e,"parentNode",function(d){return d.nodeType!=a.DOCUMENT_FRAGMENT_NODE},m,!0,h)},parent:function(e,k,m){return i(e,k,"parentNode",function(d){return d.nodeType!=a.DOCUMENT_FRAGMENT_NODE},m,d)},first:function(e,k,m){e=a.get(e);return i(e&&e.firstChild,k,"nextSibling",d,d,!0,m)},last:function(e,k,m){e=a.get(e);return i(e&&e.lastChild,k,"previousSibling",d,d,!0,m)},next:function(a,e,m){return i(a,e,"nextSibling",
d,d,d,m)},prev:function(a,e,m){return i(a,e,"previousSibling",d,d,d,m)},siblings:function(a,d,e){return p(a,d,!0,e)},children:function(a,e){return p(a,e,d)},contents:function(a,e){return p(a,e,d,1)},contains:function(d,e){d=a.get(d);e=a.get(e);return d&&e?u(d,e):!1},equals:function(d,e){d=a.query(d);e=a.query(e);if(d.length!=e.length)return!1;for(var i=d.length;0<=i;i--)if(d[i]!=e[i])return!1;return!0}});return a},{requires:["./base"]});
