function SomenteNumero(e){
    var tecla=(window.event)?event.keyCode:e.which;
    if((tecla > 47 && tecla < 58)) return true; 
    else{
    if (tecla != 8) return false;
    else return true;
    }
}
function mudar(campo, campoFocus, tamanho){
    d = "ctl00_ContentPlaceHolder1_" + campo;
    e = "ctl00_ContentPlaceHolder1_" + campoFocus;
    if(document.getElementById(d).value.length == tamanho)
        document.getElementById(e).focus();
}
function mudaCor(e){
    e.style.background = "#eff8fe";
    e.style.border = "1px #3e7496 solid";
    e.style.color = "#3e7496";
}
function tiraCor(e){
    e.style.background = "url(images/fnd_campos.jpg) repeat-x";
    e.style.border = "1px #c9c9c9 solid";
    e.style.color = "#838383";
}

function senha(e) {

var min=3;
    if (e.value.length < min) 
    {
        alert("O campo senha deve conter no mínimo 3 caracteres!");
        e.value = "";
        e.style.background = "url(images/fnd_campos.jpg) repeat-x";
        e.style.border = "1px #c9c9c9 solid";
        e.style.color = "#838383";

    }
    else
    {
        e.style.background = "url(images/fnd_campos.jpg) repeat-x";
        e.style.border = "1px #c9c9c9 solid";
        e.style.color = "#838383";
    }
}     

function calculo(numero){
    if(numero == "1")
    {
        valor = document.getElementById("hdTamanho1").value;
        quantidade = document.getElementById("inQuantidade").value;
        
        total = valor * quantidade;
        tamanho = total.toString().length;
        if(tamanho > 5)
        {
            esq1 = total.toString().substr(0, tamanho -5);
            dir1 = total.toString().substr(tamanho -5, 5);
            total = esq1 + "." + dir1;     
            tamanho = tamanho+1;   
        }
        esq = total.toString().substr(0, tamanho -2);
        dir = total.toString().substr(tamanho -2, 2);
        total = esq + "," + dir;
        if(quantidade == 0)
            total = 0;
        document.getElementById("inTotal").value = total;
    }
    if(numero == "2")
    {
        valor = document.getElementById("hdTamanho2").value;
        quantidade = document.getElementById("inQuantidade").value;
        
        total = valor * quantidade;
        tamanho = total.toString().length;
        if(tamanho > 5)
        {
            esq1 = total.toString().substr(0, tamanho -5);
            dir1 = total.toString().substr(tamanho -5, 5);
            total = esq1 + "." + dir1;     
            tamanho = tamanho+1;   
        }
        esq = total.toString().substr(0, tamanho -2);
        dir = total.toString().substr(tamanho -2, 2);
        total = esq + "," + dir;
        if(quantidade == 0)
            total = 0;
        document.getElementById("inTotal").value = total;
    }
    if(numero == "3")
    {
        valor = document.getElementById("hdTamanho3").value;
        quantidade = document.getElementById("inQuantidade").value;
        
        total = valor * quantidade;
        tamanho = total.toString().length;
        if(tamanho > 5)
        {
            esq1 = total.toString().substr(0, tamanho -5);
            dir1 = total.toString().substr(tamanho -5, 5);
            total = esq1 + "." + dir1;     
            tamanho = tamanho+1;   
        }
        esq = total.toString().substr(0, tamanho -2);
        dir = total.toString().substr(tamanho -2, 2);
        total = esq + "," + dir;
        if(quantidade == 0)
            total = 0;
        document.getElementById("inTotal").value = total;
    } 
}   
function calculo2(){

    if(document.getElementById("tamanho1").checked == true)
        checado = 1;
    else{
        if(document.getElementById("tamanho2").checked == true)
            checado = 2;
        else
            if(document.getElementById("tamanho3").checked == true)    
                checado = 3;
    }
    valor = document.getElementById("hdTamanho" + checado).value;
    quantidade = document.getElementById("inQuantidade").value;
    


        total = valor * quantidade;
        tamanho = total.toString().length;
        if(tamanho > 5)
        {
            esq1 = total.toString().substr(0, tamanho -5);
            dir1 = total.toString().substr(tamanho -5, 5);
            total = esq1 + "." + dir1;     
            tamanho = tamanho+1;   
        }
        esq = total.toString().substr(0, tamanho -2);
        dir = total.toString().substr(tamanho -2, 2);
        total = esq + "," + dir;
        if(quantidade == 0)
            total = 0;
        document.getElementById("inTotal").value = total;
        
}         
            
