$(function() {
    var states = [];
    var stateCount = 0;
    $("h2").each(function() {
        var state = $(this).text();
        states[stateCount] = state;
        state = state.toLowerCase();
        $(this).attr("id", state);
        if (stateCount > 0) {
            $(this).before('<p class="right"><a href="#uscc">&#9650; Back to Top</a></p>');
        }
        stateCount++;
    });

    var output = '<form action="" method="get"><div style="font-size: 75%; margin-bottom:1em"><select id="jump">';
    for (var i = 0; i < states.length; i++) {
        output += '<option value="#'+ states[i].toLowerCase() +'">'+ states[i] +'<\/option>';
    }
    output += '<\/select> <input type="button" value="View" onclick="window.location=document.getElementById(\'jump\').value" \/><\/div><\/form>';
    $("h2:first").before(output);
    $("h2+h3").css("border", "0");
});