function edButton(t,e,i,n,s,o){this.id=t,this.display=e,this.tagStart=i,this.tagEnd=n,this.access=s,this.open=o}function get_buttons(t){switch(t){case"textile":edButtons.push(new edButton("ed_bold","b","**","**","b")),edButtons.push(new edButton("ed_italic","i","_","_","i")),edButtons.push(new edButton("ed_link","link","","","a")),edButtons.push(new edButton("ed_img","img","!","!","m",-1)),edButtons.push(new edButton("ed_li","li","* ","","l",-1)),edButtons.push(new edButton("ed_block","b-quote",">","","q",-1)),edButtons.push(new edButton("ed_del","del","","")),edButtons.push(new edButton("ed_code","code","@","@","c")),edButtons.push(new edButton("ed_more","more","\n\n","","")),edButtons.push(new edButton("ed_publifycode","publify:code","","\n\n\n","publify:code"));break;case"markdown":case"markdown smartypants":edButtons.push(new edButton("ed_bold","b","**","**","b")),edButtons.push(new edButton("ed_italic","i","_","_","i")),edButtons.push(new edButton("ed_link","link","","","a")),edButtons.push(new edButton("ed_img","img","","","m",-1)),edButtons.push(new edButton("ed_li","li","* ","","l",-1)),edButtons.push(new edButton("ed_ol","ol","#","","o",-1)),edButtons.push(new edButton("ed_block","b-quote",">","","q",-1)),edButtons.push(new edButton("ed_del","del","","")),edButtons.push(new edButton("ed_code","code","`","`","c")),edButtons.push(new edButton("ed_more","more","\n\n","","")),edButtons.push(new edButton("ed_publifycode","publify:code","","\n\n\n","publify:code"));break;default:edButtons.push(new edButton("ed_bold","b","","","b")),edButtons.push(new edButton("ed_italic","i","","","i")),edButtons.push(new edButton("ed_link","link","","","a")),edButtons.push(new edButton("ed_img","img","","","m",-1)),edButtons.push(new edButton("ed_ul","ul","
\n\n","u")),edButtons.push(new edButton("ed_ol","ol","\n","
\n\n","o")),edButtons.push(new edButton("ed_li","li","\t","\n","l")),edButtons.push(new edButton("ed_block","b-quote","","
","q")),edButtons.push(new edButton("ed_del","del","","")),edButtons.push(new edButton("ed_code","code","","
","c")),edButtons.push(new edButton("ed_more","more","\n\n","","")),edButtons.push(new edButton("ed_publifycode","publify:code","","\n\n\n","publify:code"))}}function edLink(t,e,i){this.display=t,this.URL=e,i||(i=0),this.newWin=i}function edShowButton(t,e,i){if(e.access)var n=' accesskey = "'+e.access+'"';else n="";switch(e.id){case"ed_img":document.write('');break;case"ed_link":document.write('');break;case"ed_publifycode":document.write('');break;default:document.write('')}}function edShowLinks(){var t='",document.write(t)}function edAddTag(t,e){""!=edButtons[e].tagEnd&&(edOpenTags[t][edOpenTags[t].length]=e,document.getElementById(edButtons[e].id+"_"+t).value="/"+document.getElementById(edButtons[e].id+"_"+t).value)}function edRemoveTag(t,e){for(i=0;i"+edLinks[t].display+"";e.selectedIndex=0,edInsertContent(edCanvas,n)}else e.selectedIndex=0}function edSpell(t){myField=document.getElementById(t);var e="";if(document.selection){myField.focus();var i=document.selection.createRange();0'),i=0;i'),document.write("
"),edOpenTags[t]=new Array}function edInsertTag(t,e){if(myField=document.getElementById(t),document.selection)myField.focus(),sel=document.selection.createRange(),0',edInsertTag(t,e))}}function edInsertPublifyCode(t,e,i){if(myField=document.getElementById(t),i||(i=""),edCheckOpenTags(t,e))edInsertTag(t,e);else{var n=prompt("Choose language",i);n&&(edButtons[e].tagStart='\n',edInsertTag(t,e))}}function edInsertImage(t){myField=document.getElementById(t);var e=prompt("Enter the URL of the image","http://");e&&0')}function edInsertImageFromCarousel(t,e){myField=document.getElementById(t),e&&(myValue='
',edInsertContent(t,myValue))}function countInstances(t,e){return t.split(e).length-1}function edInsertVia(t){myField=document.getElementById(t);var e=prompt("Enter the URL of the source link","http://");e&&edInsertContent(t,e='(Thanks '+prompt("Enter the name of the source","")+")")}function edSetCookie(t,e,i,n,s){document.cookie=t+"="+escape(e)+(i?"; expires="+i.toGMTString():"")+(n?"; path="+n:"")+(s?"; domain="+s:"")}function edShowExtraCookie(){for(var t=document.cookie.split(";"),e=0;e"!==c[1]||Jt.test(a)?0:l:l.firstChild)&&a.childNodes.length;o--;)pt.nodeName(h=a.childNodes[o],"tbody")&&!h.childNodes.length&&a.removeChild(h);for(pt.merge(f,l.childNodes),l.textContent="";l.firstChild;)l.removeChild(l.firstChild);l=p.lastChild}else f.push(e.createTextNode(a));for(l&&p.removeChild(l),ct.appendChecked||pt.grep(v(f,"input"),b),m=0;a=f[m++];)if(n&&-1")).appendTo(e.documentElement))[0].contentWindow||he[0].contentDocument).document).write(),e.close(),i=M(t,e),he.detach()),ce[t]=i),i}function E(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}function N(t){if(t in De)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),i=Te.length;i--;)if((t=Te[i]+e)in De)return t}function P(t,e){for(var i,n,s,o=[],a=0,r=t.length;ax.cacheLength&&delete i[n.shift()],i[t+" "]=e}var n=[];return i}function l(t){return t[z]=!0,t}function s(t){var e=N.createElement("div");try{return!!t(e)}catch(i){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function e(t,e){for(var i=t.split("|"),n=i.length;n--;)x.attrHandle[i[n]]=e}function u(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||K)-(~t.sourceIndex||K);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function n(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function o(i){return function(t){var e=t.nodeName.toLowerCase();return("input"===e||"button"===e)&&t.type===i}}function a(a){return l(function(o){return o=+o,l(function(t,e){for(var i,n=a([],t.length,o),s=n.length;s--;)t[i=n[s]]&&(t[i]=!(e[i]=t[i]))})})}function m(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function r(){}function g(t){for(var e=0,i=t.length,n="";e+~]|"+it+")"+it+"*"),ht=new RegExp("="+it+"*([^\\]'\"]*?)"+it+"*\\]","g"),ct=new RegExp(ot),dt=new RegExp("^"+nt+"$"),pt={ID:new RegExp("^#("+nt+")"),CLASS:new RegExp("^\\.("+nt+")"),TAG:new RegExp("^("+nt+"|[*])"),ATTR:new RegExp("^"+st),PSEUDO:new RegExp("^"+ot),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+it+"*(even|odd|(([+-]|)(\\d*)n|)"+it+"*(?:([+-]|)"+it+"*(\\d+)|))"+it+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+it+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+it+"*((?:-\\d)?\\d*)"+it+"*\\)|)(?=[^-]|$)","i")},ft=/^(?:input|select|textarea|button)$/i,mt=/^h\d$/i,gt=/^[^{]+\{\s*\[native \w/,vt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,yt=/[+~]/,bt=/'|\\/g,_t=new RegExp("\\\\([\\da-f]{1,6}"+it+"?|("+it+")|.)","ig"),wt=function(t,e,i){var n="0x"+e-65536;return n!=n||i?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},xt=function(){E()};try{G.apply(Q=Z.call($.childNodes),$.childNodes),Q[$.childNodes.length].nodeType}catch(kt){G={apply:Q.length?function(t,e){X.apply(t,Z.call(e))}:function(t,e){for(var i=t.length,n=0;t[i++]=e[n++];);t.length=i-1}}}for(f in v=_.support={},C=_.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},E=_.setDocument=function(t){var e,i,n=t?t.ownerDocument||t:$;return n!==N&&9===n.nodeType&&n.documentElement&&(P=(N=n).documentElement,O=!C(N),(i=N.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",xt,!1):i.attachEvent&&i.attachEvent("onunload",xt)),v.attributes=s(function(t){return t.className="i",!t.getAttribute("className")}),v.getElementsByTagName=s(function(t){return t.appendChild(N.createComment("")),!t.getElementsByTagName("*").length}),v.getElementsByClassName=gt.test(N.getElementsByClassName),v.getById=s(function(t){return P.appendChild(t).id=z,!N.getElementsByName||!N.getElementsByName(z).length}),v.getById?(x.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&O){var i=e.getElementById(t);return i?[i]:[]}},x.filter.ID=function(t){var e=t.replace(_t,wt);return function(t){return t.getAttribute("id")===e}}):(delete x.find.ID,x.filter.ID=function(t){var i=t.replace(_t,wt);return function(t){var e="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return e&&e.value===i}}),x.find.TAG=v.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):v.qsa?e.querySelectorAll(t):void 0}:function(t,e){var i,n=[],s=0,o=e.getElementsByTagName(t);if("*"===t){for(;i=o[s++];)1===i.nodeType&&n.push(i);return n}return o},x.find.CLASS=v.getElementsByClassName&&function(t,e){if("undefined"!=typeof e.getElementsByClassName&&O)return e.getElementsByClassName(t)},j=[],H=[],(v.qsa=gt.test(N.querySelectorAll))&&(s(function(t){P.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&H.push("[*^$]="+it+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||H.push("\\["+it+"*(?:value|"+et+")"),t.querySelectorAll("[id~="+z+"-]").length||H.push("~="),t.querySelectorAll(":checked").length||H.push(":checked"),t.querySelectorAll("a#"+z+"+*").length||H.push(".#.+[+~]")}),s(function(t){var e=N.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&H.push("name"+it+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||H.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),H.push(",.*:")})),(v.matchesSelector=gt.test(F=P.matches||P.webkitMatchesSelector||P.mozMatchesSelector||P.oMatchesSelector||P.msMatchesSelector))&&s(function(t){v.disconnectedMatch=F.call(t,"div"),F.call(t,"[s!='']:x"),j.push("!=",ot)}),H=H.length&&new RegExp(H.join("|")),j=j.length&&new RegExp(j.join("|")),e=gt.test(P.compareDocumentPosition),L=e||gt.test(P.contains)?function(t,e){var i=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},V=e?function(t,e){if(t===e)return A=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!v.sortDetached&&e.compareDocumentPosition(t)===i?t===N||t.ownerDocument===$&&L($,t)?-1:e===N||e.ownerDocument===$&&L($,e)?1:M?tt(M,t)-tt(M,e):0:4&i?-1:1)}:function(t,e){if(t===e)return A=!0,0;var i,n=0,s=t.parentNode,o=e.parentNode,a=[t],r=[e];if(!s||!o)return t===N?-1:e===N?1:s?-1:o?1:M?tt(M,t)-tt(M,e):0;if(s===o)return u(t,e);for(i=t;i=i.parentNode;)a.unshift(i);for(i=e;i=i.parentNode;)r.unshift(i);for(;a[n]===r[n];)n++;return n?u(a[n],r[n]):a[n]===$?-1:r[n]===$?1:0}),N},_.matches=function(t,e){return _(t,null,null,e)},_.matchesSelector=function(t,e){if((t.ownerDocument||t)!==N&&E(t),e=e.replace(ht,"='$1']"),v.matchesSelector&&O&&!Y[e+" "]&&(!j||!j.test(e))&&(!H||!H.test(e)))try{var i=F.call(t,e);if(i||v.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(kt){}return 0<_(e,N,null,[t]).length},_.contains=function(t,e){return(t.ownerDocument||t)!==N&&E(t),L(t,e)},_.attr=function(t,e){(t.ownerDocument||t)!==N&&E(t);var i=x.attrHandle[e.toLowerCase()],n=i&&U.call(x.attrHandle,e.toLowerCase())?i(t,e,!O):undefined;return n!==undefined?n:v.attributes||!O?t.getAttribute(e):(n=t.getAttributeNode(e))&&n.specified?n.value:null},_.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},_.uniqueSort=function(t){var e,i=[],n=0,s=0;if(A=!v.detectDuplicates,M=!v.sortStable&&t.slice(0),t.sort(V),A){for(;e=t[s++];)e===t[s]&&(n=i.push(s));for(;n--;)t.splice(i[n],1)}return M=null,t},k=_.getText=function(t){var e,i="",n=0,s=t.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=k(t)}else if(3===s||4===s)return t.nodeValue}else for(;e=t[n++];)i+=k(e);return i},(x=_.selectors={cacheLength:50,createPseudo:l,match:pt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(_t,wt),t[3]=(t[3]||t[4]||t[5]||"").replace(_t,wt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||_.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&_.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return pt.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&ct.test(i)&&(e=T(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(_t,wt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=B[t+" "];return e||(e=new RegExp("(^|"+it+")"+t+"("+it+"|$)"))&&B(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(i,n,s){return function(t){var e=_.attr(t,i);return null==e?"!="===n:!n||(e+="","="===n?e===s:"!="===n?e!==s:"^="===n?s&&0===e.indexOf(s):"*="===n?s&&-1(?:<\/\1>|)$/,kt=/^.[^:#\[\.,]*$/;pt.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?pt.find.matchesSelector(n,t)?[n]:[]:pt.find.matches(t,pt.grep(e,function(t){return 1===t.nodeType}))},pt.fn.extend({find:function(t){var e,i=[],n=this,s=n.length;if("string"!=typeof t)return this.pushStack(pt(t).filter(function(){for(e=0;e)[^>]*|#([\w-]*))$/;(pt.fn.init=function(t,e,i){var n,s;if(!t)return this;if(i=i||Ct,"string"==typeof t){if(!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&3<=t.length?[null,t,null]:Tt.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof pt?e[0]:e,pt.merge(this,pt.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:nt,!0)),xt.test(n[1])&&pt.isPlainObject(e))for(n in e)pt.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}if((s=nt.getElementById(n[2]))&&s.parentNode){if(s.id!==n[2])return Ct.find(t);this.length=1,this[0]=s}return this.context=nt,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):pt.isFunction(t)?"undefined"!=typeof i.ready?i.ready(t):t(pt):(t.selector!==undefined&&(this.selector=t.selector,this.context=t.context),pt.makeArray(t,this))}).prototype=pt.fn,Ct=pt(nt);var Dt=/^(?:parents|prev(?:Until|All))/,St={children:!0,contents:!0,next:!0,prev:!0};pt.fn.extend({has:function(t){var e,i=pt(t,this),n=i.length;return this.filter(function(){for(e=0;ea",ct.leadingWhitespace=3===Ht.firstChild.nodeType,ct.tbody=!Ht.getElementsByTagName("tbody").length,ct.htmlSerialize=!!Ht.getElementsByTagName("link").length,ct.html5Clone="<:nav>"!==nt.createElement("nav").cloneNode(!0).outerHTML,Ft.type="checkbox",Ft.checked=!0,jt.appendChild(Ft),ct.appendChecked=Ft.checked,Ht.innerHTML="",ct.noCloneChecked=!!Ht.cloneNode(!0).lastChild.defaultValue,jt.appendChild(Ht),(Ft=nt.createElement("input")).setAttribute("type","radio"),Ft.setAttribute("checked","checked"),Ft.setAttribute("name","t"),Ht.appendChild(Ft),ct.checkClone=Ht.cloneNode(!0).cloneNode(!0).lastChild.checked,ct.noCloneEvent=!!Ht.addEventListener,Ht[pt.expando]=1,ct.attributes=!Ht.getAttribute(pt.expando);var Ut={option:[1,""],legend:[1,""],area:[1,""],param:[1,""],thead:[1,""],tr:[2,""],col:[2,""],td:[3,""],_default:ct.htmlSerialize?[0,"",""]:[1,"X","
"]};Ut.optgroup=Ut.option,Ut.tbody=Ut.tfoot=Ut.colgroup=Ut.caption=Ut.thead,Ut.th=Ut.td;var Qt=/<|?\w+;/,Jt=/]","i"),se=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,oe=/