$(document).ready(function() {
    $('ul.states span').click(function() {
        $(this).parent().toggleClass('open');
        $(this).parent().children('ul').toggle();
    });
});