condensed more JS into 1 shared file
authorBill Erickson <erickson@esilibrary.com>
Thu, 16 Dec 2010 17:29:51 +0000 (12:29 -0500)
committerBill Erickson <erickson@esilibrary.com>
Thu, 16 Dec 2010 17:29:51 +0000 (12:29 -0500)
Open-ILS/web/opac/skin/kcls/xml/common/js_common.xml
Open-ILS/web/opac/skin/kcls/xml/common/js_common_postbody.xml
Open-ILS/web/opac/skin/kcls/xml/common/js_shared.xml [new file with mode: 0644]

index 2d69634..8f343cd 100644 (file)
@@ -8,102 +8,6 @@
         isDebug: false
     };
     var lang, bidi;
-
-    <!--#if expr="$OILS_PAGE='index.xml'"-->
-    isFrontPage = true;
-    <!--#endif-->
-
-    function config_setup() {
-        config.ids.searchbar = {};
-        config.css.searchbar = {};
-        config.ids.searchbar.text                = 'search_box';
-        config.ids.searchbar.facets                = 'facet_box';
-        config.ids.searchbar.submit            = 'search_submit';
-        config.ids.searchbar.type_selector    = 'search_type_selector';
-        config.ids.searchbar.depth_selector    = 'depth_selector';
-        config.ids.searchbar.form_selector    = 'form_selector';
-        config.ids.searchbar.extra_row        = 'searchbar_extra';
-        config.ids.searchbar.main_row            = 'searchbar_main_row';
-        config.ids.searchbar.table                = 'searchbar_table';
-        config.ids.searchbar.location_tag    = 'search_location_tag_link';
-        config.ids.searchbar.lib_sel_span    = 'lib_selector_span';
-        config.ids.searchbar.lib_sel_link    = 'lib_selector_link';
-        config.ids.searchbar.depth_sel_span    = 'depth_selector_span';
-        config.ids.common.top_logo = "top_left_logo";
-        config.ids.sidebar = {};
-        config.css.sidebar = {};
-        config.names.sidebar = {};
-        config.css.sidebar.item = {};
-        config.ids.sidebar.home                = 'home_link_div';
-        config.ids.sidebar.advanced        = 'advanced_link_div';
-        config.ids.sidebar.myopac            = 'myopac_link_div';
-        config.ids.sidebar.prefs            = 'prefs_link_div';
-        config.ids.sidebar.mresult            = 'mresult_link_div';
-        config.ids.sidebar.rresult            = 'result_link_div';
-        config.ids.sidebar.rdetail            = "rdetail_link_div";
-        config.ids.sidebar.login            = 'login_link';
-        config.ids.sidebar.logout            = 'logout_link';
-        config.ids.sidebar.logoutbox        = 'logout_link_div';
-        config.ids.sidebar.loginbox        = 'login_link_div';
-        config.ids.sidebar.logged_in_as    = 'logged_in_as_div';
-        config.ids.sidebar.username_dest    = 'username_dest';
-
-        config.ids.sidebar.home_link        = 'home_link'
-        config.ids.sidebar.advanced_link    = 'advanced_link'
-        config.ids.sidebar.myopac_link    = 'myopac_link'
-
-        config.css.encircled                = 'encircled';
-
-        config.ids.login = {};
-        config.css.login = {};
-        config.ids.login.form            = "login_form";
-        config.ids.login.box            = "login_box";
-        config.ids.login.tbody            = "login_tbody";
-        config.ids.login.username    = "login_username";
-        config.ids.login.password    = "login_password";
-        config.ids.login.button        = "login_button";
-        config.ids.login.cancel        = "login_cancel_button";
-        config.ids.altcanvas.login            = config.ids.login.box;
-
-        config.ids.altcanvas.myopac_reload = 'myopac_reloading';
-        config.ids.myopac = {};
-        config.css.myopac = {};
-        config.names.myopac = {};
-
-        config.ids.altcanvas.org_tree       = config.ids.common.org_container;
-        config.ids.altcanvas.holds          = 'holds_box';
-        config.ids.altcanvas.check_holds    = 'check_holds_box';
-        config.ids.altcanvas.xulholds       = 'xulholds_box';
-        config.ids.altcanvas.loading        = 'loading_alt';
-
-        <!--#if expr="$OILS_PAGE='rdetail.xml'"-->
-        config.ids.rdetail              = {};
-        config.ids.rdetail.view_marc    = "rdetail_view_marc";
-        config.ids.rdetail.details_body = 'rdetail_details_body';
-        config.ids.rdetail.title        = 'rdetail_title';
-        config.ids.rdetail.author       = 'rdetail_author';
-        config.ids.rdetail.isbn         = 'rdetail_isbn';
-        config.ids.rdetail.edition      = 'rdetail_edition';
-        config.ids.rdetail.pubdate      = 'rdetail_pubdate';
-        config.ids.rdetail.publisher    = 'rdetail_publisher';
-        config.ids.rdetail.tor          = 'rdetail_tor';
-        config.ids.rdetail.abstr        = 'rdetail_abstract';
-        config.ids.rdetail.image        = 'rdetail_image';
-        config.ids.rdetail.tor_pic      = 'rdetail_tor_pic';
-
-        config.ids.rdetail.cp_status        = "rdetail_copy_info_status";
-        config.ids.rdetail.cp_info_row      = "rdetail_copy_info_row";
-        config.ids.rdetail.cp_info_loading  = "rdetail_copy_info_loading";
-        config.ids.rdetail.cp_info_local    = "copy_info_local_link";
-        config.ids.rdetail.cp_info_all      = "copy_info_all_link";
-        config.ids.rdetail.cp_info_none     = "rdetail_copy_info_none";
-        config.names.rdetail.lib_cell       = "rdetail_library_cell";
-        config.names.rdetail.cn_cell        = "rdetail_callnumber_cell";
-        config.names.rdetail.cp_count_cell  = "rdetail_copy_count_cell";
-        config.names.rdetail.cp_status      = 'rdetail_status_cell';
-
-        <!--#endif-->
-    }
 ]]></script>
 
 <script type='text/javascript' src='/js/dojo/dojo/dojo.js'></script>
 
 <!-- global js -->
 <script language='javascript' type='text/javascript'><![CDATA[
-    config_setup();
-    var cookieManager = new HTTP.Cookies(); 
-
-    /*  -----------------------------------------------------------------------
-        KCLS suppressed orgs 
-        ----------------------------------------------------------------------- */
-    var localSuppressedOrgs = {1500:true, 1501:true, 1558:true};  /* change to suit */
-    for (var i in orgArraySearcher) {
-        var org = orgArraySearcher[i];
-        if(localSuppressedOrgs[i]) {
-            org.opac_visible('f');
-        }
-    }
-    /* ----------------------------------------------------------------------- */
-
-    <!-- set up some global JS config variables, read from the Apache config -->
-    var OILS_OPAC_IMAGES_HOST = null;
-    <!--#if expr="$OILS_OPAC_IMAGES_HOST"-->
-        OILS_OPAC_IMAGES_HOST = '<!--#echo var="OILS_OPAC_IMAGES_HOST"-->extras/ac/jacket/';
-    <!--#endif -->
-    var OILS_OPAC_STATIC_PROTOCOL = null;
-    <!--#if expr="$OILS_OPAC_STATIC_PROTOCOL"-->
-        OILS_OPAC_STATIC_PROTOCOL = '<!--#echo var="OILS_OPAC_STATIC_PROTOCOL"-->';
-    <!--#endif -->
-    <!-- builds the "Now searching: <org_unit>" text on the home page -->
-
-    var chilifresh = '<!--#echo var="OILS_CHILIFRESH_ACCOUNT"-->';
-    if (chilifresh == '(none)') { chilifresh = false; }
-    var novelist = '<!--#echo var="OILS_NOVELIST_URL"-->';
-    if (novelist == '(none)') { novelist = false; }
-
-    <!--#if expr="$OILS_OPAC_FORCE_LOGIN_SSL"-->
-        forceLoginSSL = true;
-    <!--#endif -->
-
-
-
-    /* I'm not sure how to test for the situation where this block is
-       needed, but this won't hurt. */
-    try {
-        if ($('holds_frozen_chkbox').checked)
-            unHideMe($("hold_frozen_thaw_row"));
-    } catch (E) {
-        void(0);
-    }
-
+    <!--#include virtual="js_shared.xml"-->
     dojo.addOnLoad(init);
-    dojo.require('dojo.cookie');
-    dojo.require("dijit._Calendar");
-    dojo.require("dijit.form.DateTextBox");
-    dojo.require("dijit.form.FilteringSelect");
-    dojo.require("dojo.date.locale");
-    dojo.require("dojo.date.stamp");
-    dojo.require("dojo.parser");
-    dojo.require("openils.widget.FacetSidebar"); // pulls in Searcher and I18N
-    dojo.require("dijit.form.CheckBox");
-    dojo.require("openils.widget.ProgressDialog");
     dojo.addOnLoad(opac_init)
-
-    try { 
-        document.getElementById('toptable').style.display = 'table'; 
-    } catch(e) {
-        try {
-            document.getElementById('toptable').style.display = ''; 
-        } catch(ee) {}
-    }
-
-    attachEvt("common", "unload", function(){
-        if(typeof(G)!="undefined") destroyObj(G);
-        if(typeof(HTTP)!="undefined") destroyObj(HTTP);
-        if(typeof(_c)!="undefined") destroyObj(_c);
-        if(typeof(_l)!="undefined") destroyObj(_l);
-        if(typeof(config)!="undefined") destroyObj(config);
-        if(typeof(facet_list)!="undefined") destroyObj(facet_list);
-        if(typeof(globalOrgTree)!="undefined") destroyObj(globalOrgTree);
-        if(typeof(globalOrgTypes)!="undefined") destroyObj(globalOrgTypes);
-        if(typeof(google)!="undefined") destroyObj(google);
-        if(typeof(orgArraySearcher)!="undefined") destroyObj(orgArraySearcher);
-        if(typeof(recordsCache)!="undefined") destroyObj(recordsCache);
-        if(typeof(search_list)!="undefined") destroyObj(search_list);
-        if(typeof(subjectCache)!="undefined") destroyObj(subjectCache);
-        if(typeof(xrefCacheIndex)!="undefined") destroyObj(xrefCacheIndex);
-        if(typeof(x)!="undefined") destroyObj(x);
-        if(typeof(string)!="undefined") string = "";
-        //removeChildren(document);
-        //alert(errCounter+'\n'+errCounter2);
-    });
-
-    /* google analytics */
-    var _gaq = _gaq || [];
-    _gaq.push(['_setAccount', 'UA-3018520-10']);
-    _gaq.push(['_trackPageview']);
-
-    (function() {
-        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-    })();
-
 ]]> </script>
