
var RecaptchaOptions = {
theme : 'clean'
};function ShowComments()
{
$('blogd_addcomment').hide();
Effect.toggle('blogd_comments', 'blind');
}
function BlogCommentSubmit(Post)
{
if(!$('CommentEMail').value || !CheckMail($('CommentEMail').value)){
alert("Error: You must enter your E-Mail address to continue");
}
else if(Post && $('CommentText').value && $('recaptcha_challenge_field').value && $('recaptcha_response_field').value)
{
new Ajax.Request('/blog/comment',
{
method:'post',
parameters : {
'Post': Post,
'Comment': $('CommentText').value,
'Name': $('CommentName').value,
'EMail': $('CommentEMail').value,
'rChallenge': $('recaptcha_challenge_field').value,
'rResponse': $('recaptcha_response_field').value
},
onComplete:function(request){
Recaptcha.reload();
if(request.responseText.indexOf('<error>') < 0)
{
['CommentText','CommentName','CommentEMail'].each(function(o){$(o).value = '';});
$('blogd_addcomment').hide();
$('blogd_comments_outer').innerHTML = request.responseText;
if($('blogd_comments'))
{
Effect.BlindDown('blogd_comments');
$('c_c').innerHTML = $('comment_count').innerHTML+' Comment'+($('comment_count').innerHTML * 1 != 1 ? 's' : '');
} 
}
else
{
alert('Error submitting your comment or verifying CAPTCHA text. Please try again.');
}}
});
}
else
{
alert('Error: no comment to send, or you have not typed the verification text. Please try again.');
}
}

