
function checkForm(){ 

	var theForm = document.forms[0];
	var errMsg = "";
	var setfocus = "";

	if (theForm['mensaje'].value.length < 4){
		errMsg = "Por favor, debe incluir texto en el cuerpo del mensaje";
		setfocus = "['mensaje']";
	}

	if (theForm['telefono'].value == "" && theForm['email'].value == ""){
		errMsg = "Por favor, indíquenos un número de teléfono o e-mail de contacto";
		setfocus = "['telefono']";
	}

	if (theForm['nombre'].value == ""){
		errMsg = "Por favor, introduzca su nombre";
		setfocus = "['nombre']";
	}
	
	if (errMsg != ""){
		alert(errMsg);
		eval("theForm" + setfocus + ".focus()");
	}
	else theForm.submit();
}

