var Attacklab=Attacklab||{};var Attacklab=Attacklab||{};Attacklab.showdown=Attacklab.showdown||{};Attacklab.showdown.converter=function(){var a;var j;var A;var i=0;this.makeHtml=function(G){a=new Array();j=new Array();A=new Array();G=G.replace(/~/g,"~T");G=G.replace(/\$/g,"~D");G=G.replace(/\r\n/g,"\n");G=G.replace(/\r/g,"\n");G="\n\n"+G+"\n\n";G=z(G);G=G.replace(/^[ \t]+$/mg,"");G=m(G);G=d(G);G=F(G);G=q(G);G=G.replace(/~D/g,"$$");G=G.replace(/~T/g,"~");return G};var d=function(G){var G=G.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(J,L,K,I,H){L=L.toLowerCase();a[L]=h(K);if(I){return I+H}else{if(H){j[L]=H.replace(/"/g,"&quot;")}}return""});return G};var m=function(I){I=I.replace(/\n/g,"\n\n");var H="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del";var G="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";I=I.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,x);I=I.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,x);I=I.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,x);I=I.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,x);I=I.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,x);I=I.replace(/\n\n/g,"\n");return I};var x=function(G,H){var I=H;I=I.replace(/\n\n/g,"\n");I=I.replace(/^\n/,"");I=I.replace(/\n+$/g,"");I="\n\n~K"+(A.push(I)-1)+"K\n\n";return I};var F=function(H){H=f(H);var G=o("<hr />");H=H.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,G);H=H.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,G);H=H.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,G);H=D(H);H=b(H);H=u(H);H=m(H);H=g(H);return H};var r=function(G){G=B(G);G=l(G);G=e(G);G=E(G);G=y(G);G=n(G);G=h(G);G=c(G);G=G.replace(/  +\n/g," <br>\n");return G};var l=function(H){var G=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;H=H.replace(G,function(J){var I=J.replace(/(.)<\/?code>(?=.)/g,"$1`");I=w(I,"\\`*_");return I});return H};var y=function(G){G=G.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,C);G=G.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,C);G=G.replace(/(\[([^\[\]]+)\])()()()()()/g,C);return G};var C=function(M,S,R,Q,P,O,L,K){if(K==undefined){K=""}var J=S;var H=R;var I=Q.toLowerCase();var G=P;var N=K;if(G==""){if(I==""){I=H.toLowerCase().replace(/ ?\n/g," ")}G="#"+I;if(a[I]!=undefined){G=a[I];if(j[I]!=undefined){N=j[I]}}else{if(J.search(/\(\s*\)$/m)>-1){G=""}else{return J}}}G=w(G,"*_");var T='<a href="'+G+'"';if(N!=""){N=N.replace(/"/g,"&quot;");N=w(N,"*_");T+=' title="'+N+'"'}T+=">"+H+"</a>";return T};var E=function(G){G=G.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,t);G=G.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,t);return G};var t=function(M,S,R,Q,P,O,L,K){var J=S;var I=R;var H=Q.toLowerCase();var G=P;var N=K;if(!N){N=""}if(G==""){if(H==""){H=I.toLowerCase().replace(/ ?\n/g," ")}G="#"+H;if(a[H]!=undefined){G=a[H];if(j[H]!=undefined){N=j[H]}}else{return J}}I=I.replace(/"/g,"&quot;");G=w(G,"*_");var T='<img src="'+G+'" alt="'+I+'"';N=N.replace(/"/g,"&quot;");N=w(N,"*_");T+=' title="'+N+'"';T+=" />";return T};var f=function(G){G=G.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(H,I){return o("<h1>"+r(I)+"</h1>")});G=G.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(I,H){return o("<h2>"+r(H)+"</h2>")});G=G.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(H,K,J){var I=K.length;return o("<h"+I+">"+r(J)+"</h"+I+">")});return G};var p;var D=function(H){H+="~0";var G=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;if(i){H=H.replace(G,function(J,M,L){var N=M;var K=(L.search(/[*+-]/g)>-1)?"ul":"ol";N=N.replace(/\n{2,}/g,"\n\n\n");var I=p(N);I=I.replace(/\s+$/,"");I="<"+K+">"+I+"</"+K+">\n";return I})}else{G=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;H=H.replace(G,function(K,O,M,J){var N=O;var P=M;var L=(J.search(/[*+-]/g)>-1)?"ul":"ol";var P=P.replace(/\n{2,}/g,"\n\n\n");var I=p(P);I=N+"<"+L+">\n"+I+"</"+L+">\n";return I})}H=H.replace(/~0/,"");return H};p=function(G){i++;G=G.replace(/\n{2,}$/,"\n");G+="~0";G=G.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(J,L,K,I,H){var N=H;var M=L;var O=K;if(M||(N.search(/\n{2,}/)>-1)){N=F(s(N))}else{N=D(s(N));N=N.replace(/\n$/,"");N=r(N)}return"<li>"+N+"</li>\n"});G=G.replace(/~0/g,"");i--;return G};var b=function(G){G+="~0";G=G.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(H,J,I){var K=J;var L=I;K=v(s(K));K=z(K);K=K.replace(/^\n+/g,"");K=K.replace(/\n+$/g,"");K="<pre><code>"+K+"\n</code></pre>";return o(K)+L});G=G.replace(/~0/,"");return G};var o=function(G){G=G.replace(/(^\n+|\n+$)/g,"");return"\n\n~K"+(A.push(G)-1)+"K\n\n"};var B=function(G){G=G.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(J,L,K,I,H){var M=I;M=M.replace(/^([ \t]*)/g,"");M=M.replace(/[ \t]*$/g,"");M=v(M);return L+"<code>"+M+"</code>"});return G};var v=function(G){G=G.replace(/&/g,"&amp;");G=G.replace(/</g,"&lt;");G=G.replace(/>/g,"&gt;");G=w(G,"*_{}[]\\",false);return G};var c=function(G){G=G.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g,"$1<strong>$3</strong>$4");G=G.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g,"$1<em>$3</em>$4");return G};var u=function(G){G=G.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(H,I){var J=I;J=J.replace(/^[ \t]*>[ \t]?/gm,"~0");J=J.replace(/~0/g,"");J=J.replace(/^[ \t]+$/gm,"");J=F(J);J=J.replace(/(^|\n)/g,"$1  ");J=J.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(K,L){var M=L;M=M.replace(/^  /mg,"~0");M=M.replace(/~0/g,"");return M});return o("<blockquote>\n"+J+"\n</blockquote>")});return G};var g=function(M){M=M.replace(/^\n+/g,"");M=M.replace(/\n+$/g,"");var L=M.split(/\n{2,}/g);var I=new Array();var G=L.length;for(var H=0;H<G;H++){var K=L[H];if(K.search(/~K(\d+)K/g)>=0){I.push(K)}else{if(K.search(/\S/)>=0){K=r(K);K=K.replace(/^([ \t]*)/g,"<p>");K+="</p>";I.push(K)}}}G=I.length;for(var H=0;H<G;H++){while(I[H].search(/~K(\d+)K/)>=0){var J=A[RegExp.$1];J=J.replace(/\$/g,"$$$$");I[H]=I[H].replace(/~K\d+K/,J)}}return I.join("\n\n")};var h=function(G){G=G.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;");G=G.replace(/<(?![a-z\/?\$!])/gi,"&lt;");return G};var e=function(G){G=G.replace(/\\(\\)/g,k);G=G.replace(/\\([`*_{}\[\]()>#+-.!])/g,k);return G};var n=function(G){G=G.replace(/(^|\s)(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\]])($|\W)/gi,"$1<$2$3>$4");G=G.replace(/<((https?|ftp):[^'">\s]+)>/gi,'<a href="$1">$1</a>');return G};var q=function(G){G=G.replace(/~E(\d+)E/g,function(H,J){var I=parseInt(J);return String.fromCharCode(I)});return G};var s=function(G){G=G.replace(/^(\t|[ ]{1,4})/gm,"~0");G=G.replace(/~0/g,"");return G};var z=function(G){G=G.replace(/\t(?=\t)/g,"    ");G=G.replace(/\t/g,"~A~B");G=G.replace(/~B(.+?)~A/g,function(H,K,J){var M=K;var I=4-M.length%4;for(var L=0;L<I;L++){M+=" "}return M});G=G.replace(/~A/g,"    ");G=G.replace(/~B/g,"");return G};var w=function(K,H,I){var G="(["+H.replace(/([\[\]\\])/g,"\\$1")+"])";if(I){G="\\\\"+G}var J=new RegExp(G,"g");K=K.replace(J,k);return K};var k=function(G,I){var H=I.charCodeAt(0);return"~E"+H+"E"}};Attacklab.wmdBase=function(){Attacklab.wmd_env={version:1,output:"Markdown",lineLength:40,buttons:"bold italic link blockquote code image ol ul heading hr"};var k=window.Attacklab;var m=window.document;var n=window.RegExp;var a=window.navigator;k.Util={};k.Position={};k.Command={};k.Global={};var f=k.Util;var g=k.Position;var e=k.Command;var b=k.Global;b.isIE=/msie/.test(a.userAgent.toLowerCase());b.isIE_5or6=/msie 6/.test(a.userAgent.toLowerCase())||/msie 5/.test(a.userAgent.toLowerCase());b.isOpera=/opera/.test(a.userAgent.toLowerCase());var j='<p><b>Insert Hyperlink</b></p><p>http://example.com/ "optional title"</p>';var i="<p><b>Insert Image</b></p><p>http://example.com/images/diagram.jpg \"optional title\"<br><br>Need <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>free image hosting?</a></p>";var d="http://";var o="http://";var c="/Content/Img/";var h="/editing-help";var l="Markdown Editing Help";k.PanelCollection=function(){this.buttonBar=m.getElementById("wmd-button-bar");this.preview=m.getElementById("wmd-preview");this.output=m.getElementById("wmd-output");this.input=m.getElementById("wmd-input")};k.panels=undefined;k.ieCachedRange=null;k.ieRetardedClick=false;f.isVisible=function(p){if(window.getComputedStyle){return window.getComputedStyle(p,null).getPropertyValue("display")!=="none"}else{if(p.currentStyle){return p.currentStyle.display!=="none"}}};f.addEvent=function(q,p,r){if(q.attachEvent){q.attachEvent("on"+p,r)}else{q.addEventListener(p,r,false)}};f.removeEvent=function(q,p,r){if(q.detachEvent){q.detachEvent("on"+p,r)}else{q.removeEventListener(p,r,false)}};f.fixEolChars=function(p){p=p.replace(/\r\n/g,"\n");p=p.replace(/\r/g,"\n");return p};f.extendRegExp=function(r,t,q){if(t===null||t===undefined){t=""}if(q===null||q===undefined){q=""}var s=r.toString();var p;s=s.replace(/\/([gim]*)$/,"");p=n.$1;s=s.replace(/(^\/|\/$)/g,"");s=t+s+q;return new n(s,p)};f.createImage=function(p){var r=c+p;var q=m.createElement("img");q.className="wmd-button";q.src=r;return q};f.prompt=function(v,y,r){var s;var p;var t;if(y===undefined){y=""}var u=function(z){var A=(z.charCode||z.keyCode);if(A===27){w(true)}};var w=function(z){f.removeEvent(m.body,"keydown",u);var A=t.value;if(z){A=null}else{A=A.replace("http://http://","http://");A=A.replace("http://https://","https://");A=A.replace("http://ftp://","ftp://");if(A.indexOf("http://")===-1&&A.indexOf("ftp://")===-1&&A.indexOf("https://")===-1){A="http://"+A}}s.parentNode.removeChild(s);p.parentNode.removeChild(p);r(A);return false};var q=function(){p=m.createElement("div");p.className="wmd-prompt-background";style=p.style;style.position="absolute";style.top="0";style.zIndex="1000";if(b.isIE){style.filter="alpha(opacity=50)"}else{style.opacity="0.5"}var z=g.getPageSize();style.height=z[1]+"px";if(b.isIE){style.left=m.documentElement.scrollLeft;style.width=m.documentElement.clientWidth}else{style.left="0";style.width="100%"}m.body.appendChild(p)};var x=function(){s=m.createElement("div");s.className="wmd-prompt-dialog";s.style.padding="10px;";s.style.position="fixed";s.style.width="400px";s.style.zIndex="1001";var z=m.createElement("div");z.innerHTML=v;z.style.padding="5px";s.appendChild(z);var A=m.createElement("form");A.onsubmit=function(){return w(false)};style=A.style;style.padding="0";style.margin="0";style.cssFloat="left";style.width="100%";style.textAlign="center";style.position="relative";s.appendChild(A);t=m.createElement("input");t.type="text";t.value=y;style=t.style;style.display="block";style.width="80%";style.marginLeft=style.marginRight="auto";A.appendChild(t);var C=m.createElement("input");C.type="button";C.onclick=function(){return w(false)};C.value="OK";style=C.style;style.margin="10px";style.display="inline";style.width="7em";var B=m.createElement("input");B.type="button";B.onclick=function(){return w(true)};B.value="Cancel";style=B.style;style.margin="10px";style.display="inline";style.width="7em";if(/mac/.test(a.platform.toLowerCase())){A.appendChild(B);A.appendChild(C)}else{A.appendChild(C);A.appendChild(B)}f.addEvent(m.body,"keydown",u);s.style.top="50%";s.style.left="50%";s.style.display="block";if(b.isIE_5or6){s.style.position="absolute";s.style.top=m.documentElement.scrollTop+200+"px";s.style.left="50%"}m.body.appendChild(s);s.style.marginTop=-(g.getHeight(s)/2)+"px";s.style.marginLeft=-(g.getWidth(s)/2)+"px"};q();window.setTimeout(function(){x();var A=y.length;if(t.selectionStart!==undefined){t.selectionStart=0;t.selectionEnd=A}else{if(t.createTextRange){var z=t.createTextRange();z.collapse(false);z.moveStart("character",-A);z.moveEnd("character",A);z.select()}}t.focus()},0)};g.getTop=function(r,q){var p=r.offsetTop;if(!q){while(r=r.offsetParent){p+=r.offsetTop}}return p};g.getHeight=function(p){return p.offsetHeight||p.scrollHeight};g.getWidth=function(p){return p.offsetWidth||p.scrollWidth};g.getPageSize=function(){var q,r;var p,u;if(self.innerHeight&&self.scrollMaxY){q=m.body.scrollWidth;r=self.innerHeight+self.scrollMaxY}else{if(m.body.scrollHeight>m.body.offsetHeight){q=m.body.scrollWidth;r=m.body.scrollHeight}else{q=m.body.offsetWidth;r=m.body.offsetHeight}}if(self.innerHeight){p=self.innerWidth;u=self.innerHeight}else{if(m.documentElement&&m.documentElement.clientHeight){p=m.documentElement.clientWidth;u=m.documentElement.clientHeight}else{if(m.body){p=m.body.clientWidth;u=m.body.clientHeight}}}var t=Math.max(q,p);var s=Math.max(r,u);return[t,s,p,u]};k.undoManager=function(A){var E=this;var y=[];var w=0;var v="none";var q;var B;var r;var u;var p=function(G,F){if(v!=G){v=G;if(!F){s()}}if(!b.isIE||v!="moving"){r=window.setTimeout(x,1)}else{u=null}};var x=function(){u=new k.TextareaState();r=undefined};this.setCommandMode=function(){v="command";s();r=window.setTimeout(x,0)};this.canUndo=function(){return w>1};this.canRedo=function(){if(y[w+1]){return true}return false};this.undo=function(){if(E.canUndo()){if(q){q.restore();q=null}else{y[w]=new k.TextareaState();y[--w].restore();if(A){A()}}}v="none";k.panels.input.focus();x()};this.redo=function(){if(E.canRedo()){y[++w].restore();if(A){A()}}v="none";k.panels.input.focus();x()};var s=function(){var F=u||new k.TextareaState();if(!F){return false}if(v=="moving"){if(!q){q=F}return}if(q){if(y[w-1].text!=q.text){y[w++]=q}q=null}y[w++]=F;y[w+1]=null;if(A){A()}};var z=function(F){var H=false;if((F.ctrlKey||F.metaKey)&&!F.altKey){var G=F.charCode||F.keyCode;var I=String.fromCharCode(G);switch(I){case"y":E.redo();H=true;break;case"z":if(!F.shiftKey){E.undo()}else{E.redo()}H=true;break}}if(H){if(F.preventDefault){F.preventDefault()}if(window.event){window.event.returnValue=false}return}};var D=function(F){if(!F.ctrlKey&&!F.metaKey){var G=F.keyCode;if((G>=33&&G<=40)||(G>=63232&&G<=63235)){p("moving")}else{if(G==8||G==46||G==127){p("deleting")}else{if(G==13){p("newlines")}else{if(G==27){p("escape")}else{if((G<16||G>20)&&G!=91){p("typing")}}}}}}};var t=function(){f.addEvent(k.panels.input,"keypress",function(G){if((G.ctrlKey||G.metaKey)&&!G.altKey&&(G.keyCode==89||G.keyCode==90)){G.preventDefault()}});var F=function(){if(b.isIE||(u&&u.text!=k.panels.input.value)){if(r==undefined){v="paste";s();x()}}};f.addEvent(k.panels.input,"keydown",z);f.addEvent(k.panels.input,"keydown",D);f.addEvent(k.panels.input,"mousedown",function(){p("moving")});k.panels.input.onpaste=F;k.panels.input.ondrop=F};var C=function(){t();x();s()};C()};k.editor=function(y){if(!y){y=function(){}}var v=k.panels.input;var s=0;var z=this;var u;var B;var q;var w;var x;var E=function(G){v.focus();if(G.textOp){if(x){x.setCommandMode()}var I=new k.TextareaState();if(!I){return}var J=I.getChunks();var F=function(){v.focus();if(J){I.setChunks(J)}I.restore();y()};var H=G.textOp(J,F);if(!H){F()}}if(G.execute){G.execute(z)}};var C=function(){if(x){p(document.getElementById("wmd-undo-button"),x.canUndo());p(document.getElementById("wmd-redo-button"),x.canRedo())}};var p=function(F,H){var I="0px";var J="-20px";var G="-40px";if(H){F.style.backgroundPosition=F.XShift+" "+I;F.onmouseover=function(){this.style.backgroundPosition=this.XShift+" "+G};F.onmouseout=function(){this.style.backgroundPosition=this.XShift+" "+I};if(b.isIE){F.onmousedown=function(){k.ieRetardedClick=true;k.ieCachedRange=document.selection.createRange()}}if(!F.isHelp){F.onclick=function(){if(this.onmouseout){this.onmouseout()}E(this);return false}}}else{F.style.backgroundPosition=F.XShift+" "+J;F.onmouseover=F.onmouseout=F.onclick=function(){}}};var t=function(){var K=document.getElementById("wmd-button-bar");var G="0px";var J="-20px";var P="-40px";var V=document.createElement("ul");V.id="wmd-button-row";V=K.appendChild(V);var O=document.createElement("li");O.className="wmd-button";O.id="wmd-bold-button";O.title="Strong <strong> Ctrl+B";O.XShift="0px";O.textOp=e.doBold;p(O,true);V.appendChild(O);var N=document.createElement("li");N.className="wmd-button";N.id="wmd-italic-button";N.title="Emphasis <em> Ctrl+I";N.XShift="-20px";N.textOp=e.doItalic;p(N,true);V.appendChild(N);var S=document.createElement("li");S.className="wmd-spacer";S.id="wmd-spacer1";V.appendChild(S);var T=document.createElement("li");T.className="wmd-button";T.id="wmd-link-button";T.title="Hyperlink <a> Ctrl+L";T.XShift="-40px";T.textOp=function(ab,ac){return e.doLinkOrImage(ab,ac,false)};p(T,true);V.appendChild(T);var W=document.createElement("li");W.className="wmd-button";W.id="wmd-quote-button";W.title="Blockquote <blockquote> Ctrl+Q";W.XShift="-60px";W.textOp=e.doBlockquote;p(W,true);V.appendChild(W);var X=document.createElement("li");X.className="wmd-button";X.id="wmd-code-button";X.title="Code Sample <pre><code> Ctrl+K";X.XShift="-80px";X.textOp=e.doCode;p(X,true);V.appendChild(X);var L=document.createElement("li");L.className="wmd-button";L.id="wmd-image-button";L.title="Image <img> Ctrl+G";L.XShift="-100px";L.textOp=function(ab,ac){return e.doLinkOrImage(ab,ac,true)};p(L,true);V.appendChild(L);var R=document.createElement("li");R.className="wmd-spacer";R.id="wmd-spacer2";V.appendChild(R);var M=document.createElement("li");M.className="wmd-button";M.id="wmd-olist-button";M.title="Numbered List <ol> Ctrl+O";M.XShift="-120px";M.textOp=function(ab,ac){e.doList(ab,ac,true)};p(M,true);V.appendChild(M);var aa=document.createElement("li");aa.className="wmd-button";aa.id="wmd-ulist-button";aa.title="Bulleted List <ul> Ctrl+U";aa.XShift="-140px";aa.textOp=function(ab,ac){e.doList(ab,ac,false)};p(aa,true);V.appendChild(aa);var U=document.createElement("li");U.className="wmd-button";U.id="wmd-heading-button";U.title="Heading <h1>/<h2> Ctrl+H";U.XShift="-160px";U.textOp=e.doHeading;p(U,true);V.appendChild(U);var H=document.createElement("li");H.className="wmd-button";H.id="wmd-hr-button";H.title="Horizontal Rule <hr> Ctrl+R";H.XShift="-180px";H.textOp=e.doHorizontalRule;p(H,true);V.appendChild(H);var Q=document.createElement("li");Q.className="wmd-spacer";Q.id="wmd-spacer3";V.appendChild(Q);var F=document.createElement("li");F.className="wmd-button";F.id="wmd-undo-button";F.title="Undo - Ctrl+Z";F.XShift="-200px";F.execute=function(ab){ab.undo()};p(F,true);V.appendChild(F);var Z=document.createElement("li");Z.className="wmd-button";Z.id="wmd-redo-button";Z.title="Redo - Ctrl+Y";if(/win/.test(a.platform.toLowerCase())){Z.title="Redo - Ctrl+Y"}else{Z.title="Redo - Ctrl+Shift+Z"}Z.XShift="-220px";Z.execute=function(ab){ab.redo()};p(Z,true);V.appendChild(Z);var Y=document.createElement("li");Y.className="wmd-button";Y.id="wmd-help-button";Y.XShift="-240px";Y.isHelp=true;var I=document.createElement("a");I.href=h;I.target="_blank";I.title=l;Y.appendChild(I);p(Y,true);V.appendChild(Y);C()};var r=function(){if(/\?noundo/.test(m.location.href)){k.nativeUndo=true}if(!k.nativeUndo){x=new k.undoManager(function(){y();C()})}t();var G="keydown";if(b.isOpera){G="keypress"}f.addEvent(v,G,function(I){if((I.ctrlKey||I.metaKey)&&!I.altKey){var J=I.charCode||I.keyCode;var H=String.fromCharCode(J).toLowerCase();switch(H){case"b":E(document.getElementById("wmd-bold-button"));break;case"i":E(document.getElementById("wmd-italic-button"));break;case"l":E(document.getElementById("wmd-link-button"));break;case"q":E(document.getElementById("wmd-quote-button"));break;case"k":E(document.getElementById("wmd-code-button"));break;case"g":E(document.getElementById("wmd-image-button"));break;case"o":E(document.getElementById("wmd-olist-button"));break;case"u":E(document.getElementById("wmd-ulist-button"));break;case"h":E(document.getElementById("wmd-heading-button"));break;case"r":E(document.getElementById("wmd-hr-button"));break;case"y":E(document.getElementById("wmd-redo-button"));break;case"z":if(I.shiftKey){E(document.getElementById("wmd-redo-button"))}else{E(document.getElementById("wmd-undo-button"))}break;default:return}if(I.preventDefault){I.preventDefault()}if(window.event){window.event.returnValue=false}}});f.addEvent(v,"keyup",function(H){if(H.shiftKey&&!H.ctrlKey&&!H.metaKey){var I=H.charCode||H.keyCode;if(I===13){fakeButton={};fakeButton.textOp=e.doAutoindent;E(fakeButton)}}});if(b.isIE){f.addEvent(v,"keydown",function(H){var I=H.keyCode;if(I===27){return false}})}if(v.form){var F=v.form.onsubmit;v.form.onsubmit=function(){A();if(F){return F.apply(this,arguments)}}}};var A=function(){if(k.showdown){var F=new k.showdown.converter()}var G=v.value;var H=function(){v.value=G};if(!/markdown/.test(k.wmd_env.output.toLowerCase())){if(F){v.value=F.makeHtml(G);window.setTimeout(H,0)}}return true};this.undo=function(){if(x){x.undo()}};this.redo=function(){if(x){x.redo()}};var D=function(){r()};this.destroy=function(){if(x){x.destroy()}if(q.parentNode){q.parentNode.removeChild(q)}if(v){v.style.marginTop=""}window.clearInterval(w)};D()};k.TextareaState=function(){var p=this;var q=k.panels.input;this.init=function(){if(!f.isVisible(q)){return}this.setInputAreaSelectionStartEnd();this.scrollTop=q.scrollTop;if(!this.text&&q.selectionStart||q.selectionStart===0){this.text=q.value}};this.setInputAreaSelection=function(){if(!f.isVisible(q)){return}if(q.selectionStart!==undefined&&!b.isOpera){q.focus();q.selectionStart=p.start;q.selectionEnd=p.end;q.scrollTop=p.scrollTop}else{if(m.selection){if(m.activeElement&&m.activeElement!==q){return}q.focus();var r=q.createTextRange();r.moveStart("character",-q.value.length);r.moveEnd("character",-q.value.length);r.moveEnd("character",p.end);r.moveStart("character",p.start);r.select()}}};this.setInputAreaSelectionStartEnd=function(){if(q.selectionStart||q.selectionStart===0){p.start=q.selectionStart;p.end=q.selectionEnd}else{if(m.selection){p.text=f.fixEolChars(q.value);var u;if(k.ieRetardedClick&&k.ieCachedRange){u=k.ieCachedRange;k.ieRetardedClick=false}else{u=m.selection.createRange()}var v=f.fixEolChars(u.text);var t="\x07";var s=t+v+t;u.text=s;var w=f.fixEolChars(q.value);u.moveStart("character",-s.length);u.text=v;p.start=w.indexOf(t);p.end=w.lastIndexOf(t)-t.length;var r=p.text.length-f.fixEolChars(q.value).length;if(r){u.moveStart("character",-v.length);while(r--){v+="\n";p.end+=1}u.text=v}this.setInputAreaSelection()}}};this.restore=function(){if(p.text!=undefined&&p.text!=q.value){q.value=p.text}this.setInputAreaSelection();q.scrollTop=p.scrollTop};this.getChunks=function(){var r=new k.Chunks();r.before=f.fixEolChars(p.text.substring(0,p.start));r.startTag="";r.selection=f.fixEolChars(p.text.substring(p.start,p.end));r.endTag="";r.after=f.fixEolChars(p.text.substring(p.end));r.scrollTop=p.scrollTop;return r};this.setChunks=function(r){r.before=r.before+r.startTag;r.after=r.endTag+r.after;if(b.isOpera){r.before=r.before.replace(/\n/g,"\r\n");r.selection=r.selection.replace(/\n/g,"\r\n");r.after=r.after.replace(/\n/g,"\r\n")}this.start=r.before.length;this.end=r.before.length+r.selection.length;this.text=r.before+r.selection+r.after;this.scrollTop=r.scrollTop};this.init()};k.Chunks=function(){};k.Chunks.prototype.findTags=function(q,s){var p=this;var r;if(q){r=f.extendRegExp(q,"","$");this.before=this.before.replace(r,function(t){p.startTag=p.startTag+t;return""});r=f.extendRegExp(q,"^","");this.selection=this.selection.replace(r,function(t){p.startTag=p.startTag+t;return""})}if(s){r=f.extendRegExp(s,"","$");this.selection=this.selection.replace(r,function(t){p.endTag=t+p.endTag;return""});r=f.extendRegExp(s,"^","");this.after=this.after.replace(r,function(t){p.endTag=t+p.endTag;return""})}};k.Chunks.prototype.trimWhitespace=function(p){this.selection=this.selection.replace(/^(\s*)/,"");if(!p){this.before+=n.$1}this.selection=this.selection.replace(/(\s*)$/,"");if(!p){this.after=n.$1+this.after}};k.Chunks.prototype.skipLines=function(r,q,p){if(r===undefined){r=1}if(q===undefined){q=1}r++;q++;var s;var t;this.selection=this.selection.replace(/(^\n*)/,"");this.startTag=this.startTag+n.$1;this.selection=this.selection.replace(/(\n*$)/,"");this.endTag=this.endTag+n.$1;this.startTag=this.startTag.replace(/(^\n*)/,"");this.before=this.before+n.$1;this.endTag=this.endTag.replace(/(\n*$)/,"");this.after=this.after+n.$1;if(this.before){s=t="";while(r--){s+="\\n?";t+="\n"}if(p){s="\\n*"}this.before=this.before.replace(new n(s+"$",""),t)}if(this.after){s=t="";while(q--){s+="\\n?";t+="\n"}if(p){s="\\n*"}this.after=this.after.replace(new n(s,""),t)}};e.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)";e.unwrap=function(q){var p=new n("([^\\n])\\n(?!(\\n|"+e.prefixes+"))","g");q.selection=q.selection.replace(p,"$1 $2")};e.wrap=function(q,p){e.unwrap(q);var r=new n("(.{1,"+p+"})( +|$\\n?)","gm");q.selection=q.selection.replace(r,function(s,t){if(new n("^"+e.prefixes,"").test(s)){return s}return t+"\n"});q.selection=q.selection.replace(/\s+$/,"")};e.doBold=function(p,q){return e.doBorI(p,q,2,"strong text")};e.doItalic=function(p,q){return e.doBorI(p,q,1,"emphasized text")};e.doBorI=function(v,t,u,p){v.trimWhitespace();v.selection=v.selection.replace(/\n{2,}/g,"\n");v.before.search(/(\**$)/);var s=n.$1;v.after.search(/(^\**)/);var q=n.$1;var w=Math.min(s.length,q.length);if((w>=u)&&(w!=2||u!=1)){v.before=v.before.replace(n("[*]{"+u+"}$",""),"");v.after=v.after.replace(n("^[*]{"+u+"}",""),"")}else{if(!v.selection&&q){v.after=v.after.replace(/^([*_]*)/,"");v.before=v.before.replace(/(\s?)$/,"");var r=n.$1;v.before=v.before+q+r}else{if(!v.selection&&!q){v.selection=p}var x=u<=1?"*":"**";v.before=v.before+x;v.after=x+v.after}}return};e.stripLinkDefs=function(q,p){q=q.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,function(u,v,r,s,t){p[v]=u.replace(/\s*$/,"");if(s){p[v]=u.replace(/["(](.+?)[")]$/,"");return s+t}return""});return q};e.addLinkDef=function(w,s){var p=0;var r={};w.before=e.stripLinkDefs(w.before,r);w.selection=e.stripLinkDefs(w.selection,r);w.after=e.stripLinkDefs(w.after,r);var q="";var v=/(\[(?:\[[^\]]*\]|[^\[\]])*\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g;var u=function(y){p++;y=y.replace(/^[ ]{0,3}\[(\d+)\]:/,"  ["+p+"]:");q+="\n"+y};var t=function(z,A,B,y){if(r[B]){u(r[B]);return A+p+y}return z};w.before=w.before.replace(v,t);if(s){u(s)}else{w.selection=w.selection.replace(v,t)}var x=p;w.after=w.after.replace(v,t);if(w.after){w.after=w.after.replace(/\n*$/,"")}if(!w.after){w.selection=w.selection.replace(/\n*$/,"")}w.after+="\n\n"+q;return x};e.doLinkOrImage=function(p,q,s){p.trimWhitespace();p.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);if(p.endTag.length>1){p.startTag=p.startTag.replace(/!?\[/,"");p.endTag="";e.addLinkDef(p,null)}else{if(/\n\n/.test(p.selection)){e.addLinkDef(p,null);return}var r=function(v){if(v!==null){p.startTag=p.endTag="";var u=" [999]: "+v;var t=e.addLinkDef(p,u);p.startTag=s?"![":"[";p.endTag="]["+t+"]";if(!p.selection){if(s){p.selection="alt text"}else{p.selection="link text"}}}q()};if(s){f.prompt(i,d,r)}else{f.prompt(j,o,r)}return true}};f.makeAPI=function(){k.wmd={};k.wmd.editor=k.editor;k.wmd.previewManager=k.previewManager};f.startEditor=function(){var r;var q;k.panels=new k.PanelCollection();q=new k.previewManager();var p=q.refresh;r=new k.editor(p);q.refresh(true)};k.previewManager=function(){var r=this;var J;var q;var z;var y;var G;var A;var s=3000;var B="delayed";var w=function(M,N){f.addEvent(M,"input",N);M.onpaste=N;M.ondrop=N;f.addEvent(M,"keypress",N);f.addEvent(M,"keydown",N)};var F=function(){var M=0;if(window.innerHeight){M=window.pageYOffset}else{if(m.documentElement&&m.documentElement.scrollTop){M=m.documentElement.scrollTop}else{if(m.body){M=m.body.scrollTop}}}return M};var x=function(){if(!k.panels.preview&&!k.panels.output){return}var O=k.panels.input.value;if(O&&O==G){return}else{G=O}var N=new Date().getTime();if(!J&&k.showdown){J=new k.showdown.converter()}if(J){O=J.makeHtml(O)}var M=new Date().getTime();y=M-N;p(O);A=O};var I=function(){if(z){window.clearTimeout(z);z=undefined}if(B!=="manual"){var M=0;if(B==="delayed"){M=y}if(M>s){M=s}z=window.setTimeout(x,M)}};var v=function(M){if(M.scrollHeight<=M.clientHeight){return 1}return M.scrollTop/(M.scrollHeight-M.clientHeight)};var L=function(){if(k.panels.preview){k.panels.preview.scrollTop=(k.panels.preview.scrollHeight-k.panels.preview.clientHeight)*v(k.panels.preview)}if(k.panels.output){k.panels.output.scrollTop=(k.panels.output.scrollHeight-k.panels.output.clientHeight)*v(k.panels.output)}};this.refresh=function(M){if(M){G="";x()}else{I()}};this.processingTime=function(){return y};this.output=function(){return A};var C=true;var t=function(M){return M.replace(/<[^<>]*>?/gi,D)};var K=/^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|kbd|li|ol|p|pre|s|sup|sub|strong|strike|ul)>|<(br|hr)\s?\/?>)$/i;var E=/^(<a\shref="(\#\d+|(https?|ftp):\/\/[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)]+)"(\stitle="[^"<>]+")?\s?>|<\/a>)$/i;var u=/^(<img\ssrc="https?:(\/\/[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)]+)"(\swidth="\d{1,3}")?(\sheight="\d{1,3}")?(\salt="[^"<>]*")?(\stitle="[^"<>]*")?\s?\/?>)$/i;function D(M){if(M.match(K)||M.match(E)||M.match(u)){return M}else{return""}}var p=function(P){var M=g.getTop(k.panels.input)-F();if(k.panels.output){if(k.panels.output.value!==undefined){k.panels.output.value=P;k.panels.output.readOnly=true}else{var O=P.replace(/&/g,"&amp;").replace(/</g,"&lt;");k.panels.output.innerHTML="<pre><code>"+O+"</code></pre>"}}if(k.panels.preview){k.panels.preview.innerHTML=t(P)}L();if(C){C=false;return}var N=g.getTop(k.panels.input)-F();if(b.isIE){window.setTimeout(function(){window.scrollBy(0,N-M)},0)}else{window.scrollBy(0,N-M)}};var H=function(){w(k.panels.input,I);x();if(k.panels.preview){k.panels.preview.scrollTop=0}if(k.panels.output){k.panels.output.scrollTop=0}};this.destroy=function(){if(q){q.destroy()}};H()};e.doAutoindent=function(p,q){p.before=p.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n");p.before=p.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n");p.before=p.before.replace(/(\n|^)[ \t]+\n$/,"\n\n");if(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(p.before)){if(e.doList){e.doList(p)}}if(/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(p.before)){if(e.doBlockquote){e.doBlockquote(p)}}if(/(\n|^)(\t|[ ]{4,}).*\n$/.test(p.before)){if(e.doCode){e.doCode(p)}}};e.doBlockquote=function(p,q){p.selection=p.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(v,u,t,s){p.before+=u;p.after=s+p.after;return t});p.before=p.before.replace(/(>[ \t]*)$/,function(t,s){p.selection=s+p.selection;return""});p.selection=p.selection.replace(/^(\s|>)+$/,"");p.selection=p.selection||"Blockquote";if(p.before){p.before=p.before.replace(/\n?$/,"\n")}if(p.after){p.after=p.after.replace(/^\n?/,"\n")}p.before=p.before.replace(/(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*$)/,function(s){p.startTag=s;return""});p.after=p.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(s){p.endTag=s;return""});var r=function(t){var s=t?"> ":"";if(p.startTag){p.startTag=p.startTag.replace(/\n((>|\s)*)\n$/,function(v,u){return"\n"+u.replace(/^[ ]{0,3}>?[ \t]*$/gm,s)+"\n"})}if(p.endTag){p.endTag=p.endTag.replace(/^\n((>|\s)*)\n/,function(v,u){return"\n"+u.replace(/^[ ]{0,3}>?[ \t]*$/gm,s)+"\n"})}};if(/^(?![ ]{0,3}>)/m.test(p.selection)){e.wrap(p,k.wmd_env.lineLength-2);p.selection=p.selection.replace(/^/gm,"> ");r(true);p.skipLines()}else{p.selection=p.selection.replace(/^[ ]{0,3}> ?/gm,"");e.unwrap(p);r(false);if(!/^(\n|^)[ ]{0,3}>/.test(p.selection)&&p.startTag){p.startTag=p.startTag.replace(/\n{0,2}$/,"\n\n")}if(!/(\n|^)[ ]{0,3}>.*$/.test(p.selection)&&p.endTag){p.endTag=p.endTag.replace(/^\n{0,2}/,"\n\n")}}if(!/\n/.test(p.selection)){p.selection=p.selection.replace(/^(> *)/,function(s,t){p.startTag+=t;return""})}};e.doCode=function(p,q){var s=/\S[ ]*$/.test(p.before);var u=/^[ ]*\S/.test(p.after);if((!u&&!s)||/\n/.test(p.selection)){p.before=p.before.replace(/[ ]{4}$/,function(v){p.selection=v+p.selection;return""});var t=1;var r=1;if(/\n(\t|[ ]{4,}).*\n$/.test(p.before)){t=0}if(/^\n(\t|[ ]{4,})/.test(p.after)){r=0}p.skipLines(t,r);if(!p.selection){p.startTag="    ";p.selection="enter code here"}else{if(/^[ ]{0,3}\S/m.test(p.selection)){p.selection=p.selection.replace(/^/gm,"    ")}else{p.selection=p.selection.replace(/^[ ]{4}/gm,"")}}}else{p.trimWhitespace();p.findTags(/`/,/`/);if(!p.startTag&&!p.endTag){p.startTag=p.endTag="`";if(!p.selection){p.selection="enter code here"}}else{if(p.endTag&&!p.startTag){p.before+=p.endTag;p.endTag=""}else{p.startTag=p.endTag=""}}}};e.doList=function(A,t,s){var C=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/;var B=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/;var p="-";var x=1;var v=function(){var D;if(s){D=" "+x+". ";x++}else{D=" "+p+" "}return D};var w=function(D){if(s===undefined){s=/^\s*\d/.test(D)}D=D.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(E){return v()});return D};A.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null);if(A.before&&!/\n$/.test(A.before)&&!/^\n/.test(A.startTag)){A.before+=A.startTag;A.startTag=""}if(A.startTag){var r=/\d+[.]/.test(A.startTag);A.startTag="";A.selection=A.selection.replace(/\n[ ]{4}/g,"\n");e.unwrap(A);A.skipLines();if(r){A.after=A.after.replace(B,w)}if(s==r){return}}var u=1;A.before=A.before.replace(C,function(D){if(/^\s*([*+-])/.test(D)){p=n.$1}u=/[^\n]\n\n[^\n]/.test(D)?1:0;return w(D)});if(!A.selection){A.selection="List item"}var y=v();var q=1;A.after=A.after.replace(B,function(D){q=/[^\n]\n\n[^\n]/.test(D)?1:0;return w(D)});A.trimWhitespace(true);A.skipLines(u,q,true);A.startTag=y;var z=y.replace(/./g," ");e.wrap(A,k.wmd_env.lineLength-z.length);A.selection=A.selection.replace(/\n/g,"\n"+z)};e.doHeading=function(r,s){r.selection=r.selection.replace(/\s+/g," ");r.selection=r.selection.replace(/(^\s+|\s+$)/g,"");if(!r.selection){r.startTag="## ";r.selection="Heading";r.endTag=" ##";return}var t=0;r.findTags(/#+[ ]*/,/[ ]*#+/);if(/#+/.test(r.startTag)){t=n.lastMatch.length}r.startTag=r.endTag="";r.findTags(null,/\s?(-+|=+)/);if(/=+/.test(r.endTag)){t=1}if(/-+/.test(r.endTag)){t=2}r.startTag=r.endTag="";r.skipLines(1,1);var u=t==0?2:t-1;if(u>0){var q=u>=2?"-":"=";var p=r.selection.length;if(p>k.wmd_env.lineLength){p=k.wmd_env.lineLength}r.endTag="\n";while(p--){r.endTag+=q}}};e.doHorizontalRule=function(p,q){p.startTag="----------\n";p.selection="";p.skipLines(2,1,true)}};
