$(function() {

	$('.gallery').each(function(i) {
		
		$(this).find('a').attr('rel', 'prettyPhoto[galeria_' + i + ']');
	
	});
	
	$('a[href$=jpg],a[href$=png],a[href$=png]').has('img').prettyPhoto({theme:'facebook'});

});
