(sitka-tpac) force metarecord display when MR has one constituent result
[sitka/evergreen.git] / Open-ILS / src / templates / opac / parts / result / table.tt2
1 [%  PROCESS "opac/parts/misc_util.tt2";
2
3     USE ResolverResolver;
4
5     ctx.result_start = 1 + ctx.page_size * page;
6     ctx.result_stop = ctx.page_size * (page + 1);
7     IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
8
9     result_count = ctx.result_start;
10
11     # don't display a box for the search_format filter,
12     # as that's got its own widget
13     ignore_filters = ['search_format'];
14
15     trimmed_filters = [];
16     FOR filter IN ctx.query_struct.filters;
17         fname = filter.name;
18         IF ignore_filters.grep('^' _ fname _ '$').size;
19             NEXT;
20         END;
21         trimmed_filters.push(filter);
22     END;
23
24     ctx.query_struct.filters = trimmed_filters;
25
26 %]
27
28 [% PROCESS "opac/parts/result/paginate.tt2" %] 
29 [% ctx.results_count_header = PROCESS results_count_header;
30     ctx.results_count_header %]
31 [% IF ctx.bookbag %]
32 <div id="result-bookbag-heading">
33     <div class="result-bookbag-name">[% ctx.bookbag.name | html %]</div>
34     <div class="result-bookbag-description">[% ctx.bookbag.description | html %]</div>
35 </div>
36 [% END %]
37 <div id="result_table_div">
38     <div class="facet_sidebar_hidden" id="facet_sidebar">
39     [%- IF ctx.is_staff %]
40     <h3 class="sr-only">[% l('Saved Searches') %]</h3>
41     [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
42     [%-  END %]
43     <h3 class="sr-only">[% l('Search Results facets') %]</h3>
44     [% INCLUDE 'opac/parts/result/facets.tt2' %]
45     <h3 class="sr-only">[% l('Search Results List') %]</h3>
46     </div>
47             <div id="result_block" class="result_block_visible">
48                 <table id="result_table_table" title="[% l('Search Results') %]"
49                   class="table_no_border_space table_no_cell_pad">
50                     <thead class="sr-only">
51                       <tr>
52                         <th>[% l('Search result number') %]</th>
53                         <th>[% l('Book jacket cover art') %]</th>
54                         <th>[% l('Item details and Actions') %]</th>
55                       </tr>
56                     </thead>
57                     <tbody id="result_table">
58                     [%  FOR rec IN ctx.records;
59                             attrs = {};
60                             attrs.marc_xml = rec.marc_xml;
61                             attrs.mr_constituent_ids = [];
62                             FOREACH mr_constituent_id IN rec.mr_constituent_ids;
63                                 attrs.mr_constituent_ids.push(mr_constituent_id);
64                             END;
65                             PROCESS get_marc_attrs args=attrs;
66                             IF show_detail_view;
67                                 attrs.title = attrs.title_extended;
68                             END;
69                             # note: rec.id refers to the record identifier, regardless
70                             # of the type of record. i.e. rec.id = mmr_id ? mmr_id : bre_id
71                             IF rec.mmr_id;
72                                 #IF rec.mr_constituent_count > 1;
73                                     # metarecords link to record list page
74                                     record_url = mkurl(ctx.opac_root _ '/results', 
75                                         {metarecord => rec.mmr_id}, ['page']);
76                                 #ELSE;
77                                     # for MR, bre_id refers to the master and in
78                                     # this case, only, record
79                                     #record_url = mkurl(ctx.opac_root _ '/record/' _ attrs.mr_constituent_ids.0, { badges => rec.badges.join(',') });
80                                 #END;
81                                 hold_type = 'M';
82                             ELSE;
83                                 record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id, { badges => rec.badges.join(',') });
84                                 hold_type = 'T';
85                             END;
86                     -%]
87                         <tr class="result_table_row">
88                                             <td class="results_row_count" name="results_row_count">[%
89                                                     result_count; result_count = result_count + 1
90                                                 %].</td>
91                                             <td class='result_table_pic_header'>
92                                                 <a href="[% record_url %]"><img alt="[% l('Book cover') %]"
93                                                         name='item_jacket' class='result_table_pic' width="55"
94                                                         src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% rec.bre_id | uri %]' /></a><br />
95                                             </td>
96                                             <td class='result_table_title_cell' name='result_table_title_cell'>
97                                                <div class="result_metadata">
98                                                     [% IF rec.mmr_id %]
99                                                     <abbr class="unapi-id" 
100                                                       title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:metabib-metarecord/[% rec.mmr_id %]'>
101                                                     </abbr>
102                                                     [% ELSE %]
103                                                     <abbr class="unapi-id" 
104                                                       title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.bre_id %]'>
105                                                     </abbr>
106                                                     [% END %]
107                                                     <a class='record_title search_link' name='record_[% rec.id %]'
108                                                         href="[% record_url %]"
109                                                         [% html_text_attr('title', l('Display record details for "[_1]"', attrs.title)) %]>
110                                                         [% attrs.title | html %]
111                                                      </a>
112                                                      [% IF rec.mr_constituent_count.defined %]
113                                                      <span title="[% l('This group contains [_1] records', rec.mr_constituent_count) %]">
114                                                       ([% rec.mr_constituent_count %])
115                                                      </span>
116                                                      [% END %]
117
118 [%-
119 FOR entry IN attrs.graphic_titles;
120     FOR alt IN entry.graphic;
121         diratt = "";
122         IF alt.dir;
123             diratt = ' dir="' _ alt.dir _ '"';
124         END;
125 -%]
126 <div class="graphic880"[% diratt %]>
127     [% alt.value | html %]
128 </div>
129 [%-
130     END;
131 END;
132 -%]
133  
134                                                     <div>
135                                                         <a title="[% l("Perform an Author Search") %]"
136                                                                 class="record_author"
137                                                                 href="[%- 
138                                                                     authorquery = attrs.author | replace('[#"^$\+\-,\.:;&|\[\]()]', ' ');
139                                                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, general_search_parms.merge(expert_search_parms, browse_search_parms, facet_search_parms))
140                                                                     -%]" rel="nofollow" vocab="">[% attrs.author | html %]</a>
141 [%-
142 FOR entry IN attrs.graphic_authors;
143     FOR alt IN entry.graphic;
144         diratt = "";
145         IF alt.dir;
146             diratt = ' dir="' _ alt.dir _ '"';
147         END;
148 -%]
149 <div class="graphic880"[% diratt %]>
150     [% alt.value | html %]
151 </div>
152 [%-
153     END;
154 END;
155 -%]
156
157                                                     </div>
158                                                     <div class='result_table_title_cell'>
159                                                     [%- IF attrs.format_label; %]
160                                                         [% FOR format IN attrs.all_formats %]
161                                                             <img title="[% format.label | html %]" 
162                                                                 alt="[% format.label | html %]" 
163                                                                 src="[% format.icon %]" /> 
164                                                             [% format.label | html %]
165                                                         [% END %]
166                                                     [%- END %]
167                                                     </div>
168                                                     [% IF rec.popularity > 0.0 %]
169                                                       <div>
170                                                         <span><strong>[% l('Popularity:') %]</strong> [% rec.popularity %] / 5.0</span>
171                                                       </div>
172                                                     [% END %]
173                                                     <table 
174                                                        role="presentation"
175                                                        title="[% l('Record Holdings Summary') %]"
176                                                        class="table_no_border_space table_no_cell_pad table_no_border results_info_table">
177                                                         [% UNLESS rec.mmr_id %]
178 <!--- turn off display of call number
179                                                            [% IF args.holdings.size > 0 %]
180                                                         <tr name='bib_cn_list' class='result_table_title_cell'>
181                                                             <td valign='top'>
182                                                                 <strong>[% l('Call number:') %]</strong>
183                                                             </td>
184                                                             <td>[% args.holdings.0.label | html %]</td>
185                                                         </tr>
186                                                            [% END %]
187                                                         [% END %]
188 -->
189
190                                                         [%- IF show_detail_view -%]
191                                                         <!-- These fields are visible when viewing the results page in 'detailed' mode -->
192                                                         [% UNLESS rec.mmr_id %]
193                                                         <!-- Do not show publication-specific information on a metarecord search results page -->
194                                                         [% IF attrs.publisher %]
195                                                             <tr name="results_pub_tr">
196                                                                 <td valign="top">
197                                                                     <strong>[% l('Publisher:') %]</strong>
198                                                                 </td>
199                                                                 <td>[% attrs.pubplace | html; %] [% attrs.publisher | html; %] [% attrs.pubdate | html; %]
200 [%-
201 FOR entry IN attrs.graphic_pubinfos;
202     FOR alt IN entry.graphic;
203         diratt = "";
204         IF alt.dir;
205             diratt = ' dir="' _ alt.dir _ '"';
206         END;
207 -%]
208 <div class="graphic880"[% diratt %]>
209     [% alt.value | html %]
210 </div>
211 [%-
212     END;
213 END;
214 -%]
215 </td>
216                                                             </tr>
217                                                         [% ELSIF attrs.producer %]
218                                                             <tr name="results_pub_tr">
219                                                                 <td valign="top">
220                                                                     <strong>[% l('Producer:') %]</strong>
221                                                                 </td>
222                                                                 <td>[% attrs.prodplace | html; %] [% attrs.producer | html; %] [% attrs.proddate | html; %]</td>
223                                                             </tr>
224                                                         [% ELSIF attrs.distributor %]
225                                                             <tr name="results_pub_tr">
226                                                                 <td valign="top">
227                                                                     <strong>[% l('Distributor:') %]</strong>
228                                                                 </td>
229                                                                 <td>[% attrs.distplace | html; %] [% attrs.distributor | html; %] [% attrs.distdate | html; %]</td>
230                                                             </tr>
231                                                         [% ELSIF attrs.manufacturer %]
232                                                             <tr name="results_pub_tr">
233                                                                 <td valign="top">
234                                                                     <strong>[% l('Manufacturer:') %]</strong>
235                                                                 </td>
236                                                                 <td>[% attrs.manplace | html; %] [% attrs.manufacturer | html; %] [% attrs.mandate | html; %]</td>
237                                                             </tr>
238                                                         [% END %]
239                                                         [% IF attrs.isbns.size > 0 %]
240                                                             <tr name="results_isbn_tr">
241                                                                 <td valign="top">
242                                                                     <strong>[% l('ISBN:') %]</strong>
243                                                                 </td>
244                                                                 <td>[% attrs.isbns.0 | html %]</td>
245                                                             </tr>
246                                                         [% END %]
247                                                         [%- IF attrs.issns.size > 0 %]
248                                                             <tr name="results_issn_tr">
249                                                                 <td valign="top">
250                                                                     <strong>[% l('ISSN:') %]</strong>
251                                                                 </td>
252                                                                 <td>[% attrs.issns.0 | html %]</td>
253                                                             </tr>
254                                                         [%- END %]
255                                                         [%- IF openurl.enabled == 'true';
256                                                             FOREACH issn IN args.issns;
257                                                                 NEXT IF issn == '';
258                                                                 res_urls = ResolverResolver.resolve_issn(issn, openurl.baseurl);
259                                                                 FOREACH res IN res_urls;
260                                                         %]
261                                                         <tr name="results_issn_tr">
262                                                             <td valign="top">
263                                                                 <strong><a href="[% res.target_url %]">
264                                                                 [% res.public_name | html %]</a></strong>
265                                                             </td>
266                                                             <td>[% res.target_coverage | html %]
267                                                             [%- IF res.target_embargo != '';
268                                                                     ' - ';
269                                                                     res.target_embargo | html;
270                                                                 END;
271                                                             -%]
272                                                             </td>
273                                                         </tr>
274                                                                 [% END %]
275                                                             [% END %]
276                                                         [% END %]
277
278                                                         [% IF attrs.edition %]
279                                                             <tr name="results_edition_tr">
280                                                                 <td valign="top">
281                                                                     <strong>[% l('Edition:') %]</strong>
282                                                                 </td>
283                                                                 <td>[% attrs.edition | html %]
284 [%-
285 FOR entry IN attrs.graphic_editions;
286     FOR alt IN entry.graphic;
287         diratt = "";
288         IF alt.dir;
289             diratt = ' dir="' _ alt.dir _ '"';
290         END;
291 -%]
292 <div class="graphic880"[% diratt %]>
293     [% alt.value | html %]
294 </div>
295 [%-
296     END;
297 END;
298 -%]
299 </td>
300                                                             </tr>
301                                                         [% END %]
302                                                         [% IF attrs.phys_desc %]
303                                                             <tr name="results_phys_desc_tr">
304                                                                 <td nowrap="nowrap" valign="top">
305                                                                     <strong>[% l('Phys. Desc.:') %]</strong>
306                                                                 </td>
307                                                                 <td>
308                                                                     [% args.phys_desc | html %]
309                                                                 </td>
310                                                             </tr>
311                                                         [% END %]
312
313                                                         [%- IF ctx.is_staff && args.holdings.size < 1 %]
314                                                             <tr>
315                                                                 <td colspan="2">
316                                                                 [% IF args.tag856u %]
317                                                                     <span class="electronic_resource">ELECTRONIC RESOURCE</span>
318                                                                 [% ELSE %]
319                                                                     <span class="nocopies">NO COPIES</span>
320                                                                 [% END %]
321                                                                 </td>
322                                                             </tr>
323                                                         [% END %]
324
325                                                         [% 
326                                                         IF ctx.search_ou;
327                                                             limit_uris_displayed = ctx.get_org_setting(ctx.search_ou, 'opac.luri_results_uri_limit');
328                                                         END;
329                                                         %]
330                                                         [% FOR uri IN args.uris %]
331                                                             <tr name='bib_uri_list' class='result_table_title_cell'>
332                                                                 <td valign='top'>
333                                                                     <strong>[% l('Electronic resource') %]</strong>
334                                                                 </td>
335                                                                 <td><a href="[% uri.href %]" class="uri_link">[% uri.link | html %]</a>[% ' - ' _ uri.note | html IF uri.note %]</td>
336                                                             </tr>
337                                                             [%
338                                                             IF loop.count >= limit_uris_displayed AND args.uris.size > limit_uris_displayed;
339                                                             %]
340                                                                 <tr>
341                                                                     <td>
342                                                                         <a class='record_title search_link' name='record_[% rec.id %]'
343                                                                             href="[% record_url %]"
344                                                                             [% html_text_attr('title', l('Display record details for "[_1]"', attrs.title)) %]>
345                                                                             More...
346                                                                         </a>
347                                                                     </td>
348                                                                 </tr>
349                                                             [%
350                                                                 LAST;
351                                                             END;
352                                                             %]
353                                                             [% END %]
354                                                          [% END %]
355
356                                                         [%-
357                                                         rec_id = rec.id;
358                                                         IF ctx.holdings.$rec_id.size > 0;
359                                                             FOREACH copy IN ctx.holdings.$rec_id;
360                                                                 IF copy.part_label != '';
361                                                                     has_parts = 'true';
362                                                                     LAST;
363                                                                 END;
364                                                             END %]
365                                                             <tr name='bib_cn_list' class='result_table_title_cell'>
366                                                                 <td colspan='2'>
367                                                                     <table title="[% l('Record Holdings Details') %]"
368                                                                            class='result_holdings_table'>
369                                                                         <thead><tr>
370                                                                             <th>[% l('Library') %]</th>
371                                                                             <th>[% l('Shelving location') %]</th>
372                                                                             <th>[% l('Call number') %]</th>
373                                                                             [%- IF has_parts == 'true'; %]
374                                                                             <th>[% l('Part') %]</th>
375                                                                             [%- END %]
376                                                                             <th>[% l('Status') %]</th>
377                                                                         </tr></thead>
378                                                                         <tbody>
379                                                             [%
380                                                             copies = ctx.holdings.$rec_id;
381
382                                                             FOR copy IN copies;
383                                                                 callnum = copy.call_number_label;
384                                                                 NEXT IF callnum == '##URI##';
385                                                                 
386                                                                 IF copy.part_label != '';
387                                                                     has_parts = 'true';
388                                                                 END %]
389                                                                             <tr>
390                                                                                 <td>[% 
391                                                                                         org_name = ctx.get_aou(copy.circ_lib).name;
392                                                                                         org_name | html
393                                                                                 %]
394                                                                                 </td>
395                                                                                 <td>[% copy.copy_location | html %]</td>
396                                                                                 <td>[% copy.call_number_label | html %]</td>
397                                                                                 [%- IF has_parts == 'true'; %]
398                                                                                     <td>[% copy.part_label %]</td>
399                                                                                 [%- END %]
400                                                                                 <td>[% copy.copy_status | html %]</td>
401                                                                             </tr>
402                                                             [% END %]
403                                                                         </tbody>
404                                                                     </table>
405                                                                 </td>
406                                                             </tr>
407                                                             [%- has_parts = 'false';
408                                                         END;
409                                                         %]
410                                                         [% END %] <!-- END detail_record_view -->
411                                                     </table>
412                                                     [% 
413                                                         IF ebook_api.enabled == 'true';
414                                                             INCLUDE "opac/parts/ebook_api/avail.tt2";
415                                                         END;
416                                                     %]
417                                                     [% PROCESS "opac/parts/result/copy_counts.tt2" %]
418                                                     [% IF rec.user_circulated %]
419                                                     <div class="result_item_circulated">
420                                                         <img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('Checked Out Before') %]"/>
421                                                         <span>[% l('I have checked this item out before') %]</span>
422                                                     </div>
423                                                     [% END %]
424                                                     [% IF ctx.bookbag;
425                                                         rec_id = rec.id;
426                                                         FOR note IN ctx.bookbag_items_by_bre_id.$rec_id.notes %]
427                                                     <div class="result-bookbag-item-note">
428                                                         [% note.note | html %]
429                                                     </div>
430                                                         [% END %]
431                                                     [% END %]
432                                                 </div>
433                                                 <div class="result_table_utils_cont">
434                                                     <div class="result_table_utils">
435                                                         [% IF args.uris.size > 0 and (args.bib_source.id == 5 or args.bib_source.id == 6 or args.bib_source.id == 7) %]
436                                                             <div class="results_aux_utils place_hold"><a
437                                                                     href="[% args.uris.0.href %]"
438                                                                     [% html_text_attr('title', l('Place Hold on [_1]', attrs.title)) %]
439                                                                         class="no-dec" rel="nofollow" vocab=""><img
440                                                                     src="[% ctx.media_prefix %]/images/green_check.png"
441                                                                     alt=""/><span class="result_place_hold">
442                                                                         [%- l('Place Hold'); -%]
443                                                                         [%- IF attrs.format_label; -%]
444                                                                             <br/>[%- l('(on [_1])', attrs.format_label); -%]
445                                                                         [%- END; %]
446                                                                     </span></a>
447                                                             </div>
448                                                         [% ELSE %]
449 [%- search_ou = ctx.search_ou;
450     num_holdable_copies = attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size || 0;
451     IF ctx.place_unfillable ||
452         ( num_holdable_copies > 0
453             && (ctx.holds_block.enabled != 'true' || attrs.org_copy_counts.$search_ou.available == 0)
454         )
455 %]
456                                                         <div class="results_aux_utils place_hold"><a
457                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold',
458                                                                     {hold_target => rec.id, hold_type => hold_type, 
459                                                                       hold_source_page => mkurl()}, ['query','tag','subfield','term','_special','sort','page']) %]"
460                                                                 [% html_text_attr('title', l('Place Hold on [_1]', attrs.title)) %]
461                                                                     class="no-dec" rel="nofollow" vocab=""><img
462                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
463                                                                 alt=""/><span class="result_place_hold">[% l('Place Hold') %]</span></a>
464                                                         </div>
465 [%- END -%]
466 [%- END -%]
467                                                         <div class="results_aux_utils result_util">
468                                                         [% IF !ctx.is_staff %]
469                                                             [%  IF ctx.user;
470                                                                 INCLUDE "opac/parts/bookbag_actions.tt2";
471                                                             %]
472                                                             [%  ELSE;
473                                                                 operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
474                                                                 label = (operation == "add") ?  l("Add to my list") : l("Remove from my list");
475                                                                 title_label = (operation == "add") ? 
476                                                                   l("Add [_1] to my list", attrs.title) : 
477                                                                   l("Remove [_1] from my list", attrs.title);
478                                                                 href = mkurl(ctx.opac_root _ '/mylist/' _ operation, 
479                                                                         {record => rec.id, anchor => 'record_' _ rec.id}, 1);
480                                                             %]      
481                                                             <a href="[% href %]" class="no-dec" 
482                                                                 [% html_text_attr('title', title_label) %] rel="nofollow" vocab="">
483                                                                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
484                                                                 [% label %]
485                                                             </a>
486                                                             [% END %]
487                                                         [% END %]
488                                                         </div>
489                                                         [% IF ENV.OILS_CONTENT_CAFE_USER;
490                                                             IF NOT ctx.is_staff;
491                                                                 tpac_ou = ctx.physical_loc;
492                                                             ELSE;
493                                                                 tpac_ou = ctx.user.ws_ou;
494                                                             END;
495                                                             new_window = ctx.get_org_setting(tpac_ou, 'opac.reviews_and_more_new_tab');
496                                                             record = ctx.opac_root _ '/record/' _ rec.id;
497                                                             name = 'summaryplus';
498                                                             href = mkurl(record, {expand => name}) _ '#' _ name; 
499                                                         %]
500                                                         <div class="results_aux_utils result_util">
501                                                             <a title="[% l('Reviews and More') %]"
502                                                                 [% IF new_window; %]
503                                                                     [% IF NOT ctx.is_staff %]
504                                                                         target='_blank'
505                                                                     [% ELSE %]
506                                                                         target='_blank'
507                                                                         [%
508                                                                         #this code will open up the Content Cafe data in a new tab as opposed to target='_blank', which opens it in new window in
509                                                                         #in the staff client.  When opening Content Cafe data in a new tab, there is a problem if the user has set a preferred 
510                                                                         #search location via the staff client Admin menu.  If this is the case, then the tab is not focused on the review and 
511                                                                         #the user has to scroll down to see it.  There is a fix on user/lwhalen/rt16523_with_staff_client_fix, but it requires a
512                                                                         #new staff client, so support has opted to go with opening in a new window until a staff client can be released.
513                                                                         #I am keeping this code in the source to make it esay to implement whenever support would like to change the behaviour from
514                                                                         #opening in a new window to opening in a new tab.
515                                                                         #href = "javascript:xulG.new_tab(xulG.urls.XUL_OPAC_WRAPPER, {}, {'opac_url' : 'oils://remote" _ href _ "'});void(0);" 
516                                                                         %]
517                                                                     [% END %]
518                                                                 [% END %]
519                                                                 href="[% href %]">
520                                                                 <img src='[% ctx.media_prefix %]/images/starz.png'/> 
521                                                                 <span class="results_reviews">[% l('Reviews &amp; More') %]</span>
522                                                             </a>
523                                                         </div>
524                                                         [% END %]
525                                                     </div>
526                                                 </div>
527
528                                             </td>
529
530                                         </tr>
531                                         [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %]
532                                         <tr>
533                                             <td/>
534                                             <td align='center'> <!-- Chilifresh reviews link --> 
535                                                 <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
536                                             </td>
537                                         </tr>
538                                         <tr>
539                                             <td/>
540                                             <td colspan='5'> <!-- Chilifresh reviews panel -->
541                                                 <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center"></div>
542                                             </td>
543                                         </tr>
544                                         [%- END %]
545                     [% END %]
546                     </tbody>
547                 </table>
548             </div>
549 </div>
550 <div class="result_footer_nav1">
551     [% ctx.results_count_header %]
552 </div>
553 <script>
554 resultBlock = document.getElementById('result_block');
555 resultButton = document.getElementById('return_to_hits');
556 facetSidebar = document.getElementById('facet_sidebar');
557 facetButton =  document.getElementById('refine_hits');
558 function getFacety() {
559     resultBlock.setAttribute('class', 'result_block_hidden');
560     resultButton.setAttribute('class', 'results_header_btns result_block_visible');
561     facetSidebar.setAttribute('class', 'facet_sidebar_visible');
562     facetButton.setAttribute('class', 'result_block_hidden');
563     window.location.hash = 'return_to_hits';
564 }
565 function getResulty() {
566     resultBlock.setAttribute('class', 'result_block_visible');
567     resultButton.setAttribute('class', 'result_block_hidden');
568     facetSidebar.setAttribute('class', 'facet_sidebar_hidden');
569     facetButton.setAttribute('class', 'results_header_btns result_block_visible');
570     window.location.hash = 'refine_hits';
571 }
572 </script>