+
 <!--#endif--> <!-- != Firefox/Xulrunner -->
index d851669..074a048 100644 (file)
@@ -2,50 +2,16 @@
     dojo.require('openils.Util');
 
     // set up some global JS config variables, read from the Apache config
-    var OILS_OPAC_IMAGES_HOST = null;
-    <!--#if expr="$OILS_OPAC_IMAGES_HOST"-->
-        OILS_OPAC_IMAGES_HOST = '<!--#echo var="OILS_OPAC_IMAGES_HOST"-->extras/ac/jacket/';
-    <!--#endif -->
-    var OILS_OPAC_STATIC_PROTOCOL = null;
-    <!--#if expr="$OILS_OPAC_STATIC_PROTOCOL"-->
-        OILS_OPAC_STATIC_PROTOCOL = '<!--#echo var="OILS_OPAC_STATIC_PROTOCOL"-->';
-    <!--#endif -->
-
-    var chilifresh = '<!--#echo var="OILS_CHILIFRESH_ACCOUNT"-->';
-    if (chilifresh == '(none)') { chilifresh = false; }
-    var novelist = '<!--#echo var="OILS_NOVELIST_URL"-->';
-    if (novelist == '(none)') { novelist = false; }
-
-    openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/Cookies.js');
-    var cookieManager = new HTTP.Cookies();  
 
     openils.Util.requireLegacy('/js/dojo/dojo/openils_dojo.js');
     openils.Util.requireLegacy('/js/dojo/fieldmapper/AutoIDL.js');
