  var lista = "";
  var total = 0;  
  var posui_site = ""; 
  var modelo_nu = 1;
  
function modelo_controle(nu, acao){
  var modelo = document.getElementById("div_layout");  
  var maximo = 10;
  modelo.className = 'loading_p1';  
  
  if(modelo_nu>9)
    modelo_nu = 9;
	
  if(modelo_nu<1)
    modelo_nu = 1;	
	

  if(acao){
    modelo_nu = modelo_nu + nu;    
    modelo.className = 'div_layout' + modelo_nu;
  }
  

  if(!acao){
    modelo_nu = modelo_nu - nu;    
    modelo.className = 'div_layout' + modelo_nu;
  }
  //alert(nu);
}
  
function btn_modelo_mouseover(status, botao){
  var vt_modelo  = document.getElementById("vt_modelo");     
  var px_modelo  = document.getElementById("px_modelo");    

  if(status){
	if(botao.id=="vt_modelo")
      vt_modelo.className = "vt_modelo_voltar_ativo";
	  
    if(botao.id=="px_modelo")		
      px_modelo.className = "px_modelo_proximo_ativo";	   
  }

  if(!status){
	if(botao.id=="vt_modelo")
      vt_modelo.className = "vt_modelo_normal";
	  
    if(botao.id=="px_modelo")		
      px_modelo.className = "px_modelo_normal";	   
  }  
  
}
  
function removerAlerta(acao){
  var vt_modelo  = document.getElementById("vt_modelo");     
  var px_modelo  = document.getElementById("px_modelo");    
  var alerta = document.getElementById("div_alertas");   	    
  
  if(acao){
    vt_modelo.style.display = "block";
    px_modelo.style.display = "block";
  }
  
  if(!acao){
    vt_modelo.style.display = "none";
    px_modelo.style.display = "none";
  }
  
  alerta.style.display = "none";	
}

function p1_links(acao){
	
  var links = ' ' +
				'<div class="div_frame" id="div_frame" onmouseout="removerAlerta(true)">' +
				'  Vis&atilde;o 1 ' +
				'  <div class="div_frame_centro" id="div_frame_centro">' +
				'  <div id="vt_modelo" class="vt_modelo_normal" onMouseOver="btn_modelo_mouseover(true, this)" onmouseout="btn_modelo_mouseover(false, this)" onclick="modelo_controle(1, false)"></div>' +
				'  <div id="px_modelo" class="px_modelo_normal" onMouseOver="btn_modelo_mouseover(true, this)" onmouseout="btn_modelo_mouseover(false, this)" onclick="modelo_controle(1, true)"></div>' +				
				'  </div>' +
				'  <br>' +
				'  Vis&atilde;o 2 ' +
				'</div> ';
	
  // DIV COM OS LINKS DAS IMAGENS DE DEMONSTRAÇÃO 
  var p1_links = document.getElementById("div_p1_links");    
  p1_links.innerHTML = links;
  
  if(acao)
  p1_links.style.display = "block";
  
  if(!acao)
  p1_links.style.display = "none";  
  
  removerAlerta();	
  
}
  
function ajax(url) 
{ 
//alert(nick); 
//alert(dest); 
//alert("msg"); 

req = null; 
// Procura por um objeto nativo (Mozilla/Safari) 
if (window.XMLHttpRequest) { 
req = new XMLHttpRequest(); 
req.onreadystatechange = processReqChange; 
req.open("GET",url,true); 
req.send(null); 
// Procura por uma versão ActiveX (IE) 
} else if (window.ActiveXObject) { 
req = new ActiveXObject("Microsoft.XMLHTTP"); 
if (req) { 

req.onreadystatechange = processReqChange; 
req.open("GET",url,true); 

req.send(); 
} 
} 
}   
  
function processReqChange(){ 
  var produto_codigo_1  = document.getElementById("produto_codigo_1");   
  var produto_valor_1  = document.getElementById("produto_valor_1");     
  var produto_extra_1  = document.getElementById("produto_extra_1");       
  var titulo_total  = document.getElementById("titulo_total"); 

  var nome  = document.getElementById("nome");         
  var cpf  = document.getElementById("cpf");
  var rg  = document.getElementById("rg");  
  var telefone  = document.getElementById("telefone");    
  var cidade  = document.getElementById("cidade");      
  var estado  = document.getElementById("estado");        
  var cep  = document.getElementById("cep");
  var email  = document.getElementById("email");  
  
  document.pagamentodigital.nome.value	 = nome.value;
  document.pagamentodigital.cpf.value	 = cpf.value;  
  document.pagamentodigital.rg.value	 = rg.value;    
  document.pagamentodigital.telefone.value	 = telefone.value;      
  document.pagamentodigital.cidade.value	 = cidade.value;        
  document.pagamentodigital.estado.value	 = estado.value;          
  document.pagamentodigital.cep.value	 = cep.value;              
  document.pagamentodigital.email.value	 = email.value;                
  
  produto_valor_1.value   = ((new Number (total))).toFixed(2);
  produto_extra_1.value   = nome.value + ' :: ' + cpf.value;


// apenas quando o estado for "completado" 
if (req.readyState == 4) { 

// apenas se o servidor retornar "OK" 

if (req.status ==200) { 

// procura pela div id="pagina" e insere o conteudo 
// retornado nela, como texto HTML 

  if(req.responseText>0){
	//SUCESSO
	produto_codigo_1.value = req.responseText;	
  } else { 	
	alert(req.responseText);

    //document.getElementById("div_msg").className = "msg_erro";		  
	//document.getElementById("div_msg").innerHTML = "O correu um erro ao enviar a sua mensagem, tente mais tarde";  
  }

  } else { 
    alert("Houve um problema ao obter os dados:n" + req.statusText); 
  } 

  //document.getElementById('enviar').value = 'Enviar';
  //document.getElementById('enviar').disabled = false;
  //document.getElementById('limpar').disabled = false;  
  
}}   

