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($){$.23.T=3(f,g){B k,v,A,F;v=A=F=l;k={D:\'\',12:\'\',U:\'\',1j:\'\',1y:7,24:\'25\',1k:\'~/2R/1z.1A\',1b:\'\',26:\'27\',1l:7,1B:\'\',1C:\'\',1D:{},1E:{},1F:{},1G:{},28:[{}]};$.V(k,f,g);2(!k.U){$(\'2S\').1c(3(a,b){1H=$(b).14(0).2T.2U(/(.*)2V\\.2W(\\.2X)?\\.2Y$/);2(1H!==29){k.U=1H[1]}})}4 G.1c(3(){B d,u,15,16,p,H,L,P,17,1m,w,2a,M,18;d=$(G);u=G;15=[];18=l;16=p=0;H=-1;k.1b=1d(k.1b);k.1k=1d(k.1k);3 1d(a,b){2(b){4 a.W(/("|\')~\\//g,"$1"+k.U)}4 a.W(/^~\\//,k.U)}3 2b(){D=\'\';12=\'\';2(k.D){D=\'D="\'+k.D+\'"\'}8 2(d.1I("D")){D=\'D="T\'+(d.1I("D").2c(0,1).2Z())+(d.1I("D").2c(1))+\'"\'}2(k.12){12=\'N="\'+k.12+\'"\'}d.1J(\'<z \'+12+\'></z>\');d.1J(\'<z \'+D+\' N="T"></z>\');d.1J(\'<z N="30"></z>\');d.2d("2e");17=$(\'<z N="31"></z>\').2f(d);$(1K(k.28)).1L(17);1m=$(\'<z N="32"></z>\').1M(d);2(k.1l===7&&$.X.33!==7){1l=$(\'<z N="34"></z>\').1M(d).1e("1N",3(e){B h=d.2g(),y=e.2h,1n,1o;1n=3(e){d.2i("2g",35.36(20,e.2h+h-y)+"37");4 l};1o=3(e){$("1A").1O("2j",1n).1O("2k",1o);4 l};$("1A").1e("2j",1n).1e("2k",1o)});1m.2l(1l)}d.2m(1P).38(1P);d.1e("1Q",3(e,a){2(a.1p!==l){14()}2(u===$.T.2n){Y(a)}});d.1f(3(){$.T.2n=G})}3 1K(b){B c=$(\'<Z></Z>\'),i=0;$(\'C:2o > Z\',c).2i(\'39\',\'q\');$.1c(b,3(){B a=G,t=\'\',1q,C,j;1q=(a.19)?(a.1R||\'\')+\' [3a+\'+a.19+\']\':(a.1R||\'\');19=(a.19)?\'2p="\'+a.19+\'"\':\'\';2(a.2q){C=$(\'<C N="3b">\'+(a.2q||\'\')+\'</C>\').1L(c)}8{i++;2r(j=15.6-1;j>=0;j--){t+=15[j]+"-"}C=$(\'<C N="2s 2s\'+t+(i)+\' \'+(a.3c||\'\')+\'"><a 3d="" \'+19+\' 1q="\'+1q+\'">\'+(a.1R||\'\')+\'</a></C>\').1e("3e",3(){4 l}).2t(3(){4 l}).1N(3(){2(a.2u){3f(a.2u)()}2v(3(){Y(a)},1);4 l}).2o(3(){$(\'> Z\',G).3g();$(E).3h(\'2t\',3(){$(\'Z Z\',17).2w()})},3(){$(\'> Z\',G).2w()}).1L(c);2(a.2x){15.3i(i);$(C).2d(\'3j\').2l(1K(a.2x))}}});15.3k();4 c}3 2y(c){2(c){c=c.3l();c=c.W(/\\(\\!\\(([\\s\\S]*?)\\)\\!\\)/g,3(x,a){B b=a.1S(\'|!|\');2(F===7){4(b[1]!==2z)?b[1]:b[0]}8{4(b[1]===2z)?"":b[0]}});c=c.W(/\\[\\!\\[([\\s\\S]*?)\\]\\!\\]/g,3(x,a){B b=a.1S(\':!:\');2(18===7){4 l}1T=3m(b[0],(b[1])?b[1]:\'\');2(1T===29){18=7}4 1T});4 c}4""}3 I(a){2($.3n(a)){a=a(P)}4 2y(a)}3 1g(a){J=I(L.J);1a=I(L.1a);Q=I(L.Q);O=I(L.O);2(Q!==""){q=J+Q+O}8 2(m===\'\'&&1a!==\'\'){q=J+1a+O}8{q=J+(a||m)+O}4{q:q,J:J,Q:Q,1a:1a,O:O}}3 Y(a){B b,j,n,i;P=L=a;14();$.V(P,{1r:"",U:k.U,u:u,m:(m||\'\'),p:p,v:v,A:A,F:F});I(k.1B);I(L.1B);2(v===7&&A===7){I(L.3o)}$.V(P,{1r:1});2(v===7&&A===7){R=m.1S(/\\r?\\n/);2r(j=0,n=R.6,i=0;i<n;i++){2($.3p(R[i])!==\'\'){$.V(P,{1r:++j,m:R[i]});R[i]=1g(R[i]).q}8{R[i]=""}}o={q:R.3q(\'\\n\')};11=p;b=o.q.6+(($.X.1U)?n:0)}8 2(v===7){o=1g(m);11=p+o.J.6;b=o.q.6-o.J.6-o.O.6;b-=1s(o.q)}8 2(A===7){o=1g(m);11=p;b=o.q.6;b-=1s(o.q)}8{o=1g(m);11=p+o.q.6;b=0;11-=1s(o.q)}2((m===\'\'&&o.Q===\'\')){H+=1V(o.q);11=p+o.J.6;b=o.q.6-o.J.6-o.O.6;H=d.K().1h(p,d.K().6).6;H-=1V(d.K().1h(0,p))}$.V(P,{p:p,16:16});2(o.q!==m&&18===l){2A(o.q);1W(11,b)}8{H=-1}14();$.V(P,{1r:\'\',m:m});2(v===7&&A===7){I(L.3r)}I(L.1C);I(k.1C);2(w&&k.1y){1X()}A=F=v=18=l}3 1V(a){2($.X.1U){4 a.6-a.W(/\\n*/g,\'\').6}4 0}3 1s(a){2($.X.2B){4 a.6-a.W(/\\r*/g,\'\').6}4 0}3 2A(a){2(E.m){B b=E.m.1Y();b.2C=a}8{d.K(d.K().1h(0,p)+a+d.K().1h(p+m.6,d.K().6))}}3 1W(a,b){2(u.2D){2($.X.1U&&$.X.3s>=9.5&&b==0){4 l}1i=u.2D();1i.3t(7);1i.2E(\'1Z\',a);1i.3u(\'1Z\',b);1i.3v()}8 2(u.2F){u.2F(a,a+b)}u.1t=16;u.1f()}3 14(){u.1f();16=u.1t;2(E.m){m=E.m.1Y().2C;2($.X.2B){B a=E.m.1Y(),1u=a.3w();1u.3x(u);p=-1;3y(1u.3z(a)){1u.2E(\'1Z\');p++}}8{p=u.2G}}8{p=u.2G;m=d.K().1h(p,u.3A)}4 m}3 1z(){2(!w||w.3B){2(k.1j){w=3C.2H(\'\',\'1z\',k.1j)}8{M=$(\'<2I N="3D"></2I>\');2(k.24==\'25\'){M.1M(1m)}8{M.2f(17)}w=M[M.6-1].3E||3F[M.6-1]}}8 2(F===7){2(M){M.3G()}8{w.2J()}w=M=l}2(!k.1y){1X()}}3 1X(){2K()}3 2K(){B b;2(k.1b!==\'\'){$.2L({2M:\'3H\',2N:k.1b,27:k.26+\'=\'+3I(d.K()),2O:3(a){21(1d(a,1))}})}8{2(!2a){$.2L({2N:k.1k,2O:3(a){21(1d(a,1).W(/<!-- 3J -->/g,d.K()))}})}}4 l}3 21(a){2(w.E){3K{22=w.E.2P.1t}3L(e){22=0}w.E.2H();w.E.3M(a);w.E.2J();w.E.2P.1t=22}2(k.1j){w.1f()}}3 1P(e){A=e.A;F=e.F;v=(!(e.F&&e.v))?e.v:l;2(e.2M===\'2m\'){2(v===7){C=$("a[2p="+3N.3O(e.1v)+"]",17).1w(\'C\');2(C.6!==0){v=l;2v(3(){C.3P(\'1N\')},1);4 l}}2(e.1v===13||e.1v===10){2(v===7){v=l;Y(k.1F);4 k.1F.1x}8 2(A===7){A=l;Y(k.1E);4 k.1E.1x}8{Y(k.1D);4 k.1D.1x}}2(e.1v===9){2(A==7||v==7||F==7){4 l}2(H!==-1){14();H=d.K().6-H;1W(H,0);H=-1;4 l}8{Y(k.1G);4 k.1G.1x}}}}2b()})};$.23.3Q=3(){4 G.1c(3(){B a=$(G).1O().3R(\'2e\');a.1w(\'z\').1w(\'z.T\').1w(\'z\').Q(a)})};$.T=3(a){B b={1p:l};$.V(b,a);2(b.1p){4 $(b.1p).1c(3(){$(G).1f();$(G).2Q(\'1Q\',[b])})}8{$(\'u\').2Q(\'1Q\',[b])}}})(3S);',62,241,'||if|function|return||length|true|else|||||||||||||false|selection||string|caretPosition|block||||textarea|ctrlKey|previewWindow|||div|shiftKey|var|li|id|document|altKey|this|caretOffset|prepare|openWith|val|clicked|iFrame|class|closeWith|hash|replaceWith|lines||markItUp|root|extend|replace|browser|markup|ul||start|nameSpace||get|levels|scrollPosition|header|abort|key|placeHolder|previewParserPath|each|localize|bind|focus|build|substring|range|previewInWindow|previewTemplatePath|resizeHandle|footer|mouseMove|mouseUp|target|title|line|fixIeBug|scrollTop|rangeCopy|keyCode|parent|keepDefault|previewAutoRefresh|preview|html|beforeInsert|afterInsert|onEnter|onShiftEnter|onCtrlEnter|onTab|miuScript|attr|wrap|dropMenus|appendTo|insertAfter|mousedown|unbind|keyPressed|insertion|name|split|value|opera|fixOperaBug|set|refreshPreview|createRange|character||writeInPreview|sp|fn|previewPosition|after|previewParserVar|data|markupSet|null|template|init|substr|addClass|markItUpEditor|insertBefore|height|clientY|css|mousemove|mouseup|append|keydown|focused|hover|accesskey|separator|for|markItUpButton|click|call|setTimeout|hide|dropMenu|magicMarkups|undefined|insert|msie|text|createTextRange|moveStart|setSelectionRange|selectionStart|open|iframe|close|renderPreview|ajax|type|url|success|documentElement|trigger|templates|script|src|match|jquery|markitup|pack|js|toUpperCase|markItUpContainer|markItUpHeader|markItUpFooter|safari|markItUpResizeHandle|Math|max|px|keyup|display|Ctrl|markItUpSeparator|className|href|contextmenu|eval|show|one|push|markItUpDropMenu|pop|toString|prompt|isFunction|beforeMultiInsert|trim|join|afterMultiInsert|version|collapse|moveEnd|select|duplicate|moveToElementText|while|inRange|selectionEnd|closed|window|markItUpPreviewFrame|contentWindow|frame|remove|POST|encodeURIComponent|content|try|catch|write|String|fromCharCode|triggerHandler|markItUpRemove|removeClass|jQuery'.split('|'),0,{}))

mySettings = {
	previewParserPath:	'', // path to your BBCode parser
	markupSet: [
		{openWith:'[h1]',closeWith:'[/h1]'},
		{openWith:'[h2]',closeWith:'[/h2]'},
		{openWith:'[h3]',closeWith:'[/h3]'},
		{openWith:'[h4]',closeWith:'[/h4]'},
		{openWith:'[h5]',closeWith:'[/h5]'},
		{openWith:'[h6]',closeWith:'[/h6]'},
		{separator:'---------------'},
		{openWith:'[b]',closeWith:'[/b]'},
		{openWith:'[i]',closeWith:'[/i]'},
		{openWith:'[u]',closeWith:'[/u]'},
		{separator:'---------------'},
		{replaceWith:'[img][![Url]!][/img]'},
		{openWith:'[url=[![Url]!]]',closeWith:'[/url]',placeHolder:'Your text to link here...'},
		{replaceWith:'[email][![Adresse email]!][/email]'},
		{separator:'---------------'},
		{name:'Size', openWith:'[size=[![Text size]!]]', closeWith:'[/size]',
		dropMenu :[
			{name:'Big', openWith:'[big]', closeWith:'[/big]'},
			{name:'Small', openWith:'[size=small]', closeWith:'[/small]'}
		]},
		{className:'palette',
		dropMenu: [
			{openWith:'[color=#FCE94F]',closeWith:'[/color]',className:"color-FCE94F"},
			{openWith:'[color=#EDD400]',closeWith:'[/color]',className:"color-EDD400"},
			{openWith:'[color=#C4A000]',closeWith:'[/color]',className:"color-C4A000"},
			{openWith:'[color=#FCAF3E]',closeWith:'[/color]',className:"color-FCAF3E"},
			{openWith:'[color=#F57900]',closeWith:'[/color]',className:"color-F57900"},
			{openWith:'[color=#CE5C00]',closeWith:'[/color]',className:"color-CE5C00"},
			{openWith:'[color=#E9B96E]',closeWith:'[/color]',className:"color-E9B96E"},
			{openWith:'[color=#C17D11]',closeWith:'[/color]',className:"color-C17D11"},
			{openWith:'[color=#8F5902]',closeWith:'[/color]',className:"color-8F5902"},
			{openWith:'[color=#8AE234]',closeWith:'[/color]',className:"color-8AE234"},
			{openWith:'[color=#73D216]',closeWith:'[/color]',className:"color-73D216"},
			{openWith:'[color=#4E9A06]',closeWith:'[/color]',className:"color-4E9A06"},
			{openWith:'[color=#729FCF]',closeWith:'[/color]',className:"color-729FCF"},
			{openWith:'[color=#3465A4]',closeWith:'[/color]',className:"color-3465A4"},
			{openWith:'[color=#204A87]',closeWith:'[/color]',className:"color-204A87"},
			{openWith:'[color=#AD7FA8]',closeWith:'[/color]',className:"color-AD7FA8"},
			{openWith:'[color=#75507B]',closeWith:'[/color]',className:"color-75507B"},
			{openWith:'[color=#5C3566]',closeWith:'[/color]',className:"color-5C3566"},
			{openWith:'[color=#EF2929]',closeWith:'[/color]',className:"color-EF2929"},
			{openWith:'[color=#CC0000]',closeWith:'[/color]',className:"color-CC0000"},
			{openWith:'[color=#A40000]',closeWith:'[/color]',className:"color-A40000"},
			{openWith:'[color=#FFFFFF]',closeWith:'[/color]',className:"color-FFFFFF"},
			{openWith:'[color=#D3D7CF]',closeWith:'[/color]',className:"color-D3D7CF"},
			{openWith:'[color=#BABDB6]',closeWith:'[/color]',className:"color-BABDB6"},
			{openWith:'[color=#888A85]',closeWith:'[/color]',className:"color-888A85"},
			{openWith:'[color=#555753]',closeWith:'[/color]',className:"color-555753"},
			{openWith:'[color=#000000]',closeWith:'[/color]',className:"color-000000"}
		]},
		{openWith:'[center]', closeWith:'[/center]'},
		{separator:'---------------'},
		{openWith:'[list]\n', closeWith:'\n[/list]'},
		{openWith:'[list=[![Starting number]!]]\n', closeWith:'\n[/list]'}, 
		{openWith:'[*] '},
		{separator:'---------------'},
		{openWith:'[quote]', closeWith:'[/quote]'},
		{openWith:'[spoiler]', closeWith:'[/spoiler]'},
		{openWith:'[code]', closeWith:'[/code]'}, 
		{separator:'---------------'},
		{className:'smilies',
		dropMenu: [
			{openWith:':ange:',className:"smilies-ange"},
			{openWith:':angry:',className:"smilies-angry"},
			{openWith:':blush:',className:"smilies-blush"},
			{openWith:':bye:',className:"smilies-bye"},
			{openWith:':censored:',className:"smilies-censored"},
			{openWith:':cheers:',className:"smilies-cheers"},
			{openWith:':?',className:"smilies-confused"},
			{openWith:':\'(',className:"smilies-cry"},
			{openWith:':decayed:',className:"smilies-decayed"},
			{openWith:':disgusted:',className:"smilies-disgusted"},
			{openWith:':doubt:',className:"smilies-doubt"},
			{openWith:':eyebrow:',className:"smilies-eyebrow"},
			{openWith:':fear:',className:"smilies-fear"},
			{openWith:':giggle:',className:"smilies-giggle"},
			{openWith:':D',className:"smilies-grin"},
			{openWith:':)',className:"smilies-happy"},
			{openWith:':help',className:"smilies-help"},
			{openWith:':hmmm:',className:"smilies-hmmm"},
			{openWith:':hypocrite:',className:"smilies-hypocrite"},
			{openWith:':innocent:',className:"smilies-innocent"},
			{openWith:':itsok:',className:"smilies-itsok"},
			{openWith:':love:',className:"smilies-love"},
			{openWith:':pout:',className:"smilies-pout"},
			{openWith:':rolleyes:',className:"smilies-rolleyes"},
			{openWith:':(',className:"smilies-sad"},
			{openWith:':shifty:',className:"smilies-shifty"},
			{openWith:':shock:',className:"smilies-shock"},
			{openWith:':sulk:',className:"smilies-sulk"},
			{openWith:'8-)',className:"smilies-sunglasses"},
			{openWith:':sweatingbullets:',className:"smilies-sweatingbullets"},
			{openWith:':thumbdown:',className:"smilies-thumbdown"},
			{openWith:':P',className:"smilies-tongue"},
			{openWith:':verryhappy:',className:"smilies-verryhappy"},
			{openWith:':whip:',className:"smilies-whip"},
			{openWith:':whistling:',className:"smilies-whistling"},
			{openWith:';)',className:"smilies-wink"},
			{openWith:':worried:',className:"smilies-worried"},
			{openWith:':wry:',className:"smilies-wry"},
			{openWith:':mrgreen:',className:"smilies-mrgreen"},
		]},
		{className:'deck',
		dropMenu: [
			{openWith:':ac:',className:"deck-ac"},
			{openWith:':kc:',className:"deck-kc"},
			{openWith:':qc:',className:"deck-qc"},
			{openWith:':jc:',className:"deck-jc"},
			{openWith:':tc:',className:"deck-tc"},
			{openWith:':9c:',className:"deck-9c"},
			{openWith:':8c:',className:"deck-8c"},
			{openWith:':7c:',className:"deck-7c"},
			{openWith:':6c:',className:"deck-6c"},
			{openWith:':5c:',className:"deck-5c"},
			{openWith:':4c:',className:"deck-4c"},
			{openWith:':3c:',className:"deck-3c"},
			{openWith:':2c:',className:"deck-2c"},
			{openWith:':as:',className:"deck-as"},
			{openWith:':ks:',className:"deck-ks"},
			{openWith:':qs:',className:"deck-qs"},
			{openWith:':js:',className:"deck-js"},
			{openWith:':ts:',className:"deck-ts"},
			{openWith:':9s:',className:"deck-9s"},
			{openWith:':8s:',className:"deck-8s"},
			{openWith:':7s:',className:"deck-7s"},
			{openWith:':6s:',className:"deck-6s"},
			{openWith:':5s:',className:"deck-5s"},
			{openWith:':4s:',className:"deck-4s"},
			{openWith:':3s:',className:"deck-3s"},
			{openWith:':2s:',className:"deck-2s"},
			{openWith:':ad:',className:"deck-ad"},
			{openWith:':kd:',className:"deck-kd"},
			{openWith:':qd:',className:"deck-qd"},
			{openWith:':jd:',className:"deck-jd"},
			{openWith:':td:',className:"deck-td"},
			{openWith:':9d:',className:"deck-9d"},
			{openWith:':8d:',className:"deck-8d"},
			{openWith:':7d:',className:"deck-7d"},
			{openWith:':6d:',className:"deck-6d"},
			{openWith:':5d:',className:"deck-5d"},
			{openWith:':4d:',className:"deck-4d"},
			{openWith:':3d:',className:"deck-3d"},
			{openWith:':2d:',className:"deck-2d"},
			{openWith:':ah:',className:"deck-ah"},
			{openWith:':kh:',className:"deck-kh"},
			{openWith:':qh:',className:"deck-qh"},
			{openWith:':jh:',className:"deck-jh"},
			{openWith:':th:',className:"deck-th"},
			{openWith:':9h:',className:"deck-9h"},
			{openWith:':8h:',className:"deck-8h"},
			{openWith:':7h:',className:"deck-7h"},
			{openWith:':6h:',className:"deck-6h"},
			{openWith:':5h:',className:"deck-5h"},
			{openWith:':4h:',className:"deck-4h"},
			{openWith:':3h:',className:"deck-3h"},
			{openWith:':2h:',className:"deck-2h"},
		]},
		{separator:'---------------'},
		{className:"clean", replaceWith:function(markitup) { return markitup.selection.replace(/\[(.*?)\]/g, "") } },
	]
}

$(document).ready(function()	{
	$('#article').markItUp(mySettings);
	$('.add').click(function() {
 		$.markItUp( { 	openWith:'<opening tag>',
						closeWith:'<\/closing tag>',
						placeHolder:"New content"
					}
				);
 		return false;
	});
	$('.toggle').click(function() {
		if ($("#markItUp.markItUpEditor").length === 1) {
 			$("#markItUp").markItUpRemove();
			$("span", this).text("get markItUp! back");
		} else {
			$('#markItUp').markItUp(mySettings);
			$("span", this).text("remove markItUp!");
		}
 		return false;
	});
});

$(document).ready(function(){
	$('.ajouter').click(function(){
		fichier=$(this).attr("name");
		$("#article").append(fichier);
	});
});
