﻿//Here you can specify all the keywods and alternate mappings 
//used in the autocomplete feature of the search box
var AutoComplete = 
{
"MainKeywords" : 
[
//DEFINE KEYWORDS HERE
//--------------------
//- Make sure not to have double quotes in the keyword, example “health “facts””
//- Add a comma after every keyword added
//
//
"ADAP",
"Advergaming",
"Advertising ",
"Africa, HIV/AIDS",
"African American AIDS",
"African American health",
"African American men survey",
"African American women and health care, insurance, coverage",
"African Americans HIV/AIDS",
"African broadcast",
"African Media",
"African PSA",
"African public service announcement",
"AIDS Drug Assistance Program (ADAP)",
"AIDS in African Americans",
"AIDS in Hispanics",
"AIDS in Latinos",
"AIDS Timeline",
"Asian health",
"Baby Einstein",
"Barbara Jordan Scholars Program",
"Basics of Medicaid",
"Being a Black Man",
"BET",
"BET PSA ",
"BET public service announcement",
"Bill and Melinda Gates Foundation",
"Birth control",
"BJ Scholars",
"Black Americans with HIV/AIDS",
"Black health ",
"Black Men HIV/AIDS",
"Black women and health care, insurance, coverage",
"Black Women HIV/AIDS",
"Brainy Baby",
"calendar",
"career",
"Caribbean and HIV/AIDS",
"Caribbean broadcast",
"Caribbean media",
"Caribbean PSA ",
"Caribbean public service announcement",
"CBOs",
"Center for Strategic and International Studies (CSIS)",
"Centers for Disease Control (CDC) HIV/AIDS testing statistics",
"Cervical cancer vaccine",
"Child obesity",
"Childbirth health care, coverage, insurance",
"Children’s coverage",
"Children's health insurance program reauthorization act of 2009 ",
"CHIPRA",
"COBRA",
"Community based organizations (CBOs)",
"Consumer Directed Health Plans",
"Consumer Driven Health Plans",
"Contraception",
"cost of covering uninsured",
"Cost sharing",
"Covering the uninsured",
"CSIS",
"Digital divide",
"Disparities facts",
"Disparities legislation",
"Disparities report",
"Domestic HIV/AIDS funding and/or budget",
"Donated PSA ",
"Donor commitments",
"Donor governments",
"Drug Coverage",
"Drug Formularies",
"Drug Spending",
"Dual Eligible Beneficiaries",
"Dual eligibles with HIV/AIDS",
"EC",
"Economy and health care",
"Economy, health coverage",
"Educational media ",
"Emergency contraception",
"Employer Health Benefits Survey",
"Employer Sponsored Health Benefits",
"Enterate",
"ERISA",
"Ethnic health disparities",
"European Commission funding",
"events",
"Family planning",
"Federal budget for HIV/AIDS",
"Federal spending on HIV/AIDS",
"Food advertising",
"Food advertising on TV",
"Formularies",
"Fox",
"G8 funding",
"Gardasil",
"Genital warts vaccine",
"GenM",
"Girls with HIV/AIDS",
"Giving Voice to the People of New Orleans",
"Global and/or International response",
"Global Fund to Fight AIDS, Tuberculosis, and Malaria",
"Global Health",
"Global Health Survey",
"Global HIV Prevention Working Group",
"Global HIV/AIDS",
"Global HIV/AIDS budget",
"Global HIV/AIDS funding",
"Global HIV/AIDS PSA ",
"Global HIV/AIDS public service announcement",
"Global policymakers",
"Guide to safe sex",
"H1N1",
"Health and the election ",
"Health Care Costs",
"Health care for women with disabilities",
"health care reform proposals",
"Health coverage",
"Health coverage of women in United States",
"Health coverage trends",
"Health Insurance ",
"Health insurance gaps by race, ethnicity",
"Health News Index",
"health reform",
"health reform side-by-side",
"Health Plan Tracker",
"Health Savings Accounts",
"Health Security Watch",
"Healthy Indiana plan",
"High Deductible Health Plans",
"HIPAA",
"Hispanic AIDS",
"Hispanic health",
"Hispanic Men HIV/AIDS",
"Hispanic Women HIV/AIDS",
"Hispanics with HIV/AIDS",
"HIV Cost and Services Utilization Study",
"HIV/AIDS budget request",
"HIV/AIDS drug coverage",
"HIV/AIDS epidemic",
"HIV/AIDS experts",
"HIV/AIDS federal spending",
"HIV/AIDS funding",
"HIV/AIDS international assistance",
"HIV/AIDS media campaigns",
"HIV/AIDS prescription drugs",
"HIV/AIDS PSA ",
"HIV/AIDS public service announcement",
"HIV/AIDS testing",
"HMOs",
"Household media",
"HPV vaccine",
"HSA ",
"Human papillomavirus",
"Hurricane Katrina Survey",
"I Live UP ",
"Immigrants ",
"Immigrant health",
"Independents, health care",
"indicators by ethnicity",
"indicators by race",
"Individual Health Insurance",
"It begins with you ",
"It’s your sex life",
"job",
"Kaiser Health Security Watch",
"Kaiser Pew Global Health Survey",
"Kaiser/Hewitt Retiree Health Benefits Survey",
"Katrina",
"Katrina Survey",
"Kids and Media",
"Latina, Hispanic women and health care, insurance, coverage",
"Latino AIDS",
"Latino health",
"Latinos with HIV/AIDS in the U.S.",
"Long-term care",
"Low-income women",
"Low-income women,  contraception",
"Low-income women,  family planning",
"Low-income women,  health insurance, coverage",
"Low-income women,  long term care",
"Malaria",
"Malpractice",
"Managed Care ",
"Massachusetts health care reform",
"Maternity care",
"Media in the bedroom",
"Media monitoring ",
"Media multitasking",
"Media ratings ",
"Media Use ",
"Medicaid abuse",
"Medicaid basics",
"Medicaid beneficiaries",
"Medicaid benefits by state",
"Medicaid budgets",
"Medicaid Dual Eligible Beneficiaries",
"Medicaid Dual Enrollees",
"Medicaid elder care ",
"Medicaid Eligibility",
"Medicaid fraud  ",
"Medicaid Regulations",
"Medicaid spending",
"Medicaid,  condoms",
"Medicaid,  contraception",
"Medicaid,  family planning",
"Medicaid,  HIV/AIDS",
"Medicaid, Economy",
"Medicaid, unemployment",
"Medical debt",
"Medical Malpractice ",
"Medicare",
"Medicare Advantage",
"Medicare Advantage Plan Tracker",
"Medicare Chartbook",
"Medicare Drug Benefit",
"Medicare Dual Eligible Beneficiaries",
"Medicare Fact Sheets",
"Medicare Financing",
"Medicare Health Plan Tracker",
"Medicare Modernization Act",
"Medicare Part D Drug Benefit",
"Medicare Prescription Drug Benefit",
"Medicare Private-Fee-For-Service Plans",
"Medicare Solvency",
"Medicare spending",
"Medicare, HIV/AIDS",
"Mental Health",
"Minority AIDS Initiative (MAI)",
"Minority health",
"Morning after pill",
"MTV ",
"MTV PSA ",
"MTV public service announcement",
"mtvU",
"Multitasking",
"NASTAD",
"National Alliance of State and Territorial AIDS Directors (NASTAD)",
"National health coverage of women",
"National profile of women",
"National survey of women on their health",
"Native Hawaiian health",
"New media environment",
"New Orleans Survey",
"news release",
"NPR Kaiser Harvard Surveys",
"Number of people who get HIV/AIDS test ",
"Number of women, girls living with HIV/AIDS",
"Official development assistance ",
"Online food advertising",
"Out of pocket spending",
"Pacific Islander health",
"Parent’s TV viewing",
"Parental rules",
"Parents, health coverage",
"Part D Medicare Drug Benefit",
"PAUSE ",
"PBMs",
"PEPFAR",
"Percent of African Americans, Blacks with HIV/AIDS",
"Percent of people who get HIV/AIDS test",
"Pharmacy Benefit Managers",
"Plan B",
"Political Independents and Health Care",
"PPOs",
"Pre-existing conditions",
"Pregnancy care",
"Premiums",
"Prescription Drug Spending",
"Prescription drugs survey",
"President’s Emergency Plan for AIDS Relief (PEPFAR)",
"President’s HIV/AIDS budget",
"Presidential election",
"Presidential Election Poll",
"press release",
"Private Fee-for-Service Plans",
"Progestin",
"Public Opinion Spotlight",
"Racial disparities",
"Racial disparities facts",
"Racial, ethnic disparities in women’s health",
"Racial, ethnic minorities",
"Reading and education",
"reauthorization of SCHIP",
"Retiree Health Benefits",
"Ryan White CARE Act",
"Safer sex messages",
"SCHIP reauthorization",
"Screen media",
"Seniors with HIV/AIDS",
"Sesame Street",
"Sex on television or TV",
"Sexual health",
"Sexual health,  teens",
"Sexual scenes",
"Snapshots Health Care Costs",
"Social Security, HIV/AIDS",
"South Africa National Survey",
"state health coverage",
"state Medicaid",
"Survey of parents ",
"swine flu",
"Talking About Medicare",
"TB",
"Teacher in the living room",
"Teen pregnancy",
"Teens,  HIV/AIDS",
"Teens,  sexually transmitted diseases, STDs",
"Teens, young adults,  violence",
"Teens, young adults, adolescents,  drugs",
"Television ",
"Television Advertising Online",
"Television as a babysitter",
"Today's Topics In Health Disparities",
"Total AIDS deaths",
"Total Number of African Americans/Blacks with HIV/AIDS",
"Total Number of Latinos with HIV/AIDS",
"Total people with HIV",
"Trends in health coverage",
"Tuberculosis",
"TV at dinner",
"TV, bedrooms",
"TV, children’s behavior",
"U.S. international funding for health",
"Uncompensated care",
"Underinsured",
"uninsured adults",
"Uninsured basics",
"uninsured costs",
"Uninsured women",
"Unintended pregnancy",
"USA Today  Kaiser Harvard Surveys",
"V-Chip",
"Video games",
"Washington Post Kaiser Harvard Surveys",
"WHO ",
"Women with HIV/AIDS in the U.S.",
"Women,  employer sponsored health insurance",
"Women,  family planning",
"Women,  health care",
"Women,  HPV",
"Women,  long term care",
"Women,  Medicaid",
"Women,  Medicare",
"Women,  private insurance",
"Women,  public health insurance",
"Women, HIV/AIDS",
"Women’s health",
"Women’s health insurance coverage",
"Zero to six"
],


"AltMappings" : 
[
//DEFINE ALTERNATE MAPPINGS HERE
//------------------------------
// usage = [keyword, mapping]
//
//- Make sure not to have double quotes in the keyword, example “health “facts””
//- Add a comma after every mapping added
//
//
["ADAP", "AIDS Drug Assistance Program"],
["HIV", "HIV/AIDS, AIDS"],
["AIDS", "HIV, HIV/AIDS"],
["Women", "Female"],
["CBO", "Community Based Organizations"],
["CDC", "Centers for Disease Control and Prevention"],
["CSIS", "Center for Strategic and International Studies"],
["EC", "Emergency contraception"],
["TV", "Television"],
["PSA", "Public service announcement"],
["HSA", "Health savings accounts"],
["MIA", "Minority AIDS Initiative"],
["NASTAD", "National Alliance of State and Territorial AIDS Directors"],
["PBMs", "Pharmacy benefit manager"],
["PEPFAR", "President’s Emergency Plan for AIDS Relief"],
["press release", "News release"],
["career", "job"],
["CHIPRA", "Children's Health Insurance Program Reauthorization Act of 2009"]
],

//
//DO NOT MODIFY CODE BELOW
//
"GetResults" : 
    function(sQuery) 
	{ 
	    var aMatches = new Array();
	    
	    //put alt mappings to top of list
	    for (var i = 0; i < AutoComplete.AltMappings.length; i++)
	    {
	        if (AutoComplete.IsMatch(unescape(sQuery), AutoComplete.AltMappings[i][0], true))
    	        aMatches.push( [ AutoComplete.AltMappings[i][1], AutoComplete.AltMappings[i][1] ] ); 
	    }
	    
	    //find matching keywords
	    for (var i = 0; i < AutoComplete.MainKeywords.length; i++)
	    {
            if (AutoComplete.IsMatch(unescape(sQuery), AutoComplete.MainKeywords[i], false))
                aMatches.push( [ AutoComplete.MainKeywords[i], AutoComplete.MainKeywords[i] ] ); 
	    }
	    
	    if (aMatches.length < 2)
    	    document.getElementById("acSearchContainer").childNodes[0].style.overflowX = "hidden";
    	else
    	    document.getElementById("acSearchContainer").childNodes[0].style.overflowX = "auto";
    	    
	    return aMatches; 
	},
	
"FormatResult" : 
	function(aResultItem, sQuery) 
	{ 
	   var q = unescape(sQuery).toLowerCase().trim();
       var kw = aResultItem[0].toLowerCase().trim();
         
	   var sHtml = "";
       if (kw.indexOf(q) == 0)
       {
          sHtml += "<span style='font-weight:bold'>" + kw.substr(0, q.length) + "</span>";
          if (kw.length > q.length)
              sHtml += kw.substr(q.length);
       }  
       else if (kw.substr((kw.indexOf(q)-1), 1) == " ")
       {
          sHtml += kw.substr(0, kw.indexOf(q)) + "<span style='font-weight:bold'>" + kw.substr(kw.indexOf(q), q.length) + "</span>";
          if (kw.length > kw.indexOf(q) + q.length)
              sHtml += kw.substr(kw.indexOf(q) + q.length);
       }
       else
       {
          sHtml += "<span style='font-weight:bold'>" + kw + "</span>";
       }
	   
	   return "<div id='ysearchresult'>" + sHtml + "</div>";
	},
	
"IsMatch" : 
    function(sQuery, sKeyword, bOnlyExact)
    {
        var q = sQuery.toLowerCase().trim();
        var kw = sKeyword.toLowerCase().trim();
        
        if (bOnlyExact)
            return (kw == q);
        else
            return (kw.indexOf(q) > -1 && (kw.indexOf(q) == 0 || kw.substr((kw.indexOf(q)-1), 1) == " "));
        
    }
};
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); }