/**
 * 
 * @version 
 * @author 
 */

function checkboxControl(checks){
	var allcheck= $(checks).eq(0);
	allcheck.click(function(){
		if(this.checked){
			$(checks).attr('checked','checked');
		}
		else {
			$(checks).removeAttr('checked');
		}
	});
	$(checks).click(function(){
		var all = $(checks + ':not(:eq(0))').length;
		var count = $(checks + ':not(:eq(0)):checked').length;
		if(all != count) $(checks + ':eq(0)') .removeAttr('checked');
		else $(checks + ':eq(0)').attr('checked','checked');
	});
}





