// SCRIPT LANGUAGE="JavaScript1.1"
// need JS 1.1 because of Image objects

// Begin Toolbar Script

var loaded = false;  // tells mainFrame that this page has loaded

// create and load all toolbar button Image objects
// each button has three states: unlit, lit, and selected

//home button
tb_home        = new Image(85, 30);     // unlit home button
tb_home.src    = "toolbar/tb_home.gif";
tb_homelit     = new Image(85, 30);     // lit home button
tb_homelit.src = "toolbar/tb_home+.gif";
tb_homesel     = new Image(85, 30);     // selected home button
tb_homesel.src = "toolbar/tb_home-.gif";

//database button
tb_data        = new Image(95, 30);     // unlit data button
tb_data.src    = "toolbar/tb_data.gif";
tb_datalit     = new Image(95, 30);     // lit data button
tb_datalit.src = "toolbar/tb_data+.gif";
tb_datasel     = new Image(95, 30);     // selected data button
tb_datasel.src = "toolbar/tb_data-.gif";

//articles button
tb_arti        = new Image(85, 30);     // unlit arti button
tb_arti.src    = "toolbar/tb_arti.gif";
tb_artilit     = new Image(85, 30);     // lit data button
tb_artilit.src = "toolbar/tb_arti+.gif";
tb_artisel     = new Image(85, 30);     // selected data button
tb_artisel.src = "toolbar/tb_arti-.gif";

//photos button
tb_phot        = new Image(85, 30);     // unlit phot button
tb_phot.src    = "toolbar/tb_phot.gif";
tb_photlit     = new Image(85, 30);     // lit phot button
tb_photlit.src = "toolbar/tb_phot+.gif";
tb_photsel     = new Image(85, 30);     // selected phot button
tb_photsel.src = "toolbar/tb_phot-.gif";

//interact button
tb_inte        = new Image(95, 30);     // unlit inte button
tb_inte.src    = "toolbar/tb_inte.gif";
tb_intelit     = new Image(95, 30);     // lit inte button
tb_intelit.src = "toolbar/tb_inte+.gif";
tb_intesel     = new Image(95, 30);     // selected inte button
tb_intesel.src = "toolbar/tb_inte-.gif";

//search button
tb_sear        = new Image(85, 30);     // unlit sear button
tb_sear.src    = "toolbar/tb_sear.gif";
tb_searlit     = new Image(85, 30);     // lit sear button
tb_searlit.src = "toolbar/tb_sear+.gif";
tb_searsel     = new Image(85, 30);     // selected sear button
tb_searsel.src = "toolbar/tb_sear-.gif";


function updateToolbar()  // display selected toolbar button
  {
  if (parent.mainFrame.loaded)
    {
    var currMainframeTitle = parent.mainFrame.document.title;  // current doc in mainFrame

    document.home.src = tb_home.src;     // set all buttons to unlit state
    document.data.src = tb_data.src;
	document.arti.src = tb_arti.src;
    document.phot.src = tb_phot.src;
    document.inte.src = tb_inte.src;
    document.sear.src = tb_sear.src;


    if (currMainframeTitle == "home")        // set one button to selected state
      document.home.src = tb_homesel.src;
    else if (currMainframeTitle == "data")
      document.data.src = tb_datasel.src;
	else if (currMainframeTitle == "arti")
      document.arti.src = tb_artisel.src;
    else if (currMainframeTitle == "phot")
      document.phot.src = tb_photsel.src;
    else if (currMainframeTitle == "inte")
      document.inte.src = tb_intesel.src;
    else if (currMainframeTitle == "sear")
      document.sear.src = tb_searsel.src;

    return;
    }
  setTimeout('updateToolbar();', 250);
  }

function toggleImage(imageToToggle, imageToDisplay)  // toggle rollover images
  // imageToToggle  - from IMG tag NAME attribute
  // imageToDisplay - from new Image() above
  {
  if (parent.mainFrame.document.title == imageToToggle.name)  // don't toggle if
     return;                                                  // button's selected!
  imageToToggle.src = imageToDisplay.src;  // toggle icon
  }

// window.onload = updateToolbar();

// End Toolbar Script

// Begin Multiple Frames Script
// This enables us to change the contents of more than one frame with a single click event
// It is used in the database area in order to make the leftcol taylored to the database in mainFrame

function changeMultipleFrames(newLeft)
	{
    parent.leftcol.location.href=newLeft
    parent.focus()
	}

// End Multiple Frames Script