var name = "#floatMenu";
var menuYloc = null;

$(document).ready(function(){
	//setInterval ( "slideSwitch(2000, 'slideshow_home_1')", 5000 );
	
	//show addthis buttons
	$('#addthis_div').show();
	
	$(".article_img_thumb a[rel=group], .article_img_lowres a[rel=group]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Imagem ' + (currentIndex + 1) + ' / ' + currentArray.length + ' - ' + (title.length ? ' ' + title : '') + '</span>';
		}
	});
});

function slideSwitch(switchSpeed) {
	var $active = $('.slideshow_home img.active');
	
	if ( $active.length == 0 ) $active = $('.slideshow_home img:last');

	var $next =  $active.next('img').length ? $active.next('img')
		: $('.slideshow_home img:first');

	$active.addClass('last-active');
	
	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, switchSpeed, function() {
			$active.removeClass('active last-active');
		});
}

$(function() {
	setInterval ( "slideSwitch(2000)", 5000 );
});
