// 2++ 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("examples");

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 = "bookexamples";

switch(MyID) {
case "books":
showText = "bookexamples";
break
case "essays":
showText = "essayexamples";
break
case "bookreviews":
showText = "bookreviewexamples";
break
case "secondary":
showText = "secondaryexamples";
break
case "encyclopedia":
showText = "encyclopediaexamples";
break
case "periodical-print":
showText = "periodical-printexamples";
break
case "periodical-electronic":
showText = "periodical-electronicexamples";
break
case "www":
showText = "wwwexamples";
break
case "score":
showText = "scoreexamples"
break
case "score-anthology":
showText = "score-anthologyexamples"
break
case "facsimile":
showText = "facsimileexamples"
break
case "recording-physical":
showText = "recording-physicalexamples"
break
case "recording-digital":
showText = "recording-digitalexamples"
break
case "booklet":
showText = "bookletexamples"
break
case "video":
showText = "videoexamples"
break
case "live":
showText = "liveexamples"
break

}

// turn the others off

hideExamples(showText);

// turn the right one on

document.getElementById(showText).className = "show";

}

return true;

}
//  end combotips