var DyTeRe=new Class({Implements:[Options,Events],options:{fSize:12,fColor:null,useWordwrap:true,addImageSize:false,onReplaced:$empty(),onReplacementComplete:$empty()},initialize:function(d,a,c){this.setOptions(c);if(!$chk(a)||!$chk(d)){return}this.requestFile=a;this.elements=($type(d)=="string")?$$(d):d;this.elementToReplace=null;this.elements.filter(function(e){return($chk(e.get("text")))?true:false});var b=this.elements.length;if(this.elements.length>0){this.elements.each(function(f,g){var h=this.getText(f);var e=this.getColor(f);this.elementToReplace=f;this.elementToReplace.empty();f.empty();h.each(function(k,j){if(j>0){k=" "+k}this.buildImage(escape(k),e)}.bind(this));if(g==(b-1)){this.fireEvent("onReplacementComplete",this)}}.bind(this))}},buildImage:function(e,c){var b=this;var d=((this.requestFile.contains("?"))?"&":"?")+"text="+e+"&fsize="+this.options.fSize+"&fcolor="+c;var a=new Asset.image(this.requestFile+d,{id:"myImage",alt:unescape(e).clean(),onload:function(){b.fireEvent("onReplaced",this)}}).inject(this.elementToReplace);if(this.options.addImageSize==true){a.set({width:a.getSize().x,height:a.getSize().y})}},getText:function(a){var b=($chk(a.get("text")))?a.get("text"):null;if(b){if(this.options.useWordwrap){b=b.split(" ")}else{b=$splat(b)}}return b},getColor:function(a){return(!$defined(this.options.fColor))?a.getStyle("color").replace(/#/,""):this.options.fColor.replace(/#/,"")}});