// Esta funcion es valida solo para el grupo de ficheros de contacto


function Validar(){
    var txt = "Error en los siguientes campos: \n\n";
	msg_f = txt.length;

if (document.ValidarContacto.nombre.value == "")
	{
	 document.ValidarContacto.nombre.style.backgroundColor = "#C3C3C3"
	 txt+="\tNombre\n";
	}

if (document.ValidarContacto.LugarDEentrega.value == "")
	{
	document.ValidarContacto.LugarDEentrega.style.backgroundColor = "#C3C3C3"
	 txt+="\tDirección\n";
	}

if (document.ValidarContacto.telefono.value == "")
	{
	 document.ValidarContacto.telefono.style.backgroundColor = "#C3C3C3"
	 txt+="\tTelefono\n";
	}
	
	
if (document.ValidarContacto.referido.selectedIndex == 0)
	{
	 document.ValidarContacto.referido.style.backgroundColor = "#C3C3C3"
	 txt+="\tReferido\n";
	}
	
if (document.ValidarContacto.comentario.value == "")
	{
	 document.ValidarContacto.comentario.style.backgroundColor = "#C3C3C3"
	 txt+="\tComentario\n";
	}

if(document.ValidarContacto.aceptar_condiciones.checked == false )
	{
	document.ValidarContacto.aceptar_condiciones.style.backgroundColor = "#C3C3C3"
	txt+="\tAceptar Condiciones \n";
	}
	
	
if (msg_f != txt.length){
	alert(txt);
	return false;
	}else{
		return true;
	}
}




function TestMail(texto)
{
  var correcto=true;
  if ((texto.indexOf("@")<1) || (texto.indexOf("@")>8))
    { correcto=false; }
  if ( (texto.indexOf(".com")<0) &&  (texto.indexOf(".do")<0) && (texto.indexOf(".cu")<0) && (texto.indexOf(".cl")<0) && (texto.indexOf(".br")<0) && (texto.indexOf(".ch")<0) && (texto.indexOf(".pt")<0) && (texto.indexOf(".it")<0) && (texto.indexOf(".uk")<0) && (texto.indexOf(".mx")<0) && (texto.indexOf(".ar")<0) && (texto.indexOf(".de")<0) && (texto.indexOf(".fr")<0) && (texto.indexOf(".biz")<0) && (texto.indexOf(".info")<0) && (texto.indexOf(".net")<0) && (texto.indexOf(".es")<0)  && (texto.indexOf(".org")<0) &&  (texto.indexOf(".edu")<0) )
    { correcto=false; }
  
return correcto;
}

