//============================================================
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 = "/glossario/?textoPerfilGlos=" + texto.value;
    else
        location = "/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 = "/busca/?txtTextoBusca=" + texto.value;
    location = "/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.keyCode = 0;
    Busca();
  }
}

//==========================================
// JQUERY....

$(document).ready(function() {
    // SubMenus do Menu Horizontal (serviços) - Topo da Página.
    // SubMenu ClienteSA
 /*   $('.mhClienteSA').mouseover(function(){
        sendXmlHttpRequest( '/templates/' + 'SubMenuClienteSA.ashx?' + parseInt(Math.random()*100) );
        intervalo = window.setInterval(function() {
            if (intervalProcessingAjax == 'ok') {
                clearInterval(intervalo);
                $('.smhClienteSA').html(returnValue);
            }
       }, 10);
    });
    // SubMenu Callcenter
    $('.mhCallcenter').mouseover(function(){
        sendXmlHttpRequest( '/templates/' + 'SubMenuCallcenter.ashx?' + parseInt(Math.random()*100) );
        intervalo = window.setInterval(function() {
            if (intervalProcessingAjax == 'ok') {
                clearInterval(intervalo);
                $('.smhCallcenter').html(returnValue);
            }
       }, 10);
    });    
    // SubMenu Personalidades
    $('.mhPersonalidades').mouseover(function(){
        sendXmlHttpRequest( '/templates/' + 'SubMenuPersonalidades.ashx?' + parseInt(Math.random()*100) );
        intervalo = window.setInterval(function() {
            if (intervalProcessingAjax == 'ok') {
                clearInterval(intervalo);
                $('.smhPersonalidades').html(returnValue);
            }
       }, 10);
    });
    // SubMenu Prêmio
    $('.mhPremio').mouseover(function(){
        sendXmlHttpRequest( '/templates/' + 'SubMenuPremio.ashx?' + parseInt(Math.random()*100) );
        intervalo = window.setInterval(function() {
            if (intervalProcessingAjax == 'ok') {
                clearInterval(intervalo);
                $('.smhPremio').html(returnValue);
            }
       }, 10);
    });
    // SubMenu Personalidades
    $('.mhEventos').mouseover(function(){
        sendXmlHttpRequest( '/templates/' + 'SubMenuEventos.ashx?' + parseInt(Math.random()*100) );
        intervalo = window.setInterval(function() {
            if (intervalProcessingAjax == 'ok') {
                clearInterval(intervalo);
                $('.smhEventos').html(returnValue);
            }
       }, 10);
    });
    // SubMenu Cadernos
    $('.mhCadernos').mouseover(function(){
        sendXmlHttpRequest( '/templates/' + 'SubMenuCadernos.ashx?' + parseInt(Math.random()*100) );
        intervalo = window.setInterval(function() {
            if (intervalProcessingAjax == 'ok') {
                clearInterval(intervalo);
                $('.smhCadernos').html(returnValue);
            }
       }, 100);
    });
    // SubMenu Blog
    $('.mhBlog').mouseover(function(){
        sendXmlHttpRequest( '/templates/' + 'SubMenuBlog.ashx?' + parseInt(Math.random()*100) );
        intervalo = window.setInterval(function() {
            if (intervalProcessingAjax == 'ok') {
                clearInterval(intervalo);
                $('.smhBlog').html(returnValue);
            }
       }, 10);
    });
    // SubMenu TVip
    $('.mhTVip').mouseover(function(){
        sendXmlHttpRequest( '/templates/' + 'SubMenuTVip.ashx?' + parseInt(Math.random()*100) );
        intervalo = window.setInterval(function() {
            if (intervalProcessingAjax == 'ok') {
                clearInterval(intervalo);
                $('.smhTVip').html(returnValue);
            }
       }, 10);
    });
    // SubMenu Portal Credito e Cobrança
    $('.mhIRC').mouseover(function(){
        sendXmlHttpRequest( '/templates/' + 'SubMenuCredCobranca.ashx?' + parseInt(Math.random()*100) );
        intervalo = window.setInterval(function() {
            if (intervalProcessingAjax == 'ok') {
                clearInterval(intervalo);
                $('.smhIRC').html(returnValue);
            }
       }, 10);
    });
    */
    
});


