var BADGES_TABLES = "/badges-dbtables-pack";
var BADGES_AUTHENTICATE = "/badges-dbauthenticate-pack";
var BADGES_SYNC = "/badges-dbsync-pack";
var BADGES_PUBLISH = "/badges-publish-pack";

var DEFAULT_WEIGHT = 100;
var PROGRAM_COSTS = true;

var CATEGORIES = ["Natural World","Outdoor Activity","Creative Expression","Health and Fitness","Home and Community","Canada and the World"];
var CATEGORY_COLORS = {
    "Natural World": "#000",
    "Outdoor Activity": "#090",
    "Creative Expression": "#cc0",
    "Health and Fitness": "#c00",
    "Home and Community": "#00c",
    "Canada and the World": "#90f"
};
var PRICING = { "1 year": "1 year - $39.95", "2 years": "2 years - $69.95", "3 years": "3 years - $99.95" };        // this has to match the hosted paypal buttons
var SET_INVENTORY_EXCLUSIONS = { };
var LIST_INVENTORY_INCLUSIONS = [
    "extra_slide", 
    "extra_slide_apl", 
    "extra_slide_pl", 
    "extra_epaulet", 
    "extra_epaulet_apl", 
    "extra_epaulet_pl", 
    "extra_group", 
    "extra_area", 
    "extra_council", 
    "extra_province", 
    "extra_sponsor", 
    "extra_necker", 
    "extra_bringabuddy"
];

var MAP_INVENTORY_LABELS = { 
    extra_slide: "Woggle",
    extra_slide_apl: "Second Woggle",
    extra_slide_pl: "Sixer Woggle",
    extra_epaulet: "Epaulet",
    extra_epaulet_apl: "Second Epaulet",
    extra_epaulet_pl: "Sixer Epaulet",
    extra_group: "Group Insignia",
    extra_area: "Area Insignia",
    extra_council: "Council Insignia",
    extra_province: "Provincial Insignia",
    extra_sponsor: "Sponsor Emblem",
    extra_necker: "Necker",
    extra_bringabuddy: "'Bring a Buddy' Pin"
};

// elements EXCLUDED from a particular uniform.  If it's not 
// on this list then it is INCLUDED
var MAP_INVENTORY_VARIANTS = { 
    extra_slide: 0,
    extra_slide_apl: 0,
    extra_slide_pl: 0,
    extra_epaulet: 1,
    extra_epaulet_apl: 1,
    extra_epaulet_pl: 1,
    worldconservation: 1
};

// elements in this set are common to all uniforms
var MAP_INVENTORY_INVARIANTS = { 
    extra_group: 1,
    extra_area: 1,
    extra_council: 1,
    extra_province: 1,
    extra_sponsor: 1,
    extra_necker: 1,
    extra_bringabuddy: 1,
    languagestrip: 1,
    worldscoutenvironment: 1,
    flex: 1
};

var UNIFORMS = [0,1];

var STORAGE_PREFIX = "pack-";
var SECTION_TYPE = "pack";
var BULLET = "&ndash;";
var ROLES = [
    {long:"Cub", short:"Cub", tag:""},
    {long:"Second", short:"2nd", tag:"2nd" },
    {long:"Sixer", short:"6er", tag:"6er" }
];
var LEADER_ROLES = [
    {long:"Leader", short:"Leader", tag:"" },
    {long:"Section Leader", short:"Section Leader", tag:"Sec. Lead."}
];

var STR_YOUTH = "Cub";
var STR_PROGRAM = "Cub Scouts";
var STR_YOUTHS = "Cubs";
var STR_YOUTH_POSSESSIVE = "Cub's";
var STR_YOUTHS_POSSESSIVE = "Cubs'";
var STR_LEADER = "Leader";
var STR_LEADERS = "Leaders";
var STR_LEADERS_LC = "leaders";
var STR_SECTION = "Pack";
var STR_SECTION_TERSE = "Pack";
var STR_SECTION_POSSESSIVE = "Pack's";
var STR_PATROL = "Six";
var STR_PATROLS = "Sixes";
var STR_COUNCIL = "Council";
var STR_COUNCILS = "Councils";
var STR_AREA = "Area";
var STR_AREAS = "Areas";

