function abrirAtendimentoOnline() {

   //var w = window.open("http://www.haha.com.br/atendimento/cliente.php?KEY=108507997954249VEAWIERRDI", "atendimentoonline", "width=400, height=400, status=no");

   //var w = window.open("http://www.haha.com.br/atendimento/cliente.php?KEY=108507997954249VEAWIERRDIVVHUD", "atendimentoonline", "width=400, height=400, status=no");

   //var w = window.open("http://www.portaldeatendimento.com.br/atendimento/cliente.php?KEY=108507997954249VEAWIERRDIVVHUD", "atendimentoonline", "width=400, height=400, status=no");

      var w = window.open("http://www.samba.net.br/atendimento/index_atendimento.php", "atendimento", "width=452, height=530, status=no, scrollbars=yes");

   w.focus();

 }



function abre_popmeio1(strUrl,strName,intWidth,intHeight) {

    window.open('/hotsite/samba.html','um','scrollbars=no,width=600,height=400,left=30,top=30');

}



function exibirDuvida(intAncora)

{



    if(intAncora!=0)

       window.location.href="/relacionamento_2006/faq.php#"+intAncora;



}



function gravaCookie()

{

    var expDays = 30;

    var exp = new Date();

    exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

    document.cookie = "id_signo =" + id_cookie +"; expires=" + exp.toGMTString();

}





function escolhePlano(objForm, varCodPlano)

{

    objForm.intCodPlano.value = varCodPlano;

    objForm.submit();

}





function abreJanela(pCaminho, pX, pY, pZ){



   window.open (pCaminho,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+ pZ +',resizable=no,width=' + pX + ',height=' + pY + ',top=50,left=50');



}



function redireciona(pUrl){



   if(pUrl != '0'){

       top.location.href = pUrl;

   }



}



function openWindow(theURL,winName,features) {



   window.open(theURL,winName,features);



}



function imprimirNoticia(idNoticia){



        winNot = window.open('../includes/canais/imprimir_noticia.php?idNoticia='+ idNoticia,'winimprnot','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,width=520,height=400,top=0,left=0');



}

function imprimirNoticia2(idNoticia){



        winNot = window.open('http://www.samba.net.br/noticias_2006/imprimir_noticia.php?idNoticia='+ idNoticia,'winimprnot','toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,width=520,height=400,top=0,left=0');



}


function tamanhoFonte(intTamanho){



    switch(intTamanho)

    {

       case 1:

         corpo_noticia.style.fontSize=13;

       break;



       case 2:

         corpo_noticia.style.fontSize=14;

       break;



       case 3:

         corpo_noticia.style.fontSize=16;

       break;



    }



}


function criticaBusca(objForm)

{

    var bolValida = true;



    bolValida = validarTxt(objForm.txtBusca, 'Por favor informe uma ou mais palavras para a busca')

    if (!bolValida)

         return false;



    return bolValida;

}



function criticaBoletim(objForm)

{

    var bolValida = true;



    bolValida = validarTxt(objForm.txtNomeBol, 'Por favor informe o nome')

    if (!bolValida)

         return false;

		 

    bolValida = validarTxt(objForm.txtEmailBol, 'Por favor informe o email')

    if (!bolValida)

         return false;



    return bolValida;

}





function criticaBuscaHome(objForm)

{



    var bolValida = true;



    bolValida = validarTxt(objForm.txtBusca, 'Por favor informe uma ou mais palavras para a busca')

    if (!bolValida)

         return false;



    var intLen = objForm.rdTipoBusca.length;

    var tipoBusca;



    for (i=0; i<intLen; i++) {

        if (objForm.rdTipoBusca[i].checked) {

            tipoBusca = objForm.rdTipoBusca[i].value;

        }

    }



    switch (tipoBusca)

    {

        case '1':

             objForm.action = '/noticias/index.php';

        break;



        case '2':

             window.location.href = '/includes/index_msn.php?q='+objForm.txtBusca.value;

             bolValida = false;

        break;



        case '3':

             //objForm.action = 'http://www.br.inter.net';

             window.location.href = "/includes/index_parceiros.php?url=http://www.mercadolivre.com.br/brasil/ml/pms?site=284912$$$id=2021$$$as_opt=http://www.mercadolivre.com.br/jm/search?as_display_type=G$$as_order_id=MAS_OFERTADOS$$as_word="+objForm.txtBusca.value;

             //window.open( "includes/index_parceiros.php?url=http://www.mercadolivre.com.br/brasil/ml/pms?site=284912$$$id=2021$$$as_opt=http://www.mercadolivre.com.br/jm/search?as_display_type=G$$as_order_id=MAS_OFERTADOS$$as_word="+objForm.txtBusca.value)

             bolValida = false;

        break;

    }



    return bolValida;



}

