// FUNCTIONS.js

Cufon.replace( '#header div.mid ul li a, #content div.main h2.tit, #content div.sideBar h3.tit, #footer h4.tit' );

$( function()
{
	$("div.govBar select").change(function() {
        var valu = $(this).val();
		if (valu != '') {
		    location.href=valu;
		}
        });
	
	$("#content ul.odd li:nth-child(odd)").addClass("odd");
	
	var banner = $('.banner');
	
	$('.destaques', banner ).cycle(
	{
		timeout: "10000",
		pause: 1,
		fx: "fade",
		prev: $( ".anterior", banner ),
		next: ".proximo",
		cleartype: 1
	});
	
	$("div.sideBar").sortable({
		connectWith: '.sideBar',
		handle: 'h3',
		opacity: 0.6
	});
	
	$("div.sideBar").attr('unselectable', 'off');

	$(".widget").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
		.find("h3")
			.addClass("ui-widget-header ui-corner-all")
			.end()
		.find(".tab");

	$("h3 span, div.post h3 span").click(function() {
		$(this).parent().toggleClass("ativo");
		$(this).parents(".widget:first").find(".tab").toggle();
	});

	$(".sideBar").disableSelection();
	$( ".disabled" ).resetDefaultValue();
});

