// Adds parentheses around glossary terms 

function fixGlossaryDefs() {
    var spanCollection = document.getElementsByTagName("span");
    for (var i = 0; i < spanCollection.length; i++) {
        if (spanCollection[i].className == "glossarydefinition") {
            var spanValue = trim(spanCollection[i].innerHTML);
            if (spanValue.length > 0) {
                if (spanValue.substring(0, 1) != "(" && spanValue.substring(length - 2, length - 1) != ")") {
                    spanCollection[i].innerHTML = "&nbsp;(" + spanValue + ")";
                }
            }
        }
    }
}

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