function SomenteNumero(e){
    var tecla=(window.event)?event.keyCode:e.which;
    if((tecla > 47 && tecla < 58)) return true;
    else{
    if (tecla != 8) return false;
    else return true;
    }
}
function efeito(id, img){
    id.style.background = "url(imagens/"+img+"_h.jpg) center no-repeat";
}

function exEfeito(id, img){
    id.style.background = "url(imagens/"+img+".jpg) center no-repeat";
}


function selecione(id){
    id = document.getElementById(id);
    
    if(id.style.display == "none")
        id.style.display = "block";
    else
        id.style.display = "none";
}

function alterar(elemento){
    id = document.getElementById("categoria1");
    id.value = elemento;
    
    selecione("opcoes");
    document.getElementById("opcoes").style.display = "none";
}

function alterarOrd(elemento, opcoes, ordenacao){
    id = document.getElementById(ordenacao);
    id.value = elemento;
    
    selecione(opcoes);
}

// ao clicar no documento chama a função evento
document.onclick=evento;

// função evento, o e representa o evento que chamou ela, ou seja, o click
function evento(e){

    // definindo target
    // (e && e.target) para FF
    // (event && event.srcElement) para IE
    var target = (e && e.target) || (event && event.srcElement);

    //categorias busca principal
    var obj = document.getElementById('opcoes');

    var obj2 = document.getElementById('selecione');
    var obj3 = document.getElementById('categoria1');

    checkParent(target)?obj.style.display='none':null;

    target==obj2?obj.style.display='block':null;    
    target==obj3?obj.style.display='block':null;  
    
    //primeira ordenacao
    var obj = document.getElementById('opcoes-ordenacao');

    var obj2 = document.getElementById('selecione2');
    var obj3 = document.getElementById('ordenacao');

    checkParent(target)?obj.style.display='none':null;

    target==obj2?obj.style.display='block':null;    
    target==obj3?obj.style.display='block':null;    
    
    //segunda ordenacao
    var obj = document.getElementById('opcoes-ordenacao2');

    var obj2 = document.getElementById('selecione3');
    var obj3 = document.getElementById('ordenacao2');

    checkParent(target)?obj.style.display='none':null;

    target==obj2?obj.style.display='block':null;    
    target==obj3?obj.style.display='block':null;    
}

function checkParent(t){
    while(t.parentNode){
        if(t==document.getElementById('opcoes-ordenacao')){
        return false
    }
    t=t.parentNode
}
    return true
}

function alteraImg(elemento){
    document.getElementById("img-principal").src = "produtos/" + elemento;
    document.getElementById("img-principal").alt = "produtos/" + elemento;
    document.getElementById("hrefimg").href = "produtos/" + elemento;
}

function limpa(elemento, valor){
    if(elemento.value == valor)
        elemento.value = "";
    else{
        if(elemento.value == "")
            elemento.value = valor;
    }
}


function fadeOut(id, time) {
	target = document.getElementById(id);
	alpha = 100;
	timer = (time*1000)/50;
	var i = setInterval(
			function() {
				if (alpha <= 0)
					clearInterval(i);
				setAlpha(target, alpha);
				alpha -= 2;
			}, timer);
}

function fadeIn(id, time) {
	target = document.getElementById(id);
	alpha = 0;
	timer = (time*1000)/50;
	var i = setInterval(
			function() {
				if (alpha >= 100)
					clearInterval(i);
				setAlpha(target, alpha);
				alpha += 2;
			}, timer);
}

function setAlpha(target, alpha) {
	target.style.filter = "alpha(opacity="+ alpha +")";
	target.style.opacity = alpha/100;
}



