String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};String.prototype.ltrim=function(){return this.replace(/^\s*/g,"")};String.prototype.rtrim=function(){return this.replace(/\s*$/g,"")};String.prototype.is_numeric=function(){return/^[+-]{0,1}[0-9]+$/.test(this)};String.prototype.is_mail=function(){return/^[a-z0-9]([.]?[\w-])*@[a-z0-9]([.]?[\w-])*[.][a-z]{2,3}$/i.test(this)};String.prototype.br2nl=function(){return this.replace(/<br \/>/g,"\n")};String.prototype.nl2br=function(){return this.replace(/\n/g,"<br />")};String.prototype.HTMLEncode=function(){var a=this.replace(/&/g,"&amp;");a=a.replace(/"/g,"&quot;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a=a.replace(/'/g,"&#39;")};function dataValida(a,b,c){b--;dt=new Date(a,b,c);return dt.getFullYear()==a&&dt.getMonth()==b&&dt.getDate()==c}
function ocu_mos(a){var b=document.getElementById(a),c="",d="grafics/text_ocultar.png";if(b.style.display!="none"){c="none";d="grafics/text_mostrar.png"}b.style.display=c;document.getElementById("img_"+a).src=d}var editor={};editor.isMax=[];editor.maximitza=function(a,b,c){a=a+b;b="editorTextArea"+b;valor=document.getElementById(a).value;ax=document.getElementById("aux");ej=document.getElementById("empordajove");if(this.isMax[a]){ax.style.display="none";ax.style.width="100%";copiaDiv=ax.innerHTML;ax.innerHTML="";ej.style.display="block";document.getElementById(b).innerHTML=copiaDiv;document.getElementById(a).style.height=c+"px";parent.scrollTo(0,document.getElementById(b).offsetTop);this.isMax[a]=false}else{if(parent.innerWidth)frameHeight=parent.innerHeight;else if(document.documentElement&&document.documentElement.clientWidth)frameHeight=document.documentElement.clientHeight;else if(document.body)frameHeight=document.body.clientHeight;else return;ej.style.display="none";copiaDiv=document.getElementById(b).innerHTML;document.getElementById(b).innerHTML="";ax.style.display="block";ax.style.width="99%";ax.innerHTML=copiaDiv;document.getElementById(a).style.height=frameHeight-document.getElementById(a).offsetTop-10+"px";parent.scrollTo(0,0);this.isMax[a]=true}document.getElementById(a).value=valor};function stats(a){var b=document.createElement("script");b.type="text/javascript";b.src="estats/script.php?i="+a+"&x="+window.screen.width+"&y="+window.screen.height+"&z="+window.screen.colorDepth;document.getElementsByTagName("head")[0].appendChild(b)}
function inserirtxt(a,b){txtarea=document.getElementById(a);txtarea.focus();if(document.selection)document.selection.createRange().text=b;else if(txtarea.selectionStart>=0){var c=txtarea.selectionStart,d=txtarea.selectionEnd;txtarea.value=txtarea.value.substring(0,c)+b+txtarea.value.substring(d,txtarea.textLength);if(c!=d){txtarea.selectionStart=c;txtarea.selectionEnd=c+b.length}else txtarea.selectionStart=txtarea.selectionEnd=c+b.length}else txtarea.value+=b}
function inserirtxt2(a,b,c){txtarea=document.getElementById(a);txtarea.focus();if(document.selection){txt=document.selection.createRange().text;document.selection.createRange().text=b+txt+c}else if(txtarea.selectionStart>=0){a=txtarea.selectionStart;var d=txtarea.selectionEnd;txtarea.value=txtarea.value.substring(0,a)+b+txtarea.value.substring(a,d)+c+txtarea.value.substring(d,txtarea.textLength);if(a!=d){txtarea.selectionStart=a;txtarea.selectionEnd=a+b.length+(d-a)+c.length}else txtarea.selectionStart=txtarea.selectionEnd=a+b.length}else txtarea.value+=b+c}
function inserirtxt3(a,b,c,d){txtarea=document.getElementById(a);txtarea.focus();if(document.selection){txt=document.selection.createRange().text;document.selection.createRange().text=b+txt+c+txt+d}else if(txtarea.selectionStart>=0){a=txtarea.selectionStart;var e=txtarea.selectionEnd;txtarea.value=txtarea.value.substring(0,a)+b+txtarea.value.substring(a,e)+c+txtarea.value.substring(a,e)+d+txtarea.value.substring(e,txtarea.textLength);if(a!=e){txtarea.selectionStart=a;txtarea.selectionEnd=a+b.length+(e-a)*2+c.length+d.length}else txtarea.selectionStart=txtarea.selectionEnd=a+b.length}else txtarea.value+=b+c+d}function canviaTxtMida(a,b){var c=document.getElementById(a).style.fontSize;if(c.length!=0){c=parseInt(c.replace(/(\D)/g,""));if(c<50)c=100}else c=100;if(b==0){if(c>=100)c-=25}else if(c<500)c+=25;document.getElementById(a).style.fontSize=c+"%"};

