3 var globalSearchBarFormChunk = null;
5 function SearchBarFormChunk() {
7 globalSearchBarFormChunk = this;
11 SearchBarFormChunk.prototype.init = function() {
12 debug("Initing searchBarFormchunk");
13 this.search_query = getById("mr_search_query");
14 this.search_type = getById("mr_search_type");
15 this.search_button = getById("mr_search_button");
16 this.searchRange = getById("search_range_select");
19 SearchBarFormChunk.prototype.resetPage = function() {
23 this.search_button.onclick = mrSearchSubmitForm;
24 this.search_query.onkeydown = mrSearchSubmitOnEnter;
25 this.search_type.onkeydown = mrSearchSubmitOnEnter;
28 if(paramObj.__mr_search_query)
29 this.search_query.value = paramObj.__mr_search_query;
31 if(paramObj.__mr_search_type)
32 this.search_type.value = paramObj.__mr_search_type;
34 try{ this.search_query.focus(); } catch(E) {}
36 if(this.searchRange) {
37 for( var index in globalOrgTypes ) {
38 var otype = globalOrgTypes[index]
39 var select = new Option(otype.name(), otype.depth());
41 debug("org depth " + otype.name() + " : " + otype.depth() );
42 if( otype.depth() == globalSearchDepth ) {
43 debug("Building range selector with depth "
44 + globalSearchDepth + " and name " + otype.name() );
45 select.selected = true;
46 //this.searchRange.selectedIndex
49 this.searchRange.options[index] = select;
56 function mrSearchSubmitForm() {
57 var search_query = getById("mr_search_query").value;
58 var search_type = getById("mr_search_type").value;
60 var depth = globalSearchDepth;
61 var location = globalSelectedLocation;
63 location = globalLocation.id();
65 location = location.id();
68 "target", "mr_result",
69 "mr_search_type", search_type,
70 "mr_search_query", search_query,
71 "mr_search_location", location,
72 "mr_search_depth", depth,
78 /* forces the submission of the search */
79 function mrSearchSubmitOnEnter(evt) {
80 evt = (evt) ? evt : ((window.event) ? event : null); /* for mozilla and IE */
81 var obj = globalSearchBarFormChunk;
82 var code = grabCharCode(evt);
83 if(code==13||code==3) {