27 |
|
|
28 |
function go(f) |
function go(f) |
29 |
{ |
{ |
30 |
if(!document.search.query) |
var form = document.getElementById('search'); |
31 |
|
var query = null; |
32 |
|
if (document.form.elements['query']) query = document.form.elements['query'].value; |
33 |
|
var index_name = document.form.elements['index_name'].options[document.form.elements['index_name'].selectedIndex].value; |
34 |
|
|
35 |
|
if(!query) |
36 |
{ |
{ |
37 |
return false; |
return false; |
38 |
} |
} |
39 |
|
|
|
var query=document.search.query.value; |
|
|
var index_name=document.search.index_name.value; |
|
|
|
|
40 |
if(query == null || query == "") |
if(query == null || query == "") |
41 |
{ |
{ |
42 |
alert("No search terms entered!"); |
alert("No search terms entered!"); |
60 |
{ |
{ |
61 |
if((m.nodeType == 1) && |
if((m.nodeType == 1) && |
62 |
(m.tagName.toLowerCase() == "div") && |
(m.tagName.toLowerCase() == "div") && |
63 |
|
m.getAttribute("id") && |
64 |
(m.getAttribute("id").toLowerCase() == id.toLowerCase() )) |
(m.getAttribute("id").toLowerCase() == id.toLowerCase() )) |
65 |
{ |
{ |
66 |
return m; |
return m; |
88 |
debug("printResults("+result.length+")"); |
debug("printResults("+result.length+")"); |
89 |
|
|
90 |
var d = findDiv("results"); |
var d = findDiv("results"); |
91 |
|
var header; |
92 |
|
|
93 |
// Null result output |
// Null result output |
94 |
if(result.length < 1) |
if(result.length < 1) |
95 |
{ |
{ |
96 |
var header = (d.getElementsByTagName("h2"))[0].firstChild; |
header = (d.getElementsByTagName("h2"))[0].firstChild; |
97 |
header.replaceData(0, 14, "Nothing Found "); |
try { |
98 |
|
header.replaceData(0, 14, "Nothing Found "); |
99 |
|
} catch(e) {} |
100 |
|
|
101 |
if(search_err != "") |
if(search_err != "") |
102 |
{ |
{ |
116 |
{ |
{ |
117 |
var e = document.createElement("font"); |
var e = document.createElement("font"); |
118 |
|
|
119 |
e.setAttribute("color","blue"); |
e = document.createElement("a"); |
120 |
e.setAttribute("size","+1"); |
e.setAttribute("href","browse.html?o="+result[i].link); |
121 |
e.appendChild(document.createTextNode(result[i].title)); |
e.appendChild(document.createTextNode(result[i].title)); |
122 |
d.appendChild(e); |
d.appendChild(e); |
123 |
d.appendChild(document.createTextNode(" ")); |
d.appendChild(document.createTextNode(" ")); |
|
d.appendChild(document.createElement("br")); |
|
124 |
|
|
125 |
e = document.createElement("a"); |
e = document.createElement("a"); |
126 |
e.setAttribute("href",result[i].link); |
e.setAttribute("href","thes/"+result[i].link+".html"+location.search); |
127 |
e.setAttribute("target","_blank"); |
e.setAttribute("target","popup"); |
128 |
e.appendChild(document.createTextNode(result[i].link)); |
//e.onclick = function() { return popup(); }; |
129 |
|
e.onclick = popup; |
130 |
|
e.appendChild(document.createTextNode("\u00bb")); |
131 |
d.appendChild(e); |
d.appendChild(e); |
132 |
d.appendChild(document.createTextNode(" ")); |
/* |
|
|
|
133 |
e = document.createElement("font"); |
e = document.createElement("font"); |
134 |
e.setAttribute("color","green"); |
e.setAttribute("color","gray"); |
135 |
e.appendChild(document.createTextNode("["+result[i].frequency+"]")); |
e.appendChild(document.createTextNode("["+result[i].frequency+"]")); |
136 |
d.appendChild(e); |
d.appendChild(e); |
137 |
d.appendChild(document.createElement("br")); |
*/ |
138 |
d.appendChild(document.createElement("br")); |
d.appendChild(document.createElement("br")); |
139 |
} |
} |
140 |
|
|
141 |
// Change header |
// Change header |
142 |
var header = (d.getElementsByTagName("h2"))[0].firstChild; |
header = (d.getElementsByTagName("h2"))[0].firstChild; |
143 |
|
|
144 |
header.replaceData(0, 14, "Search Results"); |
try { |
145 |
|
header.replaceData(0, 14, "Search Results"); |
146 |
|
} catch(e) {} |
147 |
|
|
148 |
} |
} |