2 /* these events should be used by all */
4 window.onunload = windowUnload;
6 attachEvt("common", "init", loadUIObjects);
7 //attachEvt("common", "init", initParams);
8 attachEvt("common", "init", initCookies);
10 attachEvt("common", "unload", _tree_killer);
11 try{ attachEvt("common", "unload", cleanRemoteRequests);} catch(e){}
17 if( getLocation() == null && getOrigLocation() != null )
18 LOCATION = getOrigLocation();
20 if( getLocation() == null && getOrigLocation() == null )
21 LOCATION = globalOrgTree.id();
23 /* if they click on the home page and the origlocation is set
24 take the opac back to the origlocation */
25 if( findCurrentPage() == HOME && getOrigLocation() != null )
26 LOCATION = getOrigLocation();
28 if(getDepth() == null) DEPTH = findOrgDepth(getLocation());
31 runEvt('common','init');
35 if( cgi.param(PARAM_LOCATION) == null ) {
36 var org = G.user.prefs[PREF_DEF_LOCATION];
37 var depth = G.user.prefs[PREF_DEF_DEPTH];
39 if(org == null) org = G.user.ws_ou();
40 if(depth == null) depth = findOrgDepth(org);
47 // show_login trumps normal page running
48 if(location.href.match(/&show_login=1/)) {
50 var src = location.href.replace(/&show_login=1/, '');
51 // forceLoginSSL setting (indicated by show_login)
52 // assumes we are not SSL on normal pages
53 src = src.replace(/https:/, 'http:');
56 attachEvt("common", "loginCanceled", reload);
59 runEvt("common", "run");
63 var loc = findOrgLasso(getLasso());
64 if (!loc) loc = findOrgUnit(getLocation());
66 if (getLasso()) G.ui.common.now_searching.appendChild(text('Search group: '));
67 G.ui.common.now_searching.appendChild(text(loc.name()));
70 function windowUnload() { runEvt("common", "unload"); }