(function(){var a={getSelection:function(){var b=this.jquery?this[0]:this;return(("selectionStart" in b&&function(){var c=b.selectionEnd-b.selectionStart;return{start:b.selectionStart,end:b.selectionEnd,length:c,text:b.value.substr(b.selectionStart,c)}})||(document.selection&&function(){b.focus();var d=document.selection.createRange();if(d==null){return{start:0,end:b.value.length,length:0}}var c=b.createTextRange();var e=c.duplicate();c.moveToBookmark(d.getBookmark());e.setEndPoint("EndToStart",c);return{start:e.text.length,end:e.text.length+d.text.length,length:d.text.length,text:d.text}})||function(){return{start:0,end:b.value.length,length:0}})()},replaceSelection:function(){var b=this.jquery?this[0]:this;var c=arguments[0]||"";return(("selectionStart" in b&&function(){b.value=b.value.substr(0,b.selectionStart)+c+b.value.substr(b.selectionEnd,b.value.length);return this})||(document.selection&&function(){b.focus();document.selection.createRange().text=c;return this})||function(){b.value+=c;return this})()}};jQuery.each(a,function(b){jQuery.fn[b]=this})})();function invTxtLen(e,d,c,f,a,g,b){this.eVal=$("#"+e)[0];this.eCurr=$("#"+d)[0];this.eLeft=$("#"+c)[0];this.txtMin=f;this.txtMax=a;this.cWarn=g;this.cOK=b;this.testLen=0;this.tmp="";this.calc=function(){o=this;o.getLen();if(o.txtMax>=o.testLen){o.eCurr.innerHTML=o.testLen;o.eLeft.innerHTML=(o.txtMax-o.testLen)}else{o.eVal.value=o.eVal.value.substr(0,o.txtMax);o.getLen();o.eCurr.innerHTML=o.testLen;o.eLeft.innerHTML=0}if(o.testLen<o.txtMin){o.eCurr.className=o.cWarn}else{o.eCurr.className=o.cOK}};this.getLen=function(){o=this;o.tmp=o.eVal.value;o.tmp=o.tmp.replace(/\[\/url\]/gi,"");o.tmp=o.tmp.replace(/\[url=http:\/\/.*?\]/gi,"");o.testLen=o.tmp.length}}function goSyn(a){$("#synRes").css("display","block");$("#synRes")[0].innerHTML='<img src="/i/loading.gif" alt="" />';$.ajax({url:"/ajax/synonimizerAjax.php",async:true,type:"POST",cache:false,data:"s="+$("#"+a).val().replace("&","")+"&synW="+$("#synW").val()+"&synH="+$("#synH").val(),success:function(b){$("#synRes").css("display","none");$("#synRes")[0].innerHTML=b;$("#synRes").show("slow")},error:function(b,c){alert("AJAX ERROR: "+c+" | data = "+b);$("#synRes").css("display","none")}})};
