﻿var Hashtable = (function () {
    function _1(_2) { return (typeof _2 === "undefined"); }; function _3(_4) { return (typeof _4 === "function"); }; function _5(_6) { return (typeof _6 === "string"); }; function _7(_8, _9) { return _3(_8[_9]); }; function _a(_b) { return _7(_b, "equals"); }; function _c(_d) { return _7(_d, "hashCode"); }; function _e(_f) {
        if (_5(_f)) { return _f; } else {
            if (_c(_f)) {
                var _10 = _f.hashCode(); if (!_5(_10)) { return _e(_10); }
                return _10;
            } else { if (_7(_f, "toString")) { return _f.toString(); } else { return String(_f); } }
        }
    }; function _11(_12, _13) { return _12.equals(_13); }; function _14(_15, _16) { if (_a(_16)) { return _16.equals(_15); } else { return _15 === _16; } }; function _17(o1, o2) { return o1 === o2; }; function _1a(arr, _1c, _1d, _1e, _1f) {
        var _20; for (var i = 0, len = arr.length; i < len; i++) { _20 = arr[i]; if (_1f(_1c, _1d(_20))) { return _1e ? [i, _20] : true; } }
        return false;
    }; function _23(arr, idx) { if (_7(arr, "splice")) { arr.splice(idx, 1); } else { if (idx === arr.length - 1) { arr.length = idx; } else { var _26 = arr.slice(idx + 1); arr.length = idx; for (var i = 0, len = _26.length; i < len; i++) { arr[idx + i] = _26[i]; } } } }; function _29(kv, _2b) { if (kv === null) { throw new Error("null is not a valid " + _2b); } else { if (_1(kv)) { throw new Error(_2b + " must not be undefined"); } } }; var _2c = "key", _2d = "value"; function _2e(key) { _29(key, _2c); }; function _30(_31) { _29(_31, _2d); }; function _32(_33, _34, _35) { this.entries = []; this.addEntry(_33, _34); if (_35 !== null) { this.getEqualityFunction = function () { return _35; }; } }; function _36(_37) { return _37[0]; }; function _38(_39) { return _39[1]; }; _32.prototype = { getEqualityFunction: function (_3a) { if (_a(_3a)) { return _11; } else { return _14; } }, searchForEntry: function (key) { return _1a(this.entries, key, _36, true, this.getEqualityFunction(key)); }, getEntryForKey: function (key) { return this.searchForEntry(key)[1]; }, getEntryIndexForKey: function (key) { return this.searchForEntry(key)[0]; }, removeEntryForKey: function (key) {
        var _3f = this.searchForEntry(key); if (_3f) { _23(this.entries, _3f[0]); return true; }
        return false;
    }, addEntry: function (key, _41) { this.entries[this.entries.length] = [key, _41]; }, size: function () { return this.entries.length; }, keys: function (_42) { var _43 = _42.length; for (var i = 0, len = this.entries.length; i < len; i++) { _42[_43 + i] = this.entries[i][0]; } }, values: function (_46) { var _47 = _46.length; for (var i = 0, len = this.entries.length; i < len; i++) { _46[_47 + i] = this.entries[i][1]; } }, containsKey: function (key) { return _1a(this.entries, key, _36, false, this.getEqualityFunction(key)); }, containsValue: function (_4b) { return _1a(this.entries, _4b, _38, false, _17); }
    }; function _4c() { }; _4c.prototype = []; function _4d(_4e) { return _4e[0]; }; function _4f(_50, _51, _52) { return _1a(_50, _51, _4d, true, _52); }; function _53(_54, _55) {
        var _56 = _54[_55]; if (_56 && (_56 instanceof _4c)) { return _56[1]; }
        return null;
    }; function _57(_58, _59) {
        var _5a = []; var _5b = {}; _58 = _3(_58) ? _58 : _e; _59 = _3(_59) ? _59 : null; this.put = function (key, _5d) { _2e(key); _30(_5d); var _5e = _58(key); var _5f = _53(_5b, _5e); if (_5f) { var _60 = _5f.getEntryForKey(key); if (_60) { _60[1] = _5d; } else { _5f.addEntry(key, _5d); } } else { var _61 = new _4c(); _61[0] = _5e; _61[1] = new _32(key, _5d, _59); _5a[_5a.length] = _61; _5b[_5e] = _61; } }; this.get = function (key) {
            _2e(key); var _63 = _58(key); var _64 = _53(_5b, _63); if (_64) { var _65 = _64.getEntryForKey(key); if (_65) { return _65[1]; } }
            return null;
        }; this.containsKey = function (key) {
            _2e(key); var _67 = _58(key); var _68 = _53(_5b, _67); if (_68) { return _68.containsKey(key); }
            return false;
        }; this.containsValue = function (_69) {
            _30(_69); for (var i = 0, len = _5a.length; i < len; i++) { if (_5a[i][1].containsValue(_69)) { return true; } }
            return false;
        }; this.clear = function () { _5a.length = 0; _5b = {}; }; this.isEmpty = function () { return _5a.length === 0; }; this.keys = function () {
            var _6c = []; for (var i = 0, len = _5a.length; i < len; i++) { _5a[i][1].keys(_6c); }
            return _6c;
        }; this.values = function () {
            var _6f = []; for (var i = 0, len = _5a.length; i < len; i++) { _5a[i][1].values(_6f); }
            return _6f;
        }; this.remove = function (key) { _2e(key); var _73 = _58(key); var _74 = _53(_5b, _73); if (_74) { if (_74.removeEntryForKey(key)) { if (_74.size() === 0) { var _75 = _4f(_5a, _73, _74.getEqualityFunction(key)); _23(_5a, _75[0]); delete _5b[_73]; } } } }; this.size = function () {
            var _76 = 0; for (var i = 0, len = _5a.length; i < len; i++) { _76 += _5a[i][1].size(); }
            return _76;
        };
    }; return _57;
})();

