MooTools.More={version:"1.4.0.1",build:"a4244edf2aa97ac8a196fc96082dd35af1abab87"},Class.Mutators.Binds=function(a){return this.prototype.initialize||this.implement("initialize",function(){}),Array.from(a).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(a){return function(){return Array.from(this.Binds).each(function(a){var b=this[a];b&&(this[a]=b.bind(this))},this),a.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(a,b){b=document.id(b||this.element);var c=b.retrieve(a||this.property);return c&&!this.occluded?this.occluded=c:(this.occluded=!1,b.store(a||this.property,this),this.occluded)}}),function(){var a=function(a,b){var c=[];return Object.each(b,function(b){Object.each(b,function(b){a.each(function(a){c.push(a+"-"+b+(a=="border"?"-width":""))})})}),c},b=function(a,b){var c=0;return Object.each(b,function(b,d){d.test(a)&&(c=c+b.toInt())}),c},c=function(a){return!!(!a||a.offsetHeight||a.offsetWidth)};Element.implement({measure:function(a){if(c(this))return a.call(this);var b=this.getParent(),d=[];while(!c(b)&&b!=document.body)d.push(b.expose()),b=b.getParent();var e=this.expose(),f=a.call(this);return e(),d.each(function(a){a()}),f},expose:function(){if(this.getStyle("display")!="none")return function(){};var a=this.style.cssText;return this.setStyles({display:"block",position:"absolute",visibility:"hidden"}),function(){this.style.cssText=a}.bind(this)},getDimensions:function(a){a=Object.merge({computeSize:!1},a);var b={x:0,y:0},c=function(a,b){return b.computeSize?a.getComputedSize(b):a.getSize()},d=this.getParent("body");if(d&&this.getStyle("display")=="none")b=this.measure(function(){return c(this,a)});else if(d)try{b=c(this,a)}catch(e){}return Object.append(b,b.x||b.x===0?{width:b.x,height:b.y}:{x:b.width,y:b.height})},getComputedSize:function(c){c=Object.merge({styles:["padding","border"],planes:{height:["top","bottom"],width:["left","right"]},mode:"both"},c);var d={},e={width:0,height:0},f;return c.mode=="vertical"?(delete e.width,delete c.planes.width):c.mode=="horizontal"&&(delete e.height,delete c.planes.height),a(c.styles,c.planes).each(function(a){d[a]=this.getStyle(a).toInt()},this),Object.each(c.planes,function(a,c){var g=c.capitalize(),h=this.getStyle(c);h=="auto"&&!f&&(f=this.getDimensions()),h=d[c]=h=="auto"?f[c]:h.toInt(),e["total"+g]=h,a.each(function(a){var c=b(a,d);e["computed"+a.capitalize()]=c,e["total"+g]+=c})},this),Object.append(e,d)}})}(),function(a){var b=Element.Position={options:{relativeTo:document.body,position:{x:"center",y:"center"},offset:{x:0,y:0}},getOptions:function(a,c){return c=Object.merge({},b.options,c),b.setPositionOption(c),b.setEdgeOption(c),b.setOffsetOption(a,c),b.setDimensionsOption(a,c),c},setPositionOption:function(a){a.position=b.getCoordinateFromValue(a.position)},setEdgeOption:function(a){var c=b.getCoordinateFromValue(a.edge);a.edge=c?c:a.position.x=="center"&&a.position.y=="center"?{x:"center",y:"center"}:{x:"left",y:"top"}},setOffsetOption:function(a,b){var c={x:0,y:0},d=a.measure(function(){return document.id(this.getOffsetParent())}),e=d.getScroll();if(!d||d==a.getDocument().body)return;c=d.measure(function(){var a=this.getPosition();if(this.getStyle("position")=="fixed"){var b=window.getScroll();a.x+=b.x,a.y+=b.y}return a}),b.offset={parentPositioned:d!=document.id(b.relativeTo),x:b.offset.x-c.x+e.x,y:b.offset.y-c.y+e.y}},setDimensionsOption:function(a,b){b.dimensions=a.getDimensions({computeSize:!0,styles:["padding","border","margin"]})},getPosition:function(a,c){var d={};c=b.getOptions(a,c);var e=document.id(c.relativeTo)||document.body;b.setPositionCoordinates(c,d,e),c.edge&&b.toEdge(d,c);var f=c.offset;return d.left=(d.x>=0||f.parentPositioned||c.allowNegative?d.x:0).toInt(),d.top=(d.y>=0||f.parentPositioned||c.allowNegative?d.y:0).toInt(),b.toMinMax(d,c),(c.relFixedPosition||e.getStyle("position")=="fixed")&&b.toRelFixedPosition(e,d),c.ignoreScroll&&b.toIgnoreScroll(e,d),c.ignoreMargins&&b.toIgnoreMargins(d,c),d.left=Math.ceil(d.left),d.top=Math.ceil(d.top),delete d.x,delete d.y,d},setPositionCoordinates:function(a,b,c){var d=a.offset.y,e=a.offset.x,f=c==document.body?window.getScroll():c.getPosition(),g=f.y,h=f.x,i=window.getSize();switch(a.position.x){case"left":b.x=h+e;break;case"right":b.x=h+e+c.offsetWidth;break;default:b.x=h+(c==document.body?i.x:c.offsetWidth)/2+e}switch(a.position.y){case"top":b.y=g+d;break;case"bottom":b.y=g+d+c.offsetHeight;break;default:b.y=g+(c==document.body?i.y:c.offsetHeight)/2+d}},toMinMax:function(a,b){var c={left:"x",top:"y"},d;["minimum","maximum"].each(function(e){["left","top"].each(function(f){d=b[e]?b[e][c[f]]:null,d!=null&&(e=="minimum"?a[f]<d:a[f]>d)&&(a[f]=d)})})},toRelFixedPosition:function(a,b){var c=window.getScroll();b.top+=c.y,b.left+=c.x},toIgnoreScroll:function(a,b){var c=a.getScroll();b.top-=c.y,b.left-=c.x},toIgnoreMargins:function(a,b){a.left+=b.edge.x=="right"?b.dimensions["margin-right"]:b.edge.x!="center"?-b.dimensions["margin-left"]:-b.dimensions["margin-left"]+(b.dimensions["margin-right"]+b.dimensions["margin-left"])/2,a.top+=b.edge.y=="bottom"?b.dimensions["margin-bottom"]:b.edge.y!="center"?-b.dimensions["margin-top"]:-b.dimensions["margin-top"]+(b.dimensions["margin-bottom"]+b.dimensions["margin-top"])/2},toEdge:function(a,b){var c={},d=b.dimensions,e=b.edge;switch(e.x){case"left":c.x=0;break;case"right":c.x=-d.x-d.computedRight-d.computedLeft;break;default:c.x=-Math.round(d.totalWidth/2)}switch(e.y){case"top":c.y=0;break;case"bottom":c.y=-d.y-d.computedTop-d.computedBottom;break;default:c.y=-Math.round(d.totalHeight/2)}a.x+=c.x,a.y+=c.y},getCoordinateFromValue:function(a){return typeOf(a)!="string"?a:(a=a.toLowerCase(),{x:a.test("left")?"left":a.test("right")?"right":"center",y:a.test(/upper|top/)?"top":a.test("bottom")?"bottom":"center"})}};Element.implement({position:function(b){if(!b||b.x==null&&b.y==null){var c=this.setStyle("position","absolute").calculatePosition(b);return b&&b.returnPos?c:this.setStyles(c)}return a?a.apply(this,arguments):this},calculatePosition:function(a){return b.getPosition(this,a)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"},isVisible:function(){var a=this.offsetWidth,b=this.offsetHeight;return a==0&&b==0?!1:a>0&&b>0?!0:this.style.display!="none"},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){var a;try{a=this.getStyle("display")}catch(b){}return a=="none"?this:this.store("element:_originalDisplay",a||"").setStyle("display","none")},show:function(a){return!a&&this.isDisplayed()?this:(a=a||this.retrieve("element:_originalDisplay")||"block",this.setStyle("display",a=="none"?"block":a))},swapClass:function(a,b){return this.removeClass(a).addClass(b)}}),Document.implement({clearSelection:function(){if(window.getSelection){var a=window.getSelection();a&&a.removeAllRanges&&a.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(b){}}});var OverText=new Class({Implements:[Options,Events,Class.Occlude],Binds:["reposition","assert","focus","hide"],options:{element:"label",labelClass:"overTxtLabel",positionOptions:{position:"upperLeft",edge:"upperLeft",offset:{x:4,y:2}},poll:!1,pollInterval:250,wrap:!1},property:"OverText",initialize:function(a,b){a=this.element=document.id(a);if(this.occlude())return this.occluded;this.setOptions(b),this.attach(a),OverText.instances.push(this),this.options.poll&&this.poll()},toElement:function(){return this.element},attach:function(){var a=this.element,b=this.options,c=b.textOverride||a.get("alt")||a.get("title");if(!c)return this;var d=this.text=(new Element(b.element,{"class":b.labelClass,styles:{lineHeight:"normal",position:"absolute",cursor:"text"},html:c,events:{click:this.hide.pass(b.element=="label",this)}})).inject(a,"after");return b.element=="label"&&(a.get("id")||a.set("id","input_"+String.uniqueID()),d.set("for",a.get("id"))),b.wrap&&(this.textHolder=(new Element("div.overTxtWrapper",{styles:{lineHeight:"normal",position:"relative"}})).grab(d).inject(a,"before")),this.enable()},destroy:function(){return this.element.eliminate(this.property),this.disable(),this.text&&this.text.destroy(),this.textHolder&&this.textHolder.destroy(),this},disable:function(){return this.element.removeEvents({focus:this.focus,blur:this.assert,change:this.assert}),window.removeEvent("resize",this.reposition),this.hide(!0,!0),this},enable:function(){return this.element.addEvents({focus:this.focus,blur:this.assert,change:this.assert}),window.addEvent("resize",this.reposition),this.reposition(),this},wrap:function(){this.options.element=="label"&&(this.element.get("id")||this.element.set("id","input_"+String.uniqueID()),this.text.set("for",this.element.get("id")))},startPolling:function(){return this.pollingPaused=!1,this.poll()},poll:function(a){return this.poller&&!a?this:(a?clearInterval(this.poller):this.poller=function(){this.pollingPaused||this.assert(!0)}.periodical(this.options.pollInterval,this),this)},stopPolling:function(){return this.pollingPaused=!0,this.poll(!0)},focus:function(){return this.text&&(!this.text.isDisplayed()||this.element.get("disabled"))?this:this.hide()},hide:function(a,b){if(this.text&&this.text.isDisplayed()&&(!this.element.get("disabled")||b)){this.text.hide(),this.fireEvent("textHide",[this.text,this.element]),this.pollingPaused=!0;if(!a)try{this.element.fireEvent("focus"),this.element.focus()}catch(c){}}return this},show:function(){return this.text&&!this.text.isDisplayed()&&(this.text.show(),this.reposition(),this.fireEvent("textShow",[this.text,this.element]),this.pollingPaused=!1),this},test:function(){return!this.element.get("value")},assert:function(a){return this[this.test()?"show":"hide"](a)},reposition:function(){return this.assert(!0),this.element.isVisible()?(this.text&&this.test()&&this.text.position(Object.merge(this.options.positionOptions,{relativeTo:this.element})),this):this.stopPolling().hide()}});OverText.instances=[],Object.append(OverText,{each:function(a){return OverText.instances.each(function(b,c){b.element&&b.text&&a.call(OverText,b,c)})},update:function(){return OverText.each(function(a){return a.reposition()})},hideAll:function(){return OverText.each(function(a){return a.hide(!0,!0)})},showAll:function(){return OverText.each(function(a){return a.show()})}})
