(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 f=c.duplicate();c.moveToBookmark(d.getBookmark());f.setEndPoint("EndToStart",c);return{start:f.text.length,end:f.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 invAddBBUrl(b,a){e=$("#"+b);if(e[0].value.length<a){alert("Za mało treści, trzeba wpisać jeszcze "+(a-e[0].value.length)+" znak(ów) aby dodanie linku było możliwe.");return}var c=e.getSelection();s2=c.text;if(s2==""){s2="nazwa strony"}e.replaceSelection("[url=http://]"+s2+"[/url]",true)}function invTxtLen(f,d,c,g,a,h,b){this.eVal=$("#"+f)[0];this.eCurr=$("#"+d)[0];this.eLeft=$("#"+c)[0];this.txtMin=g;this.txtMax=a;this.cWarn=h;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=.*?\].*?\[\/url\]/gi,"");o.tmp=o.tmp.replace(/\[\/url\]/gi,"");o.tmp=o.tmp.replace(/\[url=.*?\]/gi,"");o.testLen=o.tmp.length}}function inv_refCaptcha(a){if(inv_captchaSynch!=0){return}inv_captchaSynch=1;$("#cref")[0].innerHTML="";r=Math.random();if(a=""){ad=""}else{ad="p="+a+"&amp;"}$("#inv_captcha")[0].innerHTML='<img src="/create_captcha.php?'+ad+"tmp="+r+'" alt="proszę czekać..."  />';setTimeout("inv_refCaptcha2()",3000)};
