<!-- // hide from non-Javascript browsers
/*******************************************************************
 Simple Three-State Button Object
 
 To create a new button instance, call the new Button() function with these arguments:

 id: The name or ID string for the button's <img> object inside the HTML document.
 imgUp: The full or relative http: path to the graphic used for the up state.
 imgOver: The full or relative http: path to the graphic used for the rollover state.
 imgDown: The full or relative http: path to the graphic used for the down state.

 For example:

 myButton = new Button("button1", "b_up.jpg", "b_over.jpg", "b_down.jpg")

********************************************************************/

Button = function(btnID, imgUp, imgOver, imgDown) {

	this.id = btnID;
	this.up = new Image;
	this.up.src = imgUp;
	this.ov = new Image;
	this.ov.src = imgOver;
	this.dn = new Image;
	this.dn.src = imgDown;
	return this;
}

Button.prototype.setState = function (state) {

	if (!document.images)
		return false;

	switch (state) {
		case "up" :
			eval("document." + this.id).src = this.up.src;
			return true;
		case "over" :
			eval("document." + this.id).src = this.ov.src;
			return true;
		case "down" :
			eval("document." + this.id).src = this.dn.src;
			return true;
	}
}

ButtonGroup = function(){
	this.group = new Object;
	return this;
}

ButtonGroup.prototype.addButton = function(btnID, imgUp, imgOver, imgDown){
	this.group[btnID] = new Button(btnID, imgUp, imgOver, imgDown);
}

ButtonGroup.prototype.changeEvent = function(btnID, eventType){
	if(this.group[btnID]){
		this.group[btnID].setState(eventType);
	}
}

//-->

