window.onload = init;

function init() {    
    if (document.links) {              
        for (var i = 0; i < document.links.length; i++) {
            l = document.links[i].href;
            if (l.indexOf('http://www.svendtofte')!=0 &&
            	l.indexOf('http://udv.svendtofte')!=0 &&
                l.indexOf('http://')==0 ) {
                c = document.links[i];
                if (c.className == "dontModify") continue;
                c.className = c.className + " external";
                if (c.title != "") {
                    c.title = "External link: " + c.title;
                }
            }
        }
    }
    if (document.getElementsByTagName) {
        tables = document.getElementsByTagName("table");
        // thanks w3c, for making the tables element the same
        // as an preorder tree traversel would make them. allows
        // me to go to the last entry in the array, and also
        // know it's the last in the tree!
        for (var i = 0; i < tables.length; i++) {
            if (tables[i].getElementsByTagName) {
                trs = tables[i].getElementsByTagName("tr");
                // remember, do not remove previous class things.
                trs[trs.length-1].className = trs[trs.length-1].className + " lastrow";
                
            }
        }
    }
    // here we add styling to the abbr element in IE. why does IE suck?
    // http://www.sovavsiti.cz/css/abbr.html (though not using his solution)
    if (window.ActiveXObject && document.body.innerHTML != "") {
        oldBodyText = document.body.innerHTML;
        reg = /<ABBR([^>]*)>(.*?)<\/ABBR>/gi;
        newBodyText = oldBodyText.replace(reg,'<ABBR $1><SPAN class=\"abbr\" $1>$2</SPAN></ABBR>');
        document.body.innerHTML = newBodyText;
    }
}