53efa8955fa21e2ef2b6d2cd627f7e377ae5083e
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / js / staff-global.js
1 // staff-global.js
2
3 function _(s) { return s } // dummy function for gettext
4
5  $(document).ready(function() {
6         $(".focus").focus();
7         $('#toplevelmenu').clickMenu(); 
8         $('#header_search').tabs({
9                 onShow: function() {
10                 $('#header_search').find('div:visible').find('input').eq(0).focus();
11             }   
12         });
13         $(".close").click(function(){
14                 window.close();
15         });
16  });
17  
18
19 // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
20 function verify_patron_images() {
21     for (var i = 0; i < document.images.length; i++) {
22         img = document.images[i];
23         if ((img.src.indexOf('patronimages') >= 0)) {
24                         w = img.width;
25             h = img.height;
26      if ((w == 0) && (h == 0) || ((img.complete != null) && (!img.complete))) {
27                img.src = '/intranet-tmpl/prog/img/patron-blank.png';
28                         }
29         }
30     }
31 }