	/** AUTHOR & COPYRIGHT: MICHAEL GLOWACKI / UGENIC INFOSYS (2006 & 2007). THIS CODE OR PORTIONS OF IT MAY NOT BE COPIED, DISTRIBUTED,
	 OR USED FOR ANY OTHER APPLICATION OTHER THAN THIS, IN ANY WAY WHATSOEVER, WITHOUT THE EXPRESS PERMISSION OF THE COPYRIGHT OWNER. 
	 THIS SOFTWARE IS USED ENTIRELY AT YOUR OWN RISK */
	
	function ActiveButton(btn, over, down){		
		this.button = btn;
		this.buttonSrc = btn.src;
		this.overSrc = over.src;
		this.downSrc = down.src;
		this.loaded = false;
		this.selected = false;
		
		this.buttonOver = buttonOver;
		this.buttonDown = buttonDown;
		this.buttonOut = buttonOut;
		this.buttonUp = buttonUp;		
		this.setLoaded = setLoaded;
		this.setSelected = setSelected;
	}
		
	function buttonOver(){
		if(this.loaded && ! this.selected){
			this.button.src = this.overSrc;		
		}
	}
	
	function buttonDown(){
		if(this.loaded && ! this.selected){
			this.button.src = this.downSrc;
		}
	}
	
	function buttonUp(){
		if(this.loaded && ! this.selected){
			this.buttonOver();
		}
	}
				
	function buttonOut(){
		if(this.loaded && ! this.selected){
			this.button.src = this.buttonSrc;
		}
	}		
	
	function setLoaded(){
		this.loaded = true;
	}
	
	function setSelected(isSel){		
		if(isSel){
			this.buttonOver();
			this.selected = true;
		}else{
			this.selected = false;
			this.buttonOut();
		}
	}

	