function doHighlight()
{
	checkHLSearch();

	var hash = window.location.hash;
	
	if (hash.length < 1)
	{
		return;
	}
	
	hash = hash.substring(1);

	var elem1 = document.getElementById(hash + "_1");
	var elem2 = document.getElementById(hash + "_2");
	
	if (!elem1 || !elem2)
	{
		return;
	}




	//elem1.style.backgroundColor = '#AAFF8C';
	//elem2.style.backgroundColor = '#AAFF8C';

	elem1.style.backgroundColor = '#C5D4E8';
	elem2.style.backgroundColor = '#C5D4E8';

	//elem1.style.backgroundColor = '#FF8F08';
	//elem2.style.backgroundColor = '#FF8F08';




}


function confirmReportPost()
{
	var ans = confirm("Are you sure you wish to report this post?");
	return ans;
}


function checkHLSearch()
{
	//check highlight
	
	var elem3 = document.getElementById("hl_string");
	if (!elem3)
	{
		return;
	}

	var word = elem3.innerHTML.toLowerCase();

	var j = 1;
	var curr = document.getElementById("post"+j);
	while (curr)
	{
		var newText = "";
		var text = curr.innerHTML;
		var textLower = curr.innerHTML.toLowerCase();

		var pos = 0;
		var oldPos = 0;

		while ((pos = textLower.indexOf(word, pos)) != -1)
		{
			//first make sure we're not inside <>
			var oLoc = text.indexOf("<", pos);
			var eLoc = text.indexOf(">", pos);

			if (eLoc < oLoc)
			{
				pos++;
				continue;
			}

			newText += text.substring(oldPos,pos) + "<span style=\"background-color: #FFFF00\">" + text.substring(pos, pos + word.length) + "</span>";

			oldPos = pos + word.length;
			pos++;
		}
		
		newText += text.substring(oldPos);

		curr.innerHTML = newText;

		j++;
		curr = document.getElementById("post"+j);
	}
}