// JavaScript Document
// Funcion para validar los datos al ingresar/modificar un cliente
function valForm() {
	var error = false;
	var mens  = '';
	//Formulario correspondiente
	with(document.tform){

		if (correo.value != "") { 	
			if ( (correo.value.indexOf("@",0)==-1)||(correo.value.indexOf(".",0)==-1)){
			error = true;
			mens = mens + 'Debe ingresar un correo electrónico válido.<br />';
			correo.style.background="#d7e6ff";
			}
		}
		else {
			error = true;
			mens = mens + 'Debe ingresar un correo electrónico.<br />';
			correo.style.background="#d7e6ff";	
		}

		if (asunto.value == "Seleccione un asunto") {
			error= true;
			mens = mens + 'Debe seleccionar un asunto.<br />';
			asunto.style.background="#d7e6ff";		
		}
		
		if (mensaje.value == "") {
			error= true;
			mens = mens + 'Debe ingresar un mensaje.<br />';
			mensaje.style.background="#d7e6ff";		
		}
		
		if (dominio.value == "") {
			error= true;
			mens = mens + 'Debe ingresar un dominio.<br />';
			dominio.style.background="#d7e6ff";		
		}
		// Si los datos son validos se envian
		if (!error) {
			submit();
		}
		else {
			document.getElementById("label_mensaje").innerHTML = mens;	
		};
	}
}

function ValidaFocus(a){
	a.style.background="#ffffff";document.getElementById("label_mensaje").innerHTML = "";
}