-
-    dojo.require("dijit._Calendar");
-    dojo.require("dijit.form.DateTextBox");
-    dojo.require("dijit.form.FilteringSelect");
-    dojo.require("dojo.date.locale");
-    dojo.require("dojo.date.stamp");
-    dojo.require("dojo.parser");
-    dojo.require("dojo.cookie");
-    dojo.require("dijit.form.CheckBox");
-    dojo.require("openils.widget.ProgressDialog");
-    dojo.require("openils.widget.FacetSidebar"); // pulls in Searcher and I18N
-
-
     openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/<!--#echo var="locale"-->/OrgTree.js');
     openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/<!--#echo var="locale"-->/FacetDefs.js');
 
     <!--#if expr="$OILS_OPAC_COMBINED_JS"-->
     openils.Util.requireLegacy('<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/kcls/js/combined.js')
     <!--#else -->
-    /*
-        When combined JS is enabled in the Apache config, the block
-        below defines which files are added to the final combined JS file.
-        Currently, only files in $OPAC/common/js/ are eligible for automatic combination.
-    */
-    /* START COMPRESSION */
+    /* See js_common.xml for which files are actually combined/compressed by autogen */
     openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/OrgLasso.js');
     openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/utils.js');
     openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/config.js');
     openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/init.js');
     openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/added_content.js');
     openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/DP_DateExtensions.js');
