window.onload = function() {
    if (document.getElementById('combo_marcas_submit')) {
        document.getElementById('combo_marcas_submit').style.display = 'none';
    }
}
function hidePopup()
{
 document.getElementById('banner_flutuante').style.display="none"
}
var idNovo = 0;	
var altura = 0;


function trocaMensagem() {
var mensagens = new Array(); // Vetor que armazena as frases que serão exibidas, para adicionar mais mensagens basta adicionar mais índices no vetor. 
mensagens[0]="Carregando...";    
mensagens[1]="Por favor aguarde...";
mensagens[2]="Estamos processando suas informações...";
mensagens[3]="Verificando os produtos...";
mensagens[4]="Removendo itens do estoque...";
mensagens[5]="Verificando registros no sistema...";
mensagens[6]="Calculando valores...";
mensagens[7]="Carregando...";


if(idNovo < mensagens.length){
idNovo++;
pmeio.innerHTML = mensagens[idNovo-1];
}else{
pmeio.innerHTML = mensagens[mensagens.length-1];
}
} 

var loading = document.createElement('div');
loading.setAttribute('id', 'loading2');
var pmeio = document.createElement('p');
pmeio.appendChild(document.createTextNode('Carregando...'));
pmeio.style.textAlign= 'center';
pmeio.style.color= '#90C';
pmeio.style.fontWeight = 'bold';
loading.appendChild(pmeio);

function getScrollHeight()
{
   var h = window.pageYOffset ||
           document.body.scrollTop ||
           document.documentElement.scrollTop;
           
   return h ? h : 0;
}
		function arrumaAltura(){
pmeio.style.marginTop = ((alertSize()/2+70) + getScrollHeight())+'px';
}
	
	
	function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
//  window.alert( 'Width = ' + myWidth );
  // window.alert( 'Height = ' + myHeight );
return(myHeight);
  }
	

	
function carregandoOverlay()
{
		
	
	pageX = (document.documentElement && document.documentElement.scrollWidth) ? document.documentElement.scrollWidth : (document.body.scrollWidth > document.body.offsetWidth) ? document.body.scrollWidth : document.body.offsetWidth;
	pageY = (document.documentElement && document.documentElement.scrollHeight) ? document.documentElement.scrollHeight : (document.body.scrollHeight > document.body.offsetHeight) ? document.body.scrollHeight : document.body.offsetHeight;

	var overlay = document.createElement('div');
	overlay.setAttribute('id', 'overlay');
	overlay.style.width = pageX + 'px';
	overlay.style.height = pageY + 'px';
	overlay.style.position = 'absolute';
	overlay.style.overflow = 'hidden';
	overlay.style.display = 'block';

	overlay.style.top = 0;
	overlay.style.left = 0;
	overlay.style.background = 'white';
	overlay.style.zIndex = 2000;
			 
	var opacity = 50;
	var tamanhoImg = 124;
	overlay.style.opacity = (opacity/100);
	overlay.style.filter  = "alpha(opacity=" + opacity + ")";
	
	loading.style.display = 'block';	
	loading.style.top = '0';
	loading.style.left = '0';
	loading.style.position = 'absolute';
	loading.style.zIndex = 2001
	loading.style.width =  pageX + 'px';/*'124px';*/
	loading.style.height =  pageY + 'px';/*'200px';*/
	loading.style.background = 'url(/images/indicator.gif) fixed no-repeat center center';
	loading.onclick = function(){
		location.href = location.href;	
	}	
	
	
	arrumaAltura();
	setInterval("arrumaAltura()", 10);
		trocaMensagem();
setInterval("trocaMensagem()", 5000);
	  
	document.body.appendChild(overlay);

	document.body.appendChild(loading);			

	
}


function trim(texto) {
    return texto.replace(/^\s*/, "").replace(/\s*$/, "");
}
function pop(url, w, h) {
    w = (typeof w == "undefined") ? '400': w;
    h = (typeof h == "undefined") ? '450': h;
    window.open(url, '', 'width=' + w + ',height=' + h + ',left=20,top=20,toolbar=0,directories=0,resizable=yes,status=1,scrollbars=1').focus();
}
function disable_form() {
    document.frm.cep.disabled = true;
    document.frm.cep.value = '';
}
function mostraiframe(linha) {
    var linha = document.getElementById(linha);
    if (linha.style.display == 'none') {
        linha.style.display = '';
    } else {
        linha.style.display = 'none';
    }
}
function alteraiframe(linha, acao) {
    var linha = document.getElementById(linha);
    if (acao == 'exibe') {
        linha.style.display = '';
    } else {
        linha.style.display = 'none';
    }
}
function enable_form() {}
function pesquisar_cep(pais, cep, pesofrete) {
    var tempIFrame = document.createElement('iframe');
    tempIFrame.setAttribute('id', 'iframe_cep');
    tempIFrame.setAttribute('name', 'iframe_cep');
    tempIFrame.style.border = '0px';
    tempIFrame.style.width = '0px';
    tempIFrame.style.height = '0px';
    tempIFrame.setAttribute('src', 'cep_frete.asp?pais=' + pais + '&cep=' + cep + '&pesofrete=' + pesofrete);
    IFrameObj = document.body.appendChild(tempIFrame);
}
function valida_pesquisar_cep() {
    var pais = "BR";
    var format_cep = document.frm.cep1.value + document.frm.cep2.value
    if (pais == 'BR') {
        if (format_cep.length == 8) {
            executar_pesquisar_cep();
        } else {
            alert(ValPesqCepALERTcepinvalido);
            document.frm.cep1.focus();
			//return false;
        }
    } else {
        executar_pesquisar_cep();
    }
}
function executar_pesquisar_cep() {
    var pais = "BR";
    document.frmEditContact.pais_frete.value = pais;
    var cep = document.frm.cep1.value + document.frm.cep2.value;
    var peso = document.frm.pesofrete.value;
    pesquisar_cep(pais, cep, peso);
}
function send_frete(string) {
	
	carregandoOverlay();
	
    var vfrete = string.split('#');
    SndFrtALERTopcaofreteTMP = SndFrtALERTopcaofrete.replace("varOpcaoFrete", "" + vfrete[0]) + "";
    SndFrtALERTopcaofreteTMP = SndFrtALERTopcaofreteTMP.replace("varValorFrete", "" + vfrete[1]) + "";
    var conf_frete = true
    if (conf_frete == true) {
        document.frmEditContact.opcao_frete.value = vfrete[0];
        document.frmEditContact.frete.value = vfrete[2];
        document.frmEditContact.cep_frete.value = vfrete[3];
        document.frmEditContact.submit();
    }
}
function handleResponse(informacoes) {
	
    var tbl = document.getElementById('freteTable');
    var lastRow = tbl.rows.length;
    if (lastRow > 0) tbl.deleteRow(lastRow - 1);
    if (informacoes != 0) {
        if (informacoes == 'fretegratis') {
            document.frmEditContact.cep_frete.value = document.frm.cep1.value + document.frm.cep2.value;
            document.frmEditContact.submit();
        } else {
            var verify_informacoes = informacoes.indexOf("#");
            if (verify_informacoes >= 0) {
                var CEP = document.frm.cep1.value + document.frm.cep2.value;
                var textoCEP = document.frm.textocep.value;
                var x = document.getElementById('freteTable').insertRow(0);
                var y = x.insertCell(0);
                y.innerHTML = "<table id='" + CEP + "' border='0' width='100%' cellpadding='0' cellspacing='0'></table>";				
				
                var array_informacoes = informacoes.split("#");
                var x = document.getElementById(CEP).insertRow(0);
                var y = x.insertCell(0);
                x.height = "25";
				x.bgColor = "#FEE247";
				y.innerHTML = '<b>&nbsp;&nbsp;&nbsp; CLIQUE SOBRE A FORMA DE ENTREGA DESEJADA:</b>';
                var part_num = 0;
                var count = 0;
                var mod = 0;
                var color;
                while (part_num < array_informacoes.length) {
                    if (mod == 0) {
                        mod = 1;
                        color = '#FFFFFF';
                    } else {
                        mod = 0;
                        color = '#F5F5F5';
                    }
                    var array_frete = array_informacoes[part_num].split(":");
                    if (array_frete[2] != "ok") {
                        var nRows = document.getElementById(CEP).rows.length;
                        var x = document.getElementById(CEP).insertRow(nRows);
						var y = x.insertCell(0); 
						y.innerHTML = array_frete[0] + ": " + array_frete[2];
						count += 1;
                    } else {
                        if (array_frete[1] != "vazio") {
                            var verify_vlrFRETE = array_frete[1].indexOf("|");
                            if (verify_vlrFRETE >= 0) {
                                var vlrFRETE = array_frete[1].split("|");
                                var vlrFRETE_REAL = vlrFRETE[0];
                                var vlrFRETE_VIS = vlrFRETE[1];
                            } else {
                                var vlrFRETE_REAL = array_frete[1];
                                var vlrFRETE_VIS = array_frete[1];
                            }
                            var x = document.getElementById(CEP).insertRow(1);
							var y = x.insertCell(0);
							x.height = "10";
							x.bgColor = color; 
							if(parseFloat(vlrFRETE_REAL) == 0){
								nomeFrete = "GRÁTIS";
							}else{
								nomeFrete = array_frete[0];	
							}
							y.innerHTML = "<span style='font-size:9px;'><a href='#' id='"+ array_frete[0] + "#" + vlrFRETE_VIS + "#" + vlrFRETE_REAL + "#" + CEP +"' onclick='send_frete(this.id);return false;' class='linkfrete'><img src='images/seta_frete.gif' align='absmiddle' /> <strong>" + nomeFrete + "</strong> R$ " + vlrFRETE_VIS + " - Prazo de entrega: " + array_frete[3] + "</a></span>";
							count += 1;
                        }
                    }
                    part_num += 1;
                }
				document.getElementById('calculandofrete').style.display = 'none';
                if (count == 0) {
                    var x = document.getElementById('freteTable').insertRow(0);
					var y = x.insertCell(0);
					y.innerHTML = HndRespALERTsemfrete;
                }
                enable_form();
            } else {
                var vfrete = informacoes.split(":");
                if (vfrete[2] != "ok") {
                    var CEP = document.frm.cep.value;
                    var textoCEP = document.frm.textocep.value;
                    var x = document.getElementById('freteTable').insertRow(0);
                    var y = x.insertCell(0);
                    y.innerHTML = "<table id='" + CEP + "' border='0' width='100%' cellpadding='0' cellspacing='2'></table>";
                    var x = document.getElementById(CEP).insertRow(0);
                    var y = x.insertCell(0);
                    x.height = "25";
					x.bgColor = "#FEE247";
					y.innerHTML = '<b>&nbsp;&nbsp;&nbsp;' + textoCEP + " " + CEP + ':</b>';
                    var x = document.getElementById(CEP).insertRow(1);
					var y = x.insertCell(0); 
					y.innerHTML = vfrete[0] + ": " + vfrete[2];
					count += 1;
                } else {
                    var verify_vlrFRETE = vfrete[1].indexOf("|");
                    if (verify_vlrFRETE >= 0) {
                        var vlrFRETE = vfrete[1].split("|");
                        var vlrFRETE_REAL = vlrFRETE[0];
                        var vlrFRETE_VIS = vlrFRETE[1];
                    } else {
                        var vlrFRETE_REAL = vfrete[1];
                        var vlrFRETE_VIS = vfrete[1];
                    }
                    document.frmEditContact.opcao_frete.value = vfrete[0];
                    document.frmEditContact.frete.value = vlrFRETE_REAL;
                    document.frmEditContact.cep_frete.value = document.frm.cep1.value + document.frm.cep2.value;
                    document.frmEditContact.submit();
                }
            }
        }
    } else {
        disable_form();
        document.frm.cep.disabled = false;
        var x = document.getElementById('freteTable').insertRow(0);
		var y = x.insertCell(0);
		y.innerHTML = HndRespALERTsemfrete;
    }	
	
}
function mostra_cep() {
    Form = document.carrinho;
    if ((Form.cep1.value.length == 5) && (checatab)) {
        Form.cep2.focus();
        checatab = false;
    }
}
function cadastro_cep_verificar(cep) {
    if (!alterado_cep) {
        alterado_cep = true;
        document.all.cep.focus();
        document.all.numero.value = '';
        document.all.complemento.value = '';
    }
}
function check_meiopag(opcaopag) {
    var fr = document.OpcaoPag;
    for (a = 0; a < fr.elements.length; a++) {
        if (fr.elements[a].value == opcaopag) {
            fr.elements[a].checked = true;
        }
    }
}
var isNN = (navigator.appName.indexOf("Netscape") != -1);
function autoTab(input, len, e) {
    var keyCode = (isNN) ? e.which: e.keyCode;
    var filter = (isNN) ? [0, 8, 9] : [0, 8, 9, 16, 17, 18, 37, 38, 39, 40, 46];
    if (input.value.length >= len && !containsElement(filter, keyCode)) {
        input.value = input.value.slice(0, len);
        input.form[(getIndex(input) + 1) % input.form.length].focus();
    }
    function containsElement(arr, ele) {
        var found = false,
        index = 0;
        while (!found && index < arr.length) if (arr[index] == ele) found = true;
        else index++;
        return found;
    }
    function getIndex(input) {
        var index = -1;
        var i = 0;
        var found = false;
        while (i < input.form.length && index == -1){
			if (input.form[i] == input){
				index = i;
			}else{
				i++;
			}
		}
        return index;
    }
    return true;
}
function remover_produto(nome) {
    eval("document.carrinho." + nome + ".value = 0");
    document.carrinho.submit();
}
function atualizar_carrinho() {
    var resposta,
    Form;
    Form = document.carrinho;
    resposta = true;
    if (Form.tipofrete.value == "SEDEX" && (Form.cep1.value.length != 0 || Form.cep2.value.length != 0)) {
        resposta = valida_cep();
    }
    if (resposta == true) document.carrinho.submit();
}
function calcular_frete() {
    var resposta;
    resposta = valida_cep();
    if (resposta == true) document.carrinho.submit();
}
function mostra_calculo_frete() {
    var Form;
    Form = document.pagamento;
    janela = window.open('calculo_frete.asp?valor=' + Form.subtotal.value + '&frete=' + Form.taxa_envio.value + '&cepdestino=' + Form.cep.value + '&peso=' + Form.peso.value + '&tipo_sedex=' + Form.tipo_sedex.value, 'promocao', 'width=600,height=250,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');
	if (janela != null) {
        janela.location.href = 'calculo_frete.asp?valor=' + Form.subtotal.value + '&frete=' + Form.taxa_envio.value + '&cepdestino=' + Form.cep.value + '&peso=' + Form.peso.value + '&tipo_sedex=' + Form.tipo_sedex.value;
    }
}
function metodo_pagamento(nome) {
    var carteira, i, sel, num_pag, temp, metodo_pag, ssl, acao;
	var Form;
    Form = document.carrinho;
    num_pag = document.pagamento.num_pagamentos.value;
    if (document.pagamento.tipo.value == false) {
        alert(MtdPagALERTselpag);
        return false;
    }
    if (document.pagamento.taxa_envio.value == 0 && !document.carrinho.frete_teste) {
        alert(MtdPagALERTcalcfrete);
        return false;
    } else {
        if (num_pag == "1") {
            temp = document.pagamento.tipo.value;
            acao = document.pagamento.URL_Autentica.value + "?acao=login" + "&forma_pagamento=" + metodo_pag;
            eval("document.pagamento.action='" + acao + "'");
            document.pagamento.submit();
        } else {
            for (i = 0; i < num_pag; i++) {
                if (document.pagamento.tipo.value == true) {
                    sel = i;
                    break;
                }
            }
            temp = document.pagamento.tipo.value;
        }
        metodo_pag = temp.substring(0, temp.length - 1);
        if (metodo_pag == "AMEX" || metodo_pag == "AMEXPOS" || metodo_pag == "REDECARD" || metodo_pag == "RCARDPOS" || metodo_pag == "VISA" || metodo_pag == "VISAPOS") metodo_pag = "CARTAO";

        ssl = temp.substring(temp.length - 1, temp.length);
        if (ssl == "0") {
            acao = document.pagamento.URL_Autentica.value + "?acao=login" + "&forma_pagamento=" + metodo_pag;
        } else {
            acao = document.pagamento.URL_Autentica_seguro.value + "?acao=login" + "&forma_pagamento=" + metodo_pag;
        }
        if (metodo_pag == "CARTAO") {
            acao = acao + "&cartao=" + temp.substring(0, temp.length - 1);
        }
        eval("document.pagamento.action='" + acao + "'");
        document.pagamento.submit();
    }
}
function valida_busca() {
    Form = document.busca;
    if (Form.produto.value.length == 0) {
        alert(VldBuscaALERTcampobusca);
        Form.produto.focus();
        return false;
    }
    if (Form.produto.value.length < 3) {
        alert(VldBuscaALERTminbusca);
        Form.produto.focus();
        return false;
    }
    if (!Form.codigo_categoria) {
        alert(VldBuscaALERTexistecatbusca);
        return false;
    }
    if (Form.codigo_categoria.value == '') {
        alert(VldBuscaALERTcatbusca);
        Form.codigo_categoria.focus();
        return false;
    }
}
function valida_cep() {
    Form = document.carrinho;
    if (Form.cep1.value.length == 0) {
        alert(VldCepALERTcampocep);
        Form.cep1.focus();
        return false;
    }
    if (Form.cep2.value.length == 0) {
        alert(VldCepALERTcampocep);
        Form.cep2.focus();
        return false;
    }
    s = limpa_string(Form.cep1.value);
    if (s.length != 5) {
        alert(VldCepALERTcaractcep);
        Form.cep1.focus();
        return false;
    }
    s = limpa_string(Form.cep2.value);
    if (s.length != 3) {
        alert(VldCepALERTcaractcep);
        Form.cep2.focus();
        return false;
    }
    return true;
}
function limpa_string(S) {
    var Digitos = "0123456789";
    var temp = "";
    var digito = "";
    for (var i = 0; i < S.length; i++) {
        digito = S.charAt(i);
        if (Digitos.indexOf(digito) >= 0) {
            temp = temp + digito
        }
    }
    return temp
}
function mostra_cep() {
    Form = document.carrinho;
    if ((Form.cep1.value.length == 5) && (checatab)) {
        Form.cep2.focus();
        checatab = false;
    }
}
function semtab() {
    checatab = false;
}
function comtab() {
    checatab = true;
}
checatab = true;
function mostra_cep() {
    Form = document.carrinho;
    if ((Form.cep1.value.length == 5) && (checatab)) {
        Form.cep2.focus();
        checatab = false;
    }
}
function menu_goto(menuform) {
    selecteditem = menuform.local_frete_Exporta.selectedIndex;
    local_frete_Exporta = menuform.local_frete_Exporta.options[selecteditem].value;
    if (local_frete_Exporta.length != 0) {
        location.href = local_frete_Exporta;
    }
}
function valida_cadastro(formname, tipoverif, cep_frete) {
    var Form;
    Form = formname;
    if (cep_frete == 'SEM FRETE') {
        if (tipoverif == 'CadPedido') {
            if ((valida_endereco(Form, 'CadPedido') == false) || (valida_password(Form) == false)) {
                return false;
            }
        } else if (tipoverif == 'CadUsuario') {
            if (valida_endereco(Form, 'CadUsuario') == false) {
                return false;
            }
        }
    } else {
        if ((valida_endereco(Form, 'CadPedido') == false) || (valida_password(Form) == false) || (verifica_cep(cep_frete) == false)) {
            return false;
        }
    }
}
function valida_password(Form) {
    if (Form.tipo_login.value == "user_new") {
        if (Form.senha1.value.length < 6 || Form.senha2.value.length < 6) {
            alert(VldPwdALERTcamposenha + ' Lembre-se: a senha deve ter, no mínimo, 6 dígitos.');
            Form.senha1.focus();
            return false;
        }
        if (Form.senha1.value != Form.senha2.value) {
            alert(VldPwdALERTsenhadif);
            Form.senha1.focus();
            return false;
        }
    }

}
function valida_trocapassword(Form) {
    if (Form.senha_atual.value.length == 0) {
        alert(VldTrocaPwdALERTcamposenhaatual);
        Form.senha_atual.focus();
        return false;
    }
    if (Form.nova_senha.value.length == 0 || Form.confirma_senha.value.length == 0) {
        alert(VldTrocaPwdALERTcamposenha);
        Form.nova_senha.focus();
        return false;
    }
    if (Form.nova_senha.value != Form.confirma_senha.value) {
        alert(VldTrocaPwdALERTsenhadif);
        Form.nova_senha.focus();
        return false;
    }
}
function valida_faleconosco(Form) {
    if (Form.nome.value.length == 0) {
        alert(VldFaleConALERTcmpnome);
        Form.nome.focus();
        return false;
    }
    if (Form.email.value.length == 0) {
        alert(VldFaleConALERTcmpemail);
        Form.email.focus();
        return false;
    }
    if (Form.email.value.indexOf('@', 0) == -1 || Form.email.value.indexOf('.', 0) == -1) {
        alert(VldFaleConALERTcmpemailinc);
        Form.email.focus();
        return false;
    }
    if (Form.assunto.value.length == 0) {
        alert(VldFaleConALERTcmpassunto);
        Form.assunto.focus();
        return false;
    }
    if (Form.comentarios.value.length == 0) {
        alert(VldFaleConALERTcmpcomentario);
        Form.comentarios.focus();
        return false;
    }
    return true;
}
function valida_newsletter(Form) {
    if (Form.nome.value.length == 0) {
        alert(VldNewsALERTcmpnome);
        Form.nome.focus();
        return false;
    }
    if (Form.email.value.length == 0) {
        alert(VldNewsALERTcmpemail);
        Form.email.focus();
        return false;
    }
    if (Form.email.value.indexOf('@', 0) == -1 || Form.email.value.indexOf('.', 0) == -1) {
        alert(VldNewsALERTcmpemailinc);
        Form.email.focus();
        return false;
    }
    return true;
}
function valida_endereco(Form, tipoverif) {
    var s;
    if ((Form.tipcliente[0].checked == false) && (Form.tipcliente[1].checked == false)) {
        alert(VldEndALERTcmpfisjur);
        return false;
    }
    if (valida_dadosCobranca(Form) == false) {
        return false;
    }
    if (tipoverif == 'CadPedido') {
        if (Form.cobranca_diferente.checked == true) {
            if (valida_dadosEntrega(Form) == false) {
                return false;
            }
        }
    } else if (tipoverif == 'CadUsuario') {
        if (valida_dadosEntrega(Form) == false) {
            return false;
        }
    }
}
function valida_dadosCobranca(Form) {
    var s;
    if (Form.tipcliente[1].checked == true) {
        if (Form.razaosocial_cobranca.value.length == 0) {
            alert(VldEndALERTcmprazaosocial);
            Form.razaosocial_cobranca.focus();
            return false;
        }
        if (Form.pais_cobranca.options[Form.pais_cobranca.selectedIndex].value == "BR") {
            var cnpj_cob = Form.cnpj_cobranca_b1.value + Form.cnpj_cobranca_b2.value + Form.cnpj_cobranca_b3.value + Form.cnpj_cobranca_b4.value + Form.cnpj_cobranca_b5.value;
            if (cnpj_cob.length == 0) {
                alert(VldEndALERTcmpcnpj);
                Form.cnpj_cobranca_b1.focus();
                return false;
            }
            s = limpa_string(cnpj_cob);
            if (s.length == 14) {
                if (valida_CNPJ(cnpj_cob) == false) {
                    alert(VldEndALERTcmpcnpjinc);
                    Form.cnpj_cobranca_b1.focus();
                    return false;
                }
            } else {
                alert(VldEndALERTcmpcnpjinc);
                Form.cnpj_cobranca_b1.focus();
                return false;
            }
            Form.cnpj_cobranca.value = cnpj_cob;
        }
    }
    nome_completo = trim(Form.nome_cobranca.value);
    nomes = nome_completo.split(" ");
    if (nomes.length == 1) {
        alert(VldEndALERTcmpnome + ' Digite o nome e o sobrenome');
        Form.nome_cobranca.focus();
        return false;
    }
    if (Form.pais_cobranca.options[Form.pais_cobranca.selectedIndex].value == "BR") {
        var cpf_cob = Form.cpf_cobranca_b1.value + Form.cpf_cobranca_b2.value + Form.cpf_cobranca_b3.value + Form.cpf_cobranca_b4.value;
        if (cpf_cob.length == 0) {
            alert(VldEndALERTcmpcpf);
            Form.cpf_cobranca_b1.focus();
            return false;
        }
        s = limpa_string(cpf_cob);
        if (s.length == 11) {
            if (valida_CPF(cpf_cob) == false) {
                alert(VldEndALERTcmpcpfinc);
                Form.cpf_cobranca_b1.focus();
                return false;
            }
        } else {
            alert(VldEndALERTcmpcpfinc);
            Form.cpf_cobranca_b1.focus();
            return false;
        }
        var rg_cob = Form.rg_cobranca.value
        if (rg_cob.length == 0) {
            alert(VldEndALERTcmprg);
            Form.rg_cobranca.focus();
            return false;
        }
    }
    if (Form.logradouro_cobranca.value.length == 0) {
        alert(VldEndALERTcmpend);
        Form.logradouro_cobranca.focus();
        return false;
    }
    if (Form.bairro_cobranca.value.length == 0) {
        alert('O bairro de cobrança é um campo obrigratório');
        Form.bairro_cobranca.focus();
        return false;
    }
    if (Form.numero_cobranca.value.length == 0) {
        alert(VldEndALERTcmpnum);
        Form.numero_cobranca.focus();
        return false;
    }
    if (Form.pais_cobranca.options[Form.pais_cobranca.selectedIndex].value == "BR") {
        var cep_cob = Form.cep_cobranca_b1.value + Form.cep_cobranca_b2.value;
        if (cep_cob.length == 0) {
            alert(VldEndALERTcmpcep);
            Form.cep_cobranca_b1.focus();
            return false;
        }
        s = limpa_string(cep_cob);
        if (s.length != 8) {
            alert(VldEndALERTcmptamcep);
            Form.cep_cobranca_b1.focus();
            return false;
        }
        if (Form.cep_cobranca) {
            Form.cep_cobranca.value = cep_cob;
        }
    }
    if (Form.cidade_cobranca.value.length == 0) {
        alert(VldEndALERTcmpcidade);
        Form.cidade_cobranca.focus();
        return false;
    }
    if (Form.pais_cobranca.options[Form.pais_cobranca.selectedIndex].value == "BR") {
        if (Form.ddd_cobranca.value.length < 2) {
            alert(VldEndALERTcmpddd);
            Form.ddd_cobranca.focus();
            return false;
        }
    }
    if (Form.telefone_cobranca.value.length < 7) {
        alert(VldEndALERTcmptel + ' Digite somente os números (sem espaço ou traços).');
        Form.telefone_cobranca.focus();
        return false;
    }
    if ((Form.telefone_cobranca.value.substr(0, 1) == 7) || (Form.telefone_cobranca.value.substr(0, 1) == 8) || (Form.telefone_cobranca.value.substr(0, 1) == 9)) {
        alert('Você não deve digitar um número de telefone celular no telefone residencial');
        Form.telefone_cobranca.focus();
        return false;
    }
    if (Form.data_nascimento_cobranca_b1.value.length == 1) {
        Form.data_nascimento_cobranca_b1.value = "0" + Form.data_nascimento_cobranca_b1.value
    }
    if (Form.data_nascimento_cobranca_b2.value.length == 1) {
        Form.data_nascimento_cobranca_b2.value = "0" + Form.data_nascimento_cobranca_b2.value
    }
    var data_nascimento_cobranca = Form.data_nascimento_cobranca_b1.value + Form.data_nascimento_cobranca_b2.value + Form.data_nascimento_cobranca_b3.value;
    if (parseInt(data_nascimento_cobranca.length) < 8) {
        alert('A data de nascimento é um campo obrigatório. Digite a data no formado: DD/MM/AAAA');
        Form.data_nascimento_cobranca_b1.focus();
        return false;
    }
}
function valida_dadosEntrega(Form) {
    var s;
    if (Form.tipcliente[1].checked == true) {
        if (Form.razaosocial_entrega.value.length == 0) {
            alert(VldEndALERTcmprazaosocial);
            Form.razaosocial_entrega.focus();
            return false;
        }
        if (Form.pais_entrega.options[Form.pais_entrega.selectedIndex].value == "BR") {
            var cnpj_ent = Form.cnpj_entrega_b1.value + Form.cnpj_entrega_b2.value + Form.cnpj_entrega_b3.value + Form.cnpj_entrega_b4.value + Form.cnpj_entrega_b5.value;
            if (cnpj_ent.length == 0) {
                alert(VldEndALERTcmpcnpj);
                Form.cnpj_entrega_b1.focus();
                return false;
            }
            s = limpa_string(cnpj_ent);
            if (s.length == 14) {
                if (valida_CNPJ(cnpj_ent) == false) {
                    alert(VldEndALERTcmpcnpjinc);
                    Form.cnpj_entrega_b1.focus();
                    return false;
                }
            } else {
                alert(VldEndALERTcmpcnpjinc);
                Form.cnpj_entrega_b1.focus();
                return false;
            }
            Form.cnpj_entrega.value = cnpj_ent;
        }
    }
    if (Form.nome_entrega.value.length == 0) {
        alert(VldEndALERTcmpnome);
        Form.nome_entrega.focus();
        return false;
    }
    if (Form.pais_entrega.options[Form.pais_entrega.selectedIndex].value == "BR") {
        var cpf_ent = Form.cpf_entrega_b1.value + Form.cpf_entrega_b2.value + Form.cpf_entrega_b3.value + Form.cpf_entrega_b4.value;
        if (cpf_ent.length == 0) {
            alert(VldEndALERTcmpcpf);
            Form.cpf_entrega_b1.focus();
            return false;
        }
        s = limpa_string(cpf_ent);
        if (s.length == 11) {
            if (valida_CPF(cpf_ent) == false) {
                alert(VldEndALERTcmpcpfinc);
                Form.cpf_entrega_b1.focus();
                return false;
            }
        } else {
            alert(VldEndALERTcmpcpfinc);
            Form.cpf_entrega_b1.focus();
            return false;
        }
        var rg_ent = Form.rg_entrega.value;
        if (rg_ent.length == 0) {
            alert(VldEndALERTcmprg);
            Form.rg_entrega.focus();
            return false;
        }
    }
    if (Form.logradouro_entrega.value.length == 0) {
        alert(VldEndALERTcmpend);
        Form.logradouro_entrega.focus();
        return false;
    }
    if (Form.bairro_entrega.value.length == 0) {
        alert('O bairro de entrega é um campo obrigatório');
        Form.bairro_entrega.focus();
        return false;
    }
    if (Form.numero_entrega.value.length == 0) {
        alert(VldEndALERTcmpnum);
        Form.numero_entrega.focus();
        return false;
    }
    if (Form.pais_entrega.options[Form.pais_entrega.selectedIndex].value == "BR") {
        var cep_ent = Form.cep_entrega_b1.value + Form.cep_entrega_b2.value;
        if (cep_ent.length == 0) {
            alert(VldEndALERTcmpcep);
            Form.cep_entrega_b1.focus();
            return false;
        }
        s = limpa_string(cep_ent);
        if (s.length != 8) {
            alert(VldEndALERTcmptamcep);
            Form.cep_entrega_b1.focus();
            return false;
        }
        if (Form.cep_entrega) {
            Form.cep_entrega.value = cep_ent;
        }
    }
    if (Form.cidade_entrega.value.length == 0) {
        alert(VldEndALERTcmpcidade);
        Form.cidade_entrega.focus();
        return false;
    }
    if (Form.telefone_entrega.value.length == 0) {
        alert(VldEndALERTcmptel);
        Form.telefone_entrega.focus();
        return false;
    }
    if (Form.pais_entrega.options[Form.pais_entrega.selectedIndex].value == "BR") {
        if (Form.ddd_entrega.value.length == 0) {
            alert(VldEndALERTcmpddd);
            Form.ddd_entrega.focus();
            return false;
        }
    }
    if (Form.email_entrega.value.length == 0) {
        alert(VldEndALERTcmpemail);
        Form.email_entrega.focus();
        return false;
    }
    if (Form.email_entrega.value.indexOf('@', 0) == -1 || Form.email_entrega.value.indexOf('.', 0) == -1) {
        alert(VldEndALERTcmpemailinc);
        Form.email_entrega.focus();
        return false;
    }
    if (Form.data_nascimento_entrega_b1.value.length == 1) {
        Form.data_nascimento_entrega_b1.value = "0" + Form.data_nascimento_entrega_b1.value
    }
    if (Form.data_nascimento_entrega_b2.value.length == 1) {
        Form.data_nascimento_entrega_b2.value = "0" + Form.data_nascimento_entrega_b2.value
    }
}
function valida_cartao(Form) {
    var s;
    s = limpa_string(Form.ccn.value);
    if (s.length != 16) {
        alert(VldCartaoALERTcmptamnumcartao);
        Form.ccn.focus();
        return false;
    }
    if (Form.ccn.value.length == 0) {
        alert(VldCartaoALERTcmpnumcartao);
        Form.ccn.focus();
        return false;
    }
    if (Form.exp.value.length == 0) {
        alert(VldCartaoALERTcmpdataval);
        Form.exp.focus();
        return false;
    }
    if (Form.cvv2.value.length == 0) {
        alert(VldCartaoALERTcmpcodseg);
        Form.cvv2.focus();
        return false;
    }
    return true;
}
function valida_visa() {
    if (valida_endereco() == true) {
        document.Endereco.submit();
    } else return;
}
function limpa_string(S) {
    var Digitos = "0123456789";
    var temp = "";
    var digito = "";
    for (var i = 0; i < S.length; i++) {
        digito = S.charAt(i);
        if (Digitos.indexOf(digito) >= 0) {
            temp = temp + digito
        }
    }
    return temp
}
function valida_CPF(s) {
    var i;
    s = limpa_string(s);
    var c = s.substr(0, 9);
    var dv = s.substr(9, 2);
    var d1 = 0;
    for (i = 0; i < 9; i++) {
        d1 += c.charAt(i) * (10 - i);
    }
    if (d1 == 0) return false;
    d1 = 11 - (d1 % 11);
    if (d1 > 9) d1 = 0;
    if (dv.charAt(0) != d1) {
        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) {
        return false;
    }
    return true;
}
function valida_CNPJ(s) {
    var i;
    s = limpa_string(s);
    var c = s.substr(0, 12);
    var dv = s.substr(12, 2);
    var d1 = 0;
    for (i = 0; i < 12; i++) {
        d1 += c.charAt(11 - i) * (2 + (i % 8));
    }
    if (d1 == 0) return false;
    d1 = 11 - (d1 % 11);
    if (d1 > 9) d1 = 0;
    if (dv.charAt(0) != d1) {
        return false;
    }
    d1 *= 2;
    for (i = 0; i < 12; i++) {
        d1 += c.charAt(11 - i) * (2 + ((i + 1) % 8));
    }
    d1 = 11 - (d1 % 11);
    if (d1 > 9) d1 = 0;
    if (dv.charAt(1) != d1) {
        return false;
    }
    return true;
}
function valida_numeros(s) {
    var i;
    var dif = 0;
    for (i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if (! ((c >= "0") && (c <= "9"))) {
            dif = 1;
        }
    }
    if (dif == 1) {
        return false;
    }
    return true;
}
function copia_entrega() {
    var n = '';
    var v = '';
    var s = '';
    var i = 0;
    var form = document.Endereco;
    var x = form.length - 1;
    if (form.cobranca_igual.checked) {
        for (var y = 0; y <= x; y++) {
            n = form.elements[y].name;
            if (n.substring(0, 2) == 'b_') {
                s = n.substring(2, n.length);
                if (form.elements[s].type == "select-one") {
                    i = form.elements[s].selectedIndex;
                    form.elements[n].selectedIndex = i;
                } else {
                    v = form.elements[s].value;
                    form.elements[n].value = v;
                }
            }
        }
    }
}
function mostradados(pri) {
    var element = document.getElementById(pri);
    if (element.style.display == 'none') {
        element.style.display = '';
    } else {
        element.style.display = 'none'
    }
}
function reenvio_pwd() {
    var fr = document.autent;
    if (fr.esquecisenha.checked == true) {
        fr.senha.disabled = true;
        fr.senha.value = '';
        document.getElementById('pr').src = 'images/reenviar-senha.gif'
    } else {
        fr.senha.disabled = false;
        document.getElementById('pr').src = 'images/prosseguir.gif'
    }
}
function check_login() {
    var fr = document.autent;
    if (fr.user_id.value.length == 0) {
        alert(CkLoginALERTcmpemail);
        fr.user_id.focus();
        return false;
    }
    if (fr.user_id.value.indexOf('@', 0) == -1 || fr.user_id.value.indexOf('.', 0) == -1) {
        alert(CkLoginALERTcmpemailinc);
        fr.user_id.focus();
        return false;
    }
    if (fr.esquecisenha.checked == false) {
        if (fr.senha.value.length == 0) {
            alert(CkLoginALERTcmpsenha);
            fr.senha.focus();
            return false;
        }
    }
    return true;
}
function check_newlogin() {
    var fr = document.new_user;
    if (fr.user_id.value.length == 0) {
        alert(CkNwLoginALERTcmpemail);
        fr.user_id.focus();
        return false;
    }
    if (fr.user_id.value.indexOf('@', 0) == -1 || fr.user_id.value.indexOf('.', 0) == -1) {
        alert(CkNwLoginALERTcmpemailinc);
        fr.user_id.focus();
        return false;
    }
    return true;
}
function alteraTipCad() {
    var tipCadTextCob = document.getElementById('tipCadTextJuridico_cobranca');
    var tipCadInputCob = document.getElementById('tipCadInputJuridico_cobranca');
    var tipCadTextEnt = document.getElementById('tipCadTextJuridico_entrega');
    var tipCadInputEnt = document.getElementById('tipCadInputJuridico_entrega');
    var tipCadTextCob2 = document.getElementById('tipCadTextJuridico2_cobranca');
    var tipCadInputCob2 = document.getElementById('tipCadInputJuridico2_cobranca');
    var tipCadTextEnt2 = document.getElementById('tipCadTextJuridico2_entrega');
    var tipCadInputEnt2 = document.getElementById('tipCadInputJuridico2_entrega');
    if (document.Endereco.tipcliente[0].checked == true) {
        tipCadTextCob.style.display = 'none';
        tipCadInputCob.style.display = 'none';
        tipCadTextEnt.style.display = 'none';
        tipCadInputEnt.style.display = 'none';
        tipCadTextCob2.style.display = 'none';
        tipCadInputCob2.style.display = 'none';
        tipCadTextEnt2.style.display = 'none';
        tipCadInputEnt2.style.display = 'none';
        document.getElementsByName('razaosocial_cobranca')[0].value = '';
        document.getElementsByName('cnpj_cobranca_b1')[0].value = '';
        document.getElementsByName('cnpj_cobranca_b2')[0].value = '';
        document.getElementsByName('cnpj_cobranca_b3')[0].value = '';
        document.getElementsByName('cnpj_cobranca_b4')[0].value = '';
        document.getElementsByName('cnpj_cobranca_b5')[0].value = '';
        document.getElementsByName('inscricaoestadual_cobranca')[0].value = '';
        document.getElementsByName('razaosocial_entrega')[0].value = '';
        document.getElementsByName('cnpj_entrega_b1')[0].value = '';
        document.getElementsByName('cnpj_entrega_b2')[0].value = '';
        document.getElementsByName('cnpj_entrega_b3')[0].value = '';
        document.getElementsByName('cnpj_entrega_b4')[0].value = '';
        document.getElementsByName('cnpj_entrega_b5')[0].value = '';
        document.getElementsByName('inscricaoestadual_entrega')[0].value = '';
    } else {
        tipCadTextCob.style.display = '';
        tipCadInputCob.style.display = '';
        tipCadTextEnt.style.display = '';
        tipCadInputEnt.style.display = '';
        tipCadTextCob2.style.display = '';
        tipCadInputCob2.style.display = '';
        tipCadTextEnt2.style.display = '';
        tipCadInputEnt2.style.display = '';
    }
}
function checkTipCad(tipoEnd) {
    var verificacao;
    if (document.getElementsByName('razaosocial_' + tipoEnd)[0].value != '') {
        verificacao = true;
    } else {
        verificacao = false;
    }
    var tipCadText = document.getElementById('tipCadTextJuridico_' + tipoEnd);
    var tipCadInput = document.getElementById('tipCadInputJuridico_' + tipoEnd);
    var tipCadText2 = document.getElementById('tipCadTextJuridico2_' + tipoEnd);
    var tipCadInput2 = document.getElementById('tipCadInputJuridico2_' + tipoEnd);
    if (verificacao == false) {
        tipCadText.style.display = 'none';
        tipCadInput.style.display = 'none';
        tipCadText2.style.display = 'none';
        tipCadInput2.style.display = 'none';
        document.getElementsByName('razaosocial_' + tipoEnd)[0].value = '';
        document.getElementsByName('cnpj_' + tipoEnd + '_b1')[0].value = '';
        document.getElementsByName('cnpj_' + tipoEnd + '_b2')[0].value = '';
        document.getElementsByName('cnpj_' + tipoEnd + '_b3')[0].value = '';
        document.getElementsByName('cnpj_' + tipoEnd + '_b4')[0].value = '';
        document.getElementsByName('cnpj_' + tipoEnd + '_b5')[0].value = '';
        document.getElementsByName('inscricaoestadual_' + tipoEnd)[0].value = '';
    } else {
        tipCadText.style.display = '';
        tipCadInput.style.display = '';
        tipCadText2.style.display = '';
        tipCadInput2.style.display = '';
    }
}
function verifica_cep(cep_frete) {
    if (document.Endereco.tipo_acesso.value != "conta") {
        if (document.Endereco.cobranca_diferente.checked == true) {
            if (cep_frete != document.Endereco.cep_entrega.value) {
                resposta = confirm(VrfCepALERTcepentdif);
                if (resposta == false) {
                    return false;
                } else {
                    document.frmEditContact.mode.value = 'changeItem';
                    document.frmEditContact.cep_frete.value = document.Endereco.cep_entrega.value;
                    document.frmEditContact.submit();
                    return false;
                }
            }
        } else {
            if (cep_frete != document.Endereco.cep_cobranca.value) {
                resposta = confirm(VrfCepALERTcepentcobdif);
                if (resposta == false) {
                    return false;
                } else {
                    document.frmEditContact.mode.value = 'changeItem';
                    document.frmEditContact.cep_frete.value = document.Endereco.cep_cobranca.value;
                    document.frmEditContact.submit();
                    return false;
                }
            }
        }
    }
}
function pagamento() {
    vpos = window.open('', 'vpos', 'toolbar=yes,menubar=yes,resizable=yes,status=no,scrollbars=yes,width=600,height=400');
    document.pagamento.submit();
}
function JanelaNova(URLBoleto) {
    window.open(URLBoleto, 'NOME', 'width=680,height=400,menubar,scrollbars,resizable');
}
function Start(VarForm, x, y) {
    vpos = window.open('', 'vpos', 'toolbar=no,menubar=no,resizable=yes,status=no,scrollbars=yes,width=' + x + ',height=' + y + '');
    document.abnfinanc.submit();
}
function submit_bradesco(metodo_pag) {
    Form = document.Confirmacao;
    if (metodo_pag == "cc") {
        eval("Form.action='inicia_transacao.asp?metodo_pag=CC'");
    } else if (metodo_pag == "transfer") {
        eval("Form.action='inicia_transacao.asp?metodo_pag=TRANSFER'");
    } else if (metodo_pag == "financiamento") {
        eval("Form.action='inicia_transacao.asp?metodo_pag=FINANCIAMENTO'");
    }
    document.Confirmacao.submit();
}
function formata_data(formato, keypress, objeto) {
    campo = eval(objeto);
    if (formato == 'DATA') {
        separador = '/';
        conjunto1 = 2;
        conjunto2 = 5;
    }
    if (campo.value.length == conjunto1) {
        campo.value = campo.value + separador;
    }
    if (campo.value.length == conjunto2) {
        campo.value = campo.value + separador;
    }
}
function mostraCarrinho(pri) {
    var textview = document.getElementById(pri);
    if (textview.style.display == 'none') {
        textview.style.display = '';
    } else {
        textview.style.display = 'none';
    }
}
function PopUp(theURL, winName, features) {
    window.open(theURL, winName, features);
}
function check_opcaopag() {
    var fr = document.OpcaoPag;
    var check = false;
    for (a = 0; a < fr.elements.length; a++) {
        if (fr.elements[a].name == 'tipo') {
            if (fr.elements[a].checked == true) {
                check = true;
                break;
            }
        }
    }
    if (check == false) {
        alert(CkOpPagALERTselpag);
    } else {
        fr.submit();
    }
}
function valida_VisaMoset(Form) {
    if (Form.ccn.value.length == 0) {
        alert(VldMosetALERTcmpnumcartao);
        Form.ccn.focus();
        return false;
    }
    if (Form.email.value.length == 0) {
        alert(VldMosetALERTcmpemail);
        Form.email.focus();
        return false;
    }
    if (Form.email.value.indexOf('@', 0) == -1 || Form.email.value.indexOf('.', 0) == -1) {
        alert(VldMosetALERTcmpemailinc);
        Form.email.focus();
        return false;
    }
    if (Form.assunto.value.length == 0) {
        alert(VldMosetALERTcmpassunto);
        Form.assunto.focus();
        return false;
    }
    if (Form.comentarios.value.length == 0) {
        alert(VldMosetALERTcmpcomentario);
        Form.comentarios.focus();
        return false;
    }
    return true;
}
function fncLimpaValue(objTexto, sString) {
    if (sString == objTexto.value) {
        objTexto.value = '';
    }
}
function fncPreencheValue(objTexto, sString) {
    if (objTexto.value == '') {
        objTexto.value = sString;
    }
}
function atualiza_carrinho(tip) {
    var fr = document.frmEditContact;
    var qte_elements = 0;
    var liberado = true;
    var qte_escolhida,
    qte_atual,
    qte_maxima;
    var qte_diferenca;
    for (a = 0; a < fr.elements.length; a++) {
        if (fr.elements[a].name == 'quantidade_produto') {
            qte_elements = qte_elements + 1;
        }
    }
    qte_elements = (qte_elements - 1);
    if (qte_elements >= 1) {
        for (i = 0; i <= qte_elements; i++) {
            qte_escolhida = fr.quantidade_produto[i].value;
            qte_atual = fr.quantidade_atual[i].value;
            qte_maxima = fr.quantidade_maxima[i].value;
			qte_diferenca = qte_escolhida - qte_atual;
            var qte_tratada = String(qte_diferenca);
            if (qte_tratada.indexOf('-') == -1) {
                qte_tratada = Number(qte_tratada);
                if ((qte_tratada > qte_maxima) && (qte_maxima != 0)) {
                    alert(AtzCarALERTqtdestoque);
                    fr.quantidade_produto[i].focus();
                    liberado = false;
                    break;
                }
                if ((qte_escolhida > qte_maxima) && (qte_maxima == 0) && (qte_tratada != 0)) {
                    alert(AtzCarALERTqtdestoque);
                    fr.quantidade_produto[i].focus();
                    liberado = false;
                    break;
                }
            }
        }
    } else {
        qte_escolhida = fr.quantidade_produto.value;
        qte_atual = fr.quantidade_atual.value;
        qte_maxima = fr.quantidade_maxima.value;
		qte_diferenca = qte_escolhida - qte_atual;
        var qte_tratada = String(qte_diferenca);
        if (qte_tratada.indexOf('-') == -1) {
            qte_tratada = Number(qte_tratada);
            if ((qte_tratada > qte_maxima) && (qte_maxima != 0)) {
                alert(AtzCarALERTqtdestoque);
                fr.quantidade_produto.focus();
                liberado = false;
            }
            if ((qte_escolhida > qte_maxima) && (qte_maxima == 0) && (qte_tratada != 0)) {
                alert(AtzCarALERTqtdestoque);
                fr.quantidade_produto.focus();
                liberado = false;
            }
        }
    }
    if (liberado == true) {
        if (tip == 'frete') {
            valida_pesquisar_cep();
        } else {
            document.frmEditContact.submit();
        }
    }
}
function valida_indique() {
    Form = document.indique;
    if (Form.Nome_AmigoIndicador.value.length == 0) {
        alert(VldIndALERTcmpnome);
        Form.Nome_AmigoIndicador.focus();
        return false;
    }
    if (Form.Email_AmigoIndicador.value.length == 0) {
        alert(VldIndALERTcmpemail);
        Form.Email_AmigoIndicador.focus();
        return false;
    }
    if (Form.Email_AmigoIndicador.value.indexOf('@', 0) == -1 || Form.Email_AmigoIndicador.value.indexOf('.', 0) == -1) {
        alert(VldIndALERTcmpemailinc);
        Form.Email_AmigoIndicador.focus();
        return false;
    }
    if (Form.Nome_AmigoIndicado.value.length == 0) {
        alert(VldIndALERTcmpnome);
        Form.Nome_AmigoIndicado.focus();
        return false;
    }
    if (Form.Email_AmigoIndicado.value.length == 0) {
        alert(VldIndALERTcmpemail);
        Form.Email_AmigoIndicado.focus();
        return false;
    }
    if (Form.Email_AmigoIndicado.value.indexOf('@', 0) == -1 || Form.Email_AmigoIndicado.value.indexOf('.', 0) == -1) {
        alert(VldIndALERTcmpemailinc);
        Form.Email_AmigoIndicado.focus();
        return false;
    }
    if (Form.comentario.value.length == 0) {
        alert(VldIndALERTcmpcomentario);
        Form.comentario.focus();
        return false;
    }
    return true;
}
if (typeof deconcept == "undefined") {
    var deconcept = new Object();
}
if (typeof deconcept.util == "undefined") {
    deconcept.util = new Object();
}
if (typeof deconcept.SWFObjectUtil == "undefined") {
    deconcept.SWFObjectUtil = new Object();
}
deconcept.SWFObject = function(_1, id, w, h, _5, c, _7, _8, _9, _a) {
    if (!document.getElementById) {
        return;
    }
    this.DETECT_KEY = _a ? _a: "detectflash";
    this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
    this.params = new Object();
    this.variables = new Object();
    this.attributes = new Array();
    if (_1) {
        this.setAttribute("swf", _1);
    }
    if (id) {
        this.setAttribute("id", id);
    }
    if (w) {
        this.setAttribute("width", w);
    }
    if (h) {
        this.setAttribute("height", h);
    }
    if (_5) {
        this.setAttribute("version", new deconcept.PlayerVersion(_5.toString().split(".")));
    }
    this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
    if (!window.opera && document.all && this.installedVer.major > 7) {
        deconcept.SWFObject.doPrepUnload = true;
    }
    if (c) {
        this.addParam("bgcolor", c);
    }
    var q = _7 ? _7: "high";
    this.addParam("quality", q);
    this.setAttribute("useExpressInstall", false);
    this.setAttribute("doExpressInstall", false);
    var _c = (_8) ? _8: window.location;
    this.setAttribute("xiRedirectUrl", _c);
    this.setAttribute("redirectUrl", "");
    if (_9) {
        this.setAttribute("redirectUrl", _9);
    }
};
deconcept.SWFObject.prototype = {
    useExpressInstall: function(_d) {
        this.xiSWFPath = !_d ? "expressinstall.swf": _d;
        this.setAttribute("useExpressInstall", true);
    },
    setAttribute: function(_e, _f) {
        this.attributes[_e] = _f;
    },
    getAttribute: function(_10) {
        return this.attributes[_10];
    },
    addParam: function(_11, _12) {
        this.params[_11] = _12;
    },
    getParams: function() {
        return this.params;
    },
    addVariable: function(_13, _14) {
        this.variables[_13] = _14;
    },
    getVariable: function(_15) {
        return this.variables[_15];
    },
    getVariables: function() {
        return this.variables;
    },
    getVariablePairs: function() {
        var _16 = new Array();
        var key;
        var _18 = this.getVariables();
        for (key in _18) {
            _16[_16.length] = key + "=" + _18[key];
        }
        return _16;
    },
    getSWFHTML: function() {
        var _19 = "";
        if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
            if (this.getAttribute("doExpressInstall")) {
                this.addVariable("MMplayerType", "PlugIn");
                this.setAttribute("swf", this.xiSWFPath);
            }
            _19 = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute("swf") + "\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\" style=\"" + this.getAttribute("style") + "\"";
            _19 += " id=\"" + this.getAttribute("id") + "\" name=\"" + this.getAttribute("id") + "\" ";
            var _1a = this.getParams();
            for (var key in _1a) {
                _19 += [key] + "=\"" + _1a[key] + "\" ";
            }
            var _1c = this.getVariablePairs().join("&");
            if (_1c.length > 0) {
                _19 += "flashvars=\"" + _1c + "\"";
            }
            _19 += "/>";
        } else {
            if (this.getAttribute("doExpressInstall")) {
                this.addVariable("MMplayerType", "ActiveX");
                this.setAttribute("swf", this.xiSWFPath);
            }
            _19 = "<object id=\"" + this.getAttribute("id") + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\" style=\"" + this.getAttribute("style") + "\">";
            _19 += "<param name=\"movie\" value=\"" + this.getAttribute("swf") + "\" />";
            var _1d = this.getParams();
            for (var key in _1d) {
                _19 += "<param name=\"" + key + "\" value=\"" + _1d[key] + "\" />";
            }
            var _1f = this.getVariablePairs().join("&");
            if (_1f.length > 0) {
                _19 += "<param name=\"flashvars\" value=\"" + _1f + "\" />";
            }
            _19 += "</object>";
        }
        return _19;
    },
    write: function(_20) {
        if (this.getAttribute("useExpressInstall")) {
            var _21 = new deconcept.PlayerVersion([6, 0, 65]);
            if (this.installedVer.versionIsValid(_21) && !this.installedVer.versionIsValid(this.getAttribute("version"))) {
                this.setAttribute("doExpressInstall", true);
                this.addVariable("MMredirectURL", escape(this.getAttribute("xiRedirectUrl")));
                document.title = document.title.slice(0, 47) + " - Flash Player Installation";
                this.addVariable("MMdoctitle", document.title);
            }
        }
        if (this.skipDetect || this.getAttribute("doExpressInstall") || this.installedVer.versionIsValid(this.getAttribute("version"))) {
            var n = (typeof _20 == "string") ? document.getElementById(_20) : _20;
            n.innerHTML = this.getSWFHTML();
            return true;
        } else {
            if (this.getAttribute("redirectUrl") != "") {
                document.location.replace(this.getAttribute("redirectUrl"));
            }
        }
        return false;
    }
};
deconcept.SWFObjectUtil.getPlayerVersion = function() {
    var _23 = new deconcept.PlayerVersion([0, 0, 0]);
    if (navigator.plugins && navigator.mimeTypes.length) {
        var x = navigator.plugins["Shockwave Flash"];
        if (x && x.description) {
            _23 = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
        }
    } else {
        if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0) {
            var axo = 1;
            var _26 = 3;
            while (axo) {
                try {
                    _26++;
                    axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + _26);
                    _23 = new deconcept.PlayerVersion([_26, 0, 0]);
                } catch(e) {
                    axo = null;
                }
            }
        } else {
            try {
                var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
            } catch(e) {
                try {
                    var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
                    _23 = new deconcept.PlayerVersion([6, 0, 21]);
                    axo.AllowScriptAccess = "always";
                } catch(e) {
                    if (_23.major == 6) {
                        return _23;
                    }
                }
                try {
                    axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
                } catch(e) {}
            }
            if (axo != null) {
                _23 = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
            }
        }
    }
    return _23;
};
deconcept.PlayerVersion = function(_29) {
    this.major = _29[0] != null ? parseInt(_29[0]) : 0;
    this.minor = _29[1] != null ? parseInt(_29[1]) : 0;
    this.rev = _29[2] != null ? parseInt(_29[2]) : 0;
};
deconcept.PlayerVersion.prototype.versionIsValid = function(fv) {
    if (this.major < fv.major) {
        return false;
    }
    if (this.major > fv.major) {
        return true;
    }
    if (this.minor < fv.minor) {
        return false;
    }
    if (this.minor > fv.minor) {
        return true;
    }
    if (this.rev < fv.rev) {
        return false;
    }
    return true;
};
deconcept.util = {
    getRequestParameter: function(_2b) {
        var q = document.location.search || document.location.hash;
        if (_2b == null) {
            return q;
        }
        if (q) {
            var _2d = q.substring(1).split("&");
            for (var i = 0; i < _2d.length; i++) {
                if (_2d[i].substring(0, _2d[i].indexOf("=")) == _2b) {
                    return _2d[i].substring((_2d[i].indexOf("=") + 1));
                }
            }
        }
        return "";
    }
};
deconcept.SWFObjectUtil.cleanupSWFs = function() {
    var _2f = document.getElementsByTagName("OBJECT");
    for (var i = _2f.length - 1; i >= 0; i--) {
        _2f[i].style.display = "none";
        for (var x in _2f[i]) {
            if (typeof _2f[i][x] == "function") {
                _2f[i][x] = function() {};
            }
        }
    }
};
if (deconcept.SWFObject.doPrepUnload) {
    if (!deconcept.unloadSet) {
        deconcept.SWFObjectUtil.prepUnload = function() {
            __flash_unloadHandler = function() {};
            __flash_savedUnloadHandler = function() {};
            window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
        };
        window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
        deconcept.unloadSet = true;
    }
}
if (!document.getElementById && document.all) {
    document.getElementById = function(id) {
        return document.all[id];
    };
}
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject;
var SWFObject = deconcept.SWFObject;