]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/opac/common/js/init.js
typo
[Evergreen.git] / Open-ILS / web / opac / common / js / init.js
1
2 /* these events should be used by all */
3
4 window.onunload = windowUnload;
5
6 attachEvt("common", "init", loadUIObjects);
7 attachEvt("common", "init", initParams);
8 attachEvt("common", "init", initCookies);
9
10 attachEvt("common", "unload", _tree_killer);
11 try{ attachEvt("common", "unload", cleanRemoteRequests);} catch(e){}
12
13 function init() {
14
15         runEvt('common','init');
16         if( getOrigLocation() == 0 ) ORIGLOC = LOCATION;
17
18         var cgi = new CGI();
19         if( grabUser() ) {
20                 if( cgi.param(PARAM_LOCATION) == null ) {
21                         var org = G.user.prefs[PREF_DEF_LOCATION];
22                         var depth = G.user.prefs[PREF_DEF_DEPTH];
23
24                         if(!org) org = G.user.ws_ou();
25                         if(!depth) depth = findOrgDepth(org);
26
27                         LOCATION = org;
28                         DEPTH = DEPTH;
29                 }
30         }
31
32         runEvt("common", "run");
33         //checkUserSkin();
34         G.ui.common.now_searching.appendChild(text(findOrgUnit(getLocation()).name()));
35 }
36
37 function windowUnload() { runEvt("common", "unload"); }