/*-----------------------------
SHOPPING ND EDITORA
www.ndproducoes.com
Tecnologia: DablioTi
Desenvolvedor: Pablo Garrido
-----------------------------*/

//FUN��O PARA ACESSAR O SHOPPING
function acesso_shopping(){
	
	window.location.href="acesso.php";
}

//FUN��O PARA INCLUIR E-MAIL
function incluir_newsletter(){
	email = document.getElementById("email_newsletter").value;
	if(email == "")
	{
		alert("ENTRE COM O CAMPO E-MAIL.");
	}else{
	
		var obj = eval("document.getElementById('email_newsletter')");
		var txt = obj.value;
		if ((txt.length != 0)&& ( (txt.indexOf("@") < 1 )||( txt.indexOf('.') < 7)))
		{
			alert('E-MAIL INCORRETO');
			gE(nome_campo).value = "Digite o e-mail";
		}else{
			window.location.href="config/inserirNewsletter.php?email=" + email;
		}
	
	
	}
}

//FUN��O PARA EXCLUIR E-MAIL
function excluir_newsletter(){
	email = document.getElementById("email_newsletter").value;
	if(email == "")
	{
		alert("ENTRE COM O CAMPO E-MAIL.");
	}else{
		window.location.href="config/excluirNewsletter.php?email=" + email;
	}
}

function atualizar_carrinho(campo, preco, id_carrinho){
	var preco_total, quantidade;
	quantidade = document.getElementById("quantidade_camp" + campo).value;
	preco_total = preco * quantidade;
	window.location.href="config/atualizarCarrinho.php?quantidade=" + quantidade + "&preco_total=" + preco_total + "&id_carrinho=" + id_carrinho;
	//document.getElementById("total_camp" + campo).value = preco_total.toFixed(2);
}

function comprar(){
    var pergunta;
    pergunta = confirm('Ao clicar em CONTINUAR sua compra será processada. Deseja continuar ?');
    if(pergunta == true){
        window.location.href='config/finalizarpedido.php';
    }
}