function showCommentForm()
{
	var div = window.document.getElementById('comment_form_container');
	
	if (div == null)
	{
		alert("Form element not found.");
		return;
	}
	
	div.style.visibility= 'visible';
	div.style.display= 'block';
	div.style.height = '85px';
	var textarea = window.document.getElementById('comment_text');
	textarea.focus();

	
	div = window.document.getElementById('add_comment_bar');
	div.style.height = '0px';
	div.style.visibility = 'hidden';
}

function toggleHideComments()
{
	var div = window.document.getElementById('comment_container');
	
	if (div.style.visibility != 'visible')
	{
		div.style.visibility = 'visible';
		div.style.height = 'auto';
	}
	else
	{
		div.style.visibility = 'hidden';
		div.style.height = '0px';
	}
}

function validateComment()
{
	var form = window.document.forms["comment_form"];
	var txt = form.elements['com_txt'].value;

	if (txt.length > 512)
	{
		alert("Your comment must be 512 characters or less.");
		return false;
	}
	if (txt.length < 1)
	{
		alert("Your comment must be at least one character long.");
		return false;
	}
		
	return true;
}
