var overTail = '_o';
var defaultTail = '';

var rollover = new Object();

rollover={
	init:function(){
		if(d.getElementById){
			rollover.makeRollover.init("swapimg");
		}
	},
	end:function(){
		 fixIELeaks();
	}
};

rollover.makeRollover={
	init: function(className){
		var imgPreload = new Image();
		var parent = d.getElementsByClassName(className);
		if (! parent) { return; }
		for(var i = 0; i < parent.length; i++) {
			var imagesToRoll = parent[i].getElementsByTagName("img");
			for(var j = 0; j < imagesToRoll.length; j++){
				if(imagesToRoll[j].src){
					imagesToRoll[j].source = imagesToRoll[j].src;
					imagesToRoll[j].onmouseover = function(){
						imagePath = this.source.substring(0,this.source.length - defaultTail.length - 4);
						imageExt = this.source.substring(this.source.length - 4);
						imageRoll = imagePath + overTail + imageExt;
						this.src = imageRoll;
					}
					imagesToRoll[j].onmouseout = function(){
						this.src = this.source;
					}
				}
			}
			var imagesToRoll = parent[i].getElementsByTagName("input");
			for(var j = 0; j < imagesToRoll.length; j++){
				if(imagesToRoll[j].src){
					imagesToRoll[j].source = imagesToRoll[j].src;
					imagesToRoll[j].onmouseover = function(){
						imagePath = this.source.substring(0,this.source.length - defaultTail.length - 4);
						imageExt = this.source.substring(this.source.length - 4);
						imageRoll = imagePath + overTail + imageExt;
						this.src = imageRoll;
					}
					imagesToRoll[j].onmouseout = function(){
						this.src = this.source;
					}
				}
			}
		}	
	}
}

function fixIELeaks() {
	if (d.all && window.attachEvent) {
		var elProps = [
			"data", "onmouseover", "onmouseout",
			"onmousedown", "onmouseup", "ondblclick",
			"onclick", "onselectstart", "oncontextmenu"
		];
		var all = d.all;
		for (var i = 0, el; el = all[i]; i++) {
			for (var j = 0, elProp; elProp = elProps[j]; j++) {
				el[elProp] = null;
			}
		}
	}
};