Number.prototype.DarFormato=function(a){var b=this;var c=b.toString().indexOf(".");if(c==-1){b+=".";}else{b=b.toString().substr(0,c+a+1);}while(b.length<c+1+a){b+="0";}return b;};String.prototype.ToBR=function(){var a=new RegExp(String.fromCharCode(13),"g");var b=new RegExp(String.fromCharCode(10),"g");var c=this.replace(a,"").replace(b,"<br />");return c;};String.prototype.ToNL=function(){var a=this.replace(/<br \/>/g,String.fromCharCode(13));a=a.replace(/< br>/g,String.fromCharCode(13));a=a.replace(/<br >/g,String.fromCharCode(13));a=a.replace(/<br \/>/g,String.fromCharCode(13));a=a.replace(/<br \/>/g,String.fromCharCode(13));a=a.replace(/<br >/g,String.fromCharCode(13));a=a.replace(/< br>/g,String.fromCharCode(13));return a;};String.prototype.ToJSON=function(){try{return eval("("+this+")");}catch(e){alert(this);}};String.prototype.Trim=function(){return(this.replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,""));};String.prototype.Contains=function(a){return(this.match(a)==a);};String.prototype.StartsWith=function(a){return(this.match("^"+a)==a);};String.prototype.EndsWith=function(a){return(this.match(a+"$")==a);};String.prototype.Highlight=function(d){var a="";if(d!=undefined&&d!=""){d=d.replace(/<span style="background-color:#ddd;">/g,"").replace(/<\/span>/g,"");var c=this.length;for(var b=0;b<c;b++){if(this.substr(b,d.length).toLowerCase()==d.toLowerCase()){a+='<span style="background-color:#ddd;">'+this.substr(b,d.length)+"</span>";b+=d.length-1;}else{a+=this.substr(b,1);}}}return a;};