var STR_ORGANIZATION = "Scouts Canada";
var STR_DIRECTORY = "cubs";
var STR_PRODUCT_PLAIN = getHost().match( /scoutstracker.ca/ ) ? "SCOUTSTRACKER" : "scout-badges.com";
var STR_PRODUCT = getHost().match( /scoutstracker.ca/ ) ? "<span style='font-weight:900;font-size:90%;'><span style='color:#012D2B;'>SCOUTS</span><span style='color:#e52325;'>TRACKER</span></span>" : "scout-badges.com";
var STR_TITLE = getHost().match( /scoutstracker.ca/ ) ? "SCOUTSTRACKER | Cub" : "Cub Badges and Events";
var STR_NOMOREBADGES = "No more badges in this activity area";
var STR_CATEGORY = "Activity Area";
var STR_CATEGORIES = "Areas";

var IMG_BASE = "/mkcweb/" + STR_DIRECTORY + "/section-images/rbadges/";

var BADGE_SELECTOR_TYPES = [ "Star", "Award", "Challenge", "Other" ];
var BADGE_SELECTOR_TYPE_LABELS = [ "Stars", "Awards", "Badges", "Other" ];
    
function getHost()
{
    var host = location.host.toLowerCase();
    host = host.replace( /www\./, "" );

    if ( host == "scouttracker.ca" )
        host = "scoutstracker.ca";        // correct user's typo
    else if ( host == "scoutracker.ca" )
        host = "scoutstracker.ca";        // correct user's typo

    return host;
};

function getChannel()
{
    return getHost().match( /scoutstracker.ca/ ) ? "SC" : "";
};

function getSteps()
{
    return new Array();
};

function getMyPathBadges( youthID )
{
    return new Array();
};

function getDefaultReorderPoint( metadata )
{
    if ( metadata.type == "Challenge" )
        return 1;
    else if ( metadata.type == "Award" )
        return 2;
    else
        return 5;
};

function getMyPathbadges( youthID )
{
    return new Array();
};

function updateOtherDisplay()
{
    var div = $('#other-category-pack div.page-content');
    div.empty();

    $.each( [{ type: "award", label: "Awards" }, { type: "emblem", label: "Emblems" }, { type: "other", label: "Other" }], function( i, section ) {
        var setBadges = {};
        for ( var badgeID in g_dbTables['MetaData'] )
        {
            var metadata = g_dbTables['MetaData'][badgeID];
            if ( metadata.type != "Award" )
                continue;

            if ( metadata.category == "Other" )
            {
                if ( section.type == "other" )
                    setBadges[badgeID] = 1;
            }
            else if ( metadata.id == "religioninlife" || metadata.id == "spirituality" )
            {
                if ( section.type == "emblem" )
                    setBadges[badgeID] = 1;
            }
            else
            {
                if ( section.type == "award" )
                    setBadges[badgeID] = 1;
            }
        }

        var listRows = new Array();
        $.each( sortBadgesByName( setBadges ), function( j, badgeID ) {
            listRows.push( "<li class='forward'><a badgeid='" + badgeID + "' href='javascript:void(0)' onclick=\"populateAlphabetic('Other',false,true);setCurrentBadge('" + badgeID + "',true,'dissolve');\"><span class='stunted'><img class='glyph' style='margin-right:24px;' src='images/blank.gif'/>" + getBadgeName(badgeID) + "</span> <small class='counter'></small></a></li>" );
        });

        if ( listRows.length > 0 )
        {
            div.append( "<h1 class='listheader'>" + section.label + "</h1>" );
            div.append( "<ul class='rounded'>" + listRows.join("") + "</ul>" );
        }
    });
    // here's where custom badges can be loaded... see venturer's
    // implementation of this method for an approach to build this section
};

function resetCategoryCounts( youthID )
{
    g_mapCategoryCounts[youthID] = {};
};

function resetTypeCounts( youthID )
{
    g_mapTypeCounts[youthID] = {};
}

