// FIXME: VFL this is hard for the resource analyzer to find
// better to always reference resources by site-relative urls
// probably what would work here is a mapping of button states
// to site-relative image paths - right now there is no hope of
// the VFL dependecy checker finding the images used here
function imgRollover(imgIdArr)
{
	if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion <7) return;
	var i=0;
	var imgId='';
	var imgEle='';
	var imgArr=new Array;
	for (i=0;i<imgIdArr.length;i++)
	{
		if (document.getElementById(imgIdArr[i]))
		{
			imgArr.push(document.getElementById(imgIdArr[i]));
		}
	}
	var imgPreload=new Array();
	var imgSrc=new Array();
	var imgClass=new Array();
	for (i=0;i<imgArr.length;i++)
	{
		if (imgArr[i].className.indexOf('rollover')>-1)
		{
			// If for some reason images are stored outside of the /img dir, this will break
			imgSrc[i]=imgArr[i].getAttribute('src');
			imgClass[i]=imgArr[i].className;
			imgPreload[i]=new Image();
			if (imgClass[i].match(/rollover (\S+)/)) 
			{
				// FIXME: VFL this is hard for the resource analyzer to find
				// better to always reference resources by site-relative urls
				imgPreload[i].src = '/img/'+imgClass[i].match(/rollover (\S+)/)[1];
			}
			imgArr[i].setAttribute('rsrc', imgSrc[i]);
			imgArr[i].onmouseover=function() 
			{
				// FIXME: VFL this is hard for the resource analyzer to find
				// better to always reference resources by site-relative urls
				this.setAttribute('src', '/img/'+this.className.match(/rollover (\S+)/)[1])
			}
			imgArr[i].onmouseout=function() 
			{
				this.setAttribute('src',this.getAttribute('rsrc'))
			}
		}
		// Expand image rollover trigger to support anchor tags. -bt
		else if (imgArr[i].tagName == 'A')
		{
			imgArr[i].onmouseover=function()
			{
				var imgObj = document.getElementById(this.id.match(/_(\S+)/)[1]);
				// FIXME: VFL this is hard for the resource analyzer to find
				// better to always reference resources by site-relative urls
				imgObj.setAttribute('src', '/img/'+imgObj.className.match(/rollover (\S+)/)[1])
			}
			imgArr[i].onmouseout=function()
			{
				var imgObj = document.getElementById(this.id.match(/_(\S+)/)[1]);
				imgObj.setAttribute('src',imgObj.getAttribute('rsrc'))
			}
		}
	}
}

