// Copyright RJ Hodgkiss 2007
<!--  record referrer page for later
var lastpage = this.window.document.referrer;
if (lastpage == "") lastpage = "index.html";

// initialise variables
var initial ="";
var lowerword="";
var newURL="";
var word = "";
var variable ="";

// Focus on text input window
function nowfocus(form) { 
window.focus();
document.mysearch.search.focus();  
document.mysearch.search.disabled=false;
}

// Leap to new glossary URL - same window
function leapto(form) {
var word = document.mysearch.search.value;
if (word !='') { 
lowerword = word.toLowerCase();
initial = lowerword.charAt(0);
newURL= ("plantglossary" + initial + ".html#" + lowerword);
setTimeout("location.replace(newURL);",200);   // delay prevents incorrect settling of location
 }
}

// Parse URL for appended query text with ?word= as delimiter
   var len, len0 = 0;
   var query = "";
   var thisURL = window.location.href;
   var len = thisURL.length;
   var query = thisURL.split("?word=");
   var len0 = query[0].length;

if (len > len0 + 6) {
   if (query[1] !='') { 
      lowerword = query[1].toLowerCase();
      initial = lowerword.charAt(0);
      newURL= ("plantglossary" + initial + ".html#" + lowerword);
      setTimeout("location.replace(newURL);",200);   // delay prevents incorrect settling of location
    }
  }
// alert('Query variables=' + thisURL + '<br>  ' + query[0] + '<br>   ' +  query[1] + '   ' + len + '   ' + len0); // output test data
//--> End