3 var globalSearchBarFormChunk = null;
5 function SearchBarFormChunk() {
7 globalSearchBarFormChunk = this;
11 SearchBarFormChunk.prototype.init = function() {
13 debug("Initing searchBarFormchunk");
14 this.search_query = getById("mr_search_query");
15 this.search_type = getById("mr_search_type");
16 this.search_button = getById("mr_search_button");
21 SearchBarFormChunk.prototype.setFormat = function() {
22 var fsel = getById("mr_search_format");
23 var format = paramObj.__format;
24 for( var idx = 0; idx != fsel.options.length; idx++ ) {
25 var obj = fsel.options[idx];
26 if(obj && obj.value == format) {
27 fsel.selectedIndex = idx;
34 SearchBarFormChunk.prototype.resetPage = function() {
38 this.search_button.onclick = mrSearchSubmitForm;
39 this.search_query.onkeydown = mrSearchSubmitOnEnter;
40 this.search_type.onkeydown = mrSearchSubmitOnEnter;
42 var s = paramObj.__mr_search_query;
43 if(!s) s = lastSearchString;
44 var t = paramObj.__mr_search_type;
45 if(!t) t = lastSearchType;
46 if(s) this.search_query.value = s;
47 if(t) this.search_type.value = t;
49 try{ this.search_query.focus(); } catch(E) {}
55 function mrSearchSubmitForm() {
57 var search_query = getById("mr_search_query").value;
58 var search_type = getById("mr_search_type").value;
59 var form = getById("mr_search_format").value
61 if(search_query == null || search_query == "")
64 var depth = globalSearchDepth;
65 var location = globalSelectedLocation;
67 location = globalLocation.id();
69 location = location.id();
72 "target", "mr_result",
73 "mr_search_type", search_type,
74 "mr_search_query", search_query,
75 "mr_search_location", location,
76 "mr_search_depth", depth,
83 /* forces the submission of the search */
84 function mrSearchSubmitOnEnter(evt) {
85 var win = getWindow();
86 evt = (evt) ? evt : ((win.event) ? globalAppFrame.event : null); /* for mozilla and IE */
87 var obj = globalSearchBarFormChunk;
88 var code = grabCharCode(evt);
89 if(code==13 || code==3) {