	_button_default=null;
	_isMenuActive=false;
	_active_button=null;
	imageOK=true;

	function Button_on(){
		if (!imageOK) return;
		if (_active_button!=null)
			_active_button.off();
		_isMenuActive=true;
		_active_button=this;
		document[this.name].src=this.onImage.src;
	}
	
	function _defButtonOn(){
		if (_button_default==null)
			return;
			
		_button_default.on();
	}
	
	
	function Button_off(){
		if (!imageOK) return;
		_isMenuActive=false;
		_active_button=null;
				
		document[this.name].src=this.offImage.src;
		timerID=setTimeout('if (!_isMenuActive) _defButtonOn()', 1);
	}
		
	function setDefaultButton(button){
		if (imageOK==false){
			return;
		}
		_button_default=button;
		_active_button=_button_default;
		_button_default.defImage.src=_button_default.onImage.src;
		_button_default.on();
	}
	
	function Button(onName, offName, name){
		this.on=Button_on;
		this.off=Button_off;
		if (!document.images){
			imageOK=false;
			return;
		}
		this.nameOn=onName;
		this.nameOff=offName;
		this.name=name;
		this.on=Button_on;
		this.off=Button_off;
		this.onImage=new Image();
		this.onImage.src=this.nameOn;
		this.offImage=new Image();
		this.offImage.src=this.nameOff;
		this.defImage=new Image();
		this.defImage.src=null;
	}

	button_c4net=new Button("/images/btn_c4net_on.gif","/images/btn_c4net.gif","btn_c4net");
