function highlight()
{
var pattern = /#(.*)$/;
var result = document.URL.match(pattern);
if (result != null)
{
    var test = new RegExp('(^|a)' + result[1] + '\.[^\.]+$'); // do not use the double '/' literal way to construct a RegExp object, as we need to interpolate variable
    var bc=0;
    for (i = 0; i < document.links.length; i++)
    {
        if (document.links[i].href && document.links[i].href.indexOf(result[1])!=-1){
        	document.links[i].style.background = 'yellow';
		bc=bc+1;
		if(bc>2)break;
	}
    }
    
}
}
function init()
{
	// quit if this function has already been called
	if (arguments.callee.done) return;

	// flag this function so we don't do the same thing twice
	arguments.callee.done = true;

	if (window.addEventListener)
    	window.addEventListener("DOMContentLoaded", highlight, false); //changed from "load" to "DOMContentLoaded" ff/mozilla non-standard
	else if (window.attachEvent)
    	window.attachEvent("onload", highlight);
	else
    	window.onload = highlight;
}
    
init();
