function check_page() {
    var matched = false;
    for (i=0; i<document.links.length; i++) {
		var obj = document.links[i];
		if ((obj.href == location.href) && (obj.parentNode.id == "subnav" || obj.parentNode.parentNode.id == "subnav")) {
		   obj.style.fontWeight = 'bold';
           obj.style.color = '#eeeeee';
           matched = true;
		}
	}
    if (!matched) {
        var cur_match;
        for (i=0; i<document.links.length; i++) {
            var obj = document.links[i];
            if ((location.href.indexOf(obj.href) != -1 && (obj.parentNode.id == "subnav" || obj.parentNode.parentNode.id == "subnav"))) {
                if (!cur_match || obj.href.length > cur_match.href.length) {
                    cur_match = obj;
                }
            }
        }
        if (cur_match) {
            cur_match.style.fontWeight = 'bold';
            cur_match.style.color = '#eeeeee';
        }
    }
}
