YUI.add("selector-native",function(e,r){var _,t,S,i;(_=e).namespace("Selector"),t="compareDocumentPosition",S="ownerDocument",i={_types:{esc:{token:"",re:/\\[:\[\]\(\)#\.\'\>+~"]/gi},attr:{token:"",re:/(\[[^\]]*\])/g},pseudo:{token:"",re:/(\([^\)]*\))/g}},useNative:!0,_escapeId:function(e){return e=e&&e.replace(/([:\[\]\(\)#\.'<>+~"])/g,"\\$1")},_compare:"sourceIndex"in _.config.doc.documentElement?function(e,r){e=e.sourceIndex,r=r.sourceIndex;return e===r?0:r<e?1:-1}:_.config.doc.documentElement[t]?function(e,r){return 4&e[t](r)?-1:1}:function(e,r){var t;return e&&r&&((t=e[S].createRange()).setStart(e,0),(e=r[S].createRange()).setStart(r,0),t=t.compareBoundaryPoints(1,e)),t},_sort:function(e){return e&&(e=_.Array(e,0,!0)).sort&&e.sort(i._compare),e},_deDupe:function(e){for(var r,t=[],o=0;r=e[o++];)r._found||((t[t.length]=r)._found=!0);for(o=0;r=t[o++];)r._found=null,r.removeAttribute("_found");return t},query:function(e,r,t,o){r=r||_.config.doc;var c,n,u=[],a=_.Selector.useNative&&_.config.doc.querySelector&&!o,s=[[e,r]],l=a?_.Selector._nativeQuery:_.Selector._bruteQuery;if(e&&l){for(o||a&&!r.tagName||(s=i._splitQueries(e,r)),n=0;c=s[n++];)c=l(c[0],c[1],t),(c=t?c:_.Array(c,0,!0))&&(u=u.concat(c));1<s.length&&(u=i._sort(i._deDupe(u)))}return t?u[0]||null:u},_replaceSelector:function(e){var r,t=_.Selector._parse("esc",e);return e=_.Selector._replace("esc",e),r=_.Selector._parse("pseudo",e),e=i._replace("pseudo",e),{esc:t,attrs:_.Selector._parse("attr",e),pseudos:r,selector:e=_.Selector._replace("attr",e)}},_restoreSelector:function(e){var r=e.selector,r=_.Selector._restore("attr",r,e.attrs);return r=_.Selector._restore("pseudo",r,e.pseudos),_.Selector._restore("esc",r,e.esc)},_replaceCommas:function(e){var r=_.Selector._replaceSelector(e);return(e=r.selector)&&(e=e.replace(/,/g,""),r.selector=e,e=_.Selector._restoreSelector(r)),e},_splitQueries:function(e,r){var t,o,c,n=(e=-1<e.indexOf(",")?_.Selector._replaceCommas(e):e).split(""),u=[],a="";if(r)for(1===r.nodeType&&((t=_.Selector._escapeId(_.DOM.getId(r)))||(t=_.guid(),_.DOM.setId(r,t)),a='[id="'+t+'"] '),o=0,c=n.length;o<c;++o)e=a+n[o],u.push([e,r]);return u},_nativeQuery:function(e,r,t){if((_.UA.webkit||_.UA.opera)&&-1<e.indexOf(":checked")&&_.Selector.pseudos&&_.Selector.pseudos.checked)return _.Selector.query(e,r,t,!0);try{return r["querySelector"+(t?"":"All")](e)}catch(o){return _.Selector.query(e,r,t,!0)}},filter:function(e,r){var t,o,c=[];if(e&&r)for(t=0;o=e[t++];)_.Selector.test(o,r)&&(c[c.length]=o);return c},test:function(e,r,t){var o,c,n,u,a,s,l,i,f,p=!1,d=!1;if(e&&e.tagName)if("function"==typeof r)p=r.call(e,e);else{for(c=r.split(","),t||_.DOM.inDoc(e)||((r=e.parentNode)?t=r:((a=e[S].createDocumentFragment()).appendChild(e),t=a,d=!0)),t=t||e[S],(s=_.Selector._escapeId(_.DOM.getId(e)))||(o=!0,s=_.guid(),_.DOM.setId(e,s)),l=0;f=c[l++];){for(f+='[id="'+s+'"]',u=_.Selector.query(f,t),i=0;n=u[i++];)if(n===e){p=!0;break}if(p)break}d&&a.removeChild(e),o&&e.removeAttribute("id")}return p},ancestor:function(e,r,t){return _.DOM.ancestor(e,function(e){return _.Selector.test(e,r)},t)},_parse:function(e,r){return r.match(_.Selector._types[e].re)},_replace:function(e,r){e=_.Selector._types[e];return r.replace(e.re,e.token)},_restore:function(e,r,t){if(t)for(var o=_.Selector._types[e].token,c=0,n=t.length;c<n;++c)r=r.replace(o,t[c]);return r}},_.mix(_.Selector,i,!0)},"patched-v3.18.7",{requires:["dom-base"]});