Event.observe(document, 'dom:loaded', function(event) {
	
	$$('.checkbox-filters input').each(function (checkbox) {
		checkbox.observe('click', function(event) {
			$(this.id + '-content').toggle();
			//save_preferences('checkbox', this.ancestors()[1].id.substr(9), this.id.substr(9), this.checked);
		});
	});
	
	function save_preferences(preferences_type, parent_slug, child_slug, checked) {
		new Ajax.Request(exp_ajax_php_file, {
			method: 'post',
			parameters: {
				action: 'save_preferences',
				preferences_type: preferences_type,
				parent_slug: parent_slug,
				child_slug: child_slug,
				checked: checked
			}
		});
	}
	
});
