function RollOver(img_path) {
	this.img_path = img_path
}

// create and throw away a prototype object
new RollOver();

RollOver.prototype = {
	init: function(names) {
		this.pics = new Object;
		for (var i = 0; i < names.length; i++) {
			var name = names[i];
			var pic = new Image();
			pic.src = this.img_path + name + '_on.png';
			this.pics[name] = pic;
		}
	},

	turnOn: function(id) {
		var pic_on = this.pics[id];
		if (!pic_on) {
			return false;
		}

		var pic_off = document.getElementById(id);
		if (!pic_off) {
			return false;
		}

		pic_off.src = pic_on.src;
		return true;
	},

	turnOff: function(id) {
		var pic_on = document.getElementById(id);
		if (!pic_on) {
			return false;
		}

		pic_on.src = this.img_path + id + '_off.png';
		return true;
	}
}
