function comprobarText(obj,dnd){
	texto = obj.value;

	if (texto.length>250){
	  alert("El tamaño máximo para el mensaje son 250 caracteres.");
	  if (dnd ==0){
	    obj.value=texto.substr(0,250);
	  }
	}else{
		if (dnd ==1){
		aceptar();	
		}
	}
}

function aceptar(){
  if (datosValidos()){
   document.forms[0].action="firmar.php";
   document.forms[0].submit();
 }
}

function datosValidos(){
  texto = "";
  
  if (document.all.alias.value=="")
    texto = "Se debe introducir un alias \n";
  
  if (document.all.mensaje.value=="")
    texto += "Se debe introducir el mensaje \n";
  
  if (texto!=""){
   alert(texto);
   return false;
  }
  
  return true;
}

function libroVisitas(){
   if (parent.topFrame){
  parent.topFrame.bodytitulo.style.backgroundColor="#CCCC99";
 }
  this.location.href="php/datosLibroVisitas.htm";
}
