/*function canviarCategoria(urlHome, laCategoria, colorCategoria){
	$('.post_index_'+laCategoria).fadeTo('slow', 0.05,function(){
		location.href = urlHome+"/?categoria="+laCategoria;
	});	
}*/

$(document).ready(function(){	
	$('.more_posts_img').click(function(){			
		var pare=$(this).parent();
		var more=$(pare).next('.post_index_container').next('.more_posts');
		$(pare).fadeOut('fast', function(){
			$(pare).next('.post_index_container').fadeIn('slow');
			if(more.length>0) $(more).fadeIn('slow');
		});
	});
	
	$('.post_index_content').fadeIn('slow');
	
	$('.post_single_right_img').fadeIn('slow');
	
	$('.post_index').click(function(){
		var post_id=$(this).attr('id');
		var str_post_id=post_id.substring(11,post_id.length);		
		var str_link='http://www.ruidophoto.com/photo?p='+str_post_id;
		/*if(str_post_id=='202'){
			str_link='http://www.ruidophoto.com/formacion/';
			window.location=str_link;
		}else{*/
			if(la_categoria>0) str_link=str_link+'&categoria='+la_categoria;
			if(el_autor>0) str_link=str_link+'&autor='+el_autor;
			if(post_id.length>0){
				$(this).children('.post_index_cover').fadeTo('slow', 0.15, function(){
					$(this).children('.post_index_cover').fadeTo('fast', 1);				
				});
				window.location=str_link;
			}
		//}
	});
		/*var post_id=$(this).attr('id');
		post_id.replace('post_index_','');
		
		var str_link='http://www.ruidophoto.com/?p='+post_id;
		if(la_categoria>0) str_link+='&categoria='+la_categoria;
		if(el_autor>0) str_link+='&autor='+el_autor;
		
		if(post_id.length>0){
			$(this).children('.post_index_cover').fadeTo('slow', 0.15, function(){
				$(this).children('.post_index_cover').fadeTo('fast', 1);
				window.location=str_link; 
			});
		}
	});*/
	
	$('.post_index_cover').mouseenter(function(){
		$(this).children('.post_index_content').children('.extracte').stop(true, true).slideDown('slow');
	});
	
	$('.post_index_cover').mouseleave(function(){
		$(this).children('.post_index_content').children('.extracte').slideUp('slow');
	});	
});


