YAHOO.util.Dom=function(){var B=navigator.userAgent.toLowerCase();var C=(B.indexOf("opera")>-1);var H=(B.indexOf("safari")>-1);var D=(window.ActiveXObject);var E=0;var F=YAHOO.util;var A={};var I=function(K){var L=function(N){var M=/(-[a-z])/i.exec(N);return N.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase())};while(K.indexOf("-")>-1){K=L(K)}return K};var G=function(M){if(M.indexOf("-")>-1){return M}var N="";for(var L=0,K=M.length;L<K;++L){if(M.charAt(L)==M.charAt(L).toUpperCase()){N=N+"-"+M.charAt(L).toLowerCase()
}else{N=N+M.charAt(L)}}return N};var J=function(K){A[K]={camel:I(K),hyphen:G(K)}};return{get:function(M){if(!M){return null}if(typeof M!="string"&&!(M instanceof Array)){return M}if(typeof M=="string"){return document.getElementById(M)}else{var N=[];for(var L=0,K=M.length;L<K;++L){N[N.length]=F.Dom.get(M[L])}return N}return null},getStyle:function(K,M){var L=function(P){var S=null;var O=document.defaultView;if(!A[M]){J(M)}var N=A[M]["camel"];var R=A[M]["hyphen"];if(M=="opacity"&&P.filters){S=1;try{S=P.filters.item("DXImageTransform.Microsoft.Alpha").opacity/100
}catch(T){try{S=P.filters.item("alpha").opacity/100}catch(T){}}}else{if(P.style[N]){S=P.style[N]}else{if(D&&P.currentStyle&&P.currentStyle[N]){S=P.currentStyle[N]}else{if(O&&O.getComputedStyle){var Q=O.getComputedStyle(P,"");if(Q&&Q.getPropertyValue(R)){S=Q.getPropertyValue(R)}}}}}return S};return F.Dom.batch(K,L,F.Dom,true)},setStyle:function(L,N,O){if(!A[N]){J(N)}var K=A[N]["camel"];var M=function(P){switch(N){case"opacity":if(D&&typeof P.style.filter=="string"){P.style.filter="alpha(opacity="+O*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1
}}else{P.style.opacity=O;P.style["-moz-opacity"]=O;P.style["-khtml-opacity"]=O}break;default:P.style[K]=O}};F.Dom.batch(L,M,F.Dom,true)},getXY:function(K){var L=function(N){if(N.offsetParent===null||this.getStyle(N,"display")=="none"){return false}var M=null;var S=[];var O;if(N.getBoundingClientRect){O=N.getBoundingClientRect();var Q=document;if(!this.inDocument(N)&&parent.document!=document){Q=parent.document;if(!this.isAncestor(Q.documentElement,N)){return false}}var P=Math.max(Q.documentElement.scrollTop,Q.body.scrollTop);
var R=Math.max(Q.documentElement.scrollLeft,Q.body.scrollLeft);return[O.left+R,O.top+P]}else{S=[N.offsetLeft,N.offsetTop];M=N.offsetParent;if(M!=N){while(M){S[0]+=M.offsetLeft;S[1]+=M.offsetTop;M=M.offsetParent}}if(H&&this.getStyle(N,"position")=="absolute"){S[0]-=document.body.offsetLeft;S[1]-=document.body.offsetTop}}if(N.parentNode){M=N.parentNode}else{M=null}while(M&&M.tagName.toUpperCase()!="BODY"&&M.tagName.toUpperCase()!="HTML"){if(F.Dom.getStyle(M,"display")!="inline"){S[0]-=M.scrollLeft;S[1]-=M.scrollTop
}if(M.parentNode){M=M.parentNode}else{M=null}}return S};return F.Dom.batch(K,L,F.Dom,true)},getX:function(K){var L=function(M){return F.Dom.getXY(M)[0]};return F.Dom.batch(K,L,F.Dom,true)},getY:function(K){var L=function(M){return F.Dom.getXY(M)[1]};return F.Dom.batch(K,L,F.Dom,true)},setXY:function(K,N,M){var L=function(Q){var P=this.getStyle(Q,"position");if(P=="static"){this.setStyle(Q,"position","relative");P="relative"}var S=this.getXY(Q);if(S===false){return false}var R=[parseInt(this.getStyle(Q,"left"),10),parseInt(this.getStyle(Q,"top"),10)];
if(isNaN(R[0])){R[0]=(P=="relative")?0:Q.offsetLeft}if(isNaN(R[1])){R[1]=(P=="relative")?0:Q.offsetTop}if(N[0]!==null){Q.style.left=N[0]-S[0]+R[0]+"px"}if(N[1]!==null){Q.style.top=N[1]-S[1]+R[1]+"px"}var O=this.getXY(Q);if(!M&&(O[0]!=N[0]||O[1]!=N[1])){this.setXY(Q,N,true)}};F.Dom.batch(K,L,F.Dom,true)},setX:function(L,K){F.Dom.setXY(L,[K,null])},setY:function(K,L){F.Dom.setXY(K,[null,L])},getRegion:function(K){var L=function(M){var N=new YAHOO.util.Region.getRegion(M);return N};return F.Dom.batch(K,L,F.Dom,true)
},getClientWidth:function(){return F.Dom.getViewportWidth()},getClientHeight:function(){return F.Dom.getViewportHeight()},getElementsByClassName:function(M,K,L){var N=function(O){return F.Dom.hasClass(O,M)};return F.Dom.getElementsBy(N,K,L)},hasClass:function(M,L){var K=new RegExp("(?:^|\\s+)"+L+"(?:\\s+|$)");var N=function(O){return K.test(O.className)};return F.Dom.batch(M,N,F.Dom,true)},addClass:function(L,K){var M=function(N){if(this.hasClass(N,K)){return }N.className=[N.className,K].join(" ")};F.Dom.batch(L,M,F.Dom,true)
},removeClass:function(M,L){var K=new RegExp("(?:^|\\s+)"+L+"(?:\\s+|$)","g");var N=function(O){if(!this.hasClass(O,L)){return }var P=O.className;O.className=P.replace(K," ");if(this.hasClass(O,L)){this.removeClass(O,L)}};F.Dom.batch(M,N,F.Dom,true)},replaceClass:function(N,L,K){if(L===K){return false}var M=new RegExp("(?:^|\\s+)"+L+"(?:\\s+|$)","g");var O=function(P){if(!this.hasClass(P,L)){this.addClass(P,K);return }P.className=P.className.replace(M," "+K+" ");if(this.hasClass(P,L)){this.replaceClass(P,L,K)
}};F.Dom.batch(N,O,F.Dom,true)},generateId:function(K,M){M=M||"yui-gen";K=K||{};var L=function(N){if(N){N=F.Dom.get(N)}else{N={}}if(!N.id){N.id=M+E++}return N.id};return F.Dom.batch(K,L,F.Dom,true)},isAncestor:function(L,M){L=F.Dom.get(L);if(!L||!M){return false}var K=function(O){if(L.contains&&!H){return L.contains(O)}else{if(L.compareDocumentPosition){return !!(L.compareDocumentPosition(O)&16)}else{var N=O.parentNode;while(N){if(N==L){return true}else{if(!N.tagName||N.tagName.toUpperCase()=="HTML"){return false
}}N=N.parentNode}return false}}};return F.Dom.batch(M,K,F.Dom,true)},inDocument:function(K){var L=function(M){return this.isAncestor(document.documentElement,M)};return F.Dom.batch(K,L,F.Dom,true)},getElementsBy:function(Q,L,M){L=L||"*";M=F.Dom.get(M)||document;var N=[];var P=M.getElementsByTagName(L);if(!P.length&&(L=="*"&&M.all)){P=M.all}for(var O=0,K=P.length;O<K;++O){if(Q(P[O])){N[N.length]=P[O]}}return N},batch:function(O,K,N,M){var L=O;O=F.Dom.get(O);var S=(M)?N:window;if(!O||O.tagName||!O.length){if(!O){return false
}return K.call(S,O,N)}var Q=[];for(var P=0,R=O.length;P<R;++P){if(!O[P]){L=L[P]}Q[Q.length]=K.call(S,O[P],N)}return Q},getDocumentHeight:function(){var L=-1,Q=-1,P=-1;var M=parseInt(F.Dom.getStyle(document.body,"marginTop"),10);var O=parseInt(F.Dom.getStyle(document.body,"marginBottom"),10);var N=document.compatMode;if((N||D)&&!C){switch(N){case"CSS1Compat":L=((window.innerHeight&&window.scrollMaxY)?window.innerHeight+window.scrollMaxY:-1);Q=[document.documentElement.clientHeight,self.innerHeight||-1].sort(function(S,R){return(S-R)
})[1];P=document.body.offsetHeight+M+O;break;default:L=document.body.scrollHeight;P=document.body.clientHeight}}else{L=document.documentElement.scrollHeight;Q=self.innerHeight;P=document.documentElement.clientHeight}var K=[L,Q,P].sort(function(S,R){return(S-R)});return K[2]},getDocumentWidth:function(){var N=-1,K=-1,M=-1;var P=parseInt(F.Dom.getStyle(document.body,"marginRight"),10);var O=parseInt(F.Dom.getStyle(document.body,"marginLeft"),10);var Q=document.compatMode;if(Q||D){switch(Q){case"CSS1Compat":N=document.documentElement.clientWidth;
K=document.body.offsetWidth+O+P;break;default:K=document.body.clientWidth;N=document.body.scrollWidth;break}}else{N=document.documentElement.clientWidth;K=document.body.offsetWidth+O+P}var L=Math.max(N,K);return L},getViewportHeight:function(){var K=-1;var L=document.compatMode;if((L||D)&&!C){switch(L){case"CSS1Compat":K=document.documentElement.clientHeight;break;default:K=document.body.clientHeight}}else{K=self.innerHeight}return K},getViewportWidth:function(){var K=-1;var L=document.compatMode;if(L||D){switch(L){case"CSS1Compat":K=document.documentElement.clientWidth;
break;default:K=document.body.clientWidth}}else{K=self.innerWidth}return K}}}();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom)};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left))};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);
var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B)}else{return null}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B)};YAHOO.util.Region.prototype.toString=function(){return("Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}")
};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B)};YAHOO.util.Point=function(A,B){if(A instanceof Array){B=A[1];A=A[0]}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B};YAHOO.util.Point.prototype=new YAHOO.util.Region();