//============================================================
var urlSite = "/";

function RedirectLatam(p)
{
	if (p=='')
		location = 'http://www.latam.cc/';
	else
		location = 'http://www.latam.cc/MudaPais.asp?p=' + p;
}
//--------------------------------
function GuiaBusca()
{
    texto = document.getElementById("txtGuia");
    
    if (texto.value == "")
    {
        alert('Por favor, preencha o campo de busca!');
        return
    }
    location = "http://www.guia.callcenter.inf.br/interna.asp?sp=guia_empresa_indice.asp&palavrachave=" + texto.value + "&secID=467";
}
function GuiaBuscaEnter(e)
{
  var oEvent = (oEvent)? oEvent : event;
  var oTarget =(oEvent.target)? oEvent.target : oEvent.srcElement;
  if(oEvent.keyCode==13)
  {
    oEvent.keyCode = 0;
    GuiaBusca();
  }
}
//------------------------------
function PerfilGlossarioPesquisar()
{
    ddPG = document.getElementById( "ctl00_Topo_ddPerfilGlos" );

    if (ddPG==null)
	ddPG = document.getElementById( "Topo_ddPerfilGlos");

    texto = document.getElementById("textoPerfilGlos");

    
    if (texto.value == "")
    {
        alert('Por favor, preencha o campo de pesquisa!');
        return
    }
    if (ddPG.value=='G')
        location = "http://www.callcenter.inf.br/glossario/?textoPerfilGlos=" + texto.value;
    else
        location = "http://www.callcenter.inf.br/perfilempresarial/?textoPerfilGlos=" + texto.value;
}
function PerfilGlossarioPesquisarEnter(e)
{
  var oEvent = (oEvent)? oEvent : event;
  var oTarget =(oEvent.target)? oEvent.target : oEvent.srcElement;
  if(oEvent.keyCode==13)
  {
    oEvent.keyCode = 0;
    PerfilGlossarioPesquisar();
  }
}
//------------------------------
function Busca()
{
    texto = document.getElementById("txtTextoBusca");
    
    if (texto.value == "")
    {
        alert('Por favor, preencha o campo de busca!');
        return
    }
     location = urlSite + "busca/RegistraTextoProcurado.aspx?txtTextoBusca=" + texto.value;   
}
function BuscaEnter(e)
{
  var oEvent = (oEvent)? oEvent : event;
  var oTarget =(oEvent.target)? oEvent.target : oEvent.srcElement;
  if(oEvent.keyCode==13)
  {
  
    oEvent.returnValue=false;
    oEvent.cancel = true;
    oEvent.keyCode = 0;
    Busca();
  }
}

//==========================================
// JQUERY....

$(document).ready(function() {

    $('#icLupaBusca').click(function(){
        Busca();
    });
    $('#txtTextoBusca').keydown(function(){
        BuscaEnter();
    });

});

