
var heightDiv = '';
var contentHeight = '';

function accordion(){
    $('.accordion li h3').click(function() {
		$('.accordion li h3').next().hide('slow');
		$(this).next().toggle('slow');
		return false;
	}).next().hide();
	$('#accordion_1').toggle('slow');
}

function menuParcerias(id){
	var sub = new Array();
	sub[0] = 'areas_parceria';
	sub[1] = 'apoios';
	sub[2] = 'protocolos';
	sub[3] = 'testemunhos';
	for (var i = 0; i < 4; i++){
		if (id != sub[i])
			$('#'+sub[i]).hide();
	}
	if ($('#'+id).is(':hidden'))
		$('#'+id).show('slow');
}

function menuEfeito(items_number, id){
	//$('#left_content').removeClass('cornersz');
	var parcial_id = id.split('_');
	if (!contentHeight)
	{
	    contentHeight = $('#left_content').height();
	}
	var dif = 0;
	if (!$('#' + parcial_id[0] + '_' + parcial_id[1]+ '_0').is(':hidden'))
	{
	    heightDiv = $('#' + parcial_id[0] + '_' + parcial_id[1]+ '_0').height();
	}
	//alert(heightDiv);
	for (var i = 0; i <= items_number; i++){
		if (id != parcial_id + i)
			$('#' + parcial_id[0] + '_' + parcial_id[1]+ '_' + i).hide();
	}
	if ($('#'+id).is(':hidden'))
	{
		$('#'+id).show();
		if (heightDiv)
		{
		    //alert($('#' + id).height());
		    dif = parseFloat($('#' + id).height()) - parseFloat(heightDiv);
		    $('#left_content').height(parseFloat(contentHeight) + parseFloat(dif));
		    document.getElementById('left_content').style.border = 0;
		}
	}
	//$('#left_content').addClass('cornersz');
}

function menuFormacao(id){
	var sub = new Array();
	sub[0] = 'necessidades';
	sub[1] = 'cursos';
	sub[2] = 'outras';
	for (var i = 0; i < sub.length; i++){
		if (id != sub[i])
			$('#'+sub[i]).hide();
	}
	if ($('#'+id).is(':hidden'))
		$('#'+id).show('slow');
}

function mostraLogin(){
	if (document.getElementById('loginForm').style.display == 'none')
		$('#loginForm').show('slow');
	else 
		$('#loginForm').hide('slow');
}
function showHideRecuperar(){
    if (document.getElementById('recup_pass').style.display == 'none')
		$('#recup_pass').show('slow');
	else 
		$('#recup_pass').hide('slow');
}
