(function(){var c=YAHOO.util,j,h,g=0,i={};var b=navigator.userAgent.toLowerCase(),d=(b.indexOf("opera")>-1),k=(b.indexOf("safari")>-1),a=(!d&&!k&&b.indexOf("gecko")>-1),f=(!d&&b.indexOf("msie")>-1);var e={HYPHEN:/(-[a-z])/i};var l=function(m){if(!e.HYPHEN.test(m)){return m}if(i[m]){return i[m]}while(e.HYPHEN.exec(m)){m=m.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase())}i[m]=m;return m};if(document.defaultView&&document.defaultView.getComputedStyle){j=function(m,p){var o=null;var n=document.defaultView.getComputedStyle(m,"");if(n){o=n[l(p)]}return m.style[p]||o}}else{if(document.documentElement.currentStyle&&f){j=function(m,o){switch(l(o)){case"opacity":var q=100;try{q=m.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(p){try{q=m.filters("alpha").opacity}catch(p){}}return q/100;break;default:var n=m.currentStyle?m.currentStyle[o]:null;return(m.style[o]||n)}}}else{j=function(m,n){return m.style[n]}}}if(f){h=function(m,n,o){switch(n){case"opacity":if(typeof m.style.filter=="string"){m.style.filter="alpha(opacity="+o*100+")";if(!m.currentStyle||!m.currentStyle.hasLayout){m.style.zoom=1}}break;default:m.style[n]=o}}}else{h=function(m,n,o){m.style[n]=o}}YAHOO.util.Dom={get:function(o){if(!o){return null}if(typeof o!="string"&&!(o instanceof Array)){return o}if(typeof o=="string"){return document.getElementById(o)}else{var p=[];for(var n=0,m=o.length;n<m;++n){p[p.length]=c.Dom.get(o[n])}return p}return null},getStyle:function(m,o){o=l(o);var n=function(p){return j(p,o)};return c.Dom.batch(m,n,c.Dom,true)},setStyle:function(m,o,p){o=l(o);var n=function(q){h(q,o,p)};c.Dom.batch(m,n,c.Dom,true)},getXY:function(m){var n=function(p){if(p.parentNode===null||p.offsetParent===null||this.getStyle(p,"display")=="none"){return false}var o=null;var u=[];var q;if(p.getBoundingClientRect){q=p.getBoundingClientRect();var s=document;if(!this.inDocument(p)&&parent.document!=document){s=parent.document;if(!this.isAncestor(s.documentElement,p)){return false}}var r=Math.max(s.documentElement.scrollTop,s.body.scrollTop);var t=Math.max(s.documentElement.scrollLeft,s.body.scrollLeft);return[q.left+t,q.top+r]}else{u=[p.offsetLeft,p.offsetTop];o=p.offsetParent;if(o!=p){while(o){u[0]+=o.offsetLeft;u[1]+=o.offsetTop;o=o.offsetParent}}if(k&&this.getStyle(p,"position")=="absolute"){u[0]-=document.body.offsetLeft;u[1]-=document.body.offsetTop}}if(p.parentNode){o=p.parentNode}else{o=null}while(o&&o.tagName.toUpperCase()!="BODY"&&o.tagName.toUpperCase()!="HTML"){if(c.Dom.getStyle(o,"display")!="inline"){u[0]-=o.scrollLeft;u[1]-=o.scrollTop}if(o.parentNode){o=o.parentNode}else{o=null}}return u};return c.Dom.batch(m,n,c.Dom,true)},getX:function(m){var n=function(o){return c.Dom.getXY(o)[0]};return c.Dom.batch(m,n,c.Dom,true)},getY:function(m){var n=function(o){return c.Dom.getXY(o)[1]};return c.Dom.batch(m,n,c.Dom,true)},setXY:function(m,p,o){var n=function(s){var r=this.getStyle(s,"position");if(r=="static"){this.setStyle(s,"position","relative");r="relative"}var u=this.getXY(s);if(u===false){return false}var t=[parseInt(this.getStyle(s,"left"),10),parseInt(this.getStyle(s,"top"),10)];if(isNaN(t[0])){t[0]=(r=="relative")?0:s.offsetLeft}if(isNaN(t[1])){t[1]=(r=="relative")?0:s.offsetTop}if(p[0]!==null){s.style.left=p[0]-u[0]+t[0]+"px"}if(p[1]!==null){s.style.top=p[1]-u[1]+t[1]+"px"}if(!o){var q=this.getXY(s);if((p[0]!==null&&q[0]!=p[0])||(p[1]!==null&&q[1]!=p[1])){this.setXY(s,p,true)}}};c.Dom.batch(m,n,c.Dom,true)},setX:function(n,m){c.Dom.setXY(n,[m,null])},setY:function(m,n){c.Dom.setXY(m,[null,n])},getRegion:function(m){var n=function(o){var p=new c.Region.getRegion(o);return p};return c.Dom.batch(m,n,c.Dom,true)},getClientWidth:function(){return c.Dom.getViewportWidth()},getClientHeight:function(){return c.Dom.getViewportHeight()},getElementsByClassName:function(o,m,n){var p=function(q){return c.Dom.hasClass(q,o)};return c.Dom.getElementsBy(p,m,n)},hasClass:function(o,n){var m=new RegExp("(?:^|\\s+)"+n+"(?:\\s+|$)");var p=function(q){return m.test(q.className)};return c.Dom.batch(o,p,c.Dom,true)},addClass:function(n,m){var o=function(p){if(this.hasClass(p,m)){return}p.className=[p.className,m].join(" ")};c.Dom.batch(n,o,c.Dom,true)},removeClass:function(o,n){var m=new RegExp("(?:^|\\s+)"+n+"(?:\\s+|$)","g");var p=function(q){if(!this.hasClass(q,n)){return}var r=q.className;q.className=r.replace(m," ");if(this.hasClass(q,n)){this.removeClass(q,n)}};c.Dom.batch(o,p,c.Dom,true)},replaceClass:function(p,n,m){if(n===m){return false}var o=new RegExp("(?:^|\\s+)"+n+"(?:\\s+|$)","g");var q=function(r){if(!this.hasClass(r,n)){this.addClass(r,m);return}r.className=r.className.replace(o," "+m+" ");if(this.hasClass(r,n)){this.replaceClass(r,n,m)}};c.Dom.batch(p,q,c.Dom,true)},generateId:function(m,o){o=o||"yui-gen";m=m||{};var n=function(p){if(p){p=c.Dom.get(p)}else{p={}}if(!p.id){p.id=o+g++}return p.id};return c.Dom.batch(m,n,c.Dom,true)},isAncestor:function(n,o){n=c.Dom.get(n);if(!n||!o){return false}var m=function(q){if(n.contains&&!k){return n.contains(q)}else{if(n.compareDocumentPosition){return !!(n.compareDocumentPosition(q)&16)}else{var p=q.parentNode;while(p){if(p==n){return true}else{if(!p.tagName||p.tagName.toUpperCase()=="HTML"){return false}}p=p.parentNode}return false}}};return c.Dom.batch(o,m,c.Dom,true)},inDocument:function(m){var n=function(o){return this.isAncestor(document.documentElement,o)};return c.Dom.batch(m,n,c.Dom,true)},getElementsBy:function(s,n,o){n=n||"*";var p=[];if(o){o=c.Dom.get(o);if(!o){return p}}else{o=document}var r=o.getElementsByTagName(n);if(!r.length&&(n=="*"&&o.all)){r=o.all}for(var q=0,m=r.length;q<m;++q){if(s(r[q])){p[p.length]=r[q]}}return p},batch:function(r,m,q,p){var n=r;r=c.Dom.get(r);var v=(p)?q:window;if(!r||r.tagName||!r.length){if(!r){return false}return m.call(v,r,q)}var t=[];for(var s=0,u=r.length;s<u;++s){if(!r[s]){n=r[s]}t[t.length]=m.call(v,r[s],q)}return t},getDocumentHeight:function(){var n=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;var m=Math.max(n,c.Dom.getViewportHeight());return m},getDocumentWidth:function(){var n=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;var m=Math.max(n,c.Dom.getViewportWidth());return m},getViewportHeight:function(){var m=self.innerHeight;var n=document.compatMode;if((n||f)&&!d){m=(n=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return m},getViewportWidth:function(){var m=self.innerWidth;var n=document.compatMode;if(n||f){m=(n=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth}return m}}})();YAHOO.util.Region=function(d,e,a,c){this.top=d;this[1]=d;this.right=e;this.bottom=a;this.left=c;this[0]=c};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(f){var d=Math.max(this.top,f.top);var e=Math.min(this.right,f.right);var a=Math.min(this.bottom,f.bottom);var c=Math.max(this.left,f.left);if(a>=d&&e>=c){return new YAHOO.util.Region(d,e,a,c)}else{return null}};YAHOO.util.Region.prototype.union=function(f){var d=Math.min(this.top,f.top);var e=Math.max(this.right,f.right);var a=Math.max(this.bottom,f.bottom);var c=Math.min(this.left,f.left);return new YAHOO.util.Region(d,e,a,c)};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(e){var g=YAHOO.util.Dom.getXY(e);var d=g[1];var f=g[0]+e.offsetWidth;var a=g[1]+e.offsetHeight;var c=g[0];return new YAHOO.util.Region(d,f,a,c)};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();