/************************************************
	SÃO BRAZ
*************************************************/
var camada = "";
// Função para fechar geral | onclick="divclose('nome-da-div')"
function divclose(div){
	$('#'+div).fadeOut('slow');
}
// Surgir CoffeeShop do menu
function surgirCoffeeeShop(){
	$('#mascara, #bannerCoffe').fadeIn(999);
}
function closelayer_saobraz(){
	$('#layer_saobraz').fadeOut('slow');
}
// Funções Video Café Gourmet
function openlayer_video(){
	$('#video_gourmet').fadeIn('slow');
}
function closelayer_video(){
	$('#video_gourmet').fadeOut('slow');
}
function abrirCamada(){
	$('#flash').hide();
	$('#amostras').fadeIn('slow');
}

// Exibir Imagens produtos
function exibirImagem(imagem){
	$('.prodImagem').attr('src',imagem);
}
// PRODUTOS >> AMOSTRAS
function exibirProdutos(divAbrir, imagem) {
	$('#amostras').hide();
	exibirImagem(imagem);
	$('#'+divAbrir).fadeIn('slow');
	return false;
}

//Mostrar vídeos
function abrirVideos(){
  $('#mascara, #vid').fadeIn(999);
}

// Funções carregadas após todo a página carregar
$(function() {
	// Ocultar camadas
	$('div.infoNut, #bannerCoffe').hide();
	// Links das páginas de segmento
	if(camada != "") {
		$('#flash').hide();
		exibirProdutos(camada);
	}
	
	// Efeito Lightbox
	$('<div id="mascara"></div>')
	  .css({opacity:0.8, width:$(document).width(), height:$(document).height()+'300px'
	  })
	  .appendTo('body').hide();
	// Botão Vídeo
	$('#BTvideo').click(function(event) {
	  $('#mascara, #vid').fadeIn(999);
	  return false;
	});
	// Fechar
	$('#fecharVid, #bannerCoffe a').click(function(event) {
		$('#mascara, #vid, #bannerCoffe').fadeOut(999);	
		return false;
	});  
		  
	// Botão FECHAR
	$('a.fechar').click(function() {
		$(this).parent().hide();
		$('#flash').fadeIn('medium');
		return false;
	});
	// COFFEE SHOP
	$('#coffeeShop').click(function() {
		$('#bannerCoffe').fadeIn('medium');
		return false;
	});
	// PRODUTOS >> AMOSTRAS >> Botão VOLTAR
	$('a.voltar').click(function() {
		$('.prodImagem').attr('src','imagens/loading.gif');
		$(this).parent().hide();
		$('.infoNut').hide();
		$('#amostras, .infoIng').fadeIn('medium');
		return false;
	});
	// PRODUTOS >> AMOSTRAS >> INFORMAÇÕES >> Botões
	$('.btIng').click(function() {
		$('.infoNut').hide();
		$('.infoIng').fadeIn('slow');
		return false;
	});
	$('.btNut').click(function() {
		$('.infoIng').hide();
		$('.infoNut').fadeIn('slow');
		return false;
	});
});