Will do.
I should have mentioned that I fixed the problem by altering the removeword function in the following manner:
function removeword(h)
{
h = h.replace(/<\?xml[^>]*>/ig, "");
h = h.replace(/<\/?[a-z]+:[^>]*>/ig, "");
h = h.replace(new RegExp("(<[^>]+) class=[^ |^>]*([^>]*>)", "ig"), "$1 $2");
h = h.replace(/(<[^>]+) style="[^"]*"([^>]*>)/ig, "$1 $2");
h = h.replace(/<span[^>]*><\/span[^>]*>/ig, "");
h = h.replace(/<span[^>]*><\/span[^>]*>/ig, "");
h = h.replace(/<span><span>/ig, "<span>");
h = h.replace(/<\/span><\/span>/ig, "</span>");
//CUSTOM
h = h.replace(/<st1:.*?>/gi, ""); // delete all smarttags
h = h.replace(/<\\?\??xml[^>]>/gi, "");
return h;
}