<HTML>

<head>
<TITLE>JavaScript Catalog Menu</TITLE>
</head>

<!-------------------------------------------------------------------

This file (catalog1.htm) is the one that is loaded in the top menu panel.
It contains the form which submits searches. Search results appear in
the main display panel on the bottom (catalog2.htm).

It should not be used by itself but should be pulled up by pointing your
browser at the main frame control file (index.htm.)

You should only change those items indicated as changeable below.
--------------------------------------------------------------------->


<!-- You can change the color scheme below by consulting standard HTML text books -->
<BODY BGCOLOR="#000000" TEXT="#00FFFF" LINK="#FFFF00" VLINK="#FFFF00" ALINK="#FF0000" >

<!-- DO NOT MODIFY ANTHING BELOW THAT DOES NOT HAVE A COMMENT WITH OBVIOUS DIRECTIONS -->

<SCRIPT language="JavaScript">
<!-- Hide JavaScript from non-compliant browsers

// This is a JavaScript comment. Refer to these comments for modification directions.

var NUM_INDEXES = 30;
var SEARCHINPUT = "looking+for+this";

function BuildIndxs(n) {
   for (var i = 1; i <= n; i++) {
     this[i] = 0;
   }
   this.maxlen = n;
   this.len = 0;
   return this;
}

var indxs = new BuildIndxs(NUM_INDEXES);

function find_substring(pig, poke) {
   var i, piglen = pig.length, pokelen = poke.length;
   for (i=0; i<=pokelen-piglen; i++) {
      if (pig == poke.substring(i,i+piglen))
        return i;
   }
   return false;
}

function Indx(name, opts, home, search) {
  var whereisit = find_substring(SEARCHINPUT, search);
  this.name = name;
  this.opts = opts;
  this.home = home;
  this.pre_whereisit = search.substring(0,whereisit);
  this.post_whereisit= search.substring(whereisit+SEARCHINPUT.length, search.length);
}

function Addindx(name, opts, home, search) {
  indxs.len++;
  if (indxs.len <= indxs.maxlen) {
    indxs[indxs.len] = new Indx(name, opts, home, search)
  }
  else {
    alert("Increase the value of NUM_INDEXES: " + indxs.len + ">" + indxs.maxlen)
  }
}

function ShowPanel() {

  document.writeln('<FORM Name=whereisitform OnSubmit="DoPanel(this); return false">');

//'Enter Terms:' can be changed to anything as the prompt for entering searches
  document.writeln('Enter Terms:');

  document.writeln('<INPUT size=20 name="query">');
  document.writeln('as <SELECT name="service">');
  for (i=1; i <= indxs.len; i++) {
    document.writeln("<OPTION " + indxs[i].opts + "> " + indxs[i].name);
  }
  document.writeln('</SELECT>'); 

//'then ...' can be changed to anything you wish
  document.writeln('then ... ');

//Change "Click to find" for the label on the search button
  document.writeln('<input type=submit value="Click to find!">');

  document.writeln('</FORM>');

  document.whereisitform.query.focus()
}

function DoPanel(form) {
//  form.submit();
  var i, newq="", oldq=form.query.value;
  for (i=0; i<oldq.length; i++) {  // compress [ ]+ into \+
    var thischar = oldq.charAt(i);
    if (thischar != ' ')
      newq += thischar;
    else if (lastchar != ' ')
      newq += '+';
    lastchar = thischar;
  }
  var indx = indxs[1+form.service.selectedIndex];
  parent.display.location.href = newq ? indx.pre_whereisit + newq + indx.post_whereisit : indx.home;
  document.whereisitform.query.focus()
}


// ADD SEARCH INDEXES BELOW.
// When NOTHING is entered in a search, the first of the pair of URL's below comes up.
// Change "put.your.url.here" with the URL of your III Web catalog (the second URL).
// Most word processors have a FIND AND REPLACE command that will do this for you.
// You can also add many search engines, such as Yahoo, by doing the following:
//
// 	Do a search on a search engine using the terms "looking for this"
// 	Copy the URL and paste into one of the Addindx blocks below
//		The last entry in the list below uses Infoseek in this manner.

Addindx("Subject","",
    "http://put.your.url.here/search/d",
    "http://put.your.url.here/search/d?looking+for+this");

Addindx("Keyword","",
    "http://put.your.url.here/search/w",
    "http://put.your.url.here/search/w?looking+for+this");

Addindx("Author","",
    "http://put.your.url.here/search/a",
    "http://put.your.url.here/search/a?looking+for+this");

Addindx("Title","",
    "http://put.your.url.here/search/t",
    "http://put.your.url.here/search/t?looking+for+this");

Addindx("Periodical Title","",
    "http://put.your.url.here/search/s",
    "http://put.your.url.here/search/s?looking+for+this");

Addindx("Table of Contents","",
    "http://put.your.url.here/search/U",
    "http://put.your.url.here/search/U?looking+for+this");

Addindx("Reserves by Course","",
    "http://put.your.url.here/search/r",
    "http://put.your.url.here/search/r?looking+for+this");

Addindx("Reserves by Prof.","",
    "http://put.your.url.here/search/p",
    "http://put.your.url.here/search/p?looking+for+this");

Addindx("Call Number - LC","",
    "http://put.your.url.here/search/c",
    "http://put.your.url.here/search/c?looking+for+this");

Addindx("Gov Docs No.","",
    "http://put.your.url.here/search/g",
    "http://put.your.url.here/search/g?looking+for+this");

Addindx("ISBN/ISSN No.","",
    "http://put.your.url.here/search/i",
    "http://put.your.url.here/search/i?looking+for+this");

Addindx("OCLC No.","",
    "http://put.your.url.here/search/o",
    "http://put.your.url.here/search/o?looking+for+this");

Addindx("Encyclopedia Entry","",
    "http://www.eb.com:180/",
    "http://www.eb.com:180/cgi-bin/g?keywords=looking+for+this&DBase=Articles&hits=10");

Addindx("Internet Item","",
		"http://www.infoseek.com/",
		"http://www.infoseek.com/Titles?qt=looking+for+this&col=WW&sv=I2&svx=NSQuickseek");

Addindx("START OVER","",
	"catalog2.htm",
	"catalog2.htm?looking+for+this");

// ADD SEARCH INDEXES ABOVE.

ShowPanel();

//  Turn javascript cloaking device OFF -->

</SCRIPT>

<!-------------------------------------------------------------------

This template can be freely used, modified, and disseminated by
libraries and educational institutions for non-profit use so long
as this section of HTML commented text is retained.

Use by for-profit corporations is prohibited unless permission is
obtained from the designer:

Raleigh Muns, Reference Librarian
Thomas Jefferson Library
University of Missouri-St. Louis
St. Louis, MO 63121

muns@umsl.edu
ph: 314-516-5059

--------------------------------------------------------------------->

</BODY>
</html>