/* March 19, 2004 MathHTML (c) Peter Jipsen http://www.chapman.edu/~jipsen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
(at http://www.gnu.org/copyleft/gpl.html) for more details.*/
function convertMath(node) {// for Gecko
if (node.nodeType==1) {
var newnode =
document.createElementNS("http://www.w3.org/1998/Math/MathML",
node.nodeName.toLowerCase());
for(var i=0; i < node.attributes.length; i++) {
if (node.attributes[i].nodeName == 'displaystyle') {
newnode.setAttribute(node.attributes[i].nodeName,node.attributes[i].nodeValue);
}
}
for (var i=0; i";
}
node = node.nextSibling;
node.parentNode.removeChild(node.previousSibling);
}
if (str != '') {
str += "";
newnode = document.createElement("span");
node.parentNode.replaceChild(newnode,node);
newnode.innerHTML = str;
}
}
}
}