function highlightWordGroups(showWords, highlightWords){
	highlightWords = highlightWords.split(',');
	colorIndex = 0;
	colors = new Array('#DDFFDD', '#FFFFCC', '#FFDADA', '#CCEEFF', '#FFEEAA', '#EEEEFF', '#DDFFBB', '#FFCCEE');

	document.getElementById("highlightings").innerHTML = '<small><font color="#999999">These terms have been highlighted: <span class="highlightedWords">'+showWords+'</span> [&nbsp;<u style="cursor: pointer; cursor: hand;" onclick="removeHighlighting(); return false">remove&nbsp;highlighting</u>&nbsp;]</nobr></font></small>';

	for(j = 0; j < highlightWords.length; j++){
		re = new RegExp('\\b(' + highlightWords[j] + ')\\b', "ig")

		/* snippets */
		spans = document.getElementsByTagName("span");
	   for(i = 0; i < spans.length; i++) if(spans[i].className == 'snippet' || spans[i].className == 'highlightedWords') {
			spans[i].innerHTML = spans[i].innerHTML.replace(re, '<span class="colored" style="background:'+colors[colorIndex]+'">$1</span>');
		}

		/* titles */
		anchors = document.getElementsByTagName("a");
	   for(i = 0; i < anchors.length; i++) if(anchors[i].className == 'title') {
			anchors[i].innerHTML = anchors[i].innerHTML.replace(re, '<span class="colored" style="background:'+colors[colorIndex]+'"><b>$1</b></span>');
		}

		colorIndex = colorIndex + 1;
		if(colorIndex >= colors.length) colorIndex = 0;
	}
}
function removeHighlighting(){
	spans = document.getElementsByTagName("span");
   for(i = 0; i < spans.length; i++) if(spans[i].className == 'colored') {
		spans[i].style.background = '#FFFFFF';
	}
	document.getElementById("highlightings").style.display = 'none';
}