function sortSelectorBadges( setBadges, type )
{
    var listBadges = Array();
    if ( type == "Star" )
    {
        listBadges.push( "blackstar" );
        listBadges.push( "greenstar" );
        listBadges.push( "tawnystar" );
        listBadges.push( "redstar" );
        listBadges.push( "bluestar" );
        listBadges.push( "purplestar" );
    }
    else if ( type == "Award" )
    {
        listBadges.push( "canadianarts" );
        listBadges.push( "canadiancamper" );
        listBadges.push( "canadianfamilycare" );
        listBadges.push( "canadianhealthyliving" );
        listBadges.push( "canadianheritagetrails" );
        listBadges.push( "canadianwilderness" );
        listBadges.push( "emergencypreparedness" );
        listBadges.push( "worldcitizen" );
        listBadges.push( "worldconservation" );
        listBadges.push( "worldscoutenvironment" );
        listBadges.push( "religioninlife" );
        listBadges.push( "spirituality" );
        listBadges.push( "extra_link" );
    }
    else
         listBadges = sortBadgesByName( setBadges );

    return listBadges;
};

function populateActivity( filter, bNavigate, bSaveUpPoint )
{
    if ( bSaveUpPoint )
        saveUpPoint();

    clearActive();
    var youthID = g_currentUser;        // GUI operates on current user

    g_reSearchHighliter = null;
    var setBadges = {};

    for ( var badgeID in g_dbTables['MetaData'] )
    {
        var metadata = g_dbTables['MetaData'][badgeID];
        if ( metadata.category == filter )
            setBadges[badgeID] = 1;
    }

    var showIcons = false;
    var i = 0;

    // make the results be sorted by name
    var listSortedNames = new Array();
    var mapBadgesByName = {};
    for ( var badgeID in setBadges )
    {
        if ( badgeID === undefined )
            continue;
        var strName = g_dbTables['MetaData'][badgeID]['name'];
        listSortedNames.push( strName );      // append this name to the end of a simple list
        mapBadgesByName[strName] = badgeID;
    }
    listSortedNames.sort();

    var listBadges = new Array();
    for ( var iBadge in listSortedNames )
    {
        var strName = listSortedNames[iBadge];
        listBadges.push( mapBadgesByName[strName] );
    }

    $('#star').empty();
    $('#badges').empty();
    $('#awards').empty();

    var showStar = false;
    var showAwards = false;

    for ( var iBadge = 0; iBadge < listBadges.length; iBadge++ )
    {
        var badgeID = listBadges[iBadge];
        var metadata = g_dbTables['MetaData'][badgeID];

        var strName = tagAbbreviations( highliteSearch( metadata['name'] ) );

        var strGlyph = "";
        var flag = getBadgeStatus( youthID, badgeID );

        if ( flag == "awarded" )
        {
            strGlyph = "<img class='glyph' style='vertical-align:-2px;margin-right:8px;' src='images/check.gif'/>";
            flag = "complete";
            showIcons = true;
        }

        else if ( flag == "complete" )
        {
            strGlyph = "<img class='glyph' style='vertical-align:-2px;margin-right:8px;' src='images/unawarded.gif'/>";
            showIcons = true;
        }
        else if ( flag == "ready" )
        {
            strGlyph = "<img class='glyph' style='vertical-align:-2px;margin-right:8px' src='images/readybadge.gif'/>";
            showIcons = true;
        }
        else if ( flag == "favourite" )
        {
            strGlyph = "<img class='glyph' style='vertical-align:-2px;margin-right:4px' src='images/star.gif'/>";
            showIcons = true;
        }
        else
            strGlyph = "<img class='glyph' style='margin-right:24px' src='images/blank.gif'/>";

        var li = document.createElement( "li" );
        li.className = "forward";
        li.innerHTML = "<a badgeid='" + badgeID + "' class='" + flag + "' href=\"javascript:void(0);\" onclick=\"saveUpPoint();setCurrentBadge( '" + badgeID + "', true, 'dissolve' );\"><span class='stunted'>" + strGlyph + strName + "</span> <small class=counter></small></a>";

        var strCategory = metadata.type;
        if ( strCategory == "Star" )
        {
            showStar = true;
            $('#star').append( li );
        }
        else if ( strCategory == "Award" )
        {
            showAwards = true;
            $('#awards').append( li );
        }
        else
            $('#badges').append( li );

        annotatePercentage( badgeID );
    }

    $('#star .glyph').toggle( showIcons );
    $('#awards .glyph').toggle( showIcons );
    $('#badges .glyph').toggle( showIcons );

    $('#star').toggle( showStar );
    $('#awards').toggle( showAwards );

    $("#activities .name").text( filter );

    g_nextAlphabetic = {};
    g_prevAlphabetic = {};

    var lastID = null;
    $( "#activities div.page-content li > a[badgeid]" ).each( function() {
        var badgeID = $(this).attr( "badgeid" );
        if ( lastID )
        {
            g_prevAlphabetic[badgeID] = lastID;
            g_nextAlphabetic[lastID] = badgeID;
        }
        lastID = badgeID;
    });

    if ( ! isLandscape() )
        updateAbbreviations( true );

    if ( bNavigate )
        gotoPage( '#activities', 'slide' );
};

