//<!----- Image Rollover Script ----->
var Rollovers = {
	buttons:[],
	
	add: function(img){
		this.buttons.push(img);
		
		img.onmouseover = function(){Rollovers.over(this);};
		img.onmouseout = function(){Rollovers.out(this);};
		img.onload = null;
		
		this.buttons[this.buttons.indexOf(img)].off = new Image();
		this.buttons[this.buttons.indexOf(img)].off.src = img.src;
		this.buttons[this.buttons.indexOf(img)].on = new Image();
		this.buttons[this.buttons.indexOf(img)].on.onerror = function(){Rollovers.remove(img);}
		this.buttons[this.buttons.indexOf(img)].on.src = img.src.replace(/.gif/,"on.gif");
	},
	
	remove: function(img){
		this.buttons.splice(this.buttons.indexOf(img),1);
		img.onmouseover=null;
		img.onmouseout=null;
	},
	
	over: function(img){
		img.src = this.buttons[this.buttons.indexOf(img)].on.src;
	},
	
	out: function(img){
		img.src = this.buttons[this.buttons.indexOf(img)].off.src;
	}
}

if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, startIndex) {
	var len = this.length;
	if (startIndex == null)
		startIndex = 0;
	else if (startIndex < 0) {
		startIndex += len;
		if (startIndex < 0)
			startIndex = 0;
	}
	for (var i = startIndex; i < len; i++) {
		var val = this[i] || this.charAt && this.charAt(i);
		if (val == item)
			return i;
	}
	return -1;
};
