function jsAlert(msg)
{
    var WSHShell = WScript.CreateObject("WScript.Shell");
    return WSHShell.Popup(msg, 10000, "CyberArticle", 0);
}

function CyberArticleRemoveOneMarkTextTag(doc)
{
    var elements = doc.getElementsByTagName("span");
    for (var i in elements)
    {
        elem = elements[i];
        if (elem != null)
        {
            var ext_id = elem["ca_ext_id"];
            if (ext_id != null)
            {
                if (ext_id.toLowerCase() == "ca_mark_text")
                {
			        var innerHtml = elem.innerHTML;
			        elem.outerHTML = innerHtml;
			        //
			        return true;
                }
             }
        }
    }
    return false;
}

function CyberArticleClearMarkText()
{
    var objCAAutomation = new ActiveXObject("CyberArticle.CAAutomationApp");
    if (objCAAutomation == null)
    {
    	jsAlert("Failed to create object: CyberArticle.CAAutomationApp");
        return;
    }
    //
    var objHtmlDocument = objCAAutomation.CurrentArticleHtmlDocument;
    if (objHtmlDocument == null)
    {
    	jsAlert("Failed to get the document of the current article");
        return;
    }
    //
    while (CyberArticleRemoveOneMarkTextTag(objHtmlDocument))
    {
    }
}

CyberArticleClearMarkText();

