$(document).ready(function(){ 

 
//AUTO COLLAPSE'S TOGGLED ELEMENT 
$(".comments_container").hide();  
 
 
//CHANGES THE BUTTON FROM OPEN TO CLOSED AND VIS-VERSA 
$("h2.toggle").toggle(function(){ 
$(this).addClass("active"); 
}, function () { 
$(this).removeClass("active"); 
}); 
 
 
//SLIDES CONTAINER UP AND DOWN ON CLICK 
$("h2.toggle").click(function(){ 
$(this).next(".comments_container") 
.slideToggle("slow"); 
}); 
 
 
});

function expand_meta(e){
	if( $(e).parent().parent().hasClass('postmeta_closed') ){
		$(e).parent().parent().removeClass('postmeta_closed');
		$(e).parent().parent().addClass('postmeta_open');
	}else{
		$(e).parent().parent().removeClass('postmeta_open');
		$(e).parent().parent().addClass('postmeta_closed');
	}
}

function expand_cat(e, id){
	$(e).parent().find("#articles_" + id).toggle();
}
