function Mid(str, start, len)
{
// Make sure start and len are within proper bounds
    if (start < 0 || len < 0) return "";
    var iEnd, iLen = String(str).length;
    if (start + len > iLen)
          iEnd = iLen;
    else
          iEnd = start + len;
    return String(str).substring(start,iEnd);
}
pth = "jh/web.nsf"
function srch(fieldtouse){
var searchstring = document.getElementById(fieldtouse).value
if ( searchstring !="") 
{
var str = document.location.href.substring(7,document.location.href.length);
host = Mid(str, 0,str.indexOf("/"))
location.href=("http://"+ host +"/"+pth +"/search!open&q="+searchstring);
return false;
}
else{ 
alert("Please enter a search value"); 
searchstring.focus;
return false;
}
}
  function doClick(buttonName,fld,e)
    {
        var key;
         if(window.event)
	{
              key = window.event.keyCode;     //IE
	}
         else
	{
              key = e.which;     //firefox
	}
    
        if (key == 13)
        {
            //Get the button the user wants to have clicked
            var btn = document.getElementById(buttonName);
            if (btn != null)
            { //If we find the button click it
	//btn.click();
              srch(fld);
	key = 0;
            //  event.keyCode = 0
            }
          }
   }

