// JavaScript Document
$(document).ready(function(){
	dh_tail_ballon_ajust();


/*	fn_classe_tamanho_tela();*/
});

/*
function fn_classe_tamanho_tela(){
	$('html').addClass($(window).width() > 1300 ? 'largedisplay' : 'normaldisplay' );
}
*/

function dh_tail_ballon_ajust(){
	$('.line-dep').each(function(){
		var t = ($(this).height()/2) - 20;
		$(this).find('.taildep').css('margin-top',t);	
	});
}

var offset_galeria = 0 ;
function fn_retorna_galeria_imagem(el,offset,rcount,gid,p){

	if(!p) p = http_path + '/page/galeria/';

	if(offset_galeria > rcount){
		$(el).remove();
	}else{	

		if(offset_galeria == 0){offset_galeria = offset;}else{offset_galeria = offset_galeria + offset;}
		
		$.get(p,{'offset':offset_galeria,'gid':gid},function(data){
			$('.galeriaft-album').append(data);
			$('.galeriaft-album .image-album').lightbox();
			if(offset_galeria > rcount || (offset_galeria + offset > rcount) ){
				$(el).remove();
			}			
		});
	
	}

}


var offset_depoimento = 0 ;
function fn_retorna_depoimento(el,offset,rcount,p){

	if(!p) p = http_path + '/page/depoimento';

	
	
	if(offset_depoimento > rcount){
		$(el).remove();
	}else{	

		if(offset_depoimento == 0){offset_depoimento = offset;}else{offset_depoimento = offset_depoimento + offset;}
		
		
		$.get(p,{'offset':offset_depoimento},function(data){
			$(el).before(data);
			dh_tail_ballon_ajust()
			if(offset_depoimento > rcount || (offset_depoimento + offset > rcount  ) ){
				$(el).remove();
			}			
		});
	
	}

}