//   Glossary of terms
var Glossary = new Hashtable();
// Glossary.put("key".toLowerCase(), "value");
Glossary.put("A1C".toLowerCase(), "A test that measures blood sugar, or glucose, levels for the previous 3 to 4 months.");
Glossary.put("Bad cholesterol".toLowerCase(), "Low-density lipoprotein (LDL) cholesterol. A high level of bad cholesterol leads to a buildup of cholesterol in arteries and may lead to heart disease.");
Glossary.put("Basal insulin".toLowerCase(), "See long-acting insulin.");
Glossary.put("Bolus insulin".toLowerCase(), "Insulin that covers a rise in blood sugar, often related to a meal or snack. See fast- or rapid-acting insulin.");
Glossary.put("Cholesterol".toLowerCase(), "A fat-like substance that is found in the bloodstream and body tissue. Cholesterol is used by the body to make hormones and build cell walls. However, too much cholesterol can cause a disease that harms blood circulation.");
Glossary.put("Dietitian".toLowerCase(), "A health care professional who advises people about meal planning, weight control, and diabetes management.");
Glossary.put("Endocrinologist".toLowerCase(), " A doctor who treats people who have endocrine gland problems such as diabetes.");
Glossary.put("Fast- or rapid-acting insulin".toLowerCase(), "An insulin that starts working within 5 to 10 minutes and lasts up to 3 hours, depending on the type used.");
Glossary.put("fast-acting bolus insulin".toLowerCase(), "An insulin that starts working within 5 to 10 minutes and lasts up to 3 hours, depending on the type used.");
Glossary.put("fast-acting insulin".toLowerCase(), "An insulin that starts working within 5 to 10 minutes and lasts up to 3 hours, depending on the type used.");
Glossary.put("fast-acting, or bolus insulin".toLowerCase(), "An insulin that starts working within 5 to 10 minutes and lasts up to 3 hours, depending on the type used.");
Glossary.put("Fasting blood glucose".toLowerCase(), "The measurement of a person’s blood sugar when the person has not eaten in 8 to 12 hours.");
Glossary.put("Glucose".toLowerCase(), "Also known as blood sugar, glucose is used by the body for fuel. Glucose is produced when the digestive system breaks down food.");
Glossary.put("Glucose tablets".toLowerCase(), "Tablets made of pure glucose, used for treating hypoglycemia.");
Glossary.put("Good cholesterol".toLowerCase(), "High-density lipoprotein (HDL) cholesterol. Good cholesterol helps the liver remove all cholesterol from your body. The higher your good cholesterol level, the lower your chance of getting heart disease.");
Glossary.put("Hormone".toLowerCase(), "A chemical made by the body to help it work in different ways. For example, insulin is a hormone made in the pancreas to help the body use glucose as energy");
Glossary.put("Hyperglycemia".toLowerCase(), "A condition people with diabetes may experience when their blood glucose levels are too high. Symptoms of hyperglycemia may include having to urinate often, being very thirsty, and losing weight.");
Glossary.put("Hypoglycemia".toLowerCase(), "A condition that occurs when a person’s blood sugar is lower than normal, usually less than 70 mg/dL. Signs include hunger, nervousness, shakiness, perspiration, dizziness or light-headedness, sleepiness, and confusion. If left untreated, hypoglycemia may lead to unconsciousness. Hypoglycemia is treated by consuming a carbohydrate-rich food such as a sugar tablet or juice. It may also be treated with an injection of glucagon if the person is unconscious or unable to swallow.");
Glossary.put("Insulin".toLowerCase(), "A hormone made naturally in your pancreas.");
Glossary.put("Long-acting insulin".toLowerCase(), "A type of insulin, such as Levemir®, that starts to lower blood sugar within 4 to 6 hours after injection and has its strongest effect 10 to 18 hours after injection.");
Glossary.put("long-acting basal insulin".toLowerCase(), "A type of insulin, such as Levemir®, that starts to lower blood sugar within 4 to 6 hours after injection and has its strongest effect 10 to 18 hours after injection.");
Glossary.put("Lipodystrophy".toLowerCase(), "Small dents or lumps in the surface of the skin caused by repeated insulin injections in the same area.");
Glossary.put("Nephrologist".toLowerCase(), "A medical professional involved with the health of the kidneys.");
Glossary.put("Nutritionist".toLowerCase(), " A person with training in nutrition. A nutritionist may have specialized training and qualifications, but may not.");
Glossary.put("NPH".toLowerCase(), "An intermediate-acting insulin used to treat diabetes. It starts working more slowly, has a lower peak, and lasts longer than regular insulin. NPH stands for Neutral Protamine Hagadorn, so named because it has a neutral pH, contains protamine, and was invented by a scientist named Hans Christian Hagedorn.");
Glossary.put("Ophthalmologist".toLowerCase(), "A medical doctor who diagnoses and treats all eye diseases and eye disorders.");
Glossary.put("Pancreas".toLowerCase(), "An organ in the body that produces insulin, which enables the body to use glucose for energy. ");
Glossary.put("Podiatrist".toLowerCase(), "A doctor who specializes in the feet. Podiatrists also provide regular foot examinations and treatment.");
Glossary.put("Postprandial blood glucose".toLowerCase(), "The measurement of a person’s blood sugar level 1 to 2 hours after the person has eaten, also known as post-meal blood glucose.");
Glossary.put("Post-meal glucose levels".toLowerCase(), "The measurement of a person’s blood sugar level 1 to 2 hours after the person has eaten.");
Glossary.put("Prediabetes".toLowerCase(), "A condition in which blood sugar levels (fasting plasma glucose) are higher than normal (100 mg/dL) but are not high enough for a diagnosis of diabetes (126 mg/dL). People with prediabetes are at increased risk for developing type 2 diabetes, heart disease, and stroke. Other names for prediabetes are impaired glucose tolerance and impaired fasting glucose.");
Glossary.put("Type 1 diabetes".toLowerCase(), "A condition characterized by high blood sugar levels caused by a total lack of insulin. Occurs when the body’s immune system attacks the insulin-producing beta cells in the pancreas and destroys them. The pancreas then produces little or no insulin and therefore blood sugar cannot enter the cells to be used for energy. Type 1 diabetes develops most often in young people but can appear in adults.");
Glossary.put("Type 2 diabetes".toLowerCase(), "A condition characterized by high blood sugar levels caused by either a lack of insulin or the body’s inability to use insulin efficiently. Type 2 diabetes develops most often in middle-aged and older adults. Clinically based reports and regional studies suggest that type 2 diabetes, while still rare in children and adolescents, is being diagnosed more frequently in children and adolescents, particularly in American Indians, African Americans, and Hispanic/Latino American populations.");



