YAHOO.util.Dom=function(){var ua=navigator.userAgent.toLowerCase();var _2=(ua.indexOf("opera")>-1);var _3=(ua.indexOf("safari")>-1);var _4=(window.ActiveXObject);var _5=0;var _6=YAHOO.util;var _7={};var _8=function(_9){var _a=function(_b){var _c=/(-[a-z])/i.exec(_b);return _b.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());};while(_9.indexOf("-")>-1){_9=_a(_9);}return _9;};var _d=function(_e){if(_e.indexOf("-")>-1){return _e;}var _f="";for(var i=0,len=_e.length;i<len;++i){if(_e.charAt(i)==_e.charAt(i).toUpperCase()){_f=_f+"-"+_e.charAt(i).toLowerCase();}else{_f=_f+_e.charAt(i);}}return _f;};var _11=function(_12){_7[_12]={camel:_8(_12),hyphen:_d(_12)};};return {get:function(el){if(!el){return null;}if(typeof el!="string"&&!(el instanceof Array)){return el;}if(typeof el=="string"){return document.getElementById(el);}else{var _14=[];for(var i=0,len=el.length;i<len;++i){_14[_14.length]=_6.Dom.get(el[i]);}return _14;}return null;},getStyle:function(el,_17){var f=function(el){var _1a=null;var dv=document.defaultView;if(!_7[_17]){_11(_17);}var _1c=_7[_17]["camel"];var _1d=_7[_17]["hyphen"];if(_17=="opacity"&&el.filters){_1a=1;try{_1a=el.filters.item("DXImageTransform.Microsoft.Alpha").opacity/100;}catch(e){try{_1a=el.filters.item("alpha").opacity/100;}catch(e){}}}else{if(el.style[_1c]){_1a=el.style[_1c];}else{if(_4&&el.currentStyle&&el.currentStyle[_1c]){_1a=el.currentStyle[_1c];}else{if(dv&&dv.getComputedStyle){var _1e=dv.getComputedStyle(el,"");if(_1e&&_1e.getPropertyValue(_1d)){_1a=_1e.getPropertyValue(_1d);}}}}}return _1a;};return _6.Dom.batch(el,f,_6.Dom,true);},setStyle:function(el,_20,val){if(!_7[_20]){_11(_20);}var _22=_7[_20]["camel"];var f=function(el){switch(_20){case "opacity":if(_4&&typeof el.style.filter=="string"){el.style.filter="alpha(opacity="+val*100+")";if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}else{el.style.opacity=val;el.style["-moz-opacity"]=val;el.style["-khtml-opacity"]=val;}break;default:el.style[_22]=val;}};_6.Dom.batch(el,f,_6.Dom,true);},getXY:function(el){var f=function(el){if(el.offsetParent===null||this.getStyle(el,"display")=="none"){return false;}var _28=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)&&parent.document!=document){doc=parent.document;if(!this.isAncestor(doc.documentElement,el)){return false;}}var _2c=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var _2d=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return [box.left+_2d,box.top+_2c];}else{pos=[el.offsetLeft,el.offsetTop];_28=el.offsetParent;if(_28!=el){while(_28){pos[0]+=_28.offsetLeft;pos[1]+=_28.offsetTop;_28=_28.offsetParent;}}if(_3&&this.getStyle(el,"position")=="absolute"){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}if(el.parentNode){_28=el.parentNode;}else{_28=null;}while(_28&&_28.tagName.toUpperCase()!="BODY"&&_28.tagName.toUpperCase()!="HTML"){pos[0]-=_28.scrollLeft;pos[1]-=_28.scrollTop;if(_28.parentNode){_28=_28.parentNode;}else{_28=null;}}return pos;};return _6.Dom.batch(el,f,_6.Dom,true);},getX:function(el){return _6.Dom.getXY(el)[0];},getY:function(el){return _6.Dom.getXY(el)[1];},setXY:function(el,pos,_32){var f=function(el){var _35=this.getStyle(el,"position");if(_35=="static"){this.setStyle(el,"position","relative");_35="relative";}var _36=this.getXY(el);if(_36===false){return false;}var _37=[parseInt(this.getStyle(el,"left"),10),parseInt(this.getStyle(el,"top"),10)];if(isNaN(_37[0])){_37[0]=(_35=="relative")?0:el.offsetLeft;}if(isNaN(_37[1])){_37[1]=(_35=="relative")?0:el.offsetTop;}if(pos[0]!==null){el.style.left=pos[0]-_36[0]+_37[0]+"px";}if(pos[1]!==null){el.style.top=pos[1]-_36[1]+_37[1]+"px";}var _38=this.getXY(el);if(!_32&&(_38[0]!=pos[0]||_38[1]!=pos[1])){this.setXY(el,pos,true);}};_6.Dom.batch(el,f,_6.Dom,true);},setX:function(el,x){_6.Dom.setXY(el,[x,null]);},setY:function(el,y){_6.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var _40=new YAHOO.util.Region.getRegion(el);return _40;};return _6.Dom.batch(el,f,_6.Dom,true);},getClientWidth:function(){return _6.Dom.getViewportWidth();},getClientHeight:function(){return _6.Dom.getViewportHeight();},getElementsByClassName:function(_41,tag,_43){var _44=function(el){return _6.Dom.hasClass(el,_41);};return _6.Dom.getElementsBy(_44,tag,_43);},hasClass:function(el,_47){var re=new RegExp("(?:^|\\s+)"+_47+"(?:\\s+|$)");var f=function(el){return re.test(el["className"]);};return _6.Dom.batch(el,f,_6.Dom,true);},addClass:function(el,_4c){var f=function(el){if(this.hasClass(el,_4c)){return;}el["className"]=[el["className"],_4c].join(" ");};_6.Dom.batch(el,f,_6.Dom,true);},removeClass:function(el,_50){var re=new RegExp("(?:^|\\s+)"+_50+"(?:\\s+|$)","g");var f=function(el){if(!this.hasClass(el,_50)){return;}var c=el["className"];el["className"]=c.replace(re," ");if(this.hasClass(el,_50)){this.removeClass(el,_50);}};_6.Dom.batch(el,f,_6.Dom,true);},replaceClass:function(el,_56,_57){var re=new RegExp("(?:^|\\s+)"+_56+"(?:\\s+|$)","g");var f=function(el){if(!this.hasClass(el,_56)){this.addClass(el,_57);return;}el["className"]=el["className"].replace(re," "+_57+" ");if(this.hasClass(el,_56)){this.replaceClass(el,_56,_57);}};_6.Dom.batch(el,f,_6.Dom,true);},generateId:function(el,_5c){_5c=_5c||"yui-gen";el=el||{};var f=function(el){if(el){el=_6.Dom.get(el);}else{el={};}if(!el.id){el.id=_5c+_5++;}return el.id;};return _6.Dom.batch(el,f,_6.Dom,true);},isAncestor:function(_5f,_60){_5f=_6.Dom.get(_5f);if(!_5f||!_60){return false;}var f=function(_62){if(_5f.contains&&!_3){return _5f.contains(_62);}else{if(_5f.compareDocumentPosition){return !!(_5f.compareDocumentPosition(_62)&16);}else{var _63=_62.parentNode;while(_63){if(_63==_5f){return true;}else{if(_63.tagName.toUpperCase()=="HTML"){return false;}}_63=_63.parentNode;}return false;}}};return _6.Dom.batch(_60,f,_6.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return _6.Dom.batch(el,f,_6.Dom,true);},getElementsBy:function(_67,tag,_69){tag=tag||"*";_69=_6.Dom.get(_69)||document;var _6a=[];var _6b=_69.getElementsByTagName(tag);if(!_6b.length&&(tag=="*"&&_69.all)){_6b=_69.all;}for(var i=0,len=_6b.length;i<len;++i){if(_67(_6b[i])){_6a[_6a.length]=_6b[i];}}return _6a;},batch:function(el,_6e,o,_70){var id=el;el=_6.Dom.get(el);var _72=(_70)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}return _6e.call(_72,el,o);}var _73=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=id[i];}_73[_73.length]=_6e.call(_72,el[i],o);}return _73;},getDocumentHeight:function(){var _75=-1,windowHeight=-1,bodyHeight=-1;var _76=parseInt(_6.Dom.getStyle(document.body,"marginTop"),10);var _77=parseInt(_6.Dom.getStyle(document.body,"marginBottom"),10);var _78=document.compatMode;if((_78||_4)&&!_2){switch(_78){case "CSS1Compat":_75=((window.innerHeight&&window.scrollMaxY)?window.innerHeight+window.scrollMaxY:-1);windowHeight=[document.documentElement.clientHeight,self.innerHeight||-1].sort(function(a,b){return (a-b);})[1];bodyHeight=document.body.offsetHeight+_76+_77;break;default:_75=document.body.scrollHeight;bodyHeight=document.body.clientHeight;}}else{_75=document.documentElement.scrollHeight;windowHeight=self.innerHeight;bodyHeight=document.documentElement.clientHeight;}var h=[_75,windowHeight,bodyHeight].sort(function(a,b){return (a-b);});return h[2];},getDocumentWidth:function(){var _7e=-1,bodyWidth=-1,winWidth=-1;var _7f=parseInt(_6.Dom.getStyle(document.body,"marginRight"),10);var _80=parseInt(_6.Dom.getStyle(document.body,"marginLeft"),10);var _81=document.compatMode;if(_81||_4){switch(_81){case "CSS1Compat":_7e=document.documentElement.clientWidth;bodyWidth=document.body.offsetWidth+_80+_7f;winWidth=self.innerWidth||-1;break;default:bodyWidth=document.body.clientWidth;winWidth=document.body.scrollWidth;break;}}else{_7e=document.documentElement.clientWidth;bodyWidth=document.body.offsetWidth+_80+_7f;winWidth=self.innerWidth;}var w=[_7e,bodyWidth,winWidth].sort(function(a,b){return (a-b);});return w[2];},getViewportHeight:function(){var _85=-1;var _86=document.compatMode;if((_86||_4)&&!_2){switch(_86){case "CSS1Compat":_85=document.documentElement.clientHeight;break;default:_85=document.body.clientHeight;}}else{_85=self.innerHeight;}return _85;},getViewportWidth:function(){var _87=-1;var _88=document.compatMode;if(_88||_4){switch(_88){case "CSS1Compat":_87=document.documentElement.clientWidth;break;default:_87=document.body.clientWidth;}}else{_87=self.innerWidth;}return _87;}};}();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(_8d){return (_8d.left>=this.left&&_8d.right<=this.right&&_8d.top>=this.top&&_8d.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return ((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(_8e){var t=Math.max(this.top,_8e.top);var r=Math.min(this.right,_8e.right);var b=Math.min(this.bottom,_8e.bottom);var l=Math.max(this.left,_8e.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(_93){var t=Math.min(this.top,_93.top);var r=Math.max(this.right,_93.right);var b=Math.max(this.bottom,_93.bottom);var l=Math.min(this.left,_93.left);return new YAHOO.util.Region(t,r,b,l);};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(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();