jQuery(function( $ ){
	atual = 1;
	
	$('#menu ul li a').map(function(){
			$(this).html('<span>' + $(this).html() + '</span><span>' + $(this).html() + '</span>');
	});
	
	$('#banner ul li:nth-child(1)').css({ 'background-color': '#3893c2' });
	$('#banner ul li:nth-child(2)').css({ opacity: 0.4, 'background-color': '#17283e' });
	$('#banner ul li:nth-child(3)').css({ opacity: 0.4, 'background-color': '#17283e' });
	
	if ($("#slider").length){
			$('#slider').nivoSlider({
				effect: 'fade',
				boxCols: 8, // For box animations
				boxRows: 6, // For box animations
				animSpeed: 300, // Slide transition speed
				pauseTime: 3000, // How long each slide will show
				startSlide: 0, // Set starting Slide (0 index)
				directionNav: false, // Next & Prev navigation
				directionNavHide: true, // Only show on hover
				controlNav: false, // 1,2,3... navigation 
        		pauseOnHover: false, // Stop animation while hovering	
			});
			setInterval(function () { 
				atual++;
				if(atual > 4){ atual = 1; }
				$('#banner .atual').animate({ opacity: 0.4, 'background-color': '#17283e'});
				$('#banner .atual').removeClass('atual');
				$('#banner ul li:nth-child(' + atual + ')').addClass('atual').animate({ opacity: 1, 'background-color': '#3893c2' });
			}, 12000);
	}
	
	
	if ($(".campos").length){
			$('.campos').click(
			function() {
				if (this.value == this.defaultValue) {
					this.value = '';
				}
			}
			);
			$('.campos').blur(
			function() {
				if (this.value == '') {
					this.value = this.defaultValue;
				}
			}
			);
	}
	
	
	if ($("dl#indices").length){
			
			$.ajax({
				type: "GET",
				url: "indices.php",
				data: "jarussi=OK",
				success: function(msg){
					$('dl#indices').html(msg);
				}
			});
	}
	
	
	if ($("div#todosindices").length){
			
			$.ajax({
				type: "GET",
				url: "indices-todos.php",
				data: "jarussi=OK",
				success: function(msg){
					$('div#todosindices').html(msg);
				}
			});
	}
	
	
	if ($(".oportunidades div#lista").length){
			
			$.ajax({
				type: "GET",
				url: "oportunidades.php",
				data: "jarussi=OK",
				success: function(msg){
					$('.oportunidades div#lista').html(msg);
				}
			});
	}
	
	if ($("a.lightbox-tour").length){
		$("a.lightbox-tour").fancybox({
			'titlePosition'	: 'inside'
		});
	}
	
	$("body").append('<div class="fundo superior"></div><div class="fundo inferior"></div>');
});
