function emoticon(text) {
	var txtarea = document.form1.comentario;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
		txtarea.focus();
	}
	else {
		txtarea.value  += text;
		txtarea.focus();
	}
}
// Conta caracteres
function ContaCaracteres(){
  intCaracteres = 300 - document.form1.comentario.value.length;
  if (intCaracteres > 0){
    document.form1.caracteres.value = intCaracteres;
  	return true;
  }
  else {
    document.form1.caracteres.value = 0;
    document.form1.comentario.value = document.form1.comentario.value.substr(0,300);
    return false;
  }
}

function validateComents(form) {
	if ($(form).nome.value == "") {
		alert("Digite seu Nome!");
		$(form).nome.focus();
		return false;
	}
	if ($(form).email.value == "") {
		alert("O E-Mail é Obrigatório!");
		$(form).email.focus();
		return false;
	}
	if ($(form).comentario.value == "") {
		alert("Digite seu Comentário!");
		$(form).comentario.focus();
		return false;
	}
	//var texto = Form.serialize($(form)) + $(form).action;
	//alert(texto);
	ajaxNaDiv('comentarios',$(form).action,Form.serialize($(form)));
	return true;
}
