var overLib = {	

	setupRollovers: function(evt) { 
		if (!document.getElementsByTagName) 
	   		return; 
	 	var all_links = document.getElementsByTagName('a'); 
	 	for (var i = 0; i < all_links.length; i++) { 
	   		var lnk = all_links[i]; 
	   		if (lnk.className && (' ' + lnk.className + ' ').indexOf(' rollover ') != -1){ 
		 		if (lnk.childNodes && lnk.childNodes.length == 1 && lnk.childNodes[0].nodeName.toLowerCase() == 'img'){ 
					lnk.addEventListener( 'mouseover', overLib.mouseover, false );
					lnk.addEventListener( 'mouseout', overLib.mouseout, false );
		 		} 
	   		} 
	 	} 
	}, 
	
	findTarget: function(evt){ 
		 /* Begin the DOM events part, which you */ 
		 /* can ignore for now if it's confusing */ 
 		var target; 
 		if (window.event && window.event.srcElement){
   			target = window.event.srcElement; 
		} else if (evt && evt.target) {
   			target = evt.target;
		}
 		if (!target) {
   			return null; 
		}
 		while (target != document.body && target.nodeName.toLowerCase() != 'a') {
   			target = target.parentNode; 
		}
 		if (target.nodeName.toLowerCase() != 'a') {
   			return null; 
		}
 		return target; 
	},

	mouseover: function(evt) { 
 		var target = overLib.findTarget(evt); 
 		if (!target){
			return; 
		}
 		// the only child node of the a-tag in target will be an img-tag 
 		var img_tag = target.childNodes[0]; 
 		// Take the "src", which names an image called "something.ext", 
 		// Make it point to "something_over.ext" 
 		// This is done with a regular expression 
 		img_tag.src = img_tag.src.replace(/(\.[^.]+)$/, '-over$1');
	},

	mouseout: function(evt) { 
	 	var target = overLib.findTarget(evt); 
	 	if (!target) {
			return;
		}
		 // the only child node of the a-tag in target will be an img-tag 
		 var img_tag = target.childNodes[0]; 
		 // Take the "src", which names an image as "something_over.ext", 
		 // Make it point to "something.ext" 
		 // This is done with a regular expression 
		 img_tag.src = img_tag.src.replace(/-over(\.[^.]+)$/, '$1'); 
	}
}

window.addEventListener('load', overLib.setupRollovers, false);