function postNewComment()
{
		var form = $('comentarBlog');
		encodeURIComponent = escape; 
		var params = form.serialize();
		var ajax = new Ajax.Request( form.getAttribute('action'),
			{method: 'post',
			 postBody: params,
			 onSuccess: successPostingComment,
			 onLoading: loadingPostingComment			 
			} );		
	
		/* Captcha *
		var ajax = new Ajax.Request( '/captcha/get',
			{method: 'post',
			 onSuccess: checkCaptcha			 
			});
		*/
		return false;
	}

function loadingPostingComment( request )
{
	$('comentar').hide();
	$('comment_loading').show();
}

function successPostingComment( request )
{
	$('comment_loading').hide();
	$('comment_response').show();
}

function checkCaptcha( request )
{
	var captcha = request.responseText;
	if( captcha == $F('captcha') )
	{
		var form = $('comentarBlog');
		encodeURIComponent = escape; 
		var params = form.serialize();
		var ajax = new Ajax.Request( form.getAttribute('action'),
			{method: 'post',
			 postBody: params,
			 onSuccess: successPostingComment,
			 onLoading: loadingPostingComment			 
			} );		
	}
	else
	{
		alert( 'Informe corretamente o código de segurança.' );
	}
	return false;
}

function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
//else
//cntfield.value = maxlimit - field.value.length;
}

function getNodeValue( obj, tag )
{
   if( obj.getElementsByTagName(tag)[0].firstChild != null )
   {
      return obj.getElementsByTagName(tag)[0].firstChild.nodeValue;
   }
   else
   {
      return "";
   }
}