function enviar_criar_site(id){ 
  var sessao = document.getElementById("id").value;  // PÁGINA PRINCIPAL 	
  var nome  = document.getElementById("nome").value;   	
  var telefone  = document.getElementById("telefone").value;   	  
  var endereco1  = document.getElementById("endereco1").value;   	    
  var endereco2  = document.getElementById("endereco2").value;   	      
  var cep  = document.getElementById("cep").value;   	        
  var cidade  = document.getElementById("cidade").value;   	          
  var uf  = document.getElementById("estado".value);   	            
  var email  = document.getElementById("email").value;   	              
  var rg  = document.getElementById("rg").value;   	                
  var cpf  = document.getElementById("cpf").value;   
  var imagens = document.getElementById("imagens").value; //SERVIÇO DE REGISTRO DE DOMÍNIO     
  var registrar_site = document.getElementById("novo_endereco").value; //SERVIÇO DE REGISTRO DE DOMÍNIO   
  var endereco_site = document.getElementById("endereco_www").value; //SERVIÇO DE REGISTRO DE DOMÍNIO 
  var setor = document.getElementById("setor").value;
  var segmento = document.getElementById("segmento").value;  
  var site_referencia1 = document.getElementById("site_referencia1").value;
  var site_referencia2 = document.getElementById("site_referencia2").value;  
  var temp  = '&nome=' + nome +
  '&telefone=' + telefone +  
  '&endereco=' + endereco1 + ' ' +  endereco2 +  

  '&cep=' + cep +        
  '&cidade=' + cidade +          
  '&uf=' + uf +            
  '&email=' + email +              
  '&rg=' + rg +              
  '&cpf=' + cpf +
  '&qnt_imagens=' + imagens +  
  '&possui_site=' + posui_site +    
  '&registrar_site=' + registrar_site +      
  '&endereco_site=' + endereco_site +        
  '&site_referencia1=' + site_referencia1 +        
  '&site_referencia2=' + site_referencia2 +  
  '&setor=' + setor +        
        
  '&segmento=' + segmento +            
  '&sessao=' + sessao +              
  
  '&total=' + (new Number (total)).toFixed(2) +  
  '&lista=' + lista;
  
    caminho = "sbuider_criar_site.php?id=" + id + temp;
    ajax(caminho);
} 	


function somenteNumero(e){
    var r=false;	
    var tecla=(window.event)?event.keyCode:e.which;
    if((tecla > 47 && tecla < 58)) r = true;
    else{
    if (tecla != 8) r = false;
    else r = true;
    }
    return r;	  
}


