/*------------------------------------------- shared search functions -------------------------------------------*/ var searchErrorType = ""; function clearDefault(el) { if (el.defaultValue==el.value) el.value = "" } function cleanupSearchTerm(term) { // remove spaces and escape chars from search string, rewrite clean term term = trim1(term); term = term.replace(/\\/g, "").replace(/\//g, ""); if (document.getElementById("searchbox")) document.getElementById("searchbox").value = term; return term; } function verifySearchTerm(term) { // check for search term errors // terms must be between 3 and 25 characters if ((term == "") || (term == document.getElementById("searchbox").defaultValue)) { searchErrorType = emptySearchError; } else if (term.length <= 2) { searchErrorType = shortSearchError; } else if (term.length >= 41) { searchErrorType = longSearchError; } // test individual words for min-length if (searchErrorType == "") { var termChunks = term.split(" "); for(var i=0;i