Simplify js.
[platal.git] / templates / search / index.tpl
index 99471bd..b8988b3 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -29,8 +29,8 @@
     {include file=search/adv.links.tpl do_title=1 with_soundex=$with_soundex}
     {/if}
   {/if}
-  
-  {include file='core/plset.tpl'}
+
+  {include core=plset.tpl}
 
   {if $search_pages_nb > 1}
   <p>
   {if $search_results_nb eq 1}{literal}
     <script type="text/javascript">
       // popup automatically if only one result
-      var alinks = document.getElementById('content').getElementsByTagName('a');
-      for (i = 0; i < alinks.length; i++) {
-        if (alinks[i].className == 'popup2') {
-          popWin(alinks[i], 840, 600);
-          break;
-        }
-      }
+      $(function() {
+        $('#content a.popup2').click();
+      });
     </script>
   {/literal}{/if}