-    /* END COMPRESSION */
+    openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/Cookies.js');
     <!--#endif -->
 
-    config_setup(); /* defined in js_common.xml */
-
-    /*  -----------------------------------------------------------------------
-        KCLS suppressed orgs 
-        ----------------------------------------------------------------------- */
-    var localSuppressedOrgs = {1500:true, 1501:true, 1558:true};  /* change to suit */
-    for (var i in orgArraySearcher) {
-        var org = orgArraySearcher[i];
-        if(localSuppressedOrgs[i]) {
-            org.opac_visible('f');
-        }
-    }
-    /* ----------------------------------------------------------------------- */ 
+    <!--#include virtual="js_shared.xml"-->
 
     function skin_init() {
         openils.Util.requireLegacy('/opac/skin/kcls/js/depth_selector.js');
 
         <!--#endif--> /* if rdetail.xml */
 
-
         <!--#if expr="$OILS_PAGE='myopac.xml'"-->
         openils.Util.requireLegacy('<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/kcls/js/myopac.js');
         openils.Util.requireLegacy('<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/kcls/js/container.js');
         openils.Util.requireLegacy('<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/kcls/js/adv_global.js');
         openils.Util.requireLegacy('<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/kcls/js/sidebar.js');
         <!--#endif-->
-
-        /* I'm not sure how to test for the situation where this block is
-           needed, but this won't hurt. */
-        try {
-            if ($('holds_frozen_chkbox').checked)
-                unHideMe($("hold_frozen_thaw_row"));
-        } catch (E) {
-            void(0);
-        }
-
-        try { 
-            document.getElementById('toptable').style.display = 'table'; 
-        } catch(e) {
-            try {
-                document.getElementById('toptable').style.display = ''; 
-            } catch(ee) {}
-        }
-
-        attachEvt("common", "unload", function(){
-            if(typeof(G)!="undefined") destroyObj(G);
-            if(typeof(HTTP)!="undefined") destroyObj(HTTP);
-            if(typeof(_c)!="undefined") destroyObj(_c);
-            if(typeof(_l)!="undefined") destroyObj(_l);
-            if(typeof(config)!="undefined") destroyObj(config);
-            if(typeof(facet_list)!="undefined") destroyObj(facet_list);
-            if(typeof(globalOrgTree)!="undefined") destroyObj(globalOrgTree);
-            if(typeof(globalOrgTypes)!="undefined") destroyObj(globalOrgTypes);
-            if(typeof(google)!="undefined") destroyObj(google);
-            if(typeof(orgArraySearcher)!="undefined") destroyObj(orgArraySearcher);
-            if(typeof(recordsCache)!="undefined") destroyObj(recordsCache);
-            if(typeof(search_list)!="undefined") destroyObj(search_list);
-            if(typeof(subjectCache)!="undefined") destroyObj(subjectCache);
-            if(typeof(xrefCacheIndex)!="undefined") destroyObj(xrefCacheIndex);
-            if(typeof(x)!="undefined") destroyObj(x);
-            if(typeof(string)!="undefined") string = "";
-            //removeChildren(document);
-            //alert(errCounter+'\n'+errCounter2);
-        });
     }
 
