
// ÉSTE ES EL SCRIPT PARA EL BUSCADOR //

function quitar_blancos(cad)
{
var textocon=cad;
var textosin="";
var longit = textocon.length;
for (var i=0;i<longit;i++)
{
	var letra = textocon.charAt(i);
	if (letra != " ")
		textosin=textosin + letra;
	else
		if (textocon.charAt(i+1) != " ")
			textosin=textosin + letra;
}
if (textosin.charAt(0)==" ")
	textosin=textosin.substring(1,(textosin.length) );
if (textosin.charAt(textosin.length-1)==" ")
		textosin=textosin.substring(0,(textosin.length-1));

return(textosin);
}


function buscar(){
		
	if (window.document.frmBusqueda.txtBuscar.length!==0)
		{
			Cadena =quitar_blancos( window.document.frmBusqueda.txtBuscar.value);
			
			Texto1 = Cadena.replace (/ /gi, '+');			
			Texto2 = Cadena.replace (/ /gi, '+AND+');
			
			Cadena1 =  Texto1 + '&ct=BuscadorInternoCVC&id_rama=&l=1&qu=';
			Cadena2 = Texto2 + '&txtRdosTotales=&txtPaginas=&qu2=';
			Cadena3 = Texto1 + '&Submit=Buscar&M7=@All&opera=2&categorias=id_rama%3D%26ct%3D'
			
			window.document.location.href="../../../buscador/buscador.asp?querysin=" + Cadena1 + Cadena2 + Cadena3
		}
} 

// FINAL DEL SCRIPT PARA EL BUSCADOR //

