// VALIDACIÓN BUSCADOR 
function Valida(esteform,estevalor){
	estevalor.value = estevalor.value.split('?').join(' ');
	estevalor.value = estevalor.value.split(',').join(' ');
	while(''+estevalor.value.indexOf('  ') > 0)
	  estevalor.value = estevalor.value.split('  ').join(' ');
	while(''+estevalor.value.charAt(0)==' ')
	  estevalor.value = estevalor.value.substring(1,estevalor.value.length);
	while(''+estevalor.value.charAt(estevalor.value.length-1)==' ')
	  estevalor.value = estevalor.value.substring(0,estevalor.value.length-1);
	if ((estevalor.value=="") || (estevalor.value==" ") ||  (estevalor.value=="  ") || (estevalor.value=="   ")) {
		alert("Debe ingresar una palabra para que inicie la búsqueda.");
		estevalor.focus();
		//return false;
	} else {
		var checkOK = "._-áéíóúAÉÍÓÚçÇãÃõÕüÜàÀêÊ~`@!#$%^&*()-_=+[]{}''|\/<>,.;:\"";
		var checkStr = estevalor.value;
		var allValid = true;
		var decPoints = 0;
		var allNum = "";
		for (i = 0;  i < checkStr.length;  i++){
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
			break;
			if (j == checkOK.length){
				allValid = false;
				break;
			}
			allNum += ch;
		}
		if (!allValid){
			if(esteform.pubId[1].checked) {
				esteform.action = 'http://www.ubbi.com/resultados.asp';
				esteform.q.value = estevalor.value
				esteform.submit();
			} else {
				esteform.action = 'http://www.servicios.clarin.com/buscador/jsp/resultados.jsp';
				esteform.submit();
			}
		} else {
			alert("Ingrese una palabra válida.");
			estevalor.focus();
		}
	}
}
