/**
 * swf
 */
var flashvars = {};
var params = {};
params.wmode = "transparent";
var attributes = {};

//inclue o swf
swfobject.embedSWF("http://facema.edu.br/wp-content/themes/facema/swf/topo_facema_4.swf", "topo", "994", "334", "8.0.0", "", flashvars, params, attributes);

/*** cunfonize ***/
Cufon.set('fontFamily', 'Folks');
Cufon.replace('h1, .depth_0, .post h3 ');
Cufon.replace('.post h2, .post h3 ', 
	{
		fontWeight: '400', 
		textShadow: '0 1px 0 #fff',
		hover: {
			color: '#fff',
			textShadow: '0 1px 0 #000'
		}
	});
Cufon.replace('#barra h3', {textShadow: '0 1px 0 #fff'});
Cufon.replace('#dest-titles h2', {hover: 'color: #fff'});

/***/


$(document).ready(function ()
{	
	if($('body').hasClass('home'))
	{
		// Tabs
		$(".tab").click(function () 
		{
			$(".active").toggleClass("active");
	
			$(this).addClass("active");
			$(".tab-content").hide();
			
			var content_show = $(this).find('a').attr("href");
			var active_tab_show = content_show.substr(1);
			$("#"+active_tab_show).slideDown('normal');
			
			return false;
		});
	

		$('#the-banners ul').cycle({
			fx:     'fade',
			timeout: 20000
		});		
		
		$(".carousel").jCarouselLite({
			btnNext: ".proximo",
			btnPrev: ".anterior",
			easing:"easeinout",
			speed: 600,
			visible:1,
			vertical:false,
			auto: 6000
		});

		$(".carousel-titles").jCarouselLite({
			btnNext: ".proximo",
			btnPrev: ".anterior",
			easing:"easeinout",
			speed: 600,
			visible:1,
			vertical:false,
			auto: 6000
		});
		
			
		

		$("ul.thumbs-zoom li").hover(function() {
			$(this).css({'z-index' : '10'}); 
			
			$(this).find('img').addClass("hover").stop() 
				.animate({
					marginTop: '-75px', 
					marginLeft: '-50px',
					top: '50%',
					left: '50%',
					width: '150px',
					height: '100px', 
					padding: '2px'
				}, 200);
		
			} , function() {
				$(this).css({'z-index' : '0'});
				$(this).find('img').removeClass("hover").stop()
				.animate({
					marginTop: '0',
					marginLeft: '0',
					top: '0',
					left: '0',
					width: '75px', 
					height: '50px',
					padding: '0'
				}, 100);
		});			
	}
	
	//menu
	menu();
	
	//zebra
	$('tr:even td').addClass('zebra');
	equalize_cols('geral2', 'sidebar');
});

/**
 * Equaliza a altura de divs, simulando um falso bg...
 */
function equalize_cols (col1, col2)
{
	var conteudo = $("#"+col1).height();
	var sidebar = $("#"+col2).height();
	var maior = (conteudo > sidebar) ? conteudo : sidebar;
	
	if(conteudo > sidebar) 
	{
		maior = conteudo;
		div = col2;
	}
	else
	{
		maior = sidebar;
		div = col1;
	}
	
	$('#'+div).height(maior);
}

/* drop down menu */
function menu () 
{
	$('.page-item-174').find('ul').hide();
	$('.page-item-174').hover(function ()
	{
		$(this).children('ul').show('fast');

	},
	function ()
	{
		$(this).children('ul').hide('fast');

	});
	return this;
}
