<!--
/*
function trocar_foto(pro_mini,caminho,largura,altura){
	document.getElementById("pro_mini").innerHTML = "<img src='img/produtos/" + pro_mini + "'>";
	document.getElementById("pro_full").href = "javascript: ver_foto('"+caminho+"','"+largura+"','"+altura+"');";
}

function ver_foto(caminho,largura,altura){
	foto = window.open(caminho,'foto','height='+altura+',width='+largura+',status=yes,resizable=yes,scrollbars=no,menubar=yes,top=0,left=0');
	foto.focus();
	largura = parseFloat(largura) + 12;
	altura = parseFloat(altura) + 96;
	foto.resizeTo(largura,altura);
}
*/

function trocar_foto(pro_mini,pro_id,fot_id,largura,altura){
	document.getElementById("pro_mini").innerHTML = "<a href=\"javascript: xWindowFoto('1','iframe_produto_fotos.php?pro_id="+pro_id+"&fot_id="+fot_id+"','"+largura+"','"+altura+"');\"><img src='img/produtos/" + pro_mini + "' border=\"0\"></a>";
	document.getElementById("pro_full").href = "javascript: xWindowFoto('1','iframe_produto_fotos.php?pro_id="+pro_id+"&fot_id="+fot_id+"','"+largura+"','"+altura+"');";
}

function ver_foto(caminho,largura,altura){
	alert("Função Desativada");
	/*
	foto = window.open(caminho,'foto','height='+altura+',width='+largura+',status=yes,resizable=yes,scrollbars=no,menubar=yes,top=0,left=0');
	foto.focus();
	largura = parseFloat(largura) + 12;
	altura = parseFloat(altura) + 96;
	foto.resizeTo(largura,altura);
	*/
}

function xWindowFoto(status,pagina,largura,altura){
	if(status){
		var browser=navigator.appName;
		if(browser == "Microsoft Internet Explorer"){
			scrollTop = document.documentElement.scrollTop;
		} else { 
			scrollTop = window.pageYOffset;
		}
		
		// Jogar onScroll
		window.onscroll = function(){
			if(browser == "Microsoft Internet Explorer"){
				scrollTop = document.documentElement.scrollTop;
			} else { 
				scrollTop = window.pageYOffset;
			}
			
			document.getElementById('estCarregandoConteudo').style.marginTop = (scrollTop-(parseInt(altura)/2))+"px";
			document.getElementById('estCarregandoBg').style.top = scrollTop+"px";
		}
		
		document.getElementById('estCarregandoBg').style.display = 'block';
		document.getElementById('estCarregandoConteudo').style.display = 'block';
		document.getElementById('estCarregandoConteudo').style.width = largura+'px';
		document.getElementById('estCarregandoConteudo').style.height = altura+'px';
	 
		document.getElementById('estCarregandoConteudo').style.marginTop = (scrollTop-(parseInt(altura)/2))+"px";
		document.getElementById('estCarregandoConteudo').style.marginLeft = "-"+(parseInt(largura)/2)+"px";
		document.getElementById('estCarregandoBg').style.top = scrollTop+"px";
		
		document.getElementById('xWindowIframe').src = pagina;
		document.getElementById('xWindowIframe').width = largura;
		document.getElementById('xWindowIframe').height = altura;
	} else {
		document.getElementById('estCarregandoBg').style.display='none';
		document.getElementById('estCarregandoConteudo').style.display='none';
	}
}

function xWindowFotoResize(largura,altura){
	
	var browser=navigator.appName;
	if(browser == "Microsoft Internet Explorer"){
		scrollTop = document.documentElement.scrollTop;
	} else { 
		scrollTop = window.pageYOffset;
	}
	
	// Jogar onScroll
	window.onscroll = function(){
		if(browser == "Microsoft Internet Explorer"){
			scrollTop = document.documentElement.scrollTop;
		} else { 
			scrollTop = window.pageYOffset;
		}
		
		document.getElementById('estCarregandoConteudo').style.marginTop = (scrollTop-(parseInt(altura)/2))+"px";
		document.getElementById('estCarregandoBg').style.top = scrollTop+"px";
	}
	
	document.getElementById('estCarregandoConteudo').style.width = largura+'px';
	document.getElementById('estCarregandoConteudo').style.height = altura+'px';
 
	document.getElementById('estCarregandoConteudo').style.marginTop = (scrollTop-(parseInt(altura)/2))+"px";
	document.getElementById('estCarregandoConteudo').style.marginLeft = "-"+(parseInt(largura)/2)+"px";
	document.getElementById('estCarregandoBg').style.top = scrollTop+"px";
	
	document.getElementById('xWindowIframe').width = largura;
	document.getElementById('xWindowIframe').height = altura;
	
}

function abrir_pop(caminho,largura,altura,scrolls){
	abrir = window.open(caminho,'abrir','height='+altura+',width='+largura+',status=yes,resizable=yes,scrollbars='+scrolls+',menubar=no,top=0,left=0');
	abrir.focus();
}

function valida_mem_login(){
	with(document.mem_login){
		cor_erro = '#FFE6E7';
		cor_alert = '#FEFFE6';
		cor_original = '#FFFFFF';
		
		if(mem_email.value == ''){
			mem_email.style.background = cor_erro;
			email = 'erro';
		} else {
			mem_email.style.background = cor_original;
			email = '';
		}
		
		if(mem_senha.value == ''){
			mem_senha.style.background = cor_erro;
			senha = 'erro';
		} else {
			mem_senha.style.background = cor_original;
			senha = '';
		}
		
		if(email == 'erro' || senha == 'erro'){
			alert("Os campos em vermelho são de preenchimento obrigatório!");
			return false
		}
	}
}

function valida_buscar_produto(){
	with(document.buscar_produto){
		cor_erro = '#FFE6E7';
		
		if(campo_busca.value == ''){
			campo_busca.style.background = cor_erro;
			alert("Para efetuar a busca é necessário preencher o campo!");
			return false
		}
	}
}

function valida_frete(){
	with(document.form_frete){
		cor_erro = '#FFE6E7';
		
		if(cepDestino.value == ''){
			cepDestino.style.background = cor_erro;
			alert("Digite seu cep para efetuar o cálculo!");
			return false;
		} else {
			submit();	
		}
	}
	
}

function setClasse(tam_classe,pro_tamanhos){
	var ajax = openAjax();
	var recipiente = gE('estClasse');
	
	recipiente.innerHTML = "<select class=\"form01\" style=\"width:100%\" disabled=\"disabled\"><option value=\"\">Carregando ...</option></select>";
	
	ajax.open('GET','bib_ajax/produto.php?acao=setClasse&tam_classe='+tam_classe+'&pro_tamanhos='+pro_tamanhos,true);
	ajax.onreadystatechange = function(){
		if(ajax.readyState == 4){
			if(ajax.status == 200){
				recipiente.innerHTML = ajax.responseText;
			}
		}
	}
	ajax.send(null);
}

function setTamanho(valor){
	document.getElementById('tam_nome').value = valor;
}

function setCor(valor){
	document.getElementById('cor_nome').value = valor;
}

function addProduto(cat_id,sub_id,pro_id){
	if(document.getElementById('cor_nome').value && document.getElementById('tam_nome').value){
		label = ' - '+document.getElementById('cor_nome').value+' | '+document.getElementById('tam_nome').value;
		addPreco = 0;
		if(document.getElementById('tam_nome').value == "Camiseta Tradicional - EXG (60 CM X 74 CM) (Acréscimo de R$ 5,00)"){ addPreco = 5; }
		if(document.getElementById('tam_nome').value == "Camisetas Manga Longa - P (48 CM X 66 CM) (Acréscimo de R$ 10,00)"){ addPreco = 10; }
		if(document.getElementById('tam_nome').value == "Camisetas Manga Longa - M (50 CM X 68 CM) (Acréscimo de R$ 10,00)"){ addPreco = 10; }
		if(document.getElementById('tam_nome').value == "Camisetas Manga Longa - G (52 CM X 70 CM) (Acréscimo de R$ 10,00)"){ addPreco = 10; }
		if(document.getElementById('tam_nome').value == "Camisetas Manga Longa - GG (56 CM X 70 CM) (Acréscimo de R$ 10,00)"){ addPreco = 10; }
		window.location = 'produto.php?cat_id='+cat_id+'&sub_id='+sub_id+'&pro_id='+pro_id+'&label='+label+'&addPreco='+addPreco+'&acao=insert_carrinho';
	} else {
		alert('Selecione uma das cores e um dos tamanhos!');
	}
}

function avancaCampo(origem,destino){
	if(document.getElementById(origem).value.length == document.getElementById(origem).getAttribute("maxlength")) {
		document.getElementById(destino).focus();
	}
}

function valida_mem_esqueceu_senha(){
	with(document.mem_esqueceu_senha){
		cor_erro = '#FFE6E7';
		cor_alert = '#FEFFE6';
		cor_original = '#FFFFFF';
		
		if(mem_email.value == ''){
			mem_email.style.background = cor_erro;
			email = 'erro';
		} else {
			mem_email.style.background = cor_original;
			email = '';
		}
		
		if(email == 'erro'){
			alert("Os campos em vermelho são de preenchimento obrigatório!");
			return false
		}
	}
}
-->