var imageRoll = {
	rollovers:new Array(),
	grabRollovers:function(){
		var matches = getElementsByClassName('rollover','img');
		for(i=0;i<matches.length;i++){
			matches[i].id = "rollover_"+i;
			imageRoll.rollovers[i] = new Array();
			
			imageRoll.rollovers[i]['normal'] = new Image();
			imageRoll.rollovers[i]['normal'].src = matches[i].src;
			imageRoll.gearAdd(imageRoll.rollovers[i]['normal'].src);
								
			imageRoll.rollovers[i]['rollover'] = new Image();
			imageRoll.rollovers[i]['rollover'].src = matches[i].src.substring(0,(matches[i].src.length-4))+'_rollover'+matches[i].src.substring((matches[i].src.length-4),matches[i].src.length);
			imageRoll.gearAdd(imageRoll.rollovers[i]['rollover'].src);
			
			matches[i].onmouseover = function(){imageRoll.rollover(this);return false;};
			matches[i].onmouseout = function(){imageRoll.rollback(this);return false;};
		}
	},
	rollover:function(obj){
		var oid = obj.id.split("_");
		obj.src = imageRoll.rollovers[oid[1]]['rollover'].src;
	},
	rollback:function(obj){
		var oid = obj.id.split("_");
		obj.src = imageRoll.rollovers[oid[1]]['normal'].src;
	},gearAdd:function(src){
		if(typeof 'add2ImageStore'=='function'){
			add2ImageStore(src);
		}
	}
}
if ( typeof(window.addEventListener) !== 'undefined' )
    window.addEventListener( "load", imageRoll.grabRollovers, false );
// or the older msie nonstandard way
else if ( typeof(window.attachEvent) !== 'undefined' ) {
    window.attachEvent( "onload", imageRoll.grabRollovers );
}
