//----------------------------------------------------------------------
// button navigation mouse event handlers
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Build button image array
//----------------------------------------------------------------------
// Defines preload button images arrays and does button interactions
// NOTE: Requires the variable "buttonNameArray" be set on page linked from
var preLoadNormArray = new Array();
var preLoadOverArray = new Array();
var preLoadDownArray = new Array();
// build and preload image arrays
for (n=0; n <= buttonNameArray.length; n++){
	preLoadNormArray[n] = new Image();
	preLoadNormArray[n].src="images/"+buttonNameArray[n]+".gif";
	preLoadOverArray[n] = new Image();
	preLoadOverArray[n].src="images/"+buttonNameArray[n]+"_over.gif";
	preLoadDownArray[n] = new Image();
	preLoadDownArray[n].src="images/"+buttonNameArray[n]+"_down.gif";
}
//----------------------------------------------------------------------
// Find the index of a button name in the array
//----------------------------------------------------------------------
function findIndex(nameToFind){
	var myIndex= 0 ;
	for (n=0; n <= buttonNameArray.length; n++){
		if (buttonNameArray[n].indexOf(nameToFind)>=0) {
			return n;
		}}}
//----------------------------------------------------------------------
// mouse interaction behaviors
//----------------------------------------------------------------------
// FORMAT:
// doButton('Norm','big','big','callout','callout_big')
//	All rollover images folow this naming convetion:
//		originalName.gif
//		originalName_over.gif
//		originalName_down.gif		
//----------------------------------------------------------------------
function doButton(whichType,buttonName,buttonImage,otherName,otherImage){
		if(!buttonImage){
			eval("document."+buttonName+".src=preLoad"+whichType+"Array[findIndex(buttonName)].src");
		}else{
			if(!otherName){
				eval("document."+buttonName+".src=preLoad"+whichType+"Array[findIndex(buttonImage)].src");
			}else if(!otherImage){
				eval("document."+buttonName+".src=preLoad"+whichType+"Array[findIndex(buttonImage)].src");
				eval("document."+otherName+".src=preLoad"+whichType+"Array[findIndex(otherName)].src");
			}else{
				eval("document."+buttonName+".src=preLoad"+whichType+"Array[findIndex(buttonImage)].src");
				eval("document."+otherName+".src='"+otherImage+"'");
			}
		}
}

