
function checkForm(){ 

	var theForm = document.forms[0];
	var errMsg = "";
	var setfocus = "";

	if (theForm['asunto'].value.length < 4){
		errMsg = "Por favor, debe especificar el asunto de su consulta";
		setfocus = "['mensaje']";
	}

	if (theForm['telefono'].value == ""){
		errMsg = "Por favor, indíquenos un número de teléfono";
		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();
}
