//preload images -- procedure assumes images is a valid object
function preloadMenuButtons()
{
/* images are 100 X 20 in Georgia 10pt font color red and blue */
    if(!window.document.images)
	{
		return;
	}
	var index = 0;
	var img_array_on = new Array();
	var img_array_off = new Array();
	while (index < window.document.images.length)
	{
	   img_array_on[index] = new Image();
	   img_array_off[index] = new Image();
	   img_array_on[index].src = graphics_path + button_text[index] + "_on.gif"
	   img_array_off[index].src = graphics_path + button_text[index] + "_off.gif"
	   alert(img_array_off[index].src);
	   index = index + 1;
	}
} // end preloadMenuButtons() function.

function turnButtonOn(the_element)
{
	if(!window.document.images)
	{
		return;
	}
	var index = 0;
	var img_source = "";
	while (index < window.document.images.length)
	{
	   if (index == the_element && index != is_hidden) // index is a not hidden match of element
	   {
	     img_source = graphics_path + button_text[index] + "_on.gif";   
		 document.images[index].src = graphics_path + button_text[index] + "_on.gif"; 
		 window.status = button_status_text[index]; 
	   }
	   index = index + 1;
	}
} //end function turnButtonOn

function turnButtonOff(the_element)
{
	if(!window.document.images)
	{
		return;
	}
	var index = 0;
	while (index < window.document.images.length)
	{
	   if (index == the_element && index != is_hidden) // index is a not hidden match of element
	   {
		 document.images[index].src = graphics_path + button_text[index] + "_off.gif";  
		 window.status = "";
	   }
	   index = index + 1;
	} 
} //end turnButtonOff 

function hideButton(the_element)
{
	if(!window.document.images)
	{
		return;
	}
	var index = 0;
	while (index < window.document.images.length)
	{
	   if (index == the_element)
	   {
		 document.images[index].src = graphics_path + "white.gif";  
		 window.status = "";
	   }
	   else
	   {
		 document.images[index].src = graphics_path + button_text[index] + "_off.gif";  
       }
	   index = index + 1;
	}
} //end hideButton 