var barEffects = new function() {
	
	this.over = function() {
		var match = /highlight/;
		//test for highlight
		if(match.test(this.className)){
			//it is a highlight
			new Effect.Opacity(this, {duration:0.5, from:0.45, to:1.0});
		} else {
			//it is not a highlight
			new Effect.Opacity(this, {duration:0.5, from:0.15, to:1.0});
		}
		this.style.textIndent = "0";
	}
	
	this.out = function() {
		var match = /highlight/;
		//test for highlight
		if(match.test(this.className)) {
			new Effect.Opacity(this, {duration:0.5, from:1.0, to:0.45});	
		} else {
			new Effect.Opacity(this, {duration:0.5, from:1.0, to:0.15});					
		}
		this.style.textIndent = "-9999em";
	}
	
	this.init = function () {
		//find all the bars on the page and add event hooks to them
		var myBars = document.getElementsByTagName("span");
		var match = /resistance/;
		for(var elems=0;elems<myBars.length;elems++) {
			if(match.test(myBars[elems].className)) {
				myBars[elems].onmouseover = barEffects.over;
				myBars[elems].onmouseout = barEffects.out;
			}
		}
	}
}

Event.addEvent(window,"load",barEffects.init)
