/** 
* jTexBar 0.1
* @author: Anders Fajerson 
*
* Based on Michael Geary's TextBar module
* (http://mg.to/2005/02/26/textbar-drupal-module-for-markdown-and-textile), which was
* adapted from the DokuWiki toolbar (http://wiki.splitbrain.org/wiki:dokuwiki), which was
* adapted from the MediaWiki toolbar (http://wikipedia.sourceforge.net/), which was
* adapted from the phpBB toolbar (http://www.phpbb.com/).
* Plugin structure based on Steven Wittens' Farbtastic plugin (http://www.acko.net/dev/farbtastic). 
* License: GPL
*/

eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[(function(e){return d[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}('8.M.F=9(u){7 2e=K.36(9(){8.F(K,u)});S 2e};8.F=9(s,u){7 s=8(s).1C(0);S s.F||(s.F=17 8.1S(s,u))};8.1S=9(s,u){7 6=K;6.u=u;6.u=8.3i({15:"2i",W:[[\'D\',\'b\',\'1t\',\'2C 1l\'],[\'D\',\'i\',\'1y\',\'2D 1l\'],[\'D\',C,\'1p\',\'2F 1Q 1T\'],[\'D\',C,\'1x\',\'2G 1Q 1T\'],[\'G\',C,\'h\',\'1b\',C,[[\'D\',\'1\',\'18\',\'1n 1 1b\'],[\'D\',\'2\',\'1g\',\'1n 2 1b\'],[\'D\',\'3\',\'19\',\'1n 3 1b\']]],[\'16\',\'l\',\'10\',\'10 f\',\'2H 1V\'],[\'16\',\'m\',\'1z\',\'2I f\',\'2J\'],[\'G\',C,\'2K\',\'2L\',C,[[\'16\',C,\'1s\',\'10 f\',\'2M 1V\'],[\'1f\',C,\'1r\',\'2N 2O\'],[\'D\',C,\'V\',\'2P 1l\']]]],1J:{2i:{1t:[\'**\',\'**\'],1y:[\'*\',\'*\'],V:[\'`\',\'`\'],h:[\'# \',\'\'],18:[\'# \',\'\'],1g:[\'## \',\'\'],19:[\'### \',\'\'],1w:[\'#### \',\'\'],1q:[\'##### \',\'\'],10:[\'[\',\'](22-U "1m")\'],1s:[\'[\',\'](1X://25.26.27/ "1m")\'],1x:[\'1. \',\'\\n\'],1p:[\'* \',\'\\n\'],1r:[\'----\\n\'],1z:[\'![\',\'](/2r/2a/2b.2c "1m")\']},2Q:{1t:[\'*\',\'*\'],1y:[\'1Y\',\'1Y\'],V:[\'@\',\'@\'],h:[\'# \',\'\'],18:[\'18. \',\'\'],1g:[\'1g. \',\'\'],19:[\'19. \',\'\'],1w:[\'1w. \',\'\'],1q:[\'1q. \',\'\'],10:[\'"\',\'":22-U\'],1s:[\'"\',\'":1X://25.26.27/\'],1x:[\'# \',\'\\n\'],1p:[\'* \',\'\\n\'],1r:[\'<2Y />\\n\'],1z:[\'!/2r/2a/2b.2c(\',\')!\']}}},6.u);6.1B=9(f){S f.14(/\'/g,"\\\\\'").14(/"/g,\'&33;\').14(/\\n/g,"\\\\n")};6.1u=9(W){7 p="";7 34=0;2f(7 i=0;i<W.k;i++){7 N=W[i];7 Y=N[0];7 T=N[1];7 U=N[2];7 j=N[3];7 L=N[4];7 1G=N[5];j=6.1B(j);L=(L?6.1B(L):j);7 1H=(T?L+\' [37+\'+T.38()+\']\':L);7 M=\'8.F(\\\'#\'+s.39+\'\\\').2p(\\\'\'+Y+\'\\\',\\\'\'+U+\'\\\',\\\'\'+j+\'\\\')\';7 3a="w.3c";c(T){6.R[T]=17 3d;6.R[T].M=M}c(1G&&Y=="G"){p+=\'<y 1h="\'+U+\' G" 2n="\'+1H+\'"\';p+=\'2o="\'+M+\'">\';p+=L;p+=\'<o 3f="3g:3h">\';p+=6.1u(1G);p+="</o></y>"}z{p+=\'<y 1h="\'+U+\'" 2n="\'+1H+\'"\';p+=\'2o="\'+M+\'">\';p+=L+\'</y>\'}}S p};6.1k=9(B,q,j){q=q||\'\';7 a=8(s).1C(0);c(v.H&&!8.1E.2s){7 x=v.H.P().f;7 11=2q;c(!x){11=1c;x=j}a.X();7 f=x;c(x.1L(x.k-1)==" "){x=x.13(0,x.k-1);r=v.H.P();r.f=B+x+q+" "}z{r=v.H.P();r.f=B+x+q}c(!11){r.2t(\'1K\',-f.k-q.k);r.2u(\'1K\',-q.k)}r.2v()}z c(a.A||a.A==\'0\'){7 E=a.A;7 1a=a.Z;7 11=(1a-E);7 I=a.I;7 J=a.t.13(E,1a)||j;c(J.1L(J.k-1)==" ")1i=B+J.13(0,J.k-1)+q+" ";z 1i=B+J+q;a.t=6.1v(a.t,E,1a,1i);a.X();c(11)a.A=a.Z=E+B.k+J.k+q.k;z{a.A=E+B.k;a.Z=a.A+J.k;a.I=I}}z{7 O=2w;7 1O=17 1N("\\\\$1","g");7 1P=17 1N("\\\\$2","g");O=O.14(1O,j);O=O.14(1P,B+j+q);7 f=(j?2y(O):\'\')||j;f=B+f+q;a.t+="\\n"+f;c(!8.1E.2A)a.X()}c(a.2l)a.1W=v.H.P().1Z()};6.1M=9(t){7 d=8(s).1C(0);c(v.H){d.X();(28?28.v:v).H.P().f=t}z c(d.A||d.A==\'0\'){7 E=d.A;7 I=d.I;d.t=6.1v(d.t,E,d.Z,t);d.X();d.A=d.Z=E+t.k;d.I=I}z d.t+="\\n"+t;c(d.2l)d.1W=v.H.P().1Z()};6.1v=9(1d,20,23,1f){S 1d.13(0,20)+1f+1d.13(23,1d.k)};6.R={};6.2g=9(){8(s).2X(9(e){7 1A=2Z.30(e.31).35();c(1A 2h 6.R){2f(1F 2h 6.R){c(1A==1F&&e.3b){3e(6.R[1F].M);S 1c}}}})};6.2p=9(Y,V,j){7 15=6.u.15;7 Q=6.u.1J[15][V];7 1R={1f:9(){6.1M(Q[0])},16:9(){6.1k(Q[0],Q[1],j)},D:9(){6.1k(Q[0],Q[1],j)},G:9(){}};1R[Y]()};6.2m=9(){6.12=1c;8(v).2B();8("y.G",6.w).24(9(){6.12=2q}).2k(9(){6.1I(6.w,K)});8(v).2k(9(){c(!6.12)6.1I(6.w);6.12=1c});c(8.1E.2R){8("y",6.w).2T("<21></21>").24(9(){8(K).29().1U(\'1e-2d\')}).2V(9(){8(K).29().2j(\'1e-2d\')});8("y o y",6.w).1D(9(){8(K).1U(\'1e-1D\')},9(){8(K).2j(\'1e-1D\')})}};6.1I=9(w,1o){c(!6.12){8(".F-w y.G o").1j()}z{8(".F-w y.G o").2x(1o.2z("o")[0]).1j();7 o=8("o",1o);c(o.2S(":2U")){o.2W("32")}z{o.1j()}}};7 p=\'<o 1h="F-w">\'+6.1u(6.u.W)+\'</o>\';6.w=8(\'"\'+p+\'"\').2E(s);6.2m();6.2g()}',62,205,'||||||tb|var|jQuery|function|txtarea||if|field||text||||sampleText|length||||ul|html|tagClose||element|value|settings|document|toolbar|theSelection|li|else|selectionStart|tagOpen|null|simple|startPos|jtextbar|menu|selection|scrollTop|myText|this|toolTip|fn|button|copy_alertText|createRange|tags|keys|return|accessKey|name|code|buttons|focus|type|selectionEnd|link|replaced|isClicked|substring|replace|format|linker|new|h1|h3|endPos|Headline|false|target|IE|insert|h2|class|subst|hide|insertTags|Text|tooltip|Level|that|listul|h5|rule|extlink|bold|formatButtons|insertString|h4|list|italic|image|keyPressed|escapeQuotes|get|hover|browser|key|subMenu|toolTipAndKey|toggleSubMenus|tagsets|character|charAt|insertText|RegExp|re1|re2|List|actions|_jtextbar|Item|addClass|Link|caretPos|http|_|duplicate|iStart|span|page|iEnd|mousedown|www|example|com|opener|parent|to|img|jpg|active|objects|for|keyShortcuts|in|Markdown|removeClass|click|createTextRange|menuEvents|title|onclick|clickButton|true|path|mozilla|moveStart|moveEnd|select|alertText|not|prompt|getElementsByTagName|safari|unclick|Bold|Italic|insertBefore|Unordered|Ordered|Internal|alt|Image|more|More|External|Horizontal|Rule|Code|Textile|msie|is|wrap|hidden|mouseup|fadeIn|keydown|hr|String|fromCharCode|keyCode|fast|quot|position|toLowerCase|each|Ctrl|toUpperCase|id|imgURL|ctrlKey|png|Object|eval|style|display|none|extend'.split('|'),0,{}))
