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");
17 this.searchRange = getById("search_range_select");
22 SearchBarFormChunk.prototype.setFormat = function() {
23 var fsel = getById("mr_search_format");
24 var format = paramObj.__format;
25 for( var idx = 0; idx != fsel.options.length; idx++ ) {
26 var obj = fsel.options[idx];
27 if(obj && obj.value == format) {
28 fsel.selectedIndex = idx;
35 SearchBarFormChunk.prototype.resetPage = function() {
39 this.search_button.onclick = mrSearchSubmitForm;
41 this.search_query.onkeydown = mrSearchSubmitOnEnter;
42 this.search_type.onkeydown = mrSearchSubmitOnEnter;
44 var s = paramObj.__mr_search_query;
45 if(!s) s = lastSearchString;
46 var t = paramObj.__mr_search_type;
47 if(!t) t = lastSearchType;
48 if(s) this.search_query.value = s;
49 if(t) this.search_type.value = t;
51 try{ this.search_query.focus(); } catch(E) {}
59 function mrSearchSubmitForm() {
61 var search_query = getById("mr_search_query").value;
62 var search_type = getById("mr_search_type").value;
63 var form = getById("mr_search_format").value
66 var fsel = getById("mr_search_format");
67 var form = fsel.options[fsel.selectedIndex].value
71 var depth = globalSearchDepth;
72 var location = globalSelectedLocation;
74 location = globalLocation.id();
76 location = location.id();
79 "target", "mr_result",
80 "mr_search_type", search_type,
81 "mr_search_query", search_query,
82 "mr_search_location", location,
83 "mr_search_depth", depth,
90 /* forces the submission of the search */
91 function mrSearchSubmitOnEnter(evt) {
92 var win = getWindow();
93 evt = (evt) ? evt : ((win.event) ? globalAppFrame.event : null); /* for mozilla and IE */
94 var obj = globalSearchBarFormChunk;
95 var code = grabCharCode(evt);
96 if(code==13 || code==3) {