/*
SAMPLE USAGE:
Function must be binded to a dom element. This makes the plugin very light and allows you to use it any way you want. Here are some examples:

	$('#checkall').bind('click', function(){
		$('input[type=checkbox]').check_all();
		return false; // So link doesn't execute
	});
	$('#uncheckall').bind('click', function(){
		$('input[type=checkbox]').uncheck_all();
		return false; // So link doesn't execute
	});
	$('#toggle').toggle(function() {
		$('input[type=checkbox]').check_all();
		return false; // So link doesn't execute
	}, function() {
		$('input[type=checkbox]').uncheck_all();
		return false; // So link doesn't execute
	});
*/

(function($) {

	$.fn.check_all = function(params) {

		// traverse all nodes
	    return this.each(function() {

	        var $this = $(this);
				$this.attr('checked', 'checked');

	    });

		// allow jQuery chaining
		return this;
	};
	
	$.fn.uncheck_all = function(params) {

		// traverse all nodes
	    return this.each(function() {

	        var $this = $(this);
			$this.removeAttr("checked");
				
	    });

		// allow jQuery chaining
		return this;
	};

})(jQuery);