function criticaBuscaHome2006(objForm)

{



    var bolValida = true;



    bolValida = validarTxt(objForm.txtBusca, 'Por favor informe uma ou mais palavras para a busca')

    if (!bolValida)

         return false;



    var intLen = objForm.rdTipoBusca.length;

    var tipoBusca;



    for (i=0; i<intLen; i++) {

        if (objForm.rdTipoBusca[i].checked) {

            tipoBusca = objForm.rdTipoBusca[i].value;

        }

    }



    switch (tipoBusca)

    {

        case '1':

             objForm.action = '/noticias_2006/index.php';

        break;



        case '2':
		
			objForm.action = '/includes/index_yahoo.php';
			
            <!-- window.location.href = '/includes/index_yahoo.php?p='+objForm.txtBusca.value;-->
             <!--bolValida = false;-->

        break;



        case '3':

             //objForm.action = 'http://www.br.inter.net';

             window.location.href = "/includes/index_parceiros.php?url=http://www.mercadolivre.com.br/brasil/ml/pms?site=284912$$$id=2021$$$as_opt=http://www.mercadolivre.com.br/jm/search?as_display_type=G$$as_order_id=MAS_OFERTADOS$$as_word="+objForm.p.value;

             //window.open( "includes/index_parceiros.php?url=http://www.mercadolivre.com.br/brasil/ml/pms?site=284912$$$id=2021$$$as_opt=http://www.mercadolivre.com.br/jm/search?as_display_type=G$$as_order_id=MAS_OFERTADOS$$as_word="+objForm.txtBusca.value)

             bolValida = false;

        break;

    }



    return bolValida;



}




function escolherSigno(objSigno)

{

    var idSigno = objSigno[objSigno.selectedIndex].value;

    if (idSigno != '0')

    {

        //window.location.href='includes/index_parceiros.php?url=http://www5.estrelaguia.com.br/bin/pg_dinamica.php?id_pag=151&id_signo='+idSigno+'&tp=d';

        window.open('/includes/index_parceiros.php?url=http://www5.estrelaguia.com.br/bin/pg_dinamica.php?id_pag=151$$$id_signo='+idSigno+'$$$tp=d');

    }

}



// Funcões de Crítica



function validarCartaoCredito(txtNumCartao, strMsg) {

  st = txtNumCartao.value;

  if (st.length > 19 || st.length == 0){

    if(typeof(strMsg) != "undefined"){

        txtNumCartao.focus();

        alert(strMsg);

    }

    return (false);

  }



  sum = 0; mul = 1; l = st.length;

  for (i = 0; i < l; i++) {

    digit = st.substring(l-i-1,l-i);

    tproduct = parseInt(digit ,10)*mul;

    if (tproduct >= 10)

      sum += (tproduct % 10) + 1;

    else

      sum += tproduct;

    if (mul == 1)

      mul++;

    else

      mul--;

  }



  if ((sum % 10) == 0)

    return (true);

  else {

    if(typeof(strMsg) != "undefined"){

        txtNumCartao.focus();

        alert(strMsg);

    }

    return (false);

  }

}



function exibeTituloFuncao (strTitulo, strLink, strParent)    {

    window.parent(1).objTitulo.innerText = strTitulo;

    window.open ( strLink, strParent );

    window.focus();

}



function funcLocationHref( strLink ){

    window.location.href = strLink;

}



function validarTxt(txtInput, strMsg) {



    var strValor = trim(txtInput.value);

    if (strValor.length == 0 ) {

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        txtInput.select();

        txtInput.focus();

        return false;

    }

    return true;

}



function validarTxtMin (txtInput, intMin, strMsg) {



    var strValor = trim(txtInput.value);



    if (strValor.length < intMin ) {

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        txtInput.select();

        txtInput.focus();

        return false;

    }

    return true;

}





function marcarTodos(formulario) {

    f = formulario;

    for (i=0; i<f.length; i++)

        if (f.elements[i].type == "checkbox")

        if (f.todos.checked) f.elements[i].checked = true

        else f.elements[i].checked = false

}



function validarCombo(cboList, strMsg) {

    var intComboValue = cboList[cboList.selectedIndex].value;

    if (intComboValue == -1 ) {

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        cboList.focus();

        return false;

    }

    return true;

}



