function initRollovers() {
	if (!document.getElementById) return

	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	var lClicked = false;

	for (var i = 0; i < aImages.length; i++) {
		if ((aImages[i].className == 'imgRollover') || (aImages[i].className == 'imgLegacyRollover')) {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = '';
			
			if (aImages[i].className == 'imgRollover')
				hsrc = src.replace(ftype, '_hover'+ftype);
			else 
			{
				if (aImages[i].className == 'imgLegacyRollover')
				{
					hsrc = src.replace(ftype, '_on'+ftype);
				}
			}
			
			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				if (lClicked) return false;
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}
			
			aImages[i].onmouseout = function() {
				if (lClicked) return false;
				if (!sTempSrc) 
				{
					if (this.getAttribute('class') == 'imgRollover')
						sTempSrc = this.getAttribute('src').replace('_hover'+ftype, ftype);
					else 
					{
						if (this.getAttribute('class') == 'imgLegacyRollover')
						{
							sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
						}
					}
				}
				this.setAttribute('src', sTempSrc);
			}

			aImages[i].onclick = function() {
				lClicked = true;
			}
		}
	}
}

window.onload = initRollovers;