/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 3.0.0pr2
*/
YUI.add("dom-base",function(D){var J="nodeType",O="ownerDocument",S="documentElement",C="defaultView",I="parentWindow",M="tagName",F="parentNode",B="firstChild",R="lastChild",N="previousSibling",T="nextSibling",G="contains",K="compareDocumentPosition",P="innerText",Q="textContent",L="length",U=undefined;var H=/<([a-z]+)/i;var E={};D.DOM={byId:function(W,V){return D.DOM._getDoc(V).getElementById(W);},getText:function(V){var W=V?V[Q]:"";if(W===U&&P in V){W=V[P];}return W||"";},firstChild:function(V,W){return D.DOM._childBy(V,null,W);},firstChildByTag:function(W,V,X){return D.DOM._childBy(W,V,X);},lastChild:function(V,W){return D.DOM._childBy(V,null,W,true);},lastChildByTag:function(W,V,X){return D.DOM._childBy(W,V,X,true);},childrenByTag:function(){if(document[S].children){return function(X,V,Y,W){V=(V&&V!=="*")?V:null;var Z=[];if(X){Z=(V)?X.children.tags(V):X.children;if(Y||W){Z=D.DOM.filterElementsBy(Z,Y);}}return Z;};}else{return function(X,W,Y){W=(W&&W!=="*")?W.toUpperCase():null;var Z=[],V=Y;if(X){Z=X.childNodes;if(W){V=function(a){return a[M].toUpperCase()===W&&(!Y||Y(a));};}Z=D.DOM.filterElementsBy(Z,V);}return Z;};}}(),children:function(V,W){return D.DOM.childrenByTag(V,null,W);},previous:function(V,W){return D.DOM.elementByAxis(V,N,W);},next:function(V,W){return D.DOM.elementByAxis(V,T,W);},ancestor:function(V,W){return D.DOM.elementByAxis(V,F,W);},elementByAxis:function(V,Y,X,W){while(V&&(V=V[Y])){if((W||V[M])&&(!X||X(V))){return V;}}return null;},byTag:function(W,X,a){X=X||D.config.doc;var b=X.getElementsByTagName(W),Z=[];for(var Y=0,V=b[L];Y<V;++Y){if(!a||a(b[Y])){Z[Z[L]]=b[Y];}}return Z;},firstByTag:function(W,X,a){X=X||D.config.doc;var b=X.getElementsByTagName(W),Y=null;for(var Z=0,V=b[L];Z<V;++Z){if(!a||a(b[Z])){Y=b[Z];break;}}return Y;},filterElementsBy:function(a,Z,Y){var W=(Y)?null:[];for(var X=0,V=a[L];X<V;++X){if(a[X][M]&&(!Z||Z(a[X]))){if(Y){W=a[X];break;}else{W[W[L]]=a[X];}}}return W;},contains:function(W,X){var V=false;if(!X||!W||!X[J]||!W[J]){V=false;}else{if(W[G]){if(D.UA.opera||X[J]===1){V=W[G](X);}else{V=D.DOM._bruteContains(W,X);}}else{if(W[K]){if(W===X||!!(W[K](X)&16)){V=true;}}}}return V;},inDoc:function(V,W){W=W||D.config.doc;return D.DOM.contains(W.documentElement,V);},create:function(Z,b){b=b||D.config.doc;var W=H.exec(Z);var Y=D.DOM._create,a=D.DOM.creators,V,X;if(W&&a[W[1]]){if(typeof a[W[1]]==="function"){Y=a[W[1]];}else{V=a[W[1]];}}X=Y(Z,b,V);return(X.childNodes.length>1)?X.childNodes:X.childNodes[0];},_create:function(W,X,V){V=V||"div";var Y=E[V]||X.createElement(V);Y.innerHTML=D.Lang.trim(W);return Y;},_bruteContains:function(V,W){while(W){if(V===W){return true;}W=W.parentNode;}return false;},_getRegExp:function(W,V){V=V||"";D.DOM._regexCache=D.DOM._regexCache||{};if(!D.DOM._regexCache[W+V]){D.DOM._regexCache[W+V]=new RegExp(W,V);}return D.DOM._regexCache[W+V];},_getDoc:function(V){V=V||{};return(V[J]===9)?V:V[O]||D.config.doc;},_getWin:function(V){var W=D.DOM._getDoc(V);return(V.document)?V:W[C]||W[I]||D.config.win;},_childBy:function(Z,V,b,X){var Y=null,W,a;if(Z){if(X){W=Z[R];a=N;}else{W=Z[B];a=T;}if(D.DOM._testElement(W,V,b)){Y=W;}else{Y=D.DOM.elementByAxis(W,a,b);}}return Y;},_testElement:function(W,V,X){V=(V&&V!=="*")?V.toUpperCase():null;return(W&&W[M]&&(!V||W[M].toUpperCase()===V)&&(!X||X(W)));},creators:{},_IESimpleCreate:function(V,W){W=W||D.config.doc;return W.createElement(V);}};(function(){var Z=D.DOM.creators,V=D.DOM.create,Y=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/;var X="<table>",W="</table>";if(D.UA.gecko||D.UA.ie){D.mix(Z,{option:function(a,b){var c=V("<select>"+a+"</select>");return c;},tr:function(a,b){var c=Z.tbody("<tbody>"+a+"</tbody>",b);return c.firstChild;},td:function(a,b){var c=Z.tr("<tr>"+a+"</tr>",b);return c.firstChild;},tbody:function(a,b){var c=V(X+a+W,b);return c;},legend:"fieldset"});Z.col=Z.tbody;}if(D.UA.ie){Z.col=Z.script=Z.link=D.DOM._IESimpleCreate;Z.tbody=function(b,c){var d=V(X+b+W,c);var a=d.children.tags("tbody")[0];if(d.children.length>1&&a&&!Y.test(b)){a.parentNode.removeChild(a);}return d;};}if(D.UA.gecko||D.UA.ie){D.mix(Z,{th:Z.td,thead:Z.tbody,tfoot:Z.tbody,caption:Z.tbody,colgroup:Z.tbody,col:Z.tbody,optgroup:Z.option});}})();var A="className";D.mix(D.DOM,{hasClass:function(X,W){var V=D.DOM._getRegExp("(?:^|\\s+)"+W+"(?:\\s+|$)");return V.test(X[A]);},addClass:function(W,V){if(!D.DOM.hasClass(W,V)){W[A]=D.Lang.trim([W[A],V].join(" "));}},removeClass:function(W,V){if(V&&D.DOM.hasClass(W,V)){W[A]=D.Lang.trim(W[A].replace(D.DOM._getRegExp("(?:^|\\s+)"+V+"(?:\\s+|$)")," "));if(D.DOM.hasClass(W,V)){D.DOM.removeClass(W,V);}}},replaceClass:function(W,V,X){D.DOM.addClass(W,X);D.DOM.removeClass(W,V);},toggleClass:function(W,V){if(D.DOM.hasClass(W,V)){D.DOM.removeClass(W,V);}else{D.DOM.addClass(W,V);}}});},"3.0.0pr2",{skinnable:false,requires:["event"]});