function calcular(){
  var principal = document.getElementById("principal");  // PÁGINA PRINCIPAL 	
  var servicos = document.getElementById("servicos");  // PÁGINA SERVIÇOS
  var produtos = document.getElementById("produtos");  // PÁGINA PRODUTOS  
  var quem_somos = document.getElementById("quem_somos");  // PÁGINA QUEM SOMOS    
  var fale_conosco = document.getElementById("fale_conosco");  // PÁGINA FALE CONOSCO    
  var noticias = document.getElementById("noticias");  // PÁGINA NOTÍCIAS
  var orcamento_online = document.getElementById("orcamento_online");  // PÁGINA ORÇAMENTO ONLINE  
  var taxa_configuracao = document.getElementById("taxa_configuracao");  // TAXA DE CONF.
  var botao_total = document.getElementById("btn_total");      
  var atendimento_online = document.getElementById("atendimento_online"); //SERVIÇO ATENDIMENTO AONLINE   
  
  var layout_personalizado = document.getElementById("layout_personalizado"); //SERVIÇO LAYOUT PERSONALIZADO    
  var galeria_imagens = document.getElementById("galeria_imagens"); //SERVIÇO GALERIA DE IMAGENS      
  var galeria_videos = document.getElementById("galeria_videos"); //SERVIÇO GALERIA DE VÍDEOS   
  var email_mkt = document.getElementById("email_mkt"); //SERVIÇO E-MAIL MKT
  var captacao_emails = document.getElementById("captacao_emails"); //SERVIÇO DE CAPTAÇÃO DE E-MAIL
  var indique_amigo = document.getElementById("indique_amigo"); //SERVIÇO DE INDIQUE UM AMIGO
  var loja_virtual = document.getElementById("loja_virtual"); //SERVIÇO DE LOJA VIRTUAL 
  var super_banner = document.getElementById("super_banner"); //SERVIÇO DE SUPER BANNER 
  var novo_endereco = document.getElementById("novo_endereco"); //SERVIÇO DE REGISTRO DE DOMÍNIO 
  var imagens = document.getElementById("imagens"); //SERVIÇO DE REGISTRO DE DOMÍNIO   
  total = 0;  
  lista = "<u><strong>Lista de Servi&ccedil;os:</strong></u><br><br>";
  
  botao_total.style.display = "";   //GRÁFICO TOTAL
  
  if(principal.checked==true){
	lista = lista + 'R$ 58.00    - Criação de área principal' + '<br>';  
    total = total + 58.00;
  }
	
  if(servicos.checked==true){
	lista = lista + 'R$ 40.00    - Criação de área serviços' + '<br>';  	  
    total = total + 40.00;
  }
	
  if(produtos.checked==true){
	lista = lista + 'R$ 40.00    - Criação de área produtos' + '<br>';  	  	  
    total = total + 40.00;	
  }
  
  if(quem_somos.checked==true){  
	lista = lista + 'R$ 40.00    - Criação de área quem somos' + '<br>';  	    
    total = total + 40.00;	
  }
	
  if(fale_conosco.checked==true){
	lista = lista + 'R$ 80.00    - Criação de área fale conosco' + '<br>';  	    	  
    total = total + 80.00;	
  }
	
  if(noticias.checked==true){
	lista = lista + 'R$ 60.00    - Criação de área notícias' + '<br>';  	    	  
    total = total + 60.00;	
  }
	
  if(orcamento_online.checked==true){
	lista = lista + 'R$ 80.00    - Criação de Orçamento Online' + '<br>';  	    	  	  
    total = total + 80.00;		
  }
	
  if(taxa_configuracao.checked==true){
	lista = lista + 'R$ 98.50    - Taxa de Configuração' + '<br>';  	    	  	  	  
    total = total + 98.50;	
  }
  
  if(layout_personalizado.checked==true){
	lista = lista + 'R$ 350.00   - Layout Pesonalizado' + '<br>';  	    	  	  	  	  
    total = total + 350.00;	
  }
	
  if(galeria_imagens.checked==true){
	lista = lista + 'R$ 45.00    - Recurso de Galeria de Imagens' + '<br>';  	    	  	  	  	  	  
    total = total + 45.00;	
  }
	
  if(galeria_videos.checked==true){
	lista = lista + 'R$ 85.00    - Recurso de Galeria de Vídeos' + '<br>';  	    	  	  	  	  	  	  
    total = total + 85.00;	
  }
  if(email_mkt.checked==true){
	lista = lista + 'R$ 220.00   - Recurso de E-mail Marketing' + '<br>';  	    	  	  	  	  	  	  	  
    total = total + 220.00;	
  }
	
  if(captacao_emails.checked==true){
  	lista = lista + 'R$ 120.00   - Sistema de Captação de E-mails' + '<br>';  	    	  	  	  	  	  	  	  
    total = total + 120.00;	
  }
	
  if(indique_amigo.checked==true){
  	lista = lista + 'R$ 180.00   - Sistema de Indique ao Amigo' + '<br>';  	    	  	  	  	  	  	  	  	  
    total = total + 180.00;	
  }
	
  if(loja_virtual.checked==true){
  	lista = lista + 'R$ 35.90   - Plano I Mensal de Loja Virtual' + '<br>';  	    	  	  	  	  	  	  	  	  
    total = total + 35.90;	
  }

  if(super_banner.checked==true){
  	lista = lista + 'R$ 124.90  - Confecção de 3 Super Banners' + '<br>';  	    	  	  	  	  	  	  	  	  	
    total = total + 124.90;	
  }

  if((new Number (imagens.value)).toFixed(2)>0)
    total = total + ((new Number (imagens.value)).toFixed(2)*0.60);	
  
	
  if(novo_endereco.checked)	
    total = total + 35.90;	   
	
  botao_total.innerHTML = '<p class="texto_total">R$ '+ (new Number (total)).toFixed(2) +'</p>'; // CONTEÚDO TOTAL	
  var r= true;		
}


function valida_cpf(cpf)
      {
      var numeros, digitos, soma, i, resultado, digitos_iguais;
      digitos_iguais = 1;
      if (cpf.length < 11)
            return false;
      for (i = 0; i < cpf.length - 1; i++)
            if (cpf.charAt(i) != cpf.charAt(i + 1))
                  {
                  digitos_iguais = 0;
                  break;
                  }
      if (!digitos_iguais)
            {
            numeros = cpf.substring(0,9);
            digitos = cpf.substring(9);
            soma = 0;
            for (i = 10; i > 1; i--)
                  soma += numeros.charAt(10 - i) * i;
            resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
            if (resultado != digitos.charAt(0))
                  return false;
            numeros = cpf.substring(0,10);
            soma = 0;
            for (i = 11; i > 1; i--)
                  soma += numeros.charAt(11 - i) * i;
            resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
            if (resultado != digitos.charAt(1))
                  return false;
            return true;
            }
      else
            return false;
      }
	  