function updateSnapshotTarget( youthID )
{
    var listSteps = [ "blackstar", "greenstar", "tawnystar", "redstar", "bluestar", "purplestar" ];
    var mapAreas = {
        "blackstar": "Natural World",
        "greenstar": "Outdoor Activity",
        "tawnystar": "Creative Expression",
        "redstar": "Health and Fitness",
        "bluestar": "Home and Community",
        "purplestar": "Canada and the World"
    };
    
    // do we need to build the list of badges?
    if ( $('#snapshot li[snapshot-progress]').length < listSteps.length )
    {
        $('#snapshot li[snapshot-progress]').remove();
        for ( var iStep = listSteps.length-1; iStep >= 0; iStep-- )
        {
            var badgeID = listSteps[iStep];
            var strBadgeName = getBadgeName( badgeID );
            var strGlyph = "<img class='glyph' style='margin-right:18px' src='images/blank.gif'/>";
            var flag = "incomplete";

            var htmlLink = "<li snapshot-progress><a badgeid='" + badgeID + "' href='javascript:void(0)' class='" + flag + "' onclick='saveUpPoint();populateActivity(\"" + mapAreas[badgeID] + "\", true, true);'><span class='stunted'>" + strGlyph + strBadgeName + "</span> <small class='counter textonly'></small></a></li>";

            if ( g_mode == "personal" )
                $('#snapshot').prepend( htmlLink );
            else
                $('#snapshot li:first-child').after( htmlLink );
        }
    }

    var showIcons = false;
    for ( var iStep = listSteps.length-1; iStep >= 0; iStep-- )
    {
        var badgeID = listSteps[iStep];
        var strGlyph = "";
        var flag = getBadgeStatus( youthID, badgeID );
        if ( flag == "awarded" )
        {
            strGlyph = "<img class='glyph' style='vertical-align:-2px;margin-right:2px;' src='images/check.gif'/>";
            showIcons = true;
        }
        else if ( flag == "complete" )
        {
            strGlyph = "<img class='glyph' style='vertical-align:-2px;margin-right:2px;' src='images/unawarded.gif'/>";
            showIcons = true;
        }
        else 
            strGlyph = "<img class='glyph' style='margin-right:18px' src='images/blank.gif'/>";

        $('li[snapshot-progress] a[badgeid=' + badgeID + '] img.glyph').replaceWith( strGlyph );

        annotatePercentage( badgeID );
    }
    $('li[snapshot-progress] a[badgeid] img.glyph').toggle( showIcons );

    $('#snapshot li[snapshot-progress] span.stunted').css( "margin-bottom", "-2px" );
};

function _addSectionCSS()
{
    return "";
};

