$(document).ready(function(){
		$("#menu li img").mouseover( function(){
				$(this).attr('src', $(this).attr('src').replace('off', 'on')); 
		}).mouseout( function(){
				$(this).attr('src', $(this).attr('src').replace('on', 'off'));
		});
		
		$(".table_trabalhe_cont div.line:nth-child(odd)").addClass("odd");
		
		setInterval( "slideSwitch()", 4000 );
		setInterval( "fadeTopo()", 4000 );
});

function slideSwitch() {
	var $active = $('#slideshow IMG.active');

	if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

	// use this to pull the images in the order they appear in the markup
	var $next =  $active.next().length ? $active.next() : $('#slideshow IMG:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
		});
}

function fadeTopo() {
	var $active = $('#fadeTopo img.active');

	if ( $active.length == 0 ) $active = $('#fadeTopo IMG:last');

	// use this to pull the images in the order they appear in the markup
	var $next =  $active.next().length ? $active.next()
		: $('#fadeTopo IMG:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
		});
}

function nivela(){
	var colServ = $('#col_servicos').height() + parseInt($('#col_servicos').css('padding-top'));
	if($('#cont_servicos').height() > colServ){
			$('#col_servicos').height($('#cont_servicos').height() - parseInt($('#col_servicos').css('padding-top')));
	} else {
			$('#cont_servicos').height($('#col_servicos').height());
	}
}