function vcnpj( c ) {

     var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais, cnpj = c.value.replace(/\D+/g, '');
     digitos_iguais = 1;
    if (cnpj.length != 14) 
            {
                 alert('CNPJ inválido');
                 c.focus();
                 return false;
                 }

     for (i = 0; i < cnpj.length - 1; i++)
           if (cnpj.charAt(i) != cnpj.charAt(i + 1))
                 {
                 digitos_iguais = 0;
                 break;
                 }
     if (!digitos_iguais)
           {
           tamanho = cnpj.length - 2
           numeros = cnpj.substring(0,tamanho);
           digitos = cnpj.substring(tamanho);
           soma = 0;
           pos = tamanho - 7;
           for (i = tamanho; i >= 1; i--)
                 {
                 soma += numeros.charAt(tamanho - i) * pos--;
                 if (pos < 2)
                       pos = 9;
                 }
           resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
           if (resultado != digitos.charAt(0))
{
                 alert('CNPJ inválido');
                 c.focus();
                 return false;
                 }

           tamanho = tamanho + 1;
           numeros = cnpj.substring(0,tamanho);
           soma = 0;
           pos = tamanho - 7;
           for (i = tamanho; i >= 1; i--)
                 {
                 soma += numeros.charAt(tamanho - i) * pos--;
                 if (pos < 2)
                       pos = 9;
                 }
           resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
           if (resultado != digitos.charAt(1)){
                 alert('CNPJ inválido');
                 c.focus();
                 return false;
                 }
           else {
     // alert('CNPJ  OK !');
            return true;
            }
           }
     else{
           alert('CNPJ inválido');
           c.focus();
           return false;
           }
     } 

			
function isValidMail(email){
  cp_email = email;  
  r=true;

  if (r){  

    if (cp_email==""){
	  r=false;
    }else{
    }
  } 

  if (r){  
    if ((cp_email.length != 0) && ((cp_email.indexOf("@") < 1) || (cp_email.indexOf('.') < 7))){
      r=false;
    }else{
    }
  }
  return  r;
}
	
	// JavaScript Document

//CAMPOS 
var principal = document.getElementById("principal");
var servicos = document.getElementById("servicos");
var produtos = document.getElementById("produtos");
var quem_somos = document.getElementById("quem_somos");
var fale_conosco = document.getElementById("fale_conosco");
var noticias = document.getElementById("noticias");
var orcamento_online = document.getElementById("orcamento_online");
var taxa_configuracao = document.getElementById("taxa_configuracao");
var site_referencia1 = document.getElementById("site_referencia1");
var setor = document.getElementById("setor");
var segmento = document.getElementById("segmento");
var atendimento_online = document.getElementById("atendimento_online");
var orcamento_online = document.getElementById("orcamento_online");
var galeria_imagens = document.getElementById("galeria_imagens");
var galeria_videos = document.getElementById("galeria_videos");
var catalogo_online = document.getElementById("catalogo_online");
var captacao_emails = document.getElementById("captacao_emails");
var indique_amigo = document.getElementById("indique_amigo");
var loja_virtual = document.getElementById("loja_virtual");
var super_banner = document.getElementById("super_banner");
var imagens = document.getElementById("imagens");




function setSite(value){
  posui_site = value;	
}

var passo_selecionado = 0;
function titulo(id){
  var titulo = document.getElementById("div_titulo_tela");
  if (id=='0'){
	  titulo.className = "titulo_tela_0";
  }

  if (id=='1'){
	  titulo.className = "titulo_tela_1";
  }
  
  if (id=='2'){
	  titulo.className = "titulo_tela_2";
  }  
  
  if (id=='3'){
	  titulo.className = "titulo_tela_3";
  }  
  
  if (id=='4'){
	  titulo.className = "titulo_tela_4";
  }  
}

function alertaTexto(texto){
  var alerta = document.getElementById("div_alertas");   		
  alerta.innerHTML = texto; 
  alerta.style.display = "block";   
}

function hideAlerta(){
  var alerta = document.getElementById("div_alertas");   		
  alerta.style.display = "none";   
}

function validar_passo1(){
  var alerta = document.getElementById("div_alertas");   	
  var setor  = document.getElementById("setor");   	
  var segmento  = document.getElementById("segmento");   
  var vt_modelo  = document.getElementById("vt_modelo");     
  var px_modelo  = document.getElementById("px_modelo");        
  
  var r= true;

  if(r)
  if(setor.value=="0"){
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Selecione o setor  </div>'); 
    r = false;
  }

  if(r)
  if(segmento.value=="0"){
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Selecione o segmento  </div>'); 
    r = false;
  }

  if(!r){
    vt_modelo.style.display = "none";
    px_modelo.style.display = "none";	
  }
  return r;  
}

function validar_passo2(){
  var alerta = document.getElementById("div_alertas");   	
  var r= true;
  
  if(r)
  if(posui_site == ""){
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe se tem um site</div>'); 
    r = false;
  }

  return r;  
}