function doPublishYouth( youthID )
{
    var html = "<!DOCTYPE html>\n";
    html += "<html>\n";
    html += "<head>\n";
    html += "  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
    html += "  <title>Personal Record Sheet - " + g_mapYouthNames[youthID] + "</title>\n";
    html += "  <meta http-equiv=\"X-UA-Compatible\" content=\"IE=9; IE=8; IE=7\" >\n";

    html += _addCSS( 9 );

    html += "</head>\n";
    html += "<body onload='var re=new RegExp(\"MSIE ([0-9]{1,}[\.0-9]{0,})\"); if(re.exec(navigator.userAgent)!=null){var ver=parseFloat(RegExp.$1);if(ver<8.0)alert(\"This report is optimized for display in IE8, IE9, Firefox, Chrome or Safari.\");}'>\n";
    html += "  <table class=\"wrapper " + (g_listQueuedYouth.length>0?"next-page":"") + "\"><tbody><tr><td>\n";
    html += "  <div class='title'>Personal Record Sheet&nbsp;<span style='color:#ccc;font-size:80%;'>by</span>&nbsp;<span style='color:#a43;'>scout-badges.com</span><div class=\"print\" onclick=\"if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1){if(confirm('Printing in Chrome is still not reliable.  More consistent results will be achieved in Firefox, IE8/9, or Safari.')){window.print();}}else if(confirm('Reports will look best when you select &quot;Shrink to Fit Page Width&quot;, and &quot;Print Background Colors &amp; Images&quot; from Page Setup before printing.')){window.print();}\">Print</div></div>\n";

    // add the awards badges
    html += _addMetaData( youthID, true, "  " );

    html += "  <table class='main badges small-badges'>\n";
    html += "    <tbody>\n";

    html += "      <tr> <!-- outings -->\n";
    html += _addOutings( youthID, 0, 8, "        " );
    html += "      </tr> <!-- END outings -->\n";

    html += "      <tr> <!-- header -->\n";
    html += "        <td colspan=3 style='text-align: center;'>\n";
    html += "          <div style='margin-top:10px;font-weight:bold;color:#621;font-size:120%;'>Activity Areas</div>\n";
    html += "        </td>\n";
    html += "      </tr> <!-- END header -->\n";

    html += "      <tr>\n";
    html += "        <td class='border'> <!-- left column -->\n\n";

    html += _addActivityArea( youthID, "Natural World", "          " );

    html += "        </td> <! -- END left column -->\n\n"; 
    html += "        <td></td>\n\n"; 
    html += "        <td class='border'> <!-- right column -->\n\n";

    html += _addActivityArea( youthID, "Outdoor Activity", "          " );

    html += "        </td> <! -- END right column -->\n\n"; 
    html += "      </tr> <!-- END first row of awards -->\n\n";

    html += "    </tbody>\n";
    html += "  </table>\n";

    html += "  <table class='main badges small-badges next-page'>\n";
    html += "    <tbody>\n";
    html += "      <tr>\n";
    html += "        <td class='border'> <!-- left column -->\n\n";

    html += _addActivityArea( youthID, "Creative Expression", "          " );

    html += "        </td> <! -- END left column -->\n\n"; 
    html += "        <td></td>\n\n"; 
    html += "        <td class='border'> <!-- right column -->\n\n";

    html += _addActivityArea( youthID, "Health and Fitness", "          " );

    html += "        </td> <! -- END right column -->\n\n"; 
    html += "      </tr> <!-- END second row of awards -->\n\n";

    html += "      <tr>\n";
    html += "        <td class='border'> <!-- left column -->\n\n";

    html += _addActivityArea( youthID, "Home and Community", "          " );

    html += "        </td> <! -- END left column -->\n\n"; 
    html += "        <td></td>\n\n"; 
    html += "        <td class='border'> <!-- right column -->\n\n";

    html += _addActivityArea( youthID, "Canada and the World", "          " );

    html += "        </td> <! -- END right column -->\n\n"; 
    html += "      </tr> <!-- END third row of awards -->\n\n";

    html += "      <tr> <!-- header -->\n";
    html += "        <td colspan=3 style='text-align: center;'>\n";
    html += "          <div style='margin-top:10px;font-weight:bold;color:#621;font-size:120%;'>Miscellaneous Badges</div>\n";
    html += "        </td>\n";
    html += "      </tr> <!-- END header -->\n";

    html += "      <tr>\n";
    html += "        <td class='border'> <!-- left column -->\n\n";

    html += "<table class='award-section small-badges' style='margin-top: 0;'>\n";
    html += "  <thead>\n";
    html += "    <tr><th>Specialty Badges</th></tr>\n";
    html += "  </thead>\n";
    html += "  <tbody>\n";
    html += "    <tr>\n";
    html += "      <td>\n\n";

    html += _addBadge( youthID, "individualspecialty", true, "         " );
    html += _addBadge( youthID, "packspecialty", true, "        " );

    html += "      </td>\n";
    html += "    </tr>\n";
    html += "  </tbody>\n";
    html += "</table> <!-- end award-section -->\n";

    html += "        </td> <! -- END left column -->\n\n"; 
    html += "        <td></td>\n\n"; 
    html += "        <td class='border'> <!-- right column -->\n\n";

    html += "<table class='award-section small-badges' style='margin-top: 0;'>\n";
    html += "  <thead>\n";
    html += "    <tr><th>Other</th></tr>\n";
    html += "  </thead>\n";
    html += "  <tbody>\n";
    html += "    <tr>\n";
    html += "      <td>\n\n";

    html += _addBadge( youthID, "extra_link", true, "         " );
    html += _addBadge( youthID, "flex", true, "        " );

    html += "      </td>\n";
    html += "    </tr>\n";
    html += "  </tbody>\n";
    html += "</table> <!-- end award-section -->\n";

    html += "        </td> <! -- END right column -->\n\n"; 
    html += "      </tr> <!-- END third row of awards -->\n\n";

    html += "    </tbody>\n";
    html += "  </table>\n";
    
    // Insert Outings (DEBUG)
    if ( false )
    {
        var listOutingIDs = sortOutingsByDate( g_mapOutings );
        for ( var iOuting = 0; iOuting < listOutingIDs.length; )
        {
            html += "  <table class='main awards outing-details'>\n";
            html += "    <tbody>\n";

            html += "      <tr>\n";
            html += "        <td class='border'> <!-- left column -->\n\n";

            html += _addOutingDetails( listOutingIDs[iOuting++], "          " );

            html += "        </td> <! -- END left column -->\n\n"; 
            html += "        <td></td>\n\n"; 
            html += "        <td class='border'> <!-- right column -->\n\n";

            if ( iOuting < listOutingIDs.length ) 
                html += _addOutingDetails( listOutingIDs[iOuting++], "          " );
            else
                html += "&nbsp;";

            html += "        </td> <! -- END right column -->\n\n"; 
            html += "      </tr> <!-- END first row of awards -->\n\n";

            html += "    </tbody>\n";
            html += "  </table>\n";
        }
    }

    html += "  </td></tr></tbody></table>\n";
    html += "</body>\n";
    html += "</html>";

    ajaxPublishReport( youthID, html, 3 );

    return html;
};

