/*ESTE ARQUIVO JAVASCRIPT FOI DESENVOLVIDO POR PUBLIONLINE BRASIL
http://www.publionline.com.br*/

$(document).ready(function(){
	(function($){					   
	$('#input-busca').click(function(){
		$(this).val('');							  
	});
	
	$('.ui-autocomplete .ui-menu-item:even').css('background-color', '#000000');
	
	$('#form-busca').submit(function(){
		return false;							   
    });
	
	$(function() {
		var availableTags = ['Capital de Giro', 'Conta Garantida', 'Cheque Especial Empresarial', 'Desconto de Títulos', 'Cessão de Crédito', 'COMPROR', 'VENDOR', 'Fiança Bancária', 'Resolução 2770', 'CCE - Cédula de Crédito à Exportação', 'NCE - Nota de Crédito à Exportação', 'Câmbio e Comércio Exterior', 'Crédito Empresarial', 'Investimentos', 'CDB', 'Letra Financeira', 'Letras de Crédito Agrícola', 'Tesouraria', 'Operações de Câmbio Pronto', 'Operações prontas de Comércio Exterior em Moeda Local (SML)', 'Financiamentos à Exportação', 'Financiamentos à Importação (FINIMP)', 'Cartas de Crédito', 'Intercap Corretora'];
		$( "#input-busca" ).autocomplete({
			source: availableTags,
			delay: 0,
			minLength: 0
		});
		});
		
		$('.submit-busca').click(function(){
		
		var valorInput = $('#input-busca').val();
		
		switch(valorInput){
			
		//crédito empresarial
		case 'Crédito Empresarial' :  
		$(location).attr('href', 'creditoempresarial/index.htm');  
		break;
		
		case 'Capital de Giro' : 
		$(location).attr('href', 'creditoempresarial/capital-giro.htm');  
		break;
		
		case 'Conta Garantida' : 
		$(location).attr('href', 'creditoempresarial/conta-garantida.htm'); 
		break;
		
		case 'Cheque Especial Empresarial' : 
		$(location).attr('href', 'creditoempresarial/cheque-especial-empresarial.htm'); 
		break;
		
		case 'Desconto de Títulos' : 
		$(location).attr('href', 'creditoempresarial/desconto-titulos.htm'); 
		break;
		
		case 'Cessão de Crédito' : 
		$(location).attr('href', 'creditoempresarial/cessao-credito.htm'); 
		break;
		
		case 'COMPROR' : 
		$(location).attr('href', 'creditoempresarial/compror.htm'); 
		break;
		
		case 'VENDOR' : 
		$(location).attr('href', 'creditoempresarial/vendor.htm'); 
		break;
		
		case 'Fiança Bancária' : 
		$(location).attr('href', 'creditoempresarial/fianca-bancaria.htm'); 
		break;
		
		case 'Resolução 2770' : 
		$(location).attr('href', 'creditoempresarial/resolucao-2770.htm'); 
		break;
		
		case 'CCE - Cédula de Crédito à Exportação' : 
		$(location).attr('href', 'creditoempresarial/cce.htm'); 
		break;
		
		case 'NCE - Nota de Crédito à Exportação' : 
		$(location).attr('href', 'creditoempresarial/nce.htm'); 
		break;
		
		//Investimentos
		case 'Investimentos' : 
		$(location).attr('href', 'investimentos/index.htm'); 
		break;
		
		case 'CDB' : 
		$(location).attr('href', 'investimentos/cdb.htm'); 
		break; 
		
		case 'Letra Financeira' : 
		$(location).attr('href', 'investimentos/letra-financeira.htm'); 
		break; 
		
		case 'Letras de Crédito Agrícola' : 
		$(location).attr('href', 'investimentos/lca.htm'); 
		break; 
		
		case 'Tesouraria' : 
		$(location).attr('href', 'investimentos/tesouraria.htm'); 
		break; 
		
		//Cambio e Comercio Exterior  
		case 'Câmbio e Comércio Exterior' : 
		$(location).attr('href', 'cambio-comercioexterior/index.htm'); 
		break; 
		
		case 'Operações de Câmbio Pronto' : 
		$(location).attr('href', 'cambio-comercioexterior/operacoes-cambio-pronto.htm'); 
		break; 
		
		case 'Operações prontas de Comércio Exterior em Moeda Local (SML)' : 
		$(location).attr('href', 'cambio-comercioexterior/sistema-moeda-local.htm'); 
		break; 
		
		case 'Financiamentos à Exportação' : 
		$(location).attr('href', 'cambio-comercioexterior/financiamentos-exportacao.htm'); 
		break; 
		
		case 'Financiamentos à Importação (FINIMP)' : 
		$(location).attr('href', 'cambio-comercioexterior/financiamentos-importacao.htm'); 
		break; 
		
		case 'Cartas de Crédito' : 
		$(location).attr('href', 'cambio-comercioexterior/cartas-credito.htm'); 
		break; 
		
		//Intercap Corretora  
		case 'Intercap Corretora' : 
		$(location).attr('href', 'corretora/index.htm'); 
		break; 
		
		default:
		alert('Termo\u00A0n\u00E3o\u00A0encontrado');
		$(location).attr('href', 'index.htm'); // chamar o index caso o usuário escreva algo que não seja previsto pelo looping
		}
  
	}).attr('title', 'Buscar');
		
	})(jQuery);		
});
	
