/*function for image swapping*/

function chango(elem){
var o;
//get the img src
var which = elem.src;
//if it contains _off, we know to change it to _on
if(which.indexOf('_off') != -1){
o = which.indexOf('_off');
parts = new Array(which.substring(0, o), which.substring(o, o+4), which.substring(o+4, which.length));
elem.src = parts[0]+'_on'+parts[2];
}
// switch it back
else if(which.indexOf('_on') != -1){
o = which.indexOf('_on');
parts = new Array(which.substring(0, o), which.substring(o, o+3), which.substring(o+3, which.length));
elem.src = parts[0]+'_off'+parts[2];

}
}



//for rollover images, gathers all imgs with class=dyn, becuase those are the ones that will be able to swap.
function acto(){
	var im;
	var ims = document.getElementsByTagName ("img");
	for (var i = 0; i < ims.length; i ++) {
		im = ims[i];
		if (im.className == "dyn") {
			im.onmouseover = function (){ chango(this);};
			im.onmouseout = function (){ chango(this);};
		}
	}

} 