function validar_passo3(){
  var alerta = document.getElementById("div_alertas");   	
  var nome  = document.getElementById("nome");   	
  var telefone  = document.getElementById("telefone");   	  
  var endereco1  = document.getElementById("endereco1");   	    
  var endereco2  = document.getElementById("endereco2");   	      
  var cep  = document.getElementById("cep");   	        
  var cidade  = document.getElementById("cidade");   	          
  var estado  = document.getElementById("estado");   	            
  var email  = document.getElementById("email");   	              
  var rg  = document.getElementById("rg");   	                
  var cpf  = document.getElementById("cpf");   	                  
  var div_lista  = document.getElementById("div_lista");   	                      
  
  var r= true;  

  if(r)
  if ((nome.value.length <= "2") || (nome.value=="")) {	  
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o nome</div>'); 
	nome.focus();
    r = false;
  }
  
  if(r)
  if ((telefone.value.length <= "2") || (telefone.value=="")) {	  
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o telefone com DDD</div>'); 
	telefone.focus();	
    r = false;
  }

  if(r)
  if (endereco1.value.length <= "2") 
  if(endereco2.value.length <= "2"){	  
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o endereço</div>'); 
	endereco1.focus();	
    r = false;
  }
  
/*
  if(r)
  if ((cep.value.length <= "8") || (cep.value=="")) {	  
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o CEP corretamente</div>'); 
	cep.focus();	
    r = false;
  }
*/  
  
  if(r)
  if ((cidade.value.length <= "3") || (cidade.value=="")) {	  
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe a cidade</div>'); 
	cidade.focus();	
    r = false;
  }  

  if(r)
  if ((estado.value == "0")) {	  
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o estado</div>'); 
	estado.focus();	
    r = false;
  }  
  
  if (r){ 
  if (!isValidMail(email.value)){
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o email corretamente</div>'); 
	email.focus();		
    r=false;				  		  
  }}    
  
  if(r)
  if ((rg.value.length <= "6") || (rg.value=="")) {	  
    alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o RG</div>'); 
	rg.focus();	
    r = false;
  }    
  
    if(r)
    if ((cpf.value.length == 11)) {
  	  if (!(valida_cpf(cpf.value))) {
        alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o CPF corretamente</div>'); 
	    cpf.focus();
        r=false;				  		 
	  }
	}else{
      if ((cpf.value.length <= 10)) {		
        alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o CPF corretamente</div>'); 
	    cpf.focus();		
         r=false;			  		 
	  }
	}
	
    if(r)	
	if (!(valida_cpf(cpf.value))) 
    if ((cpf.value.length == 14)) {
  	  if (!(vcnpj(cpf.value))) {
        alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o CNPJ corretamente</div>'); 
	    cpf.focus();
        r=false;				  		 
	  }
	}else{
      if ((cpf.value.length <= 13)) {		
        alertaTexto('<div align="center"><img src="imagens/icon_error.gif"/>&nbsp;Informe o CNPJ corretamente</div>'); 
	    cpf.focus();		
         r=false;			  		 
	  }
	}  
  
 
  
  if(r){
	  
    enviar_criar_site('3');
    div_lista.innerHTML = lista;  
    div_lista.style.display = "block";   	
	
  }
  return r;  
}


function avancar(){
  var alerta = document.getElementById("div_alertas");  	
  var r = true;
  
  if(passo_selecionado==1)
    if(!validar_passo1())
	  r = false;
	  
  if(passo_selecionado==2)
    if(!validar_passo2())
	  r = false;	  
  
  if(passo_selecionado==3)
    if(!validar_passo3())
	  r = false;  
  if(r)	
  if((passo_selecionado + 1) <=4){
    passo_selecionado = passo_selecionado + 1;
    mudar_passo(passo_selecionado); 
    alerta.style.display = "none";  
  }
}

function voltar(){
  passo_selecionado = passo_selecionado - 1;
  mudar_passo(passo_selecionado);  	   
}

function btn_voltar_ativo(){
  var botao = document.getElementById("div_voltar");
  botao.className = "btn_voltar_ativo";	
}

function btn_voltar_normal(){
  var botao = document.getElementById("div_voltar");
  botao.className = "btn_voltar_normal";
}

function btn_concluir_normal(){
  var botao = document.getElementById("div_concluir");
  botao.className = "btn_concluir_normal";
}

function btn_concluir_ativo(){
  var botao = document.getElementById("div_concluir");
  botao.className = "btn_concluir_ativo";	
}


function btn_proximo_ativo(){
  var botao = document.getElementById("div_proximo");
  botao.className = "btn_proximo_ativo";	
}

function btn_proximo_normal(){
  var botao = document.getElementById("div_proximo");
  botao.className = "btn_proximo_normal";
}

function exibir_campos_p1(id){
  	
}

function reiniciar(){
  limpar_0('');
}

