// javascript file "images.js"
//     images and routines for mouseovers in a menu/ table-of-contents
//
// K.Becker
// May 2000
//
// contains references to images in:
//     ../../Resources/Clipart   [assumes page running this is in a directory below main]
//                           bl_rbut.gif :   used for normal inactive menu item
//                           gr_rbut.gif :   used for plain links
//                           cy_star.gif : used for inactive menu item when mouseOver
//                           rd_star.gif :  used for menu item when clicked
//                           yl_star.gif :  used for plain links when mouseOver
//
// ROUTINES:
//
// 	Name is the HTML name of the image to be changed in the page 
//	   function linkOn( Name )
//	   function linkOff( Name )
//	   function menuOn( Name )
//	   function menuOff( Name )
//	   function menuActive( Name ) - used for expanding menus


// images for menu/link entries
	// normal gif for inactive menu entry
          menu0 = new Image();
          menu0.src = "../Resources/Clipart/bl_rbut.gif";
	// menu entry gif for "onMouseOver"
          menu1 = new Image();
          menu1.src = "../Resources/Clipart/cy_star.gif";
	// menu entry gif for "onClick"
	// toggles between this and "normal" one:
	// this one when menu expanded; back to "normal" when collapsed
          menu2 = new Image();
          menu2.src = "../Resources/Clipart/rd_star.gif";
       // for links not yet active
          menu3 = new Image();
          menu3.src = "../Resources/Clipart/rd_rbut.gif";

	// normal gif for plain links
          link0 = new Image();
          link0.src = "../Resources/Clipart/gr_rbut.gif"; 
	// gif for links for "onMouseOver"
          link1 = new Image();
          link1.src = "../Resources/Clipart/gr_star.gif";

// image to display for MouseOver on plain link
   function linkOn( Name ){
     if (document.images) {
        document.images[ Name ].src =link1.src;
     }
   }

// image to display for MouseOut on plain link
   function linkOff( Name ){
     if (document.images) {
        document.images[ Name ].src =link0.src;
     }
   }

// image to display for MouseOver on sub-menu
  function menuOn( Name ){
     if (document.images) {
       // switch  if it wasn't clicked; otherwise leave it till next click
	if (document.images[ Name ].src = menu2.src)
        document.images[ Name ].src =menu3.src;
       else
        document.images[ Name ].src =menu1.src;
     }
   }

// image to display for MouseOut on sub-menu (also used when menu collapsed)
   function menuOff( Name ){
     if (document.images) { 
       // switch back if it wasn't clicked; otherwise leave it till next click
	if (document.images[ Name ].src = menu2.src)
        document.images[ Name ].src =menu3.src;
       else
           document.images[ Name ].src =menu0.src;
     }
   }

// image to display while sub-menu is expanded
   function menuActive( Name ){
     if (document.images) {
       // switch  if it wasn't clicked; otherwise leave it till next click
	if (document.images[ Name ].src != menu2.src)
        document.images[ Name ].src =menu2.src;
	else
	  document.images[ Name ].src = menu1.src;
     }
   }