-    /* google analytics */
-    var _gaq = _gaq || [];
-    _gaq.push(['_setAccount', 'UA-3018520-10']);
-    _gaq.push(['_trackPageview']);
-
-    (function() {
-        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-    })();
-
-    dojo.addOnLoad(
-        function() {
-            skin_init();
-            <!--#if expr="$OILS_PAGE='index.xml'"-->
-            isFrontPage = true;
-            <!--#endif-->
-            init();
-            opac_init();
-        }
-    );
+    dojo.addOnLoad( function() { skin_init(); init(); opac_init(); });
+
 ]]></script>
diff --git a/Open-ILS/web/opac/skin/kcls/xml/common/js_shared.xml b/Open-ILS/web/opac/skin/kcls/xml/common/js_shared.xml
new file mode 100644 (file)
index 0000000..1796235
--- /dev/null
@@ -0,0 +1,199 @@
+<!--#if expr="$OILS_PAGE='index.xml'"-->
+isFrontPage = true;
+<!--#endif-->
+
+config.ids.searchbar = {};
+config.css.searchbar = {};
+config.ids.searchbar.text = 'search_box';
+config.ids.searchbar.facets = 'facet_box';
+config.ids.searchbar.submit = 'search_submit';
+config.ids.searchbar.type_selector = 'search_type_selector';
+config.ids.searchbar.depth_selector = 'depth_selector';
+config.ids.searchbar.form_selector = 'form_selector';
+config.ids.searchbar.extra_row = 'searchbar_extra';
+config.ids.searchbar.main_row            = 'searchbar_main_row';
+config.ids.searchbar.table                = 'searchbar_table';
+config.ids.searchbar.location_tag    = 'search_location_tag_link';
+config.ids.searchbar.lib_sel_span    = 'lib_selector_span';
+config.ids.searchbar.lib_sel_link    = 'lib_selector_link';
+config.ids.searchbar.depth_sel_span    = 'depth_selector_span';
+config.ids.common.top_logo = "top_left_logo";
+config.ids.sidebar = {};
+config.css.sidebar = {};
+config.names.sidebar = {};
+config.css.sidebar.item = {};
+config.ids.sidebar.home                = 'home_link_div';
+config.ids.sidebar.advanced        = 'advanced_link_div';
+config.ids.sidebar.myopac            = 'myopac_link_div';
+config.ids.sidebar.prefs            = 'prefs_link_div';
+config.ids.sidebar.mresult            = 'mresult_link_div';
+config.ids.sidebar.rresult            = 'result_link_div';
+config.ids.sidebar.rdetail            = "rdetail_link_div";
+config.ids.sidebar.login            = 'login_link';
+config.ids.sidebar.logout            = 'logout_link';
+config.ids.sidebar.logoutbox        = 'logout_link_div';
+config.ids.sidebar.loginbox        = 'login_link_div';
+config.ids.sidebar.logged_in_as    = 'logged_in_as_div';
+config.ids.sidebar.username_dest    = 'username_dest';
+
+config.ids.sidebar.home_link        = 'home_link'
+config.ids.sidebar.advanced_link    = 'advanced_link'
+config.ids.sidebar.myopac_link    = 'myopac_link'
+
+config.css.encircled                = 'encircled';
+
+config.ids.login = {};
+config.css.login = {};
+config.ids.login.form            = "login_form";
+config.ids.login.box            = "login_box";
+config.ids.login.tbody            = "login_tbody";
+config.ids.login.username    = "login_username";
+config.ids.login.password    = "login_password";
+config.ids.login.button        = "login_button";
+config.ids.login.cancel        = "login_cancel_button";
+config.ids.altcanvas.login            = config.ids.login.box;
+
+config.ids.altcanvas.myopac_reload = 'myopac_reloading';
+config.ids.myopac = {};
+config.css.myopac = {};
+config.names.myopac = {};
+
+config.ids.altcanvas.org_tree       = config.ids.common.org_container;
+config.ids.altcanvas.holds          = 'holds_box';
+config.ids.altcanvas.check_holds    = 'check_holds_box';
+config.ids.altcanvas.xulholds       = 'xulholds_box';
+config.ids.altcanvas.loading        = 'loading_alt';
+
+<!--#if expr="$OILS_PAGE='rdetail.xml'"-->
+config.ids.rdetail              = {};
+config.ids.rdetail.view_marc    = "rdetail_view_marc";
+config.ids.rdetail.details_body = 'rdetail_details_body';
+config.ids.rdetail.title        = 'rdetail_title';
+config.ids.rdetail.author       = 'rdetail_author';
+config.ids.rdetail.isbn         = 'rdetail_isbn';
+config.ids.rdetail.edition      = 'rdetail_edition';
+config.ids.rdetail.pubdate      = 'rdetail_pubdate';
+config.ids.rdetail.publisher    = 'rdetail_publisher';
+config.ids.rdetail.tor          = 'rdetail_tor';
+config.ids.rdetail.abstr        = 'rdetail_abstract';
+config.ids.rdetail.image        = 'rdetail_image';
+config.ids.rdetail.tor_pic      = 'rdetail_tor_pic';
+
+config.ids.rdetail.cp_status        = "rdetail_copy_info_status";
+config.ids.rdetail.cp_info_row      = "rdetail_copy_info_row";
+config.ids.rdetail.cp_info_loading  = "rdetail_copy_info_loading";
+config.ids.rdetail.cp_info_local    = "copy_info_local_link";
+config.ids.rdetail.cp_info_all      = "copy_info_all_link";
+config.ids.rdetail.cp_info_none     = "rdetail_copy_info_none";
+config.names.rdetail.lib_cell       = "rdetail_library_cell";
+config.names.rdetail.cn_cell        = "rdetail_callnumber_cell";
+config.names.rdetail.cp_count_cell  = "rdetail_copy_count_cell";
+config.names.rdetail.cp_status      = 'rdetail_status_cell';
+
+<!--#endif-->
+
+var OILS_OPAC_IMAGES_HOST = null;
+<!--#if expr="$OILS_OPAC_IMAGES_HOST"-->
+    OILS_OPAC_IMAGES_HOST = '<!--#echo var="OILS_OPAC_IMAGES_HOST"-->extras/ac/jacket/';
+<!--#endif -->
+var OILS_OPAC_STATIC_PROTOCOL = null;
+<!--#if expr="$OILS_OPAC_STATIC_PROTOCOL"-->
+    OILS_OPAC_STATIC_PROTOCOL = '<!--#echo var="OILS_OPAC_STATIC_PROTOCOL"-->';
+<!--#endif -->
+
+var chilifresh = '<!--#echo var="OILS_CHILIFRESH_ACCOUNT"-->';
+if (chilifresh == '(none)') { chilifresh = false; }
+var novelist = '<!--#echo var="OILS_NOVELIST_URL"-->';
+if (novelist == '(none)') { novelist = false; }
+
+
+var cookieManager = new HTTP.Cookies();  
+
+/*  -----------------------------------------------------------------------
+    KCLS suppressed orgs 
+    ----------------------------------------------------------------------- */
+var localSuppressedOrgs = {1500:true, 1501:true, 1558:true};  /* change to suit */
+for (var i in orgArraySearcher) {
+    var org = orgArraySearcher[i];
+    if(localSuppressedOrgs[i]) {
+        org.opac_visible('f');
+    }
+}
+/* ----------------------------------------------------------------------- */ 
+
+<!--#if expr="$OILS_OPAC_FORCE_LOGIN_SSL"-->
+    forceLoginSSL = true;
+<!--#endif -->
+
+
+/* I'm not sure how to test for the situation where this block is
+   needed, but this won't hurt. */
+try {
+    if ($('holds_frozen_chkbox').checked)
+        unHideMe($("hold_frozen_thaw_row"));
+} catch (E) {
+    void(0);
+}
+
+dojo.require('dojo.cookie');
+dojo.require("dijit._Calendar");
+dojo.require("dijit.form.DateTextBox");
+dojo.require("dijit.form.FilteringSelect");
+dojo.require("dojo.date.locale");
+dojo.require("dojo.date.stamp");
+dojo.require("dojo.parser");
+dojo.require("openils.widget.FacetSidebar"); // pulls in Searcher and I18N
+dojo.require("dijit.form.CheckBox");
+dojo.require("openils.widget.ProgressDialog");
+
+
+dojo.addOnLoad(
+    function() {
+        setTimeout(
+            function() {
+                attachEvt("common", "unload", function(){
+                    if(typeof(G)!="undefined") destroyObj(G);
+                    if(typeof(HTTP)!="undefined") destroyObj(HTTP);
+                    if(typeof(_c)!="undefined") destroyObj(_c);
+                    if(typeof(_l)!="undefined") destroyObj(_l);
+                    if(typeof(config)!="undefined") destroyObj(config);
+                    if(typeof(facet_list)!="undefined") destroyObj(facet_list);
+                    if(typeof(globalOrgTree)!="undefined") destroyObj(globalOrgTree);
+                    if(typeof(globalOrgTypes)!="undefined") destroyObj(globalOrgTypes);
+                    if(typeof(google)!="undefined") destroyObj(google);
+                    if(typeof(orgArraySearcher)!="undefined") destroyObj(orgArraySearcher);
+                    if(typeof(recordsCache)!="undefined") destroyObj(recordsCache);
+                    if(typeof(search_list)!="undefined") destroyObj(search_list);
+                    if(typeof(subjectCache)!="undefined") destroyObj(subjectCache);
+                    if(typeof(xrefCacheIndex)!="undefined") destroyObj(xrefCacheIndex);
+                    if(typeof(x)!="undefined") destroyObj(x);
+                    if(typeof(string)!="undefined") string = "";
+                    //removeChildren(document);
+                    //alert(errCounter+'\n'+errCounter2);
+                });
+            }, 0
+        )
+    }
+);
+
+
+/* google analytics ------------------------------------------ */
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-3018520-10']);
+_gaq.push(['_trackPageview']);
+
+(function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+/* google analytics ------------------------------------------ */
+
+try { 
+    document.getElementById('toptable').style.display = 'table'; 
+} catch(e) {
+    try {
+        document.getElementById('toptable').style.display = ''; 
+    } catch(ee) {}
+}
+