﻿
function identify_Glossary_Entry(str) {
    // is this a glossary entry from the title index?
    return str.indexOf("ctl00_mainContent_TitleIndex_");
}

function isolate_Glossary_Entry(str) {
    // isolate glossary entry name from right of element id
    return str.replace("ctl00_mainContent_TitleIndex_", "");
}

function enableDefinitionPopups() {
    // create collection of all anchor tags in Glossary.aspx 
    var a_tags = document.getElementsByTagName("a");
    // loop through all anchor tags in document 
    for (var i = 0; i < a_tags.length; i++) {
        // only process glossary entries from the title index
        if (identify_Glossary_Entry(a_tags[i].id) != -1) {
            // rebuild anchor tag title for use by ./js/boxover.js
            a_tags[i].title = "header=[<img src='./images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;" +
                                  isolate_Glossary_Entry(a_tags[i].id) +
                                  ":] body=[" +
                                  a_tags[i].title +
                                  "]";
            // assign cosmetic mouseover functionality 
            a_tags[i].onmouseover = function() {
                this.style.textDecoration = "underline";
                this.style.backgroundColor = "gainsboro";
		this.style.cursor = "default";
            }
            // assign cosmetic mouseout functionality 
            a_tags[i].onmouseout = function() {
                this.style.backgroundColor = "white";
		this.style.cursor = "default";
            }
        }
    }
}

enableDefinitionPopups();