function esq(){
	if(document.getElementById("img1").style.display == "block")
	{
		document.getElementById("img1").style.display = "none";
		document.getElementById("img3").style.display = "block";
		fadeIn('img3','0.1');
		
	}else{
		if(document.getElementById("img2").style.display == "block")
		{
			document.getElementById("img2").style.display = "none";
			document.getElementById("img1").style.display = "block";	
			fadeIn('img1','0.1');
		}else{
			if(document.getElementById("img3").style.display == "block")
			{
				document.getElementById("img3").style.display = "none";
				document.getElementById("img2").style.display = "block";	
				fadeIn('img2','0.1');
			}
		}
	}
}
function direita(){
	if(document.getElementById("img1").style.display == "block")
	{
		document.getElementById("img1").style.display = "none";
		document.getElementById("img2").style.display = "block";
		fadeIn('img2','0.1');
	}else{
		if(document.getElementById("img2").style.display == "block")
		{
			document.getElementById("img2").style.display = "none";
			document.getElementById("img3").style.display = "block";	
			fadeIn('img3','0.1');
		}else{
			if(document.getElementById("img3").style.display == "block")
			{
				document.getElementById("img3").style.display = "none";
				document.getElementById("img1").style.display = "block";	
				fadeIn('img1','0.1');
			}
		}
	}
}

function validaContato(){

	d = document.FormContato;
	if (d.nome.value == "")
	{
		alert("Preencha o campo Nome!");
		d.nome.focus();
		return false;	
	}
    
    if (d.ddd.value == "")
	{
		alert("Preencha o campo DDD!");
		d.ddd.focus();
		return false;	
	}
    
	if (d.telefone.value == "")
	{
		alert("Preencha o campo Telefone!");
		d.telefone.focus();
		return false;	
	}
    
    	if (d.estado.value == "")
	{
		alert("Preencha o campo Estado!");
		d.estado.focus();
		return false;	
	}
	
	
		var str = d.email.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Inválido!")
       	   d.email.focus();
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }
		 
		 
    if (d.cidade.value == "")
	{
		alert("Preencha o campo Cidade!");
		d.cidade.focus();
		return false;	
	}
	

	if (d.assunto.value == "")
	{
		alert("Preencha o campo Assunto!");
		d.assunto.focus();
		return false;	
	}

	if (d.mensagem.value == "")
	{
		alert("Preencha o campo Mensagem!");
		d.mensagem.focus();
		return false;	
	}

	else
		return true;
	
}

function limpaNome(){
	if(document.getElementById("nome").value == "Seu nome...")
		document.getElementById("nome").value = "";
}

function retornaNome(){
	if(document.getElementById("nome").value == "")
		document.getElementById("nome").value = "Seu nome...";
}

function limpaEmail(){
	if(document.getElementById("email").value == "Seu e-mail...")
		document.getElementById("email").value = "";
}

function retornaEmail(){
	if(document.getElementById("email").value == "")
		document.getElementById("email").value = "Seu e-mail...";
}


function echeck() {

 		var str = document.getElementById("email").value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Invalido!")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Invalido!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Invalido!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Invalido!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Invalido!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Invalido!")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Invalido!")
		    return false
		 }

 		 return true					
}

function validaNews(){
	if(document.getElementById("nome").value == "" || document.getElementById("nome").value == "Seu nome...")
		alert("Preencha o campo nome!");
	else
	{
	if(document.getElementById("email").value == "" || document.getElementById("email").value == "Seu e-mail...")
		alert("Preencha o campo email!");
		else
	return true;
	}
	return false;
}

function validaIndique(d){

	d = document.indique;
	if (d.nome.value == "")
	{
		alert("Preencha o campo Seu Nome!");
		d.nome.focus();
		return false;	
	}
    
		
		var str = d.email.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Inválido!")
       	   d.email.focus();
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }
		 
		 
    if (d.nomeamigo.value == "")
	{
		alert("Preencha o campo Nome do Amigo!");
		d.nomeamigo.focus();
		return false;	
	}
	

	var str = d.emailamigo.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Inválido!")
       	   d.emailamigo.focus();
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Inválido!")
       	   d.emailamigo.focus();
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Inválido!")
       	   d.emailamigo.focus();
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Inválido!")
       	   d.emailamigo.focus();
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Inválido!")
       	   d.emailamigo.focus();
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Inválido!")
       	   d.emailamigo.focus();
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Inválido!")
       	   d.emailamigo.focus();
		    return false
		 }
		 
	else
		return true;
	
}

