// When checked, add the class, when unchecked remove the class, from the parent.
$(document).ready(function() {
	
	var cbsClass = 'category-button-selected';

	// Do it on a click
	$('div.category-button input:checkbox').click(function(){
		$(this).attr('checked') ? $(this).parent().addClass(cbsClass) : $(this).parent().removeClass(cbsClass);
	});
	
	// Do it on page load
	$('div.category-button input:checkbox').each(function(){
		$(this).attr('checked') ? $(this).parent().addClass(cbsClass) : $(this).parent().removeClass(cbsClass);
	});
	
});

