
$(document).ready(function () {
	$.urlParam = function(name) {
		var results = new RegExp('[\\&#]' + name + '=([^&#]*)').exec(location.hash);
		if (!results) { return 0; }
		return results[1] || 0;
	}
});


function exibir_topico_old(obj, shw) {
    var i = 1;
    var el;
    
    while ((el = document.getElementById(obj + i)) != null) {
        var topico = obj + i;
        if (shw == i) { 
		el.style.display = '';
		location.hash = 't=' + shw;
	}
        else el.style.display = 'none';
        i++;
    }
}

function exibir_topico(obj, shw) {
	$('[id^=' + obj + ']').hide();
	$('#' + obj + shw).fadeIn(400);
	location.hash = 't=' + shw;
}


function exibir_agenda(agid) {
	
	var topico_atual = $.urlParam('t');
	location.hash = 't=' + topico_atual + '&ag=' + agid;
	
	$('.dropdown-agenda').slideUp('normal');
	$('#' + agid).slideDown('normal');
	
	
}


