jQuery.fn.checkboxes = function() {
	return this.each(function() {
		var li = $(this);
		var input = $('input', this);
		var anchor = $('a', this);
		if (input.attr('checked')) {
			li.addClass('active');
		}
		anchor.click(function() {
			if (li.hasClass('active')) {
				li.removeClass('active');
				input.attr('checked', false);
			} else {
				li.addClass('active');
				input.attr('checked', true);
			}
			return false;
		});
		input.change(function() {
			if (input.attr('checked')) {
				li.addClass('active');
			} else {
				li.removeClass('active');
			}
		});
	});
}

