// 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 keyword

//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 = "keywordsb0";

switch(MyID) {
case "titlekey0":
showText = "titlekey1";
break
case "keywords0":
showText = "keywords1";
break
case "authorkey0":
showText = "authorkey1";
break
case "subjectkey0":
showText = "subjectkey1";
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 


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

//Code graciously provided by Larry Deck - 20050705


function hideExamples1(searchtype1) {

if (document.getElementById) {

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

ExamplesRoot1 = document.getElementById("findbexamples1");

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

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

}

}
return true;

}


function showExamples1(searchtype1) {

// 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 = searchtype1.childNodes;

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

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

var showText1 = "titleb0";

switch(MyID1) {
case "titleb0":
showText1 = "titleb1";
break
case "authorb0":
showText1 = "authorb1";
break
case "subjectb0":
showText1 = "subjectb1";
break
case "lcsub0":
showText1 = "lcsub1";
break
case "mesh0":
showText1 = "mesh1";
break
case "ISBN0":
showText1 = "ISBN1";
break
case "ISSN0":
showText1 = "ISSN1";
break
case "callno0":
showText1 = "callno1"
break


}

// turn the others off

hideExamples1(showText1);

// turn the right one on

document.getElementById(showText1).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

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


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

else
{
var sf=document.searchform1;
var submitto = sf.comborequest1.options[sf.comborequest1.selectedIndex].value +  sf.searchterms1.value;
window.location.href = submitto;
return false;
}
}


//   end combosearch