function limpar_0(id){
  var botao1 = document.getElementById("btn_plano1");  	
  var botao2 = document.getElementById("btn_plano2");  	
  var botao3 = document.getElementById("btn_plano3");  	
  var botao4 = document.getElementById("btn_plano4");    
  var conteudo = document.getElementById("div_campos_p1");    
  var menu_conteudo1 = document.getElementById("menu_conteudo1");   
  var menu_conteudo2 = document.getElementById("menu_conteudo2");     
  var botao_proximo = document.getElementById("div_proximo");     
  var botao_voltar = document.getElementById("div_voltar");       	
  var div_principal = document.getElementById("div_principal"); 	
  var botao_iniciar = document.getElementById("btn_iniciar");  
  var icone = document.getElementById("btn_icone");      
  var div_principal = document.getElementById("div_principal");  
  var botao_total = document.getElementById("btn_total");    
  var conteudo = document.getElementById("conteudo");  
  var fundo = document.getElementById("conteudo");   
  var  passos_informe = document.getElementById("div_passos");   
  var passo_texto1 = document.getElementById("div_p1_texto1");   
  var passo_texto2 = document.getElementById("div_p2_texto1");     
  var passo_texto3 = document.getElementById("div_p3_texto1");       
  var titulo_total = document.getElementById("titulo_total"); //TEXTO INVVESTIMENTO DO TOTAL   
  var pag_campos_1 = document.getElementById("div_campos_p1");  //ARQUIVO COM OS CAMPOS REFERENTE AO PASSO
  var pag_campos_2 = document.getElementById("div_campos_p2");  //ARQUIVO COM OS CAMPOS REFERENTE AO PASSO  
  var pag_campos_3 = document.getElementById("div_campos_p3");  //ARQUIVO COM OS CAMPOS REFERENTE AO PASSO      
  
  var menu_conteudo1 = document.getElementById("menu_conteudo1");   
  var menu_conteudo2 = document.getElementById("menu_conteudo2");     
  var menu_conteudo3 = document.getElementById("menu_conteudo3");       
  var menu_conteudo4 = document.getElementById("menu_conteudo3");         
  var alerta = document.getElementById("div_alertas");   	
  
  //campos p1
  var div_layout = document.getElementById("div_layout");       
  var servicos = document.getElementById("servicos");   	    
  var produtos = document.getElementById("produtos");  
  var quem_somos = document.getElementById("quem_somos");    
  var fale_conosco = document.getElementById("fale_conosco");      
  var noticias = document.getElementById("noticias");        
  var orcamento_online = document.getElementById("orcamento_online");            
  var site_referencia1 = document.getElementById("site_referencia1");            
  var site_referencia2 = document.getElementById("site_referencia2");              
  var setor = document.getElementById("setor");                 
  var segmento = document.getElementById("segmento");   
  //campos p2  
  var atendimento_online = document.getElementById("atendimento_online");     
  var layout_personalizado = document.getElementById("layout_personalizado");       
  var galeria_imagens = document.getElementById("galeria_imagens");   
  var galeria_videos = document.getElementById("galeria_videos");     
  var email_mkt = document.getElementById("email_mkt");       
  var captacao_emails = document.getElementById("captacao_emails");         
  var indique_amigo = document.getElementById("indique_amigo");           
  var loja_virtual = document.getElementById("loja_virtual");             
  var super_banner = document.getElementById("super_banner");               
  var novo_endereco = document.getElementById("novo_endereco");   
  var endereco_www = document.getElementById("endereco_www");         
  //campos p3    
  var nome = document.getElementById("nome");           
  var telefone = document.getElementById("telefone");             
  var endereco1 = document.getElementById("endereco1");               
  var endereco2 = document.getElementById("endereco2");                 
  var cep = document.getElementById("cep");
  var cidade = document.getElementById("cidade");  
  var estado = document.getElementById("estado");    
  var email = document.getElementById("email");      
  var rg = document.getElementById("rg");        
  var cpf = document.getElementById("cpf");          

  div_layout.style.display = "none";
  
  
  servicos.checked = false;  
  produtos.checked = false;
  quem_somos.checked = false;
  fale_conosco.checked = false;
  noticias.checked = false;
  orcamento_online.checked = false;
  site_referencia1.value = "www."
  site_referencia2.value = "www."
  setor.value = "0";
  segmento.value = "0";  
  
  atendimento_online.checked = false;  
  layout_personalizado.checked = false;  
  galeria_imagens.checked = false;  
  galeria_videos.checked = false;  
  email_mkt.checked = false;  
  captacao_emails.checked = false;  
  indique_amigo.checked = false;  
  loja_virtual.checked = false;  
  super_banner.checked = false;  
  novo_endereco.checked = false;  
  endereco_www.value = "www.";
  
  nome.value = "";
  telefone.value = "";
  endereco1.value = "";
  endereco2.value = "";
  cep.value = "";
  cidade.value = "";
  estado.value = "";
  email.value = "";
  rg.value = "";
  cpf.value = "";  
  
  novo_endereco.style.display = "none";
  endereco_www.style.display = "none";
  

  alerta.style.display = "none";   
  fundo.className= "conteudo_p0";    
  botao1.style.display = "none"; 	
  botao2.style.display = "none";  	
  botao3.style.display = "none";  	
  botao4.style.display = "none"; 
  menu_conteudo1.style.display = "none";  
  menu_conteudo2.style.display = "none";    
  botao_proximo.style.display = "none"; 
  botao_voltar.style.display = "none";  
  icone.style.display = "none"; 
  botao_total.style.display = "none";   
  botao_iniciar.style.display = "block";   
  passos_informe.className = "div_passo_0";	  
  passo_selecionado	= 0;	
  passo_texto1.style.display = "none";    
  titulo_total.style.display = "none";  
  passo_texto3.style.display = "none";  
  
  pag_campos_1.style.display = "none";  	
  pag_campos_2.style.display = "none";  	
  pag_campos_3.style.display = "none";
  passo_texto1.style.display = "none";
  passo_texto2.style.display = "none";	
  passo_texto3.style.display = "none";			
	
  menu_conteudo1.style.display = "none";		
  menu_conteudo2.style.display = "none";	
  menu_conteudo3.style.display = "none";  
  menu_conteudo4.style.display = "none";  
  
}

function btn_iniciar_ativo(id){
  var botao = document.getElementById("btn_iniciar");
  botao.className = "btn_iniciar_ativo";
}

function btn_iniciar_normal(id){
  var botao = document.getElementById("btn_iniciar");
  botao.className = "btn_iniciar_normal";
}

