YUI.add("stylesheet",function(u,e){var s,n,d,h=u.config.doc,a=h.createElement("p"),y=a.style,p=u.Lang.isString,i={},g={},o="cssFloat"in y?"cssFloat":"styleFloat",r="opacity",c="float",x="";function T(e,t){var s,a,o,r,c,n,i,l,f={};if(!u.instanceOf(this,T))return new T(e,t);if(e){if(u.Node&&e instanceof u.Node)s=e._node;else if(e.nodeName)s=e;else if(p(e)){if(e&&g[e])return g[e];s=h.getElementById(e.replace(/^#/,x))}if(s&&g[u.stamp(s)])return g[u.stamp(s)]}s&&/^(?:style|link)$/i.test(s.nodeName)||((s=h.createElement("style")).type="text/css"),p(e)&&(-1!=e.indexOf("{")?s.styleSheet?s.styleSheet.cssText=e:s.appendChild(h.createTextNode(e)):t=t||e),s.parentNode&&"head"===s.parentNode.nodeName.toLowerCase()||(s.ownerDocument||h).getElementsByTagName("head")[0].appendChild(s),a=s.sheet||s.styleSheet,o=a&&"cssRules"in a?"cssRules":"rules",c="deleteRule"in a?function(e){a.deleteRule(e)}:function(e){a.removeRule(e)},r="insertRule"in a?function(e,t,s){a.insertRule(e+" {"+t+"}",s)}:function(e,t,s){a.addRule(e,t,s)};for(n=a[o].length-1;0<=n;--n)l=(i=a[o][n]).selectorText,f[l]?(f[l].style.cssText+=";"+i.style.cssText,c(n)):f[l]=i;T.register(u.stamp(s),this),t&&T.register(t,this),u.mix(this,{getId:function(){return u.stamp(s)},enable:function(){return a.disabled=!1,this},disable:function(){return a.disabled=!0,this},isEnabled:function(){return!a.disabled},set:function(e,t){var s,n=f[e],i=e.split(/\s*,\s*/);if(1<i.length)for(s=i.length-1;0<=s;--s)this.set(i[s],t);else T.isValidSelector(e)&&(n?n.style.cssText=T.toCssText(t,n.style.cssText):(n=a[o].length,(t=T.toCssText(t))&&(r(e,t,n),f[e]=a[o][n])));return this},unset:function(e,t){var s,n,i=f[e],r=e.split(/\s*,\s*/),l=!t;if(1<r.length)for(n=r.length-1;0<=n;--n)this.unset(r[n],t);else if(i){if(!l){for(t=u.Array(t),y.cssText=i.style.cssText,n=t.length-1;0<=n;--n)d(y,t[n]);y.cssText?i.style.cssText=y.cssText:l=!0}if(l)for(n=(s=a[o]).length-1;0<=n;--n)if(s[n]===i){delete f[e],c(n);break}}return this},getCssText:function(e){var t,s,n;if(p(e))return(t=f[e.split(/\s*,\s*/)[0]])?t.style.cssText:null;for(n in s=[],f)f.hasOwnProperty(n)&&s.push((t=f[n]).selectorText+" {"+t.style.cssText+"}");return s.join("\n")}})}n=r in y?function(e){e.opacity=x}:function(e){e.filter=x},y.border="1px solid red",y.border=x,d=y.borderLeft?function(e,t){if(t!==o&&-1!=t.toLowerCase().indexOf(c)&&(t=o),p(e[t]))switch(t){case r:case"filter":n(e);break;case"font":e.font=e.fontStyle=e.fontVariant=e.fontWeight=e.fontSize=e.lineHeight=e.fontFamily=x;break;default:for(var s in e)0===s.indexOf(t)&&(e[s]=x)}}:function(e,t){t!==o&&-1!=t.toLowerCase().indexOf(c)&&(t=o),p(e[t])&&(t===r?n(e):e[t]=x)},s=function(e,t){var s,n=e.styleFloat||e.cssFloat||e[c],i=u.Lang.trim;try{y.cssText=t||x}catch(r){a=h.createElement("p"),(y=a.style).cssText=t||x}for(s in n&&!e[o]&&(delete(e=u.merge(e)).styleFloat,delete e.cssFloat,delete e[c],e[o]=n),e)if(e.hasOwnProperty(s))try{y[s]=i(e[s])}catch(l){}return y.cssText},u.mix(T,{toCssText:r in y?s:function(e,t){return r in e&&delete(e=u.merge(e,{filter:"alpha(opacity="+100*e.opacity+")"})).opacity,s(e,t)},register:function(e,t){return!!(e&&t instanceof T&&!g[e]&&(g[e]=t))},isValidSelector:function(e){var t=!1;return e&&p(e)&&(i.hasOwnProperty(e)||(i[e]=!/\S/.test(e.replace(/\s+|\s*[+~>]\s*/g," ").replace(/([^ ])\[.*?\]/g,"$1").replace(/([^ ])::?[a-z][a-z\-]+[a-z](?:\(.*?\))?/gi,"$1").replace(/(?:^| )[a-z0-6]+/gi," ").replace(/\\./g,x).replace(/[.#]\w[\w\-]*/g,x))),t=i[e]),t}},!0),u.StyleSheet=T},"patched-v3.18.7",{requires:["yui-base"]});