function validarEmail (txtEmail, strMsg) {



    var strEmail = trim(txtEmail.value);



    if (strEmail.length == 0 ) {

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        txtEmail.select();

        txtEmail.focus();

        return false;

    }



    var strEmailPat=/^(.+)@(.+)$/;

    var matchArray=strEmail.match(strEmailPat);



    if (matchArray==null) {

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        txtEmail.select();

        txtEmail.focus();

        return false;

    }



    return true;

}



function validarIP(txtIp, strMsg){

    var strDomain = trim(txtIp.value);

    var IPArray = strDomain.split(".");



    if (IPArray.length != 4){

        if(typeof(strMsg) != "undefined")

            alert(strMsg);

        txtIp.focus();

        return false;

    }



    for (var loop=0; loop < IPArray.length; loop++){

        if (IPArray[loop]>255) {

            if(typeof(strMsg) != "undefined"){

                alert(strMsg);

            }

            txtIp.select();

            txtIp.focus();

            return false;

        }

    }

    return true;

}



function validarData(cmbDia, cmbMes, txtAno, strMsg){

    //valida as datas no formato dd/mm/aaaa num text ...



    if (txtAno.value.length < 4){

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        return false;

    }



    var intAno = eval(txtAno.value);

    var intDia = cmbDia[cmbDia.selectedIndex].value;

    var intMes = cmbMes[cmbMes.selectedIndex].value;



    var arrMeses = new Array(13);

    arrMeses[1]  = 31;

    if((intAno % 4) == 0)

        arrMeses[2]  = 29;

    else

        arrMeses[2]  = 28;

    arrMeses[3]  = 31;

    arrMeses[4]  = 30;

    arrMeses[5]  = 31;

    arrMeses[6]  = 30;

    arrMeses[7]  = 31;

    arrMeses[8]  = 31;

    arrMeses[9]  = 30;

    arrMeses[10] = 31;

    arrMeses[11] = 30;

    arrMeses[12] = 31;



    if ((intDia < 1) || (eval(intDia) > arrMeses[eval(intMes)]) || (intMes < 1 || intMes > 12)){

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        return false;

    }



    return true;

}





function validarTxtData(txtInput, strMsg){

    if (txtInput.value.length < 10){

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        txtInput.focus();

        return false;

    }



    var arrCookies = document.cookie.split(/;/);

    var intIdIdioma;

    for(var i = 0; i < arrCookies.length; i++){

        if (arrCookies[i].indexOf("cokIdIdiomaFuncionario") == 1 ){

            intIdIdioma = arrCookies[i].substring(arrCookies[i].indexOf("=") + 1);

            break;

        }

    }



    var intAno = eval(txtInput.value.substring(6));



    if (intIdIdioma == 1 || intIdIdioma == 3){

        var intDia = txtInput.value.substring(0,2);

        var intMes = txtInput.value.substring(3,5);

    }else {

        var intDia = txtInput.value.substring(0,2);

        var intMes = txtInput.value.substring(3,5);

    }



    var arrMeses = new Array(13);

    arrMeses[1]  = 31;

    if((intAno % 4) == 0)

        arrMeses[2]  = 29;

    else

        arrMeses[2]  = 28;

    arrMeses[3]  = 31;

    arrMeses[4]  = 30;

    arrMeses[5]  = 31;

    arrMeses[6]  = 30;

    arrMeses[7]  = 31;

    arrMeses[8]  = 31;

    arrMeses[9]  = 30;

    arrMeses[10] = 31;

    arrMeses[11] = 30;

    arrMeses[12] = 31;



    if ((intDia < 1) || (eval(intDia) > arrMeses[eval(intMes)]) || (intMes < 1 || intMes > 12)){

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        txtInput.focus();

        return false;

    }



    return true;

}



function teclasNum(event, txtInput, intPos){

    var tecla = event.keyCode;

    if ((tecla > 47 && tecla < 58) || tecla == 46) // numeros de 0 a 9

        return true;

    else {

        if(typeof(txtInput) != "undefined" && typeof(intPos) != "undefined" && txtInput.value.length == intPos){

            if (tecla != 8 && tecla != 45) // backspace

                event.keyCode = 0;

            else

                return true;

        }else {

            if (tecla != 8) // backspace

                event.keyCode = 0;

                //return false;

            else

                return true;

        }

    }

}



function teclasAlfa(event){

    var tecla = event.keyCode;

    if ((tecla > 64 && tecla < 91) || (tecla > 96 && tecla < 123))

        return true;

    else {

        if (tecla != 8) // backspace

            event.keyCode = 0;

            //return false;

        else

            return true;

    }

}



function teclasMoeda(event, txtInput){

    var tecla = event.keyCode;

    var strValor = txtInput.value;

    if (tecla > 47 && tecla < 58)

        return true;

    else {

        if ((tecla == 8) || ( (tecla == 44) && (strValor != '') && (strValor.indexOf(",") < 0 )))

            return true;

        else {

            if ((tecla == 8) || ( (tecla == 46) && (strValor != '') && (strValor.indexOf(".") < 0 )))

                return true;

            else

                event.keyCode = 0;

        }

    }

}



function teclasAlfaNum(E){

    var tecla = event.keyCode;

    if ((tecla > 64 && tecla < 91) || (tecla > 96 && tecla < 123) || (tecla > 47 && tecla < 58))

        return true;

    else {

        if (tecla != 8) // backspace

            event.keyCode = 0;

            //return false;

        else

            return true;

    }

}



function formatarData(event, txtInput, intMax, txtDestino){

    var tecla = event.keyCode;

    var intTam = txtInput.value.length;

    if ((intTam == 2 || intTam == 5) && tecla != 8)

        txtInput.value = txtInput.value + '/';



    autoTab(txtInput, txtDestino, intMax, event);



}



function caixaAlta(txtInput){

    var strValor = txtInput.value;

    txtInput.value = strValor.toUpperCase();

}



function caixaBaixa(txtInput){

    var strValor = txtInput.value;

    txtInput.value = strValor.toLowerCase();

}



function textareaTamMax(f,intLength,e){

    if(f.value.length>=intLength){

        return false;

    }

    return true;

}



function textareaCounter(f, intLength, intCounter){

        eval('f.form.' + intCounter).value = intLength - f.value.length;

}



function validacpf(txtCpf, strMsg){

    var i;

    strValor = txtCpf.value;

    var c = strValor.substr(0,9);

    var dv = strValor.substr(9,2);



    var d1 = 0;

    for (i = 0; i < 9; i++) {

        d1 += c.charAt(i)*(10-i);

    }



    if (d1 == 0){

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        return false;

    }



    d1 = 11 - (d1 % 11);

    if (d1 > 9)

        d1 = 0;



    if (dv.charAt(0) != d1) {

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        return false;

    }



    d1 *= 2;

    for (i = 0; i < 9; i++) {

        d1 += c.charAt(i)*(11-i);

    }



    d1 = 11 - (d1 % 11);

    if (d1 > 9)

        d1 = 0;

    if (dv.charAt(1) != d1){

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        return false;

    }



    return true;



}



function validarRadio(optRadio, strMsg) {

        var intLen = optRadio.length;

        if(typeof(intLen) == "undefined"){

            if (optRadio.checked)

                return true;

        }



        for (i=0; i<intLen; i++) {

            if (optRadio[i].checked) {

                return true;

            }

        }

        if(typeof(strMsg) != "undefined"){

            alert(strMsg);

        }

        return false;

}



function formatarIP(event, txtIp, intMax, txtDestination){

    var intTecla = event.keyCode;

    strIp = txtIp.value;

    intLen = strIp.length;

    intPos = strIp.lastIndexOf(".");

    var IPArray = strIp.split(".");



    if (((intLen == 3 && intPos < 0) || (eval(intPos + 4) == intLen )) && (IPArray.length < 4) && (intTecla != 8)){



        txtIp.value = txtIp.value + '.';

    }



    if(typeof(intMax) != "undefined" && typeof(txtDestination) != "undefined"){

        autoTab(txtIp, txtDestination, intMax, event);

    }

}





function autoTab(txtOriginal,txtDestination, intMax, event){

   var intTecla = event.keyCode;

   if ( (txtOriginal.value.length >= intMax) && (intTecla != 37 && intTecla != 36)  ){

           txtDestination.focus();

   }

}



function trim(inputString)

{

        if (typeof inputString != "string")

        {

                return inputString;

        }



        var retValue = inputString;

        var ch = retValue.substring(0, 1);



        while (ch == " ")

        {

                retValue = retValue.substring(1, retValue.length);

                ch = retValue.substring(0, 1);

        }



        ch = retValue.substring(retValue.length-1, retValue.length);



        while (ch == " ")

        {

                retValue = retValue.substring(0, retValue.length-1);

                ch = retValue.substring(retValue.length-1, retValue.length);

        }



        while (retValue.indexOf("  ") != -1)

        {

                retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings

        }



        return retValue;

}





function mudaCorBg(varTr, varCor){

  if(document.getElementById||(document.all && !(document.getElementById))){

         varTr.style.backgroundColor=varCor;

  }

}