var checkboxGroupManager = Class.create();
checkboxGroupManager.prototype = {
	initialize: function() {	
		this.allcheckbox=[];
		this.allBtn=null;
	},
	add:function(id){
		var _checkbox = $(id);
		this.allcheckbox.push(_checkbox);
		_checkbox.observe('click', this.checkAllState.bindAsEventListener(this));
	},
	setAllBtn:function(id){
		var _checkbox = $(id);
		this.allBtn=_checkbox;
		_checkbox.observe('click', this.setAllBtnState.bindAsEventListener(this));
	},
	checkAllState:function(e){
		if(e.currentTarget.checked==false){
			this.allBtn.checked=false;	
		}else if(e.currentTarget.checked==true){
			var _isAllBtnOn=true;
			this.allcheckbox.each(function(o){ 
				if(o.checked==false){
					_isAllBtnOn=false;
				}  
			});
			this.allBtn.checked=_isAllBtnOn;	
		}
	},
	setAllBtnState:function(e){
		var v = e.currentTarget.checked;
		this.allcheckbox.each(function(o){ o.checked=v;  });
	}
};