// novanet javascript library, compiled files and compressed slightly.
// $a: alexander jerabek 
// $d: june 2006
//
// includes code from the following: 
// 2 novanet files: combotips.js, combosearch.js



// 1+ combotips: used to selectively display the tips in basic search

//Code graciously provided by Larry Deck - 20050705


function hideExamples(searchtype) {

if (document.getElementById) {

// if it isn't the one we selected, turn it off

ExamplesRoot = document.getElementById("findbexamples");

for (i=0; i<ExamplesRoot.childNodes.length; i++) {
node = ExamplesRoot.childNodes[i];

if (node.id != searchtype) {
// turn it off
node.className = "noshow";
}

}

}
return true;

}


function showExamples(searchtype) {

// if it's not a DOM2-compliant browser, don't bother

if (document.getElementById) {

//  loop through the options to get the id of the one selected

var Options = searchtype.childNodes;

for (var i=0; i<Options.length; i++) {
var ThisNode = Options[i];
if (ThisNode.selected == true) {
var MyID = ThisNode.id;
}
}

//  get the id of the example to show based on MyID, use title browse by default

var showText = "titleb0";

switch(MyID) {
case "titleb0":
showText = "titleb1";
break
case "titlekey0":
showText = "titlekey1";
break
case "keywords0":
showText = "keywords1";
break
case "authorb0":
showText = "authorb1";
break
case "authorkey0":
showText = "authorkey1";
break
case "subjectb0":
showText = "subjectb1";
break
case "subjectkey0":
showText = "subjectkey1";
break
case "lcsub0":
showText = "lcsub1";
break
case "mesh0":
showText = "mesh1";
break
case "jtwords0":
showText = "jtwords1";
break
case "ISBN0":
showText = "ISBN1";
break
case "ISSN0":
showText = "ISSN1";
break
case "callno0":
showText = "callno1"
break

// Course reserves examples

case "instructor0":
showText = "instructor1"
break
case "coursenu0":
showText = "coursenu1"
break
case "coursena0":
showText = "coursena1"
break
case "title0":
showText = "title1"
break
case "dept0":
showText = "dept1"
break
case "system0":
showText = "system1"
break
case "item0":
showText = "item1"
break
case "authors0":
showText = "authors1"
break
case "subjects0":
showText = "subjects1"
break

}

// turn the others off

hideExamples(showText);

// turn the right one on

document.getElementById(showText).className = "show";

}

return true;

}
//  end combotips 










// 2++ combosearch: used to make basic search work 
//pinched from http://www.mediacollege.com/internet/javascript/form/multi-search.html
// thanks guys!


function dosearch0() {
if(document.searchform0.comborequest0.selectedIndex==-1)
{
alert("Please select a search option from the drop down menu.");
document.searchform0.comborequest0.focus();
return false;
}

else
{
var sf=document.searchform0;
var submitto = sf.comborequest0.options[sf.comborequest0.selectedIndex].value +  sf.searchterms0.value;
window.location.href = submitto;
return false;
}
}


//   end combosearch









