public static void Init(bool allowDelayedLoad)
 {
     AppModule.Run(allowDelayedLoad, delegate(object state) {
         LoadTopTerms();
         LoadRelatedPages();
     });
 }
        public static void Init(bool allowDelayedLoad)
        {
            // Run this later on so we don't halt the start-up too much.
            // We check below if any of the globals are null and handle
            // accordingly.
            AppModule.Run(allowDelayedLoad, delegate(object state) {
                // Initialize the cache of people info
                PeopleCacheTable = Util.Database.DBSelect("people", dbfields,
                                                          new Database.UserSpec("(select count(*) from people_roles where id=personid and startdate > \"1980-00-00\") <> 0"));
                int row = 0;
                foreach (TableRow person in PeopleCacheTable)
                {
                    PeopleCacheRows[(int)(uint)person["id"]] = row++;
                }

                all_reps = MakeRepSearchArray(GetCurrentReps(), -1);
            });

            committees                       = new Dictionary <string, Hashtable>();
            committeelists                   = new Dictionary <string, List <Hashtable> >();
            committeelists["senate"]         = new List <Hashtable>();
            committeelists["house"]          = new List <Hashtable>();
            committeelists["joint"]          = new List <Hashtable>();
            committeeMapSubcommitteeToParent = new Hashtable();
            committeeMapThomasToId           = new Hashtable();
            committeeMapIdToThomas           = new Hashtable();
            string fn = Util.DataPath + Path.DirectorySeparatorChar + "committees.xml";

            Util.SandboxDownload(fn);
            XmlDocument committeesdoc = new XmlDocument();

            committeesdoc.Load(fn);
            foreach (XmlElement committee in committeesdoc.SelectNodes("committees/committee[count(@obsolete)=0]"))
            {
                Hashtable c = new Hashtable();
                c["id"]                     = committee.GetAttribute("code");
                c["displayname"]            = committee.GetAttribute("displayname");
                c["url"]                    = committee.GetAttribute("url");
                c["parentid"]               = "";
                committees[(string)c["id"]] = c;
                committeelists[committee.GetAttribute("type")].Add(c);

                foreach (XmlElement thomasname in committee.SelectNodes("thomas-names/name"))
                {
                    committeeMapThomasToId[thomasname.GetAttribute("session") + "::" + thomasname.InnerText]           = committee.GetAttribute("code");
                    committeeMapIdToThomas[thomasname.GetAttribute("session") + "::" + committee.GetAttribute("code")] = thomasname.InnerText;
                }

                c["subcommittees"] = new ArrayList();
                foreach (XmlElement subc in committee.SelectNodes("subcommittee[count(@obsolete)=0]"))
                {
                    Hashtable s = new Hashtable();
                    s["id"]            = committee.GetAttribute("code") + subc.GetAttribute("code");
                    s["displayname"]   = subc.GetAttribute("displayname");
                    s["parentid"]      = c["id"];
                    s["subcommittees"] = new ArrayList();
                    ((ArrayList)c["subcommittees"]).Add(s);

                    committees[(string)s["id"]] = s;
                }
            }

            LoadApprovalRatings();
            LoadSpectrumInfo();
        }