/* ************************************************************
** URL Jump Library
** ===========================================
** This library contains code to perform select-box URL jumps. 
** Enjoy ... and please maintain this header!
**
** To load this library in an HTML doc, put the following
** line in the doc's HEAD (before any other SCRIPT tags):
**
** <SCRIPT SRC="jumppage.js" LANGUAGE="JavaScript"></SCRIPT>
**
** Author      Ver  Date    Comments
** ======      ===  ====    ========
** Rick Scott  1.0  2/1/00  First release
**
** Copyright 2000, Rick Scott, all rights reserved.
************************************************************ */


/* ************************************************************
** openURL(url)
** ============
** open specified URL in current window
**   url - absolute or relative URL
************************************************************ */

function openURL(url)
  {
  if (url == "")
    return;
  document.location.href = url;
  // top.location.href = url;
  }


/* ************************************************************
** fillDependentSelectBox(selectBox, selectedVal)
** ===============================================
** Fill a dependent select box with desired options. E.g., in a 
** two-level select-box construct (see navigate.html), the master
** select box would use onChange to call fillDependentSelectBox(),
** and the dependent select box would use onChange to call openURL().
**   selectBox - dependent select-box object to fill
**   selectedVal - currently selected select-box value
**
** Note: This fillDependentSelectBox() code is tailored specifically 
** to the select-box constructs on the navigate.html demo page. You'll
** have to modify the code to fit your select-box construct needs. The
** logic will be the same, but the details will be different.
************************************************************ */

function fillDependentSelectBox(selectBox, selectedVal)
  {  
	if (SelectedVal == "")
		{ document.status = "nothing in SelectedVal";
			return;
		}
	if (SelectedVal == "HomePage_Works_on_Paper")
		{
    var opt1 = new Option("Works on Paper", "./index.htm");
		}

  else if (selectedVal == "Drawings 1") 
    {
    // the first arg to Option() is the text that appears in the select box
    // for a given select option, the second arg is the value of this option
    // (which, in this case, is a URL)
    var opt1 = new Option("Main Catalog Page", "./page_01_draw.htm");
    }
  else if (selectedVal == "Drawings 2") 
    {
    var opt1 = new Option("Main Catalog Page", "./page_02_draw.htm");
    }
  else  // if selectedVal doesn't match anything, create blank options
    {
    var opt1 = new Option("", "");
    }

  for (var i=1; i<2; i++)  // fill selectBox with specified option values
    selectBox.options[i] = eval("opt" + i);

  selectBox.options[0].selected = true;  // select top (blank) select-box option
	return;
  }


