// Esta funcion es valida solo para el grupo de ficheros solicitud de enlace


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



if (document.ValidarEnlace.nombre.value == "")
	{
	 document.ValidarEnlace.nombre.style.backgroundColor = "#F2F2F2"
	 txt+="\tPersona contacto\n";
	}


if (document.ValidarEnlace.correo.value == "")
	{
	document.ValidarEnlace.correo.style.backgroundColor = "#F2F2F2"
	 txt+="\tE-Mail de contacto\n";
	}
	
if (document.ValidarEnlace.urlDestino.value == "")
	{
	 document.ValidarEnlace.urlDestino.style.backgroundColor = "#F2F2F2"
	 txt+="\tUrl de destino\n";
	}

if (document.ValidarEnlace.descripcion.value == "")
	{
	 document.ValidarEnlace.descripcion.style.backgroundColor = "#F2F2F2"
	 txt+="\tBreve desdcripción\n";
	}
	
if (document.ValidarEnlace.urlNuestroEnlace.value == "")
	{
	 document.ValidarEnlace.urlNuestroEnlace.style.backgroundColor = "#F2F2F2"
	 txt+="\tUrl de la ubicación de nuestro enlace\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;
}

