Bug 4944: Add OpacNoItemTypeImages system preference
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-advsearch.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Branches %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Advanced search</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% BLOCK cssinclude %][% END %]
9 </head>
10 [% INCLUDE 'bodytag.inc' bodyid='advsearch' bodyclass='scrollto' %]
11 [% INCLUDE 'masthead.inc' %]
12 <form action="/cgi-bin/koha/opac-search.pl" method="get">
13     <input type="hidden" name="advsearch" value="1"/>
14     <div class="main">
15         <ul class="breadcrumb">
16             <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
17             <li><a href="#">Advanced search</a></li>
18         </ul>
19
20         <div class="container-fluid">
21             <div class="row-fluid">
22                 <div class="span12">
23                     <!-- BOOLEAN SEARCH OPTIONS -->
24                     <div id="booleansearch" class="maincontent">
25                         <fieldset>
26                             <legend>Search for:</legend>
27                             [% FOREACH search_box IN search_boxes_loop %]
28                                 <p>
29                                     [% IF ( expanded_options ) %]
30                                         [% IF ( search_box.boolean ) %]
31                                             <select name="op">
32                                                 <option value="and" selected="selected">and</option>
33                                                 <option value="or">or</option>
34                                                 <option value="not">not</option>
35                                             </select>
36                                         [% END %]
37                                     [% ELSE %]
38                                         <label for="search-field_[% loop.index | html %]">
39                                             [% IF loop.index == 0 %]
40                                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
41                                             [% ELSE %]
42                                                 and
43                                             [% END %]
44                                         </label>
45                                     [% END %]
46                                     [% IF ( expanded_options ) %][% left_content | html %][% END %]
47                                     <select name="idx" id="search-field_[% loop.index | html %]">
48                                         <option value="kw">Keyword</option>
49                                         [% IF ( expanded_options ) %]
50                                             <option value="kw,phr">&nbsp;&nbsp;&nbsp;&nbsp; Keyword phrase</option>
51                                         [% END %]
52                                         <option value="su,wrdl">Subject</option>
53                                         [% IF ( expanded_options ) %]
54                                             <option value="su,phr">&nbsp;&nbsp;&nbsp;&nbsp; Subject phrase</option>
55                                             <option value="su-br">&nbsp;&nbsp;&nbsp;&nbsp; Subject and broader terms</option>
56                                             <option value="su-na">&nbsp;&nbsp;&nbsp;&nbsp; Subject and narrower terms</option>
57                                             <option value="su-rl">&nbsp;&nbsp;&nbsp;&nbsp; Subject and related terms</option>
58                                         [% END %]
59                                         <option value="ti">Title</option>
60                                         [% IF ( expanded_options ) %]
61                                             <option value="ti,phr">&nbsp;&nbsp;&nbsp;&nbsp; Title phrase</option>
62                                             <option value="se,wrdl">Series title</option>
63                                             [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
64                                                 <option value="callnum,phr">Call number</option>
65                                             [% ELSE %]
66                                                 <option value="callnum">Call number</option>
67                                             [% END %]
68
69                                         [% END %]
70                                         <option value="au,wrdl">Author</option>
71                                         [% IF ( expanded_options ) %]
72                                             <option value="au,phr">&nbsp;&nbsp;&nbsp;&nbsp; Author phrase</option>
73                                             <option value="cpn,wrdl">&nbsp;&nbsp;&nbsp;&nbsp; Corporate name</option>
74                                             <option value="cfn,wrdl">&nbsp;&nbsp;&nbsp;&nbsp; Conference name</option>
75                                             <option value="cfn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Conference name phrase</option>
76                                             <option value="pn,wrdl">&nbsp;&nbsp;&nbsp;&nbsp; Personal name</option>
77                                             <option value="pn,phr">&nbsp;&nbsp;&nbsp;&nbsp; Personal name phrase</option>
78                                         [% END %]
79                                         [% IF ( expanded_options ) %]
80                                             <option value="nt">Notes/Comments</option>
81                                             [% IF (marcflavour != 'UNIMARC') %]
82                                                 <option value="curriculum">Curriculum</option>
83                                             [% END %]
84                                         [% END %]
85                                         <option value="pb,wrdl">Publisher</option>
86                                         <option value="pl,wrdl">Publisher location</option>
87                                         [% IF ( expanded_options ) %]
88                                             [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
89                                                 <option value="ident,phr">Standard number</option>
90                                             [% ELSE %]
91                                                 <option value="ident">Standard number</option>
92                                             [% END %]
93                                             <option value="nb">&nbsp;&nbsp;&nbsp;&nbsp; ISBN</option>
94                                             <option value="ns">&nbsp;&nbsp;&nbsp;&nbsp; ISSN</option>
95                                         [% ELSE %]
96                                             <option value="nb">ISBN</option>
97                                         [% END %]
98                                         <option value="bc">Barcode</option>
99                                     </select>
100                                     <input type="text" size="30" name="q" title="Enter search terms" value="" />
101                                     [% IF ( expanded_options ) %]
102                                         [% IF ( !loop.first ) %]
103                                             <a class="ButtonPlus" name="ButtonPlus" title="Add another field" href="#">[+]</a>
104                                             <a class="ButtonLess" title="Remove field" href="#">[-]</a>
105                                         [% END %]
106                                     [% END %]
107                                 </p>
108                             [% END # FOREACH search_box %]
109                         </fieldset>
110                     </div> <!-- /BOOLEAN SEARCH OPTIONS -->
111                 </div> <!-- / .span12 -->
112             </div> <!-- / .row-fluid -->
113                     <div class="text-center">
114                         <!-- SEARCH BUTTONS -->
115                         [% PROCESS searchbuttons %]
116                         <!-- /SEARCH BUTTONS -->
117                     </div>
118
119             <div class="row-fluid">
120               [%# Following on one line for translatability %]
121               [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %]
122                 <div class="span12">
123                     <div id="advsearches" class="toptabs">
124                         <ul>
125                             [% FOREACH advsearchloo IN advancedsearchesloop %]
126                                 <li id="advsearch-tab-[% advsearchloo.advanced_search_type | html %]">
127                                 <a href="#advsearch-[% advsearchloo.advanced_search_type | uri %]">
128                                [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
129                                [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
130                                [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
131                                [% ELSE %]Something else
132                                [% END %]
133                                </a></li>
134                             [% END %]
135                         </ul>
136
137                         [% FOREACH advsearchloo IN advancedsearchesloop %]
138                             <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" class="advsearch">
139                                 <fieldset>
140                                     <legend>Limit to any of the following:</legend>
141                                     <div class="row-fluid">
142                                         [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
143                                             [% IF (advsearchloo.advanced_search_type != 'itemtypes') OR (((!itemtypeloo.searchcategory) AND (itemtypeloo.cat == 0)) OR (itemtypeloo.cat == 1)) %]
144                                                 <div class="span3">
145                                                     <input type="checkbox"
146                                                         id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"
147                                                         name="[% IF ( itemtypeloo.cat == 1 ) %]searchcat[% ELSE %]limit[% END %]"
148                                                         value="[% IF ( itemtypeloo.cat == 1 ) %][% itemtypeloo.code | html %][% ELSE %]mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %][% END %]"
149                                                     />
150                                                     <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">
151                                                         [% UNLESS ( Koha.Preference('OpacNoItemTypeImages')) %]
152                                                             [% IF ( itemtypeloo.imageurl ) %]
153                                                                 <img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />
154                                                             [% END %]
155                                                             &nbsp;
156                                                         [% END %]
157                                                         [% itemtypeloo.description | html %]
158                                                     </label>
159                                                 </div>
160                                             [% IF ( loop.last ) %]</div>[% ELSE %][% UNLESS ( loop.count % 4 ) %]</div><div class="row-fluid">[% END %][% END %]
161                                             [% END %]
162                                         [% END %]
163                                 </fieldset>
164                             </div> <!-- / #advsearch-[% advsearchloo.advanced_search_type | html %] -->
165                         [% END # / FOREACH advancedsearchesloop %]
166                     </div> <!-- / #advsearches -->
167                 </div> <!-- / .span12 -->
168               [% END %]
169
170                 <div class="row-fluid">
171                   [%# Following on one line for translatability %]
172                   [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
173                     <div class="span3">
174                         <div id="pubrange">
175                             <!-- PUB RANGE OPTION -->
176                             <fieldset>
177                                 <legend>Publication date range</legend>
178                                 <label for="limit-yr">Date range:</label>
179                                 <input type="text" size="30" id="limit-yr" name="limit-yr" title="Enter search terms" value="" />
180                                 <p>For example:  1999-2001.  You could also use "-1987" for everything published in and before 1987 or "2008-" for everything published in 2008 and after.</p>
181                             </fieldset>
182                             <!-- /PUB RANGE OPTION -->
183                         </div>
184                     </div>
185                   [% END %]
186
187                   [%# Following on one line for translatability %]
188                   [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
189                     <div class="span3">
190                         <div id="langfilter">
191                             <fieldset>
192                                 <legend>Language</legend>
193                                 <!-- LANGUAGE LIMIT -->
194                                 <p>
195                                     <label for="language-limit">Language: </label>
196                                     <select id="language-limit" name="limit">
197                                         <option value="">No limit</option>
198                                             [% FOREACH search_languages_loo IN search_languages_loop %]
199                                                 [% IF ( search_languages_loo.selected ) %]
200                                                     <option value="ln,rtrn:[% search_languages_loo.iso639_2_code | html %]" selected="selected">[% search_languages_loo.language_description | html %]</option>
201                                                 [% ELSE %]
202                                                     <option value="ln,rtrn:[% search_languages_loo.iso639_2_code | html %]">[% search_languages_loo.language_description | html %]</option>
203                                                 [% END %]
204                                             [% END %]
205                                     </select>
206                                 </p>
207                                 <!-- /LANGUAGE LIMIT -->
208                             </fieldset>
209                         </div> <!-- / #langfilter -->
210                     </div> <!-- / .span3 -->
211                   [% END %]
212
213                   [%# Following on one line for translatability %]
214                   [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %]
215                     [% IF ( singleBranchMode ) %]
216                         <div class="span3">
217                             <!-- AVAILABILITY LIMITS -->
218                             <div id="location">
219                                 <fieldset>
220                                     <legend>Availability: </legend>
221                                     <div style="margin-top:.4em">
222                                         <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
223                                     </div>
224                                 </fieldset>
225                             </div> <!-- / #location -->
226                             <!-- /AVAILABILITY LIMITS -->
227                         </div> <!-- / .span3 -->
228                     [% ELSE %]
229                         <div class="span3">
230                             <!-- AVAILABILITY LIMITS -->
231                             <div id="location">
232                                 <fieldset>
233                                     <legend>Location and availability: </legend>
234                                     <label for="branchloop">Library:</label>
235                                     <select name="limit" id="branchloop">
236                                     <option value="">All libraries</option>
237                                     [% FOREACH BranchesLoo IN Branches.all( selected => opac_name ) %]
238                                         [% IF BranchesLoo.selected %]
239                                             <option value="branch:[% BranchesLoo.branchcode | html %]" selected="selected">[% BranchesLoo.branchname | html %]</option>
240                                         [% ELSE %]
241                                             <option value="branch:[% BranchesLoo.branchcode | html %]">[% BranchesLoo.branchname | html %]</option>
242                                         [% END %]
243                                     [% END %]
244                                     </select>
245                                     [% IF search_groups %]
246                                         <p>OR</p>
247                                         <label for="categoryloop">Groups of libraries</label>
248                                         <select name="multibranchlimit" id="categoryloop">
249                                             <option value=""> -- none -- </option>
250                                             [% FOREACH sg IN search_groups %]
251                                                 <option value="[% sg.id | html %]">[% sg.title | html %]</option>
252                                             [% END %]
253                                         </select>
254                                     [% END %]
255                                     <div style="margin-top:.4em">
256                                         <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
257                                     </div>
258                                 </fieldset>
259                             </div> <!-- / #location -->
260                             <!-- /AVAILABILITY LIMITS -->
261                         </div> <!-- / .span3 -->
262                     [% END # / IF singleBranchMode %]
263                   [% END %]
264
265                   [%# Following on one line for translatability %]
266                   [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
267                     <div class="span3">
268                     <!-- RANK LIMITS -->
269                         <div id="sortby">
270                             <fieldset>
271                                 <legend>Sorting: </legend>
272                                 <label for="sort_by">Sort by:</label>
273                                 <select id="sort_by" name="sort_by">
274                                     [% INCLUDE 'resort_form.inc' %]
275                                 </select>
276                             </fieldset>
277                         </div>
278                     <!-- RANK LIMITS -->
279                     </div> <!-- / .span3 -->
280                   [% END %]
281                 </div> <!-- / .row-fluid -->
282
283                 [%# Following on one line for translatability %]
284                 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
285                     <div class="row-fluid">
286                         [% IF ( usmarc ) %]
287                             <!-- SUBTYPE LIMITS -->
288                                 <div id="subtypes">
289                                     <div class="span3">
290                                         <fieldset>
291                                             <legend>Audience</legend>
292                                             <select id="subtype_audience" name="limit" class="subtype">
293                                             <option value="" selected="selected" class="menuheader">Any audience</option>
294                                                 <option value="aud:a">Preschool</option>
295                                                 <option value="aud:b">Primary</option>
296                                                 <option value="aud:c">Pre-adolescent</option>
297                                                 <option value="aud:d">Adolescent</option>
298                                                 <option value="aud:e">Adult</option>
299                                                 <option value="aud:f">Specialized</option>
300                                                 <option value="aud:g">General</option>
301                                                 <option value="aud:j">Juvenile</option>
302                                             </select>
303                                         </fieldset>
304                                     </div> <!-- / .span3 -->
305
306                                     <div class="span3">
307                                         <fieldset>
308                                             <legend>Content</legend>
309                                             <select id="subtype_content"  name="limit" class="subtype">
310                                                 <option value="" selected="selected" class="menuheader">Any content</option>
311                                                 <option value="fic:1">Fiction</option>
312                                                 <option value="fic:0">Non-fiction</option>
313                                                 <option value="bio:b">Biography</option>
314                                                 <option value="mus:j">Musical recording</option>
315                                                 <option value="mus:i">Non-musical recording</option>
316                                             </select>
317                                         </fieldset>
318                                     </div>
319
320                                     <div class="span3">
321                                         <fieldset>
322                                             <legend>Format</legend>
323                                             <select id="subtype_format" name="limit" class="subtype">
324                                                 <option value="" selected="selected" class="menuheader">Any format</option>
325                                                 <option value="l-format:ta">Regular print</option>
326                                                 <option value="l-format:tb">Large print</option>
327                                                 <option value="l-format:tc or l-format:fb">Braille</option>
328                                                 <option value="">-----------</option>
329                                                 <option value="l-format:sd">CD audio</option>
330                                                 <option value="l-format:ss">Cassette recording</option>
331                                                 <option value="l-format:vf">VHS tape / Videocassette</option>
332                                                 <option value="l-format:vd">DVD video / Videodisc</option>
333                                                 <option value="l-format:co">CD software</option>
334                                                 <option value="l-format:cr">Website</option>
335                                             </select>
336                                         </fieldset>
337                                     </div> <!-- / .span3 -->
338
339                                     <div class="span3">
340                                         <fieldset>
341                                             <legend>Additional content types for books/printed materials</legend>
342                                             <select id="subtype_additional" name="limit" class="subtype">
343                                                 <option value="">Any</option>
344                                                 <option value="ctype:a">Abstracts/summaries</option>
345                                                 <option value="ctype:b">Bibliographies</option>
346                                                 <option value="ctype:c">Catalogs</option>
347                                                 <option value="ctype:d">Dictionaries</option>
348                                                 <option value="ctype:e">Encyclopedias </option>
349                                                 <option value="ctype:f">Handbooks</option>
350                                                 <option value="ctype:g">Legal articles</option>
351                                                 <option value="ctype:i">Indexes</option>
352                                                 <option value="ctype:j">Patent document</option>
353                                                 <option value="ctype:k">Discographies</option>
354                                                 <option value="ctype:l">Legislation</option>
355                                                 <option value="ctype:m">Theses</option>
356                                                 <option value="ctype:n">Surveys</option>
357                                                 <option value="ctype:o">Reviews</option>
358                                                 <option value="ctype:p">Programmed texts</option>
359                                                 <option value="ctype:q">Filmographies</option>
360                                                 <option value="ctype:r">Directories</option>
361                                                 <option value="ctype:s">Statistics</option>
362                                                 <option value="ctype:t">Technical reports</option>
363                                                 <option value="ctype:v">Legal cases and case notes</option>
364                                                 <option value="ctype:w">Law reports and digests</option>
365                                                 <option value="ctype:z">Treaties </option>
366                                             </select>
367                                         </fieldset>
368                                     </div> <!-- / .span3 -->
369                                 </div> <!-- / #subtypes -->
370                             <!-- SUBTYPE LIMITS -->
371                         [% END # / IF usmarc %]
372
373                             [% IF ( UNIMARC ) %]
374                                 <div id="subtypes_unimarc">
375                                     <!-- SUBTYPE LIMITS -->
376                                     [% INCLUDE 'subtypes_unimarc.inc' %]
377                                 </div>
378                             [% END %]
379
380                     </div> <!-- / .row-fluid -->
381                 [% END # / IF expanded_options %]
382             </div> <!-- / .row-fluid -->
383
384             [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or
385                   ( OpacAdvSearchOptions     and OpacAdvSearchOptions.size > 0     and not expanded_options ) %]
386                 <div class="row-fluid">
387                     <div class="span12">
388                         <div class="text-center">
389                             <!-- SEARCH BUTTONS -->
390                             [% PROCESS searchbuttons %]
391                             <!-- /SEARCH BUTTONS -->
392                         </div>
393                     </div> <!-- / .span12 -->
394                 </div> <!-- / .row-fluid -->
395             [% END %]
396         </div> <!-- / .container-fluid -->
397    </div> <!-- / .main -->
398 </form>
399
400 [% INCLUDE 'opac-bottom.inc' %]
401 [% BLOCK searchbuttons %]
402     <p>
403         <input class="btn btn-success" type="submit" accesskey="s" name="do" title="Search" value="Search" />
404
405         [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 ) %]
406             [% IF expanded_options %]
407                 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=0" class="btn btn-default more-less-options">Fewer options</a>
408             [% ELSIF not expanded_options %]
409                 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=1" class="btn btn-default more-less-options">More options</a>
410             [% END %]
411         [% END %]
412
413         <a href="/cgi-bin/koha/opac-search.pl?do=Clear" class="btn btn-default new-search">New search</a>
414     </p>
415 [% END %]
416
417 [% BLOCK jsinclude %]
418 [% Asset.js("lib/jquery/plugins/jquery.deserialize.min.js") | $raw %]
419 [% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
420 <script>//<![CDATA[
421 $(document).ready(function() {
422     $('#advsearches').tabs();
423     jQuery.cookie.json = true;
424     //$('#advsearches > ul').tabs();
425
426     [% IF ( ReturnToSearch ) %]
427         if (form_serialized = jQuery.cookie("form_serialized")) {
428             $('#advsearch form').deserialize(form_serialized);
429         }
430         if (form_serialized_limits = jQuery.cookie("form_serialized_limits")) {
431             $('#language-limit')     .val(form_serialized_limits[0]);
432             $('#branchloop')         .val(form_serialized_limits[1]);
433             $('#subtype_audience')   .val(form_serialized_limits[2]);
434             $('#subtype_content')    .val(form_serialized_limits[3]);
435             $('#subtype_format')     .val(form_serialized_limits[4]);
436             $('#subtype_additional') .val(form_serialized_limits[5]);
437             $('#locloop')            .val(form_serialized_limits[6]);
438         }
439     [% ELSE %]
440         //Clear all form cookies
441         jQuery.removeCookie("form_serialized", { path: '/'});
442         jQuery.removeCookie("form_serialized_limits", { path: '/'});
443         jQuery.removeCookie("num_paragraph", { path: '/'});
444         jQuery.removeCookie("search_path_code", { path: '/'});
445     [% END %]
446     $('#advsearch form').submit(function() {
447         form_serialized = $(this).serialize();
448         jQuery.cookie("form_serialized", form_serialized,{ path: '/'});
449         form_serialized_limits = [
450             $('#language-limit').val(),   $('#branchloop').val(),
451             $('#subtype_audience').val(), $('#subtype_content').val(),
452             $('#subtype_format').val(),   $('#subtype_additional').val(),
453             $('#locloop').val()
454         ];
455         jQuery.cookie("form_serialized_limits", form_serialized_limits,{ path: '/'});
456         [% IF ( expanded_options ) %]
457         var numPar = $("#booleansearch fieldset p").size();
458         if (numPar > [% search_boxes_count | html %]){
459             jQuery.cookie("num_paragraph", numPar,{ path: '/'});
460         }else{
461             jQuery.removeCookie("num_paragraph", { path: '/'});
462         }
463         jQuery.cookie("search_path_code", 'exs',{ path: '/'});
464         [% ELSE %]
465         jQuery.cookie("search_path_code", 'ads',{ path: '/'});
466         jQuery.removeCookie("num_paragraph", { path: '/'});
467         [% END %]
468     });
469
470 });
471     /* This function allows to display a new field to search.
472     */
473     $(document).on("click", '.ButtonPlus', function(e) {
474         e.preventDefault();
475         $('.ButtonLess').show();
476         var thisLine = $(this).parent();
477         var newLine = thisLine.clone();
478         newLine.find('input').val('');
479         thisLine.after(newLine);
480     });
481
482     $(document).on("click", '.ButtonLess', function(e) {
483         e.preventDefault();
484         if($(this).parent().siblings().length <= 3 ) {
485            $('.ButtonLess').hide();
486         }
487         $(this).parent().remove();
488     });
489     //]]>
490 </script>
491 [% END %]