function _addActivityArea( youthID, categoryID, s )
{
    var html = "";

    html += s + "<table class='award-section small-badges' style='margin-top: 0;'>\n";
    html += s + "  <thead>\n";
    html += s + "    <tr><th><span style='color:" + CATEGORY_COLORS[categoryID] + ";'>&#9733;</span>&nbsp;" + categoryID + "</th></tr>\n";
    html += s + "  </thead>\n";
    html += s + "  <tbody>\n";
    html += s + "    <tr>\n";
    html += s + "      <td>\n\n";

    var uniformID = getYouthUniform( youthID );

    var setBadges = {};
    for ( var badgeID in g_dbTables['MetaData'] )
    {
        var metadata = g_dbTables['MetaData'][badgeID];
        if ( metadata['category'] == categoryID )
            setBadges[badgeID] = 1;
        if ( categoryID == "Canada and the World" && badgeID == "flex" )
            setBadges[badgeID] = 1;
    }

    var listBadges = sortBadgesByName( setBadges );

    for ( var iBadge = 0; iBadge < listBadges.length; iBadge++ )
        if ( g_dbTables['MetaData'][listBadges[iBadge]].type == "Star" )
            html += _addBadge( youthID, listBadges[iBadge], false, s + "         " );

    for ( var iBadge = 0; iBadge < listBadges.length; iBadge++ )
        if ( g_dbTables['MetaData'][listBadges[iBadge]].type == "Challenge" )
            html += _addBadge( youthID, listBadges[iBadge], false, s + "         " );

    for ( var iBadge = 0; iBadge < listBadges.length; iBadge++ )
        if ( g_dbTables['MetaData'][listBadges[iBadge]].type == "Award" )
        {
            // Canadian Heritage Trails and World Conservation have been deprecated
            if ( uniformID != 0 && ( listBadges[iBadge] == "canadianheritagetrails" || listBadges[iBadge] == "worldconservation" ) )
                continue;

            html += _addBadge( youthID, listBadges[iBadge], false, s + "         " );
        }

    html += s + "      </td>\n";
    html += s + "    </tr>\n";
    html += s + "  </tbody>\n";
    html += s + "</table> <!-- end award-section -->\n";

    return html + "\n";
};

function translateBadgeImage( badgeID, uniformID )
{
    return badgeID;
};

