var currentDiv = 2;

$(window).load(
	function() {
		$('#Slider').nivoSlider({				
			effect: 'sliceDownLeft',
			slices: 15,
			animSpeed: 700,
			pauseTime: 4000,
			directionNav: false, 
			directionNavHide: true, 
			controlNav: false 
		});
		if (document.getElementById('Slider')) {
			document.getElementById('Slider').style.visibility = 'visible';
		}
	}
);
$(document).ready(function(){
	if ($(".gallery a[rel^='prettyPhoto']").length) {						   	
		$(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
	};
	setTimeout(autoSlide, 6000);
});

function resizeIframe()
{
	if (parent.document.getElementById('cont_9e6c90aaf71d31be18aedc9594dbfdb0')) {
		parent.document.getElementById('cont_9e6c90aaf71d31be18aedc9594dbfdb0').style.cssText = 'width: 500px; height: 45px; padding: 0; overflow: hidden;';
	};
	if (parent.document.getElementById('9e6c90aaf71d31be18aedc9594dbfdb0')) {
		parent.document.getElementById('9e6c90aaf71d31be18aedc9594dbfdb0').style.cssText = 'zoom:90%; -moz-transform: scale(0.85); -moz-transform-origin: 0 0; width: 500px; height: 55px;';
	};
};

$(function()
{
	if ($('.date-pick').length) {
		$('.date-pick').datePicker();
	};
});

function autoSlide()
{	
	if ($("#Colaboradores2").length) {
		for (i=1;i<15;i++) {
			if (i != currentDiv) {
				if ($("#Colaboradores"+i.toString()).length) {
					$("#Colaboradores"+i.toString()).fadeOut("slow");
				}
			}
			else {
				if ($("#Colaboradores"+i.toString()).length) {
					$("#Colaboradores"+i.toString()).fadeIn("slow");
				}			
			}
		}
		currentDiv+=1;
		if (($("#Colaboradores"+currentDiv.toString()).length) == false) {
			currentDiv=1;	
		}
		setTimeout(autoSlide, 6000);	
	}
}

