//constructor
//needs to be places after button HTML
function toolbar(btnsId, intSelected, blnGrouped) {
	//props
	this.btnsId = btnsId;
	this.Selected = intSelected;
	this.Grouped = blnGrouped;
	//methods
	//this.over = mtdOver;	//not used
	this.up = mtdUp;
	this.out = mtdOut;
	this.down = mtdDown;
	//locals
	var toolbarObj = this;

//go	
resetBtns(true);
	
//function mtdOver(img) {
	//resetBtns(this.Grouped);
	//img.className = 'toolButtonOver';
//}

function mtdOut(btn) {
	resetBtns(this.Grouped);
}

function mtdDown(btn) {
	var btns = document.all(toolbarObj.btnsId);
	if (btns) {
		for (var i=0; i<btns.length; i++) {
			if (btns[i] == btn) {
				this.Selected = i;	//get id
			} 
		}
	}
	resetBtns(true);
}

function mtdUp(btn) {
	resetBtns(this.Grouped);
}


function resetBtns(doAll) {
	var btns = document.all(toolbarObj.btnsId);
	if (btns) {
		for (var i=0; i<btns.length; i++) {
			if ((i==toolbarObj.Selected) && (doAll))
				btns[i].className = 'toolButtonDown'
			else
				btns[i].className = 'toolButton';
		}
	}
}

}

//Idnividual functions

function toolbarDown(btn) {
	btn.className = 'toolButtonDown';
}

function toolbarUp(btn) {
	btn.className = 'toolButton';
}

function toolbarOut(btn) {
	btn.className = 'toolButton';
}