YUI.add("selector-css2",function(N,e){var r="tagName",i="combinator",a="pseudos",S=N.Selector,t={_reRegExpTokens:/([\^\$\?\[\]\*\+\-\.\(\)\|\\])/,SORT_RESULTS:!0,_isXML:"DIV"!==N.config.doc.createElement("div").tagName,shorthand:{"\\#(-?[_a-z0-9]+[-\\w\\uE000]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w\\uE000]*)":"[className~=$1]"},operators:{"":function(e,t){return""!==N.DOM.getAttribute(e,t)},"~=":"(?:^|\\s+){val}(?:\\s+|$)","|=":"^{val}-?"},pseudos:{"first-child":function(e){return N.DOM._children(e.parentNode)[0]===e}},_bruteQuery:function(e,t,r){var a,n,o,s,l,i,c=[],u=[],e=S._tokenize(e),f=e[e.length-1];N.DOM._getDoc(t);if(f){if(o=f.id,s=f.className,l=f.tagName||"*","undefined"!=typeof t.getElementsByTagName)u=o&&(t.all||9===t.nodeType||N.DOM.inDoc(t))?N.DOM.allById(o,t):s?t.getElementsByClassName(s):t.getElementsByTagName(l);else for(a=[],n=t.firstChild,i="*"===l;n;){for(;n;)"@"<n.tagName&&(i||n.tagName===l)&&u.push(n),a.push(n),n=n.firstChild;for(;0<a.length&&!n;)n=a.pop().nextSibling}u.length&&(c=S._filterNodes(u,e,r))}return c},_filterNodes:function(e,t,r){for(var a,n,o,s,l,i,c,u,f=0,g=t.length,p=g-1,m=[],d=e[0],_=d,h=N.Selector.getters,f=0;_=d=e[f++];){p=g-1,l=null;e:for(;_&&_.tagName;){if(a=(c=(s=t[p]).tests).length)for(;u=c[--a];)if(n=u[1],h[u[0]]?i=h[u[0]](_,u[0]):(i=_[u[0]],"string"!=typeof(i="tagName"!==u[0]||S._isXML?i:i.toUpperCase())&&i!==undefined&&i.toString?i=i.toString():i===undefined&&_.getAttribute&&(i=_.getAttribute(u[0],2))),"="===n&&i!==u[2]||"string"!=typeof n&&n.test&&!n.test(i)||!n.test&&"function"==typeof n&&!n(_,u[0],u[2])){if(_=_[l])for(;_&&(!_.tagName||s.tagName&&s.tagName!==_.tagName);)_=_[l];continue e}if(p--,!(o=s.combinator)){if(m.push(d),r)return m;break}for(_=_[l=o.axis];_&&!_.tagName;)_=_[l];o.direct&&(l=null)}}return d=_=null,m},combinators:{" ":{axis:"parentNode"},">":{axis:"parentNode",direct:!0},"+":{axis:"previousSibling",direct:!0}},_parsers:[{name:"attributes",re:/^\uE003(-?[a-z]+[\w\-]*)+([~\|\^\$\*!=]=?)?['"]?([^\uE004'"]*)['"]?\uE004/i,fn:function(e,t){var r=e[2]||"",a=S.operators,n=e[3]?e[3].replace(/\\/g,""):"";if(("id"===e[1]&&"="===r||"className"===e[1]&&N.config.doc.documentElement.getElementsByClassName&&("~="===r||"="===r))&&(t.prefilter=e[1],e[3]=n,t[e[1]]="id"===e[1]?e[3]:n),r in a&&("string"==typeof(r=a[r])&&(e[3]=n.replace(S._reRegExpTokens,"\\$1"),r=new RegExp(r.replace("{val}",e[3]))),e[2]=r),!t.last||t.prefilter!==e[1])return e.slice(1)}},{name:r,re:/^((?:-?[_a-z]+[\w-]*)|\*)/i,fn:function(e,t){e=e[1];if(S._isXML||(e=e.toUpperCase()),"*"!==(t.tagName=e)&&(!t.last||t.prefilter))return[r,"=",e];t.prefilter||(t.prefilter="tagName")}},{name:i,re:/^\s*([>+~]|\s)\s*/,fn:function(e,t){}},{name:a,re:/^:([\-\w]+)(?:\uE005['"]?([^\uE005]*)['"]?\uE006)*/i,fn:function(e,t){var r=S[a][e[1]];return!!r&&(e[2]&&(e[2]=e[2].replace(/\\/g,"")),[e[2],r])}}],_getToken:function(e){return{tagName:null,id:null,className:null,attributes:{},combinator:null,tests:[]}},_tokenize:function(e){e=S._parseSelector(N.Lang.trim(e=e||""));var t,r,a,n,o=S._getToken(),s=[],l=!1;e:do{for(l=!1,a=0;n=S._parsers[a++];)if(t=n.re.exec(e)){if(n.name!==i&&(o.selector=e),(e=e.replace(t[0],"")).length||(o.last=!0),S._attrFilters[t[1]]&&(t[1]=S._attrFilters[t[1]]),!1===(r=n.fn(t,o))){l=!1;break e}r&&o.tests.push(r),e.length&&n.name!==i||(s.push(o),o=S._getToken(o),n.name===i&&(o.combinator=N.Selector.combinators[t[1]])),l=!0}}while(l&&e.length);return s=l&&!e.length?s:[]},_replaceMarkers:function(e){return e=(e=(e=(e=e.replace(/\[/g,"")).replace(/\]/g,"")).replace(/\(/g,"")).replace(/\)/g,"")},_replaceShorthand:function(e){var t,r=N.Selector.shorthand;for(t in r)r.hasOwnProperty(t)&&(e=e.replace(new RegExp(t,"gi"),r[t]));return e},_parseSelector:function(e){var t=N.Selector._replaceSelector(e),e=t.selector;return e=N.Selector._replaceShorthand(e),e=N.Selector._restore("attr",e,t.attrs),e=N.Selector._restore("pseudo",e,t.pseudos),e=N.Selector._replaceMarkers(e),e=N.Selector._restore("esc",e,t.esc)},_attrFilters:{"class":"className","for":"htmlFor"},getters:{href:function(e,t){return N.DOM.getAttribute(e,t)},id:function(e,t){return N.DOM.getId(e)}}};N.mix(N.Selector,t,!0),N.Selector.getters.src=N.Selector.getters.rel=N.Selector.getters.href,N.Selector.useNative&&N.config.doc.querySelector&&(N.Selector.shorthand["\\.(-?[_a-z]+[-\\w]*)"]="[class~=$1]")},"patched-v3.18.4",{requires:["selector-native"]});