// Begin Search-Specific Script
// Use absolute URLs for results pages

function isblank(s)
{
        for(var i=0; i<s.length; i++)
        {
                var c = s.charAt(i);
                if((c != ' ') && (c != '\n') && (c != '\t'))
                        return false;
        }
        return true;
}
function verify()
{
        var msg;
        var SearchTerm = document.excaliburSearch.query.value;
        if((SearchTerm == null) || (SearchTerm == "") || isblank(SearchTerm))
        {
                msg = "Please enter one or more keywords...\n";
                alert(msg);
                return false;
        }
        return true;
}

 function submitSelect() {
if (! verify()) {
	return false;
}

var listbox = document.excaliburSearch.group;
var query = escape(document.excaliburSearch.query.value);
var libraryGroup = listbox.options[listbox.selectedIndex].value;


switch (libraryGroup) {
  case "allschool":
	location.href = "http://school.discovery.com/schoolsearch/allschool.jsp?query=" + query + "&school=on&flstore=on";
	break;
  case "flstore":
	location.href = "http://school.discovery.com/schoolsearch/parents.jsp?query=" + query + "&parents=on";
	break;
  case "teachers":
	location.href = "http://school.discovery.com/schoolsearch/teachers.jsp?query=" + query + "&teachers=on";
	break;
  case "students":
	location.href = "http://school.discovery.com/schoolsearch/students.jsp?query=" + query + "&students=on";
	break;
  case "parents":
	location.href = "http://school.discovery.com/schoolsearch/parents.jsp?query=" + query + "&parents=on";
	break;
  case "schrock":
	location.href = "http://school.discovery.com/schoolsearch/schrock.jsp?query=" + query + "&schrock=on";
	break;
  case "worldbook":
	location.href = "http://school.discovery.com/schoolsearch/worldbook.jsp?query=" + query + "&worldbook=on";
	break;
  default:
	location.href = "http://school.discovery.com/schoolsearch/allschool.jsp";
	break;
}
  return false;
 }
