function submitComment() {
	if (document.getElementById('fauthor_name').value.length == 0) {
		document.getElementById('fauthor_name').value = "Anonymous";
	}
	
	document.comment_form.author_name.value = document.getElementById('fauthor_name').value;
	document.comment_form.author_email.value = document.getElementById('fauthor_email').value;
	document.comment_form.comment_body.value = document.getElementById('fcomment_body').value;
	
	if (document.comment_form.comment_body.value.length == 0) {
		alert('Please enter a comment.');
		document.getElementById('fcomment_body').focus();
		return;
	}
	
	document.getElementById('commentSubmitButton').value = "Posting..."
	document.getElementById('commentSubmitButton').disabled = true;
	document.getElementById('commentClearButton').disabled = true;
	document.getElementById('fauthor_name').disabled = true;
	document.getElementById('fauthor_email').disabled = true;
	document.getElementById('fcomment_body').disabled = true;
	
	document.comment_form.submit();
	return;
}

function clearComment() {
	document.getElementById('fauthor_name').value = "";
	document.getElementById('fauthor_email').value = "";
	document.getElementById('fcomment_body').value = "";
	document.getElementById('fauthor_name').focus();
}

function commentFormat(obj) {
	switch (obj) {
		case 'b':
			format_notice = "Enter the text you would like to make bold:";
			break;
			
		case 'i':
			var format_notice = "Enter the text you would like to make italic:";
			break;
			
		case 'u':
			var format_notice = "Enter the text you would like to underline:";
			break;
		
		case 'url':
			var format_notice = "Enter the URL you would like to link to:";
			break;
	}
	
	var notice = prompt(format_notice, '');
	
	if (notice.length == 0) { document.getElementById('fcomment_body').focus(); return; }
	
	if (obj != "url") {
		document.getElementById('fcomment_body').value += "["+obj+"]"+notice+"[/"+obj+"]";
		document.getElementById('fcomment_body').focus();
		return;
	}
	
	var url_text = prompt("Enter the link description:", notice);
	
	if (url_text.length == 0) { url_text = notice; }
	
	document.getElementById('fcomment_body').value += "["+obj+"="+notice+"]"+url_text+"[/"+obj+"]";
	document.getElementById('fcomment_body').focus();
		
}

