// JS document

function setupComment()
{ 
	if(document.getElementById("comment")) {
		var anchorObj1 = document.getElementById("comment");
		anchorObj1.onclick = function()
		{
			var utilityBoxObj = document.getElementById("add-comment");
			if(utilityBoxObj.style.display == "block")
				utilityBoxObj.style.display = "none";
			else
				utilityBoxObj.style.display = "block";
			return false;
		}
	}
	if(document.getElementById("comment-top")) {
		var anchorObj1 = document.getElementById("comment-top");
		anchorObj1.onclick = function()
		{
			var utilityBoxObj = document.getElementById("add-comment-top");
			if(utilityBoxObj.style.display == "block")
				utilityBoxObj.style.display = "none";
			else
				utilityBoxObj.style.display = "block";
			return false;
		}
	}

	//setup the more comments section
	//hide the more comments on page load
	if(document.getElementById("more-comments")) {
		var commentsObj = document.getElementById("more-comments");
		commentsObj.style.display = "none";
	}
	//display extra comments when button is clicked
	if(document.getElementById("more")) {
		var commentsButton = document.getElementById("more");
		commentsButton.onclick = function()
		{
			var commentsObj = document.getElementById("more-comments");
			if( commentsObj.style.display == "none" ) {
				commentsObj.style.display = "block";
				//change button text
				commentsButton.innerHTML = "Hide comments";
				commentsButton.style.background = "#FFFFFF url(images/css-images/content/minus-icon.gif) no-repeat scroll 1px 4px";
			} else {
				commentsObj.style.display = "none";
				//change button text
				commentsButton.innerHTML = "Read more comments";
				commentsButton.style.background = "#FFFFFF url(images/css-images/content/plus-icon.gif) no-repeat scroll 1px 4px";
			}
			return false;
		}
	}
}

function closeCommentBox() 
{
	var commentBoxObj = document.getElementById("add-comment");
	commentBoxObj.style.display = "none";
	return false;
}
function closeCommentBox2() 
{
	var commentBoxObj = document.getElementById("add-comment-top");
	commentBoxObj.style.display = "none";
	return false;
}