var id = 1;

getDepartamentos = function(codigo) {
	$('#labelCarregandoDep').show();
    $.ajax({
        url: '/site/contato/get-departamentos/codigo/'+codigo,
        success: function(data) {
            $('select[name=depto]').html(data);
			$('#labelCarregandoDep').hide();
        }
    });
}

calculaSeta = function() {
	var num = id-1;
	$('.titleHighlight').find('h2').removeClass('highlight');
	$('.titleHighlight').removeClass('titleHighlight');
	
	$('div[id=title-'+id+']').addClass('titleHighlight');
	$('div[id=title-'+id+']').find('h2').addClass('highlight');
	$('.seta').css('top', 2+num*54);
	$('.seta').show();
	
	id++;
	if(id == 6) {
		id = 1;
	}
}

$(document).ready(
	function() {
		$('.imgContainer').cycle({
				fx:     'scrollLeft', 
    			timeout: 3000, 
    			before:  calculaSeta
		});
		
		/*$('div[id*=title]').hover(
			function() {
				$(this).addClass('titleHighlight');
				var num = parseFloat($(this).find('h2').html());
				num--;
				
				$('.seta').css('top', 2+num*54);
				$('.seta').show();
			},
			function() {
				$(this).removeClass('titleHighlight');
				$('.seta').hide();
			}
		);*/
		
		$('div[id*=title-]').find('h2').click(
			function() {
				var temp_id = ($(this).parent().get(0).id).split('-');
				id = temp_id[1];
				$('.imgContainer').cycle(id-1);
				return false;
			}
		);
		
		$('a[rel*=facebox]').facebox();
	}
);

showSeminovosProposta = function(){
    $('#semi_novos-proposta_container').toggle('clip',null,500);
}

showNovosProposta = function(){
    $('#novos-proposta_container').toggle('clip',null,500);
}

