
// antiHOYGAN
// Script URI: http://www.nopuedocreer.com/quelohayaninventado/?page_id=203
// Description: "Filtro antiHOYGAN"
// Author: Dani "Troy" Gonzalez
// Version: 1.0
// Author URI: http://www.hevistocosas.com 

function filterHOYGAN (texto)
{
	swHOYGAN=false;
	msgError="";

	numLetras=texto.length;
	numMayusculas=0;
	for (i=0;i<numLetras;i++)
		if (texto.charAt(i)>='A' && texto.charAt(i)<='Z')
			numMayusculas++;
    if (numLetras>4 && numMayusculas>numLetras/4)			
    {
		swHOYGAN=true;
		msgError="Texto en MAYUSCULAS no permitido";
	}
	else
	{
		textoLower=texto.toLowerCase();
		textoLower=" "+textoLower;
		HOYGANseed = new Array("hoygan","hoigan","wenas","wolas","wola","wapo","wapa","weno","fabor","xfavor","xfabor","kiero","plis ","pliss","plisss","grasias","antebraso"," ke "," k "," q "," l "," ls ","pq","xq","aaaa","eeee","iiii","oooo","uuuu","jajaja","hahaha","jejeje","!!!!","¡¡¡¡","¿¿","¿¿¿","????","dddd","fff","ggg","jjj","mmmm","nnnn","rrrr","xxxx","zzzz","dddd","ssss"," xk ","makina","conbustible"," io ","pnsar","muxo","kedan"," pro ","qmikas","preokupan","tnpoko","Wnas!", "exar");
		for (i=0;i<HOYGANseed.length;i++)
		{
			if (textoLower.indexOf(HOYGANseed[i])!=-1)
			{
				swHOYGAN=true;
				msgError=HOYGANseed[i];
				break;
			}	
		}
	}
	if (swHOYGAN)
	{	
		alert ("Graves faltas de ortografía\n\nHa escrito incorrectamente: \""+msgError+"\"\n\nRevise su mensaje y vuelva a intentarlo, por favor.\n\nSi el problema persiste pruebe a corregir el texto en su editor habitual copiandolo aquí nuevamente");
		return false;
    }
    return true;
}
