/*function showMore() { try { document.getElementById("extraContent").style.display = 'table-row'; } catch (e) { document.getElementById("extraContent").style.display = 'inline'; } };
function hideMore() { document.getElementById("extraContent").style.display = 'none'; };
*/
function showAddCommentBox(ArticleID)
{
	$("#addCommentBox").fadeIn(1000);
	$("#addComment").css('display','none');
}

function sumbitComment()
{
var id = $('#ArticleID').val();
	$.post('includes/submitComment.php', {txtComment:$("#txtComment").val(), txtEmail:$('#txtEmail').val(), ArticleID:id},
		function(data){
			$("#commentBoxContent").fadeOut(500, function(){populateContent(data)});
		}
     );	
}

function populateContent(data)
{
	$("#commentBoxContent").fadeIn(200);
	if(data == 'success')
	{
		
		$('#commentBoxContent').html("<h2>Thank you</h2><p>An email has been sent to confirm your comment.</p>");
	}
	else
	{
		$('#commentBoxContent').html("<h2>Error</h2><p>There was an error processing your comment, please try again later.</p>");
	}
	setTimeout(function(){$("#addCommentBox").fadeOut(500)},5000);
}

function closeCommentBox()
{
	$("#addCommentBox").fadeOut(1000);
	$("#addComment").fadeIn(1000);
}