//BOTÕES PLANOS 
function btn_plano_ativo(id){
  var botao = document.getElementById("btn_plano"+id);
  var ativo = botao.className;
  ativo = ativo.substr(ativo.length-1,1);
  botao.className = "btn_plano_ativo_"+id;
}

function btn_plano_normal(id){
  var botao = document.getElementById("btn_plano"+id);
  botao.className = "btn_plano_normal_"+id;  
}

function btn_plano_inativo(id){
  var botao = document.getElementById("btn_plano"+id);
  var ativo = botao.className;
  var selecto = "btn_plano" + passo_selecionado;
  var botao_selecionado;
  
  ativo = ativo.substr(ativo.length-1,1);
  botao.className = "btn_plano_inativo_"+id;
  
  if(selecto!=='btn_plano0'){
    botao_selecionado = document.getElementById("btn_plano"+passo_selecionado);
    botao_selecionado.className = "btn_plano_normal_"+passo_selecionado;
  }  
}

function exibir_botoes(id){
  var botao = document.getElementById("btn_plano"+id);	
  var botao_icone = document.getElementById("btn_icone");  	 
  var botao_total = document.getElementById("btn_total");  	   
  var botao1 = document.getElementById("btn_plano1");  	
  var botao2 = document.getElementById("btn_plano2");  	
  var botao3 = document.getElementById("btn_plano3");  	
  var botao4 = document.getElementById("btn_plano4");    

  botao1.className = "btn_plano_inativo_1";  	
  botao2.className = "btn_plano_inativo_2";  	
  botao3.className = "btn_plano_inativo_3";  	
  botao4.className = "btn_plano_inativo_4";  	
  
  botao.style.display = "";  
  botao.className = "btn_plano_normal_"+id;  	  
  
  botao_icone.style.display = ""; //ÍCONE
  botao_total.style.display = "";   //GRÁFICO TOTAL
  botao_total.innerHTML = '<p class="texto_total">R$ 498,00</p>'; // CONTEÚDO TOTAL
  
  if(id>1){
    botao = document.getElementById("btn_plano1");	  
	botao.style.display = "";   

  }   
  
  if(id>2){
	botao1.style.display = "";   
    botao = document.getElementById("btn_plano2");	  
    botao.style.display = "";   
  }     

  if(id>3){
	botao1.style.display = "";   
	botao2.style.display = "";	  
    botao = document.getElementById("btn_plano3");	  
    botao.style.display = "";   
  }     
  
  if(id>4){
	botao1.style.display = "";   
	botao2.style.display = "";    
	botao3.style.display = "";	  
    botao = document.getElementById("btn_plano4");	  
    botao.style.display = "";   
  }
}

