function validate_required(field,alerttxt)
{
	if(field.value!=null)
		if(field.value=="")
			{alert(alerttxt);return false;}
	return true;
}

function validate_phone(field,alerttxt)
{
	oRegular=new RegExp(/^[689]\d{8}$/);
	if(field.value!=null)
		if(!oRegular.test(field.value))
			{alert(alerttxt);return false;}
	return true;
}

function validate_form(thisform)
{
	if(validate_required(thisform.strNombre,"Debe rellenar el campo nombre!")==false)
	  {thisform.strNombre.focus();return false;}
	if(validate_required(thisform.strApellidos,"Debe rellenar el campo apellidos!")==false)
	  {thisform.strApellidos.focus();return false;}
	if(validate_required(thisform.strTelefono,"Debe rellenar el campo telefono!")==false)
	  {thisform.strTelefono.focus();return false;}
	if(validate_phone(thisform.strTelefono,"Formato de telefono incorrecto!")==false)
	  {thisform.strTelefono.focus();return false;}
	return true;
}