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