$(document).ready(function(){
	
	$('#pane1').jScrollPane();
	
	$(".regiao-mapa").click(function(){
    $.get("res_representantes.php",
    {
        cat:$(this).attr("title")
    },
    function(resultado){
        $("#lista_repre").html(resultado)
    })
    
	});
	
	
	
	
	$(".sele_contato").click(function () {
		$("#contato").animate({ height: 'toggle', opacity: 'toggle'}, "slow");
		$("#noticias").css("display", "none");
		$("#empresa").css("display", "none");
		$("#representantes").css("display", "none");
	});
	
	$(".sele_repre").click(function () {
		$("#representantes").animate({ height: '100%'}, "slow");
		$("#noticias").css("display", "none");
		$("#contato").css("display", "none");
		$("#empresa").css("display", "none");
	});
	
	
	
  
 	$("#box_select_uf select").change(function(){
		$("#res_local_uf").text($(this).val());
  	});
  
  
 
  
 	$("#box_select_setor select").change(function(){
		$("#res_local_setor").text($(this).val());
  	});
	
	
	
	$('.mapa').maphilight({
        fill: true,
        fillColor:'000000',
        fillOpacity:0.5,
        stroke:true,
        strokeColor:'000000',
        strokeOpacity:0.5
	});
  
	
});

function mostra_texto() {
		$('#empresa').animate({ height: 'toggle', opacity: 'toggle'}, "slow");
		$("#noticias").css("display", "none");
		$("#contato").css("display", "none");
		$("#representantes").css("display", "none");
}

function limpa(){
	$('#barra').stop().animate({ width: '0%' }, 1);
}

function img1(){
	$('#barra').animate({ width: '0%' }, 1);
	
	
	$("body").css("background-position","center 0px");
	
	
	$("#marcadores img").attr({ src: 'imagens/default/selecionar.png' });
	$("#bg_1").attr({ src: 'imagens/default/selecionado.png' });

	$('#barra').animate({ width: '100%' }, 5000,function(){
		img2()
	});
}

function img2(){
	$('#barra').animate({ width: '0%' }, 1);
	
	
	
	$("body").css("background-position","center -812px");
	

	
	$("#marcadores img").attr({ src: 'imagens/default/selecionar.png' });
	$("#bg_2").attr({ src: 'imagens/default/selecionado.png' });
	
	$('#barra').animate({ width: '100%' }, 5000,function(){
		img3()
	});
}

function img3(){
	$('#barra').animate({ width: '0%' }, 1);
	
	
	$("body").css("background-position","center -1624px");
	
	
	$("#marcadores img").attr({ src: 'imagens/default/selecionar.png' });
	$("#bg_3").attr({ src: 'imagens/default/selecionado.png' });
	
	$('#barra').animate({ width: '100%' }, 5000,function(){
		img4()
	});
}

function img4(){
	$('#barra').animate({ width: '0%' }, 1);
	
	
	$("body").css("background-position","center -2436px");
	
	
	$("#marcadores img").attr({ src: 'imagens/default/selecionar.png' });
	$("#bg_4").attr({ src: 'imagens/default/selecionado.png' });
	
	$('#barra').animate({ width: '100%' }, 5000,function(){
		img5()
	});
}

function img5(){
	$('#barra').animate({ width: '0%' }, 1);
	
	
	$("body").css("background-position","center -3248px");
	
	
	$("#marcadores img").attr({ src: 'imagens/default/selecionar.png' });
	$("#bg_5").attr({ src: 'imagens/default/selecionado.png' });
	
	$('#barra').animate({ width: '100%' }, 5000,function(){
		img6()
	});
}

function img6(){
	$('#barra').animate({ width: '0%' }, 1);
	
	
	$("body").css("background-position","center -4060px");
	
	
	$("#marcadores img").attr({ src: 'imagens/default/selecionar.png' });
	$("#bg_6").attr({ src: 'imagens/default/selecionado.png' });
	
	$('#barra').animate({ width: '100%' }, 5000,function(){
		img1()
	});
}
