function toggleHighlighting(name)
{
	var input = document.getElementById(name);
	var row = document.getElementById(name+"_row");
	
	if (input.checked)
	{
		if (row.className == "comment_block_even")
		{
			row.className = "comment_block_even_highlighted";
		}
		else if (row.className == "comment_block_odd")
		{
			row.className = "comment_block_odd_highlighted";
		}
	}
	else
	{
		if (row.className == "comment_block_odd_highlighted")
		{
			row.className = "comment_block_odd";
		}
		else if (row.className == "comment_block_even_highlighted")
		{
			row.className = "comment_block_even";
		}
	}
	
	var inputList = document.getElementsByTagName("input");
	var count = 0;
	
	for (var i = 0; i < inputList.length; i++)
	{
		var input = inputList[i];
		if (input.type == "checkbox" && input.name.indexOf("comment") != -1)
		{
			// found a comment checkbox
			if (input.checked)
			{
				count++;
			}
		}
	}
	
	var delete_all_selected = new getObj("delete_all_selected_link");
	if (delete_all_selected)
	{
		if (count == 0)
		{
			delete_all_selected.style.display = "none";
		}
		else
		{
			delete_all_selected.style.display = "";
		}
	}
}

function deleteComment(message, delete_url)
{
	var selection = confirm(message);
	if (selection)
	{
		window.location = encodeUrl(delete_url);
	}
}

function massDelete(message, delete_url)
{
	var inputList = document.getElementsByTagName("input");
	var input = null;
	var selection = null;
	var idsToDelete = null;
	
	for (var i = 0; i < inputList.length; i++)
	{
		input = inputList[i];
		
		if (input.type == "checkbox" && input.name.indexOf("comment") != -1)
		{
			// found a comment checkbox
			if (input.checked)
			{
				if (idsToDelete == null)
				{
					idsToDelete = input.name.split("_")[1] + ",";
				}
				else
				{
					idsToDelete += input.name.split("_")[1] + ",";
				}
			}
		}
		
		input = null;
	}
	
	idsToDelete = idsToDelete.substring(0, idsToDelete.length - 1);
	
	selection = confirm(message);
	if (selection)
	{
		var beginIndex = delete_url.indexOf("&submissioncontext");
		var url = delete_url.substring(0, beginIndex) + "&commentids=" + idsToDelete + delete_url.substring(beginIndex)
		var newurl = encodeUrl(url);
		
		window.location = newurl;
	}
}

function onLoad()
{
}

