window.onload = setRollovers




/*

setRollovers() scans the HTML page for any img tag that
has the class "rollover". When it finds one, it attaches
the mouseover events.

*/

function setRollovers()
{ imgs = document.getElementsByTagName("img");
  for (i=0;i<imgs.length;i++)
  { if (/rollOver/.test(imgs[i].className))
    { imgs[i].parentNode.onmouseover=function(){roll(this,true);}
      imgs[i].parentNode.onmouseout=function(){roll(this,false);}
      imgs[i].parentNode.onfocus=function(){roll(this,true);}
      imgs[i].parentNode.onblur=function(){roll(this,false);}
    }
  }
}




/*

roll() handles the image rollovers.

*/

function roll(node,status)
{	nodeImg = node.firstChild
	srcImage = nodeImg.getAttribute("src")
	
	if (status)
	{	navState = srcImage.substring(srcImage.length - 7,srcImage.length - 4)
		if (navState == "off")
		{	srcImage = srcImage.substring(0,srcImage.length - 7)
			srcImage = srcImage + "on.gif"
			nodeImg.setAttribute("src",srcImage)
		}
	}
	else
	{	navState = srcImage.substring(srcImage.length - 7,srcImage.length - 4)
		if ((navState != "sel") && (navState != "off"))
		{	srcImage = srcImage.substring(0,srcImage.length - 6)
			srcImage = srcImage + "off.gif"
			nodeImg.setAttribute("src",srcImage)
		}
	}
}




/*

swapPic() handles the image rollovers for Bring it all Together.

*/

function swapPic(which)
{ srcImage = "images/together/pic_" + which + ".jpg"
  document.getElementById("bigPic").setAttribute("src",srcImage)
}






/*

showChart() and hideCharts() works with the enlarged charts in Financial Highlights.

*/

function showChart(which)
{ hideCharts()
  document.getElementById("chart" + which).style.visibility = "visible"
}

function hideCharts()
{ for(i=0;i<6;i++)
  { document.getElementById("chart" + i).style.visibility = "hidden"
  }
}



