function Guardar(form)
   {
   GuardaDatos=1;
   if (Trim(form.nombre.value)=="" || form.nombre.value==null)
      {
      form.nombre.style.backgroundColor = "#FF989D";
      form.nombre.focus();
      GuardaDatos=0;
      }
   else form.nombre.style.backgroundColor = "#F3EDE7";
   if (Trim(form.comentario.value)=="" || form.comentario.value==null)
      {
      form.comentario.style.backgroundColor = "#FF989D";
      form.comentario.focus();
      GuardaDatos=0;
      }
   else form.comentario.style.backgroundColor = "#F3EDE7";
   if (formu.email.value.indexOf("@") != -1)
          form.email.style.backgroundColor = "#F3EDE7";
       else
       {
          GuardaDatos=0;
          form.email.style.backgroundColor = "#FF989D";
          form.email.focus();
          alert("Ha d'escriure una adreça de correu electrònic correcta");
          return false
       }
   if (GuardaDatos) { form.submit(); }
   else { alert ("Falta alguna dada per introduir..."); }
   }



function Trim(STRING){
	STRING = LTrim(STRING);
	return RTrim(STRING);
}

function RTrim(STRING){
	while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
	}
	return STRING;
}

function LTrim(STRING){
	while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
	}
	return STRING;
}
