MathJax.Extension.mml2jax={version:"2.7.0",config:{preview:"mathml"},MMLnamespace:"http://www.w3.org/1998/Math/MathML",PreProcess:function(e){this.configured||(this.config=MathJax.Hub.CombineConfig("mml2jax",this.config),this.config.Augment&&MathJax.Hub.Insert(this,this.config.Augment),this.InitBrowser(),this.configured=!0),"string"==typeof e&&(e=document.getElementById(e)),e||(e=document.body);var t=[];this.PushMathElements(t,e,"math"),this.PushMathElements(t,e,"math",this.MMLnamespace);var a,s;if("undefined"!=typeof document.namespaces)try{for(a=0,s=document.namespaces.length;a<s;a++){var n=document.namespaces[a];n.urn===this.MMLnamespace&&this.PushMathElements(t,e,n.name+":math")}}catch(e){}else{var i=document.getElementsByTagName("html")[0];if(i)for(a=0,s=i.attributes.length;a<s;a++){var r=i.attributes[a];"xmlns:"===r.nodeName.substr(0,6)&&r.nodeValue===this.MMLnamespace&&this.PushMathElements(t,e,r.nodeName.substr(6)+":math")}}this.ProcessMathArray(t)},PushMathElements:function(e,t,a,s){var n,i=MathJax.Hub.config.preRemoveClass;if(s){if(!t.getElementsByTagNameNS)return;n=t.getElementsByTagNameNS(s,a)}else n=t.getElementsByTagName(a);for(var r=0,o=n.length;r<o;r++){var h=n[r].parentNode;h&&h.className!==i&&!h.isMathJax&&!n[r].prefix==!s&&e.push(n[r])}},ProcessMathArray:function(e){var t,a=e.length;if(a)if(this.MathTagBug)for(t=0;t<a;t++)"MATH"===e[t].nodeName?this.ProcessMathFlattened(e[t]):this.ProcessMath(e[t]);else for(t=0;t<a;t++)this.ProcessMath(e[t])},ProcessMath:function(e){var t=e.parentNode;if(t&&t.className!==MathJax.Hub.config.preRemoveClass){var a=document.createElement("script");if(a.type="math/mml",t.insertBefore(a,e),this.AttributeBug){var s=this.OuterHTML(e);this.CleanupHTML&&(s=s.replace(/<\?import .*?>/i,"").replace(/<\?xml:namespace .*?\/>/i,""),s=s.replace(/&nbsp;/g,"&#xA0;")),MathJax.HTML.setScript(a,s),t.removeChild(e)}else{var n=MathJax.HTML.Element("span");n.appendChild(e),MathJax.HTML.setScript(a,n.innerHTML)}"none"!==this.config.preview&&this.createPreview(e,a)}},ProcessMathFlattened:function(e){var t=e.parentNode;if(t&&t.className!==MathJax.Hub.config.preRemoveClass){var a=document.createElement("script");a.type="math/mml",t.insertBefore(a,e);for(var s,n="",i=e;e&&"/MATH"!==e.nodeName;)s=e,e=e.nextSibling,n+=this.NodeHTML(s),s.parentNode.removeChild(s);e&&"/MATH"===e.nodeName&&e.parentNode.removeChild(e),a.text=n+"</math>","none"!==this.config.preview&&this.createPreview(i,a)}},NodeHTML:function(e){var t,a,s;if("#text"===e.nodeName)t=this.quoteHTML(e.nodeValue);else if("#comment"===e.nodeName)t="<!--"+e.nodeValue+"-->";else{for(t="<"+e.nodeName.toLowerCase(),a=0,s=e.attributes.length;a<s;a++){var n=e.attributes[a];if(n.specified&&"_moz-math-"!==n.nodeName.substr(0,10)){t+=" "+n.nodeName.toLowerCase().replace(/xmlns:xmlns/,"xmlns")+"=";var i=n.nodeValue;null==i&&"style"===n.nodeName&&e.style&&(i=e.style.cssText),t+='"'+this.quoteHTML(i)+'"'}}if(t+=">",null!=e.outerHTML&&e.outerHTML.match(/(.<\/[A-Z]+>|\/>)$/)){for(a=0,s=e.childNodes.length;a<s;a++)t+=this.OuterHTML(e.childNodes[a]);t+="</"+e.nodeName.toLowerCase()+">"}}return t},OuterHTML:function(e){if("#"===e.nodeName.charAt(0))return this.NodeHTML(e);if(!this.AttributeBug)return e.outerHTML;for(var t=this.NodeHTML(e),a=0,s=e.childNodes.length;a<s;a++)t+=this.OuterHTML(e.childNodes[a]);return t+="</"+e.nodeName.toLowerCase()+">"},quoteHTML:function(e){return null==e&&(e=""),e.replace(/&/g,"&#x26;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;")},createPreview:function(e,t){var a=this.config.preview;if("none"!==a){var s=!1,n=MathJax.Hub.config.preRemoveClass;if((t.previousSibling||{}).className!==n){if("mathml"===a&&(s=!0,a=this.MathTagBug?"alttext":e.cloneNode(!0)),"alttext"===a||"altimg"===a){s=!0;var i=this.filterPreview(e.getAttribute("alttext"));if("alttext"===a)a=null!=i?MathJax.HTML.TextNode(i):null;else{var r=e.getAttribute("altimg");if(null!=r){var o={width:e.getAttribute("altimg-width"),height:e.getAttribute("altimg-height")};a=MathJax.HTML.Element("img",{src:r,alt:i,style:o})}else a=null}}if(a){var h;s?(h=MathJax.HTML.Element("span",{className:n}),h.appendChild(a)):h=MathJax.HTML.Element("span",{className:n},a),t.parentNode.insertBefore(h,t)}}}},filterPreview:function(e){return e},InitBrowser:function(){var e=MathJax.HTML.Element("span",{id:"<",className:"mathjax",innerHTML:"<math><mi>x</mi><mspace /></math>"}),t=e.outerHTML||"";this.AttributeBug=""!==t&&!(t.match(/id="&lt;"/)&&t.match(/class="mathjax"/)&&t.match(/<\/math>/)),this.MathTagBug=e.childNodes.length>1,this.CleanupHTML=MathJax.Hub.Browser.isMSIE}},MathJax.Hub.Register.PreProcessor(["PreProcess",MathJax.Extension.mml2jax],5),MathJax.Ajax.loadComplete("[MathJax]/extensions/mml2jax.js");