//FUNCION PARA VALIDAR MAIL
	function email_valido(email)
	{
		var i;
		var cStrCont,cStrDot;
		i = 0;
		cStrCont = 0;
		cStrDot = 0;

		for ( i=0; i < email.length ; i++ )
		{
			if ( email.charAt(i) == "@" )
			{
				cStrCont = cStrCont + 1
			}
			if ( email.charAt(i) == "." )
			{
				cStrDot = cStrDot + 1
			}
		}

		if (cStrCont != 1 || cStrDot == 0)
		{
			return false;
		}
		if ( email.charAt(email.length - 1 ) == "." )
		{
			return false;
		}
		return true;
	}


//FUNCION PARA VALIDAR FORMULARIOS
function form_valido(form)
{ 
		if(form == "contacto")
		{
			if (window.document.frmContacto.nombre.value == 0){
				alert('Ingrese nombre');
				document.frmContacto.nombre.focus();
				return false;
			}
			//VALIDAR E-MAIL
			if (!email_valido(window.document.frmContacto.email.value)){
				alert('Por favor ingrese su email, (Ej. sucuenta@dominio.com)');
				document.frmContacto.email.focus();
				return false;
			}
			if (window.document.frmContacto.mensaje.value == 0){
				alert('Ingrese el mensaje');
				document.frmContacto.mensaje.focus();
				return false;
			}						
		}

		if(form == "enlaces")
		{
			if (window.document.frmEnlace.titulo.value == 0){
				alert('Ingrese titulo de su pagina web');
				document.frmEnlace.titulo.focus();
				return false;
			}
			if (window.document.frmEnlace.url.value == 'http://'){
				alert('Ingrese la URL de su pagina web');
				document.frmEnlace.url.focus();
				return false;
			}
			if (window.document.frmEnlace.descripcion.value == 0){
				alert('Ingrese la descripcion de su pagina web');
				document.frmEnlace.descripcion.focus();
				return false;
			}
			if (window.document.frmEnlace.nombre.value == 0){
				alert('Ingrese nombre de la persona de contacto');
				document.frmEnlace.nombre.focus();
				return false;
			}
 			//VALIDAR E-MAIL
			if (!email_valido(window.document.frmEnlace.email.value)){
				alert('Ingrese su email de contacto, (Ej. sucuenta@dominio.com)');
				document.frmEnlace.email.focus();
				return false;
			}
				if (window.document.frmEnlace.direccion.value == 'http://'){
				alert('Ingrese la URL de su pagina web');
				document.frmEnlace.direccion.focus();
				return false;
			}
		}

} //form_Valido