Patron image javascript check is no longer necessary now that alternate patron image...
[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         $('#header_search').tabs({
8                 onShow: function() {
9                 $('#header_search').find('div.residentsearch').not('.tabs-hide').find('input').eq(0).focus();
10             }   
11         });
12         $(".close").click(function(){
13                 window.close();
14         });
15  });
16  
17
18             YAHOO.util.Event.onContentReady("header", function () {
19                                 var oMoremenu = new YAHOO.widget.Menu("moremenu", { zindex: 2 });
20
21                                 function positionoMoremenu() {
22                                         oMoremenu.align("tl", "bl");
23                                 }
24
25                 oMoremenu.subscribe("beforeShow", function () {
26                     if (this.getRoot() == this) {
27                                                 positionoMoremenu();
28                     }
29                 });
30
31                                 oMoremenu.render();
32
33                 oMoremenu.cfg.setProperty("context", ["showmore", "tl", "bl"]);
34
35                                 function onShowMoreClick(p_oEvent) {
36                     // Position and display the menu        
37                     positionoMoremenu();
38                     oMoremenu.show();
39                     // Stop propagation and prevent the default "click" behavior
40                     YAHOO.util.Event.stopEvent(p_oEvent);       
41                                 }
42
43                                 YAHOO.util.Event.addListener("showmore", "click", onShowMoreClick);
44
45                 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMoremenu);
46             });
47
48 YAHOO.util.Event.onContentReady("changelanguage", function () {
49                 var oMenu = new YAHOO.widget.Menu("sublangs", { zindex: 2 });
50
51                     function positionoMenu() {
52                     oMenu.align("bl", "tl");
53                 }
54
55                 oMenu.subscribe("beforeShow", function () {
56                     if (this.getRoot() == this) {
57                                                 positionoMenu();
58                     }
59                 });
60
61                 oMenu.render();
62
63                                 oMenu.cfg.setProperty("context", ["showlang", "bl", "tl"]);
64
65                                 function onYahooClick(p_oEvent) {
66                     // Position and display the menu        
67                     positionoMenu();
68                     oMenu.show();
69                     // Stop propagation and prevent the default "click" behavior
70                     YAHOO.util.Event.stopEvent(p_oEvent);
71                 }
72
73                                 YAHOO.util.Event.addListener("showlang", "click", onYahooClick);
74
75                                 YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu);
76             });