// JavaScript Document
try
{
var carousel = null;
jQuery(document).ready(function(){

// AUMENTAR / DIMINUIR FONTE
 var zoom = 0;

 jQuery(".aumentaDiminuiFonte ul li a").click(function() {
		var jQuerythis = jQuery(this);
		var val = false;
		if ((jQuerythis.attr("title") == "Aumentar" && zoom < 3) || (jQuerythis.attr("title") == "Diminuir" && zoom > 0)) {
			jQuery('.divConteudo *, .contTxt *').each(function() {
				var atual = jQuery(this).css('font-size');
				var nova = 0;

				if (jQuerythis.attr("title") == "Aumentar") {
					nova = parseInt(atual) + 1;
					val = true;
				}
				else if (jQuerythis.attr("title") == "Diminuir") {
					nova = parseInt(atual) - 1;
					val = false;
				}
				jQuery(this).css('font-size', nova + "px");
			});
			if (val) {
				zoom++;
			} else { zoom--; }
		}
		return false;
	});


	jQuery(".abaRightOff").hide();
	jQuery(".iconSeta").hide();
	jQuery(".abaIcon").hide();
	jQuery(".abaLeftOff").hide();
						   
						   
	// ABAS PAGINA INTERNA
	jQuery('#abatabela_nutricional').show();			
	jQuery('.contAbas li').click(function(e){
		/* TROCA ABAS */
		jQuery('.contAbas li').each(function(){
			jQuery(this).removeClass("on");
			jQuery(this).addClass("off");
		});
		jQuery(this).removeClass("off");
		jQuery(this).addClass("on");
		
		/* CONTEUDO ABA */
		var aba = jQuery(this).attr("title");
		jQuery('.abaCont').each(function(){
			jQuery(this).hide();
		});
		jQuery(aba).show();
		e.preventDefault();
	});
 
 jQuery(".btnAbreCompartilhe").click(function () {
	  	 jQuery(".boxCompartilhe").show(1);
    });
 
  jQuery(".btnAbreCompartilhe2").click(function () {
	  	 jQuery(".boxCompartilhe2").show(1);
    });

	
	jQuery('.btnFecharCompartilhe').click(function() {
		 jQuery(".boxCompartilhe").hide(1);
	});	
	
		jQuery('.btnFecharCompartilhe2').click(function() {
		 jQuery(".boxCompartilhe2").hide(1);
	});	
	
	/* Abas Imprensa */	
	
	jQuery('[id$=bt{CC245CDF-A74A-4D6F-98D6-5D7906BB3C6E}]').css('display','none');
	jQuery('[id$=bt{F71792CF-EA83-4802-B081-BD9F085E5B2F}]').css('display','none');
	jQuery('[id$=bt{F71792CF-EA83-4802-B081-BD9F085E5B2F}]').fadeIn("slow");
	
	jQuery('.listaBt li a').click(function(e){
		
		if(jQuery(this).attr('rel') == 'bt01')
		{
			document.getElementById('liBt02').className = '';
			document.getElementById('liBt01').className = 'btAtivo';
			jQuery('[id$=bt{CC245CDF-A74A-4D6F-98D6-5D7906BB3C6E}]').css('display','none');
			jQuery('[id$=bt{F71792CF-EA83-4802-B081-BD9F085E5B2F}]').fadeIn("slow");
		}
		else
		{
			document.getElementById('liBt01').className = '';
			document.getElementById('liBt02').className = 'btAtivo';
			jQuery('[id$=bt{F71792CF-EA83-4802-B081-BD9F085E5B2F}]').css('display','none');
			jQuery('[id$=bt{CC245CDF-A74A-4D6F-98D6-5D7906BB3C6E}]').fadeIn("slow");
		}
		e.preventDefault();
	});
		
	/* fim abas imprensa */
	
	jQuery('a[name=modal]').click(function(e) {
	
		e.preventDefault();
				
		
		var id = jQuery(this).attr('href');
	
		var maskHeight = jQuery(document).height();
		var maskWidth = jQuery(window).width();
	
		jQuery('#mask').css({'width':maskWidth,'height':maskHeight});

		jQuery('#mask').fadeIn(100);	
		jQuery('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = jQuery(window).height();
		var winW = jQuery(window).width();
              
		jQuery(id).css('top',  winH/2-jQuery(id).height()/2);
		jQuery(id).css('left', winW/2-jQuery(id).width()/2);
	
		jQuery(id).fadeIn(2000);
		
		setTimeout(function(){
			
			carousel = jQuery('#carouselProdutos').jcarousel({
				scroll: 1,
				animation: 'slow'
				}
			);
		
		}, 100);

		
	
	});
	
	jQuery('.window .btFechar').click(function (e) {
		e.preventDefault();
		
		jQuery('#mask').hide();
		jQuery('.window').hide();
	});		
	
	jQuery('#mask').click(function () {
		jQuery(this).hide();
		jQuery('.window').hide();
	});
	
});

function menuAbas(indice){		
	var objMenuAbas = document.getElementById("menuAbasTopo");
	var totalAbas = objMenuAbas.getElementsByTagName("li");
	var objAbaConteiner = document.getElementById("abaConteiner_" + indice);
	var objAba = document.getElementById("aba_" + indice);

	for (var i = 0; i < totalAbas.length; i++) {
		document.getElementById("aba_" + i).className = "off";
		document.getElementById("abaConteiner_" + i).style.display = "none";
	}

		objAbaConteiner.style.display = "block";
		objAba.className = "on";
} 



}catch(err)
{
	txt="Descrição do Erro: " + err.description;
	alert(txt);

}

var fileref=document.createElement("script");
fileref.setAttribute("type", "text/javascript");
fileref.setAttribute("src", "/custom/taeq/client/scripts/top_clicktale.js");
document.getElementsByTagName("head")[0].appendChild(fileref);

