﻿function addComment() {
	qString = Form.serialize('comment_form');
	$('submit_wait').innerHTML = 'Adding comment&hellip; <img src="/journal/partner_pages/offexploring/images/comment_offex.gif">';
	new Ajax.Updater('guest_comments', '/journal/includes/comment.php', {asynchronous: false, evalScripts:true, parameters:qString + '&set=1', method:'post', onComplete:commentDelay});
}

function commentAdded() {
	$('submit_wait').innerHTML = '<input type="submit" class="btn_ns_2" value="Add comment" onclick="addComment();return false">';

	if ($('comment_error').innerHTML.length == 0) {
		Effect.PhaseOut('comment_form');
	}
}

function commentDelay() {
 	setTimeout("commentAdded();",500);
}