function validaftp(){
	
	d = document.FormFtp;
	if (d.nome.value == "")
	{
		alert("Preencha o campo Nome!");
		d.nome.focus();
		return false;	
	}
    
    if (d.email.value == "")
	{
		alert("Preencha o campo E-mail!");
		d.email.focus();
		return false;	
	}

    if (d.receber.checked == "")
	{
		alert("Selecione a opção Desejo receber dados de acesso ao FTP ");
		d.receber.focus();
		return false;	
	}

	else
		return true;
}


function validaAdesivo()
{

    var total_tamanhos = document.frmAdesivo.tamanho.length;
    var tamanho = 0;
    
    for(var i=0; i < total_tamanhos; i++) 
    {
        if(document.frmAdesivo.tamanho[i].checked) 
        {
            tamanho++;
        }
    } 

    if (tamanho == 0)
    {
        alert("Escolha um dos Tamanhos!!");
        return false;
    }
    
}

function validaOrcamento(){

	d = document.FormOrcamento;
	if (d.nome.value == "")
	{
		alert("Preencha o campo Nome!");
		d.nome.focus();
		return false;	
	}
    
    if (d.telefone.value == "")
	{
		alert("Preencha o campo Telefone!");
		d.telefone.focus();
		return false;	
	}
    
    	if (d.estado.value == "")
	{
		alert("Preencha o campo Estado!");
		d.estado.focus();
		return false;	
	}
	
	
		var str = d.email.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Inválido!")
       	   d.email.focus();
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }
		 
		 
    if (d.cidade.value == "")
	{
		alert("Preencha o campo Cidade!");
		d.cidade.focus();
		return false;	
	}
	

	if (d.mensagem.value == "")
	{
		alert("Preencha o campo Mensagem!");
		d.mensagem.focus();
		return false;	
	}

	else
		return true;
	
}

function validaCompra(){

	d = document.frmComprar;
	if (d.nome.value == "")
	{
		alert("Preencha o campo Nome!");
		d.nome.focus();
		return false;	
	}
    
    if (d.telefone.value == "")
	{
		alert("Preencha o campo Telefone!");
		d.telefone.focus();
		return false;	
	}
		var str = d.email.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Inválido!")
       	   d.email.focus();
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Inválido!")
       	   d.email.focus();
		    return false
		 }
		 
}

function mudaImg(elemento){
    if (elemento == "img-dicas1")
        document.getElementById(elemento).style.background = "url(images/prd2.jpg)";
    if (elemento == "img-dicas2")
        document.getElementById(elemento).style.background = "url(images/ads2.jpg)";
    if (elemento == "img-dicas3")
        document.getElementById(elemento).style.background = "url(images/cmp2.jpg)";
    if (elemento == "img-dicas4")
        document.getElementById(elemento).style.background = "url(images/grl2.jpg)";

}

function voltaImg(elemento){
    
    valor = document.getElementById("dica_atual").value;
    
    if (elemento == "img-dicas1")
    {   
        if ( valor != "1")
        {
            document.getElementById(elemento).style.background = "url(images/prd1.jpg)";
        }
    }
    else
        if (elemento == "img-dicas2")
        {   
            if ( valor != "2")
            {
            document.getElementById(elemento).style.background = "url(images/ads1.jpg)";
            }
        }
        else
            if (elemento == "img-dicas3")
            {   
                if ( valor != "3")
                {
                document.getElementById(elemento).style.background = "url(images/cmp1.jpg)";
                }
            }
            else
                if (elemento == "img-dicas4")
                {   
                    if ( valor != "4")
                    {
                    document.getElementById(elemento).style.background = "url(images/grl1.jpg)";
                    }
                }
}

