
function comprobar() 
{
	var f = document.getElementById("form1");
	var ok;
	ok = true;
	
	if ((ok)&&(f.nombre.value=="")) {
		alert("Introduza correctamente o teu nome");
		ok = false;
		f.nombre.focus();
	}
	if ((ok)&&(f.titulo.value=="")) {
		alert("Introduza correctamente o titulo do comentario");
		ok = false;
		f.titulo.focus();
	}
	if ((ok)&&(f.comentario.value=="")) {
		alert("Introduza correctamente o comentario ");
		ok = false;
		f.comentario.focus();
	}
        if ((ok)&&(f.recaptcha_response_field.value=="")) {
		alert("Introduza o codigo de seguridade ");
		ok = false;
		f.recaptcha_response_field.focus();
	}
	
	return ok;
}

function borrar() 
{
	var f = document.getElementById("form1");

	f.reset();
}

function enviar() 
{
	var f = document.getElementById("form1");
	
	if (comprobar()) {
		f.submit();
	}		
}

function ismaxlength(obj){

      var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""

      if (obj.getAttribute && obj.value.length>mlength)

      obj.value=obj.value.substring(0,mlength)

}

