/*******************************************************************************/	
/* MOSTRA GALERIA DE FOTOS DAS OBRA */
/*function TrocaFotoObra(campo)
{
	//alert(campo);
	//ajaxIframe('principais_obras_foto_ver.php?campo='+campo+'','foto_g','');
	//ajax('principais_obras_foto_ver.php' ,'foto_g', 'sel='+id );
}
*/
/* MOSTRA  OBRAS DO CLIENTES */
function seleciona_cliente()
{
	valor = $("#sel").val();
	//alert(valor)
	if(valor == '#'){
		$.post('obras_conteudo_todas.php',
		{sel: valor},
		function(data){
			document.getElementById('divDados').innerHTML = data;
			//$('#divDados').empty().html(data);
		});
	}else{
		$.post('obras_conteudo_todas.php',
		{sel: valor},
		function(data){
			document.getElementById('divDados').innerHTML = data;
			//$('#divDados').empty().html(data);
		});
	}
}
/* MOSTRA  OBRAS  */
function seleciona_obras_cliente()
{
	valor = $("#sel").val();
	$.post('obras_conteudo_todas.php',
		{sel: valor},
		function(data){
			document.getElementById('divDados').innerHTML = data;
			//$('#divDados').empty().html(data);
		});
}
/*PAGINAÇÃO NOTÍCIAS LER*/
function TrocaPaginacao(page)
{
	
	$.post('materias_comentarios.php',
		{page: page},
		function(data){
			document.getElementById('divComentarios').innerHTML = data;
			//$('#divComentarios').empty().html(data);
			
		});
}
/*PAGINAÇÃO FAQ COMENTARIOS*/
function TrocaPaginacaoFaq(page)
{
	
	$.post('faq_comentarios.php',
		{page: page},
		function(data){
			document.getElementById('divComentarios').innerHTML = data;
			//$('#divComentarios').empty().html(data);
			
		});
}
 //////////////////////
//Encontre advogados//
function buscaSelectCidades()
{
	id_cidade = $('#cidade').val();

	if($('#selestados').val() != '')
		id_estado = $('#selestados').val();
	else
		id_estado = $('#estado').val();
	$.post('cidades_select_ajax.php',
		{idestado: id_estado, idcidade : id_cidade},
		function(data){
			document.getElementById('select_busca_adv_2').innerHTML = data;
			//$('#select_busca_adv_2').empty().html(data);
			buscaSelectBairros();
		});
}
function buscaSelectBairros()
{
	
	id_bairro = $('#bairro').val();	
	id_cidade = $('#selcidades').val();	
	uf = $('#selestados').val();
	$.post('bairros_select_ajax.php',
		{cidade_nome: id_cidade, uf : uf, idbairro : id_bairro},
		function(data){
			document.getElementById('select_busca_adv_3').innerHTML = data;
			//$('#select_busca_adv_3').empty().html(data);
		});
}

function carregaSelectCidades()
{	
	id_estado = $('#seluf').val();	
	id_cidade = $('#idcidade').val();	

	$.post('../cidadesIBGE_select_ajax.php',
		{estado_id: id_estado, cidade_id : id_cidade},
		function(data){

			$('#select_cidades').html(data);
			
			
			//$('#select_busca_adv_3').empty().html(data);
		});
}

function carregaSelectCidadesRaiz()
{	

	id_estado = $('#seluf').val();	
	id_cidade = $('#idcidade').val();	

	$.post('cidadesIBGE_select_ajax.php',
		{estado_id: id_estado, cidade_id : id_cidade},
		function(data){
			
			$('#select_cidades').html(data);
			
			
			//$('#select_busca_adv_3').empty().html(data);
		});
}
function paginacaoHistoricoPergunta(page){
	
	$.post('lista_historico_pergunta_ajax.php',
		{page: page},
		function(data){
			document.getElementById('pag_hist_pergunta').innerHTML = data;
			
			
			//$('#select_busca_adv_3').empty().html(data);
		});
	
}

function paginacaoHistoricoResposta(page){
	
	$.post('lista_historico_resposta_ajax.php',
		{page: page},
		function(data){

			document.getElementById('pag_hist_resposta').innerHTML = data;
			
			
			//$('#select_busca_adv_3').empty().html(data);
		});
	
}

function paginacaoHistoricoArtigo(page){
	
	$.post('lista_historico_artigo_ajax.php',
		{page: page},
		function(data){

			document.getElementById('pag_hist_artigo').innerHTML = data;
			
			
			//$('#select_busca_adv_3').empty().html(data);
		});
	
}

function paginacaoHistoricoPeticao(page){
	
	$.post('lista_historico_peticao_ajax.php',
		{page: page},
		function(data){

			document.getElementById('pag_hist_peticao').innerHTML = data;
			
			
			//$('#select_busca_adv_3').empty().html(data);
		});
	
}