function selecionaDica(elemento){
    if (elemento == "img-dicas1")
    {
        document.getElementById("img-dicas2").style.background = "url(images/ads1.jpg)";
        document.getElementById("img-dicas3").style.background = "url(images/cmp1.jpg)";
        document.getElementById("img-dicas4").style.background = "url(images/grl1.jpg)";
        
        document.getElementById("produtos").style.display = "block";
        document.getElementById("adesivos").style.display = "none";
        document.getElementById("compras").style.display = "none";
        document.getElementById("geral").style.display = "none";

        document.getElementById("dicas-meio").style.display = "block";
        document.getElementById("dicas-bot").style.display = "block";

        document.getElementById(elemento).style.background = "url(images/prd2.jpg)";
        document.getElementById("dicas-top").style.background = "url(images/brd1.jpg)";
        document.getElementById("dica_atual").value = "1"
    }
    
    if (elemento == "img-dicas2")
    {
        document.getElementById("img-dicas1").style.background = "url(images/prd1.jpg)";
        document.getElementById("img-dicas3").style.background = "url(images/cmp1.jpg)";
        document.getElementById("img-dicas4").style.background = "url(images/grl1.jpg)";

        document.getElementById("adesivos").style.display = "block";    
        document.getElementById("produtos").style.display = "none";
        document.getElementById("compras").style.display = "none";
        document.getElementById("geral").style.display = "none";
        
        document.getElementById("dicas-meio").style.display = "block";
        document.getElementById("dicas-bot").style.display = "block";
        
        document.getElementById(elemento).style.background = "url(images/ads2.jpg)";
        document.getElementById("dicas-top").style.background = "url(images/brd2.jpg)";
        document.getElementById("dica_atual").value = "2"
        
        
    }
    
    if (elemento == "img-dicas3")
    {
        document.getElementById("img-dicas2").style.background = "url(images/ads1.jpg)";
        document.getElementById("img-dicas1").style.background = "url(images/prd1.jpg)";
        document.getElementById("img-dicas4").style.background = "url(images/grl1.jpg)";
    
        document.getElementById("compras").style.display = "block";    
        document.getElementById("produtos").style.display = "none";
        document.getElementById("adesivos").style.display = "none";
        document.getElementById("geral").style.display = "none";
    
        document.getElementById("dicas-meio").style.display = "block";
        document.getElementById("dicas-bot").style.display = "block";
    
        document.getElementById(elemento).style.background = "url(images/cmp2.jpg)";
        document.getElementById("dicas-top").style.background = "url(images/brd3.jpg)";
        document.getElementById("dica_atual").value = "3"
    }

    if (elemento == "img-dicas4")
    {
        document.getElementById("img-dicas2").style.background = "url(images/ads1.jpg)";
        document.getElementById("img-dicas3").style.background = "url(images/cmp1.jpg)";
        document.getElementById("img-dicas1").style.background = "url(images/prd1.jpg)";
    
        document.getElementById("geral").style.display = "block";    
        document.getElementById("produtos").style.display = "none";
        document.getElementById("compras").style.display = "none";
        document.getElementById("adesivos").style.display = "none";
    
        document.getElementById("dicas-meio").style.display = "block";
        document.getElementById("dicas-bot").style.display = "block";
    
        document.getElementById(elemento).style.background = "url(images/grl2.jpg)";
        document.getElementById("dicas-top").style.background = "url(images/brd4.jpg)";
        document.getElementById("dica_atual").value = "4"
    }
}

function abreMenu(subMenu,Menu)
{
    
    if (document.getElementById(subMenu).style.display == "none")
        document.getElementById(subMenu).style.display = "block"
    else
    {
        if(document.getElementById(subMenu).style.display == "block")
        document.getElementById(subMenu).style.display = "none"
     }   
}


function emailContato(){

 		var str = document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Email Invalido!")
		   document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value = ""
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email Invalido!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Email Invalido!")
		   document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value = ""
		   return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Email Invalido!")
		   document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value = ""
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Email Invalido!")
		   document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value = ""
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Email Invalido!")
		   document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value = ""
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Email Invalido!")
		   document.getElementById("ctl00_ContentPlaceHolder1_txtEmail").value = ""
		    return false
		 }
        
 		 return true					
}