function mudar_passo(passo){
  var botao1 = document.getElementById("btn_plano1");  	
  var botao2 = document.getElementById("btn_plano2");  	
  var botao3 = document.getElementById("btn_plano3");  	
  var botao4 = document.getElementById("btn_plano4");    
  var conteudo = document.getElementById("div_campos_p1");    
  var fundo = document.getElementById("conteudo");      
  var menu_conteudo1 = document.getElementById("menu_conteudo1");   
  var menu_conteudo2 = document.getElementById("menu_conteudo2");     
  var menu_conteudo3 = document.getElementById("menu_conteudo3");       
  var botao_proximo = document.getElementById("div_proximo");     
  var botao_voltar = document.getElementById("div_voltar");       	
  var div_principal = document.getElementById("div_principal"); 	
  var botao = document.getElementById("btn_iniciar");  
  var icone = document.getElementById("btn_iniciar");   
  var passos_informe = document.getElementById("div_passos");     
  var passo_texto1 = document.getElementById("div_p1_texto1"); 
  var passo_texto2 = document.getElementById("div_p2_texto1");   
  var passo_texto3 = document.getElementById("div_p3_texto1");     
  var passo_texto4 = document.getElementById("div_p4_texto1");       
  var titulo_total = document.getElementById("titulo_total"); //TEXTO INVVESTIMENTO DO TOTAL 
  var botao_icone = document.getElementById("btn_icone"); 
  var botao_total = document.getElementById("btn_total");
  var pag_campos_1 = document.getElementById("div_campos_p1");  //ARQUIVO COM OS CAMPOS REFERENTE AO PASSO
  var pag_campos_2 = document.getElementById("div_campos_p2");  //ARQUIVO COM OS CAMPOS REFERENTE AO PASSO  
  var pag_campos_3 = document.getElementById("div_campos_p3");  //ARQUIVO COM OS CAMPOS REFERENTE AO PASSO    
  var passos_informe = document.getElementById("div_passos");     
  var botao_concluir = document.getElementById("div_concluir");     
  var alerta = document.getElementById("div_alertas");   	
  var div_lista  = document.getElementById("div_lista");   	   
  var modelo = document.getElementById("div_layout");    
  var frame = document.getElementById("div_p1_links");  
  var novo_endereco = document.getElementById("novo_endereco");   
  var endereco_www = document.getElementById("endereco_www");    

  botao1.style.display = "none"; 
  botao2.style.display = "none"; 
  botao3.style.display = "none"; 
  botao4.style.display = "none"; 
  botao_concluir.style.display = "none";
  modelo.style.display = "none";

  if (passo=='0'){	
    div_principal.className = "passo_0";  
	botao.style.display = "";
    passo_selecionado	= 0;
	
    //MODIFICAÇÕES
	botao.style.display = "";
	fundo.className= "conteudo_p0";
    conteudo.style.display = "none";	
	menu_conteudo1.style.display = "none";		
	menu_conteudo2.style.display = "none";
	botao_proximo.style.display = "none";		
	botao_voltar.style.display = "none";
    passos_informe.className = "div_passo_0";
	passo_texto1.style.display = "none";
	passo_texto2.style.display = "none";	
	passo_texto3.style.display = "none";		
	passo_texto4.style.display = "none";			
	titulo_total.style.display = "none";	
    botao_icone.style.display = "none"; 
    botao_total.style.display = "none";  
	pag_campos_1.style.display = "none";  
	pag_campos_2.style.display = "none";  	
	pag_campos_3.style.display = "none";  		
	titulo('0');
    passos_informe.className = "div_passo_0";	 
    alerta.style.display = "none";   
    div_lista.style.display = 'none';	
	frame.style.display = 'none';			
  }  
  
  if (passo=='1'){	
    //div_principal.className = "passo_1";  
	botao.style.display = "none";
	fundo.className= "conteudo_p1";
    conteudo.style.display = "";	
	menu_conteudo1.style.display = "";		
	menu_conteudo2.style.display = "none";	
	menu_conteudo3.style.display = "none";		
	
	btn_plano_normal('1');
	exibir_botoes('1');
    passo_selecionado	= 1;	
	botao_proximo.style.display = "";		
	botao_voltar.style.display = "";
    passos_informe.className = "div_passo_1";
	passo_texto1.style.display = "";
	passo_texto2.style.display = "none";
	passo_texto3.style.display = "none";			
	passo_texto4.style.display = "none";				
	titulo_total.style.display = "";
	titulo('1');	
	pag_campos_1.style.display = "";  
	pag_campos_2.style.display = "none"; 
	pag_campos_3.style.display = "none";  			
    passos_informe.className = "div_passo_1";	
    botao_icone.className = "btn_icone1";
	botao_proximo.style.display = "";		
	botao_voltar.style.display = "none";
    alerta.style.display = "none";  
    div_lista.style.display = 'none';		
	calcular();
    p1_links(true);	
    removerAlerta(true);
    modelo.style.display = "block";	
	frame.style.display = 'block';		
  }
  
  if (passo=='2'){	
	botao.style.display = "none";
	fundo.className= "conteudo_p1";
    conteudo.style.display = "";	
	menu_conteudo1.style.display = "none";		
    menu_conteudo2.style.display = "";			
	menu_conteudo3.style.display = "none";		
	btn_plano_normal('2');
	exibir_botoes('2');
    passo_selecionado	= 2;	
	botao_proximo.style.display = "";		
	botao_voltar.style.display = "";
    passos_informe.className = "div_passo_1";
	passo_texto1.style.display = "none";
	passo_texto2.style.display = "";
	passo_texto3.style.display = "none";			
	passo_texto4.style.display = "none";				
	titulo_total.style.display = "";
	titulo('2');	
	pag_campos_1.style.display = "none";  	
	pag_campos_2.style.display = "";  	
	pag_campos_3.style.display = "none";  			
    passos_informe.className = "div_passo_2";
    botao_icone.className = "btn_icone2";	
	botao_proximo.style.display = "";		
	botao_voltar.style.display = "";	
    alerta.style.display = "none";   	
	calcular();
	frame.style.display = 'none';	
    novo_endereco.style.display = "";
    endereco_www.style.display = "";	
  }  
  
  if (passo=='3'){	
    passos_informe.className = "div_passo_3";	
    botao_icone.className = "btn_icone3";
	titulo('3');	
	exibir_botoes('3');	
	pag_campos_1.style.display = "none";  	
	pag_campos_2.style.display = "none";  	
	pag_campos_3.style.display = "";
	passo_texto1.style.display = "none";
	passo_texto2.style.display = "none";	
	passo_texto3.style.display = "";			
	passo_texto4.style.display = "none";				
	
	menu_conteudo1.style.display = "none";		
	menu_conteudo2.style.display = "none";	
	menu_conteudo3.style.display = "";	
	botao_proximo.style.display = "";		
	botao_voltar.style.display = "";
    alerta.style.display = "none";   
    div_lista.style.display = 'none';		
	calcular();
	frame.style.display = 'none';				
  }
  
  if (passo=='4'){	
    passos_informe.className = "div_passo_4";	 	
    botao_icone.className = "btn_icone4";	
	titulo('4');	
	exibir_botoes('4');	
	
	pag_campos_1.style.display = "none";  	
	pag_campos_2.style.display = "none";  	
	pag_campos_3.style.display = "none";
	passo_texto1.style.display = "none";
	passo_texto2.style.display = "none";	
	passo_texto3.style.display = "none";			
	passo_texto4.style.display = "";				
	
	menu_conteudo1.style.display = "none";		
	menu_conteudo2.style.display = "none";	
	menu_conteudo3.style.display = "none";	
	botao_proximo.style.display = "none";		
	botao_voltar.style.display = "none";	
    botao_concluir.style.display = ""; 	
    alerta.style.display = "none";  	
	calcular();
	frame.style.display = 'none';				
  }
  
}