/*
**** LICENCE AGREEMENT **** 
This code is the property of www.pcinfo-web.com, and under Creative Common (Non Commercial, Paternity, Share Alike) Licence.
You can free distribte and modify this code but you can't :
* Use it for commercial purpose without the express permission of the author ( http://www.pcinfo-web.com/contact.php )

You also must : 
* Quote the author and the origin of the code, by keeping this licence at the top of the code
* Distribute the code and you modifications under the same licence

If you don't respect these conditions, you also make an illegal utilisationn of this work and you expose yourself to law-suit.

You can view a copy of this licence at this page : http://creativecommons.org/licenses/by-nc-sa/2.0/fr/deed.en_GB
****************************

function badtags()
This function checks if the BBcode tags of a string are correctly opened and closed.
If not, the function rectifies.

@param str : form element (if @param replace on true) or string to check
@param disp : write the result of the function
@param verbose : debug option : write the path of the script and the result

Warning : if @param replace on true be careful that str be a form element and not a string.

*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3(w(D)!="s"){s D(a,b,c){2 i=0;1r(i!=-1){i=c.1s(E(a),i);3(i>=0){c=c.1a(0,i)+b+c.1a(i+a.4);i+=b.4}}z c}}2 L=E.1t(5,6,7);3(w(16)!="s"){s 16(t){x=F E(t);x=x.v(/\\r\\n/g,L);x=x.v(/\\n/g,L);z x}}3(w(17)!="s"){s 17(t){x=F E(t);z x.v(F 1u(L,\'g\'),\'\\n\')}}s 1b(a){2 b=a.M(/\\[9\\](.*?)\\[\\/9\\]/y);2 c=F 1c();3(w(b)!=\'G\'&&b!=I&&b.4>=1){3(w(b[1])!=\'G\'){H(2 i=0;i<b.4;i++){c[i]=p(/\\[9\\](.*?)\\[\\/9\\]/y,\'$1\',b[i]);c[i]=p(/\\[/g,\'&#A;\',c[i]);c[i]=p(/\\]/g,\'&#B;\',c[i]);c[i]="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f+="J 15 dé1hée<8 />";3(e.4>=1){f+="<8 />1z 18 19 1A : "+e.4+"<8 />";2 j=1B.1C(e.4-1);2 k=e[j].v(/\\[(N|9|O|P|Q|R|q|S|T|U|V|W|X|Y|Z|10|11|12|13|14|b|u|i)(( |=)[^\\]]+)?\\]/i,"[$1]");3(k!=I&&k==n[0].v(/\\[\\//,"[")){f+="J 15 1i : dé1j <8 />";e.4=j}C{f+="J 15 1D 1i : <8 />1k 1E : "+k+"<8 />1k 1F : "+n[0].v(/\\[\\//,"[")+" <8 />1G 1H dé1j<8 />";h[i]=h[i].v(m[0],k.v(/\\[/,"[/"));e.4=j}}C{f+="1l ! E 1Iç1J 1K 1m K 15, 1L 18 19 K.<8 />";h[i]=""}}C{f+="1M K 1n 1m K 1N, 1O.<8 />";e[e.4]=h[i]}}}3(e.4>0){H(2 i=0;i<e.4;i++){f+="<8 />J 1Pée 1Q : "+e[i]+"<8 />1R 18 19 K";2 l=e[i].v(/\\[(N|9|O|P|Q|R|q|S|T|U|V|W|X|Y|Z|10|11|12|13|14|b|u|i)(( |=)[^\\]]+)?\\]/i,"[/$1]");h[h.4]=l}}2 o=h.1S("").v(/&#A;/y,"[").v(/&#B;/y,"]");3(d)1o.1p(f+"<8 /><8 />"+o);C 3(c)1o.1p(o);3(b){a.1g=o}}s 1T(f,a,b,c,d){3(w(f)=="G"||!f)1U("1l, f 1n 1V");H(2 i=0;i<f.1q.4;i++){2 e=f.1q[i];H(2 j=0;j<a.4;j++){3(e.1W==a[j]){1f(e,b,c,d);1X}}}}',62,122,'||var|if|length||||br|nocode||||||||||||||||remplace_tag|code||function|||replace|typeof|textarea|gi|return|91|93|else|replacez|String|new|undefined|for|null|Balise|balise|ptag|match|img|list|url|color|quote|flash|center|size|float|justify|right|left|poll|strike|titre|stitre|style|anchor|fermante|nl2khol|unkhol|de|la|substring|noCode_badtags|Array|sCode_badtags|Wiki_Paf|badtags|value|tect|correspondante|pilage|Tag|Erreur|une|est|document|write|elements|while|indexOf|fromCharCode|RegExp|ig|split|It|ration|Longueur|pile|Math|abs|non|ouvrant|fermant|correction|puis|commen|ant|par|suppression|La|ouvrante|empilage|rest|ouverte|Fermeture|join|badtags_form|alert|vide|name|break'.split('|'),0,{}))
