Tmobile.util.Dom=function(){var b=navigator.userAgent.toLowerCase();var a=0;return{get:function(e){if(typeof e!="string"&&!(e instanceof Array)){return e}if(typeof e=="string"){return document.getElementById(e)}else{var f=[];for(var d=0,c=e.length;d<c;++d){f[f.length]=this.get(e[d])}return f}return null},getStyle:function(c,e){var d=function(k,g){var l=null;var j=document.defaultView;if(e=="opacity"&&k.filters){l=1;try{l=k.filters.item("DXImageTransform.Microsoft.Alpha").opacity/100}catch(n){try{l=k.filters.item("alpha").opacity/100}catch(n){}}}else{if(k.style[e]){l=k.style[e]}else{if(k.currentStyle&&k.currentStyle[e]){l=k.currentStyle[e]}else{if(j&&j.getComputedStyle){var m="";for(var h=0,f=e.length;h<f;++h){if(e.charAt(h)==e.charAt(h).toUpperCase()){m=m+"-"+e.charAt(h).toLowerCase()}else{m=m+e.charAt(h)}}if(j.getComputedStyle(k,"")&&j.getComputedStyle(k,"").getPropertyValue(m)){l=j.getComputedStyle(k,"").getPropertyValue(m)}}}}}return l};return this.batch(c,d,this)},setStyle:function(c,e,g){var d=function(h,f){switch(e){case"opacity":if(h.filters){h.style.filter="alpha(opacity="+g*100+")";if(!h.currentStyle.hasLayout){h.style.zoom=1}}else{h.style.opacity=g;h.style["-moz-opacity"]=g;h.style["-khtml-opacity"]=g}break;default:h.style[e]=g}};this.batch(c,d,this)},getXY:function(c){var d=function(g,e){if(g.parentNode===null||e.getStyle(g,"display")=="none"){return false}var f=null;var k=[];var h;if(g.getBoundingClientRect){h=g.getBoundingClientRect();Math.max(document.documentElement.scrollTop,document.body.scrollTop);var i=Math.max(document.documentElement.scrollTop,document.body.scrollTop);var j=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);return[h.left+j,h.top+i]}else{if(document.getBoxObjectFor){h=document.getBoxObjectFor(g);k=[h.x,h.y]}else{k=[g.offsetLeft,g.offsetTop];f=g.offsetParent;if(f!=g){while(f){k[0]+=f.offsetLeft;k[1]+=f.offsetTop;f=f.offsetParent}}if(b.indexOf("opera")!=-1||(b.indexOf("safari")!=-1&&e.getStyle(g,"position")=="absolute")){k[0]-=document.body.offsetLeft;k[1]-=document.body.offsetTop}}}if(g.parentNode){f=g.parentNode}else{f=null}while(f&&f.tagName!="BODY"&&f.tagName!="HTML"){k[0]-=f.scrollLeft;k[1]-=f.scrollTop;if(f.parentNode){f=f.parentNode}else{f=null}}return k};return this.batch(c,d,this)},getX:function(c){return this.getXY(c)[0]},getY:function(c){return this.getXY(c)[1]},setXY:function(c,g,e){var d=function(k,i){var j=i.getStyle(k,"position");if(j=="static"){i.setStyle(k,"position","relative");j="relative"}var m=Tmobile.util.Dom.getXY(k);if(m===false){return false}var l=[parseInt(Tmobile.util.Dom.getStyle(k,"left"),10),parseInt(Tmobile.util.Dom.getStyle(k,"top"),10)];if(isNaN(l[0])){l[0]=(j=="relative")?0:k.offsetLeft}if(isNaN(l[1])){l[1]=(j=="relative")?0:k.offsetTop}if(g[0]!==null){k.style.left=g[0]-m[0]+l[0]+"px"}if(g[1]!==null){k.style.top=g[1]-m[1]+l[1]+"px"}var f=i.getXY(k);if(!e&&(f[0]!=g[0]||f[1]!=g[1])){var h=function(){Tmobile.util.Dom.setXY(k,g,true)};setTimeout(h,0)}};this.batch(c,d,this)},setX:function(d,c){this.setXY(d,[c,null])},setY:function(c,d){this.setXY(c,[null,d])},getRegion:function(c){var d=function(f,e){return new Tmobile.util.Region.getRegion(f)};return this.batch(c,d,this)},getClientWidth:function(){return(document.documentElement.offsetWidth||document.body.offsetWidth)},getClientHeight:function(){return(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)},getElementsByClassName:function(f,c,d){var e=new RegExp("(?:^|\\s+)"+f+"(?:\\s+|$)");var g=function(h){return e.test(h.className)};return this.getElementsBy(g,c,d)},hasClass:function(d,c){var e=function(h,f){var g=new RegExp("(?:^|\\s+)"+c+"(?:\\s+|$)");return g.test(h.className)};return this.batch(d,e,this)},addClass:function(d,c){var e=function(g,f){if(f.hasClass(g,c)){return}g.className=[g.className,c].join(" ")};this.batch(d,e,this)},removeClass:function(d,c){var e=function(h,f){if(!f.hasClass(h,c)){return}var g=new RegExp("(?:^|\\s+)"+c+"(?:\\s+|$)","g");var i=h.className;h.className=i.replace(g," ")};this.batch(d,e,this)},replaceClass:function(e,d,c){var g=function(h,f){f.removeClass(h,d);f.addClass(h,c)};this.batch(e,g,this)},generateId:function(c,e){e=e||"yui-gen";var d=function(g,f){g=g||{};if(!g.id){g.id=e+a++}return g.id};return this.batch(c,d,this)},isAncestor:function(d,e){d=this.get(d);if(!d||!e){return false}var c=function(h,f){if(d.contains&&b.indexOf("safari")<0){return d.contains(h)}else{if(d.compareDocumentPosition){return !!(d.compareDocumentPosition(h)&16)}else{var g=h.parentNode;while(g){if(g==d){return true}else{if(g.tagName=="HTML"){return false}}g=g.parentNode}return false}}};return this.batch(e,c,this)},inDocument:function(c){var d=function(f,e){return e.isAncestor(document.documentElement,f)};return this.batch(c,d,this)},getElementsBy:function(j,d,e){d=d||"*";e=this.get(e)||document;var f=[];var h=e.getElementsByTagName(d);for(var g=0,c=h.length;g<c;++g){if(j(h[g])){f[f.length]=h[g]}}return f},batch:function(e,h,g){e=this.get(e);if(!e||!e.length){return h(e,g)}var f=[];for(var d=0,c=e.length;d<c;++d){f[f.length]=h(e[d],g)}return f}}}();Tmobile.util.Region=function(d,e,a,c){this.top=d;this.right=e;this.bottom=a;this.left=c};Tmobile.util.Region.prototype.contains=function(a){return(a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom)};Tmobile.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left))};Tmobile.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 Tmobile.util.Region(d,e,a,c)}else{return null}};Tmobile.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 Tmobile.util.Region(d,e,a,c)};Tmobile.util.Region.prototype.toString=function(){return("Region {  t: "+this.top+", r: "+this.right+", b: "+this.bottom+", l: "+this.left+"}")};Tmobile.util.Region.getRegion=function(e){var g=Tmobile.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 Tmobile.util.Region(d,f,a,c)};Tmobile.util.Point=function(a,b){this.x=a;this.y=b;this.top=b;this.right=a;this.bottom=b;this.left=a};Tmobile.util.Point.prototype=new Tmobile.util.Region();