jQuery .hide() and .show() now working in one instance
<p>I have 2 buttons that I am trying to show/hide by toggling and using the jQuery hide and show functions. But for some reason I can't get them to work.</p>

<p>It happens when a person votes on an item.  Here is the code:</p>

<pre><code>    // Called right away after someone clicks on the vote up link
    $('.vote_up').click(function() 
    {        
        $("#loading").show();
        var problem_id = $(this).attr("data-problem_id");

        vote(problem_id , 1);

        //Return false to prevent page navigation
        return false;       
    });

    $('.vote_down').click(function() 
    {
        $("#loading").show();
        problem_id = $(this).attr("data-problem_id");

        vote ( problem_id , -1 );

        //Return false to prevent page navigation
        return false;
    });       

// Global function
var vote = function(problem_id , vote) 
{
    var dataString = 'problem_id=' + problem_id + '&amp;vote=' + vote;

    // The person is actually logged in so lets have him vote
    $.ajax({
        type: "POST",
        url: "/auth/check_login.php",
        dataType: "json",
        success: function(data)
        {
            $.ajax({    
                type: "POST",
                url: "/problems/vote.php",
                data: dataString,
                success: function(html)
                      { 
                           $("#loading").hide();
                           if ( html == "not_logged_in" )
                           {
                               queue.login = false;

                               //set the current problem id to the one within the dialog
                               $problemId.val(problem_id);                  

                               // Try to create the popup that asks user to log in.
                               $("#loginpopup").dialog(  {title: 'Please Login To Vote'} );  // title: 'Login Dialog'

                               // prevent the default action, e.g., following a link
                               return false;
                           }
                           else
                           if ( html == "already_voted" )
                           {
                               // Display a dialog box saying that the user already voted
                               $('&lt;div&gt;You already voted this way on this problem.&lt;/div&gt;').dialog( {title: 'Already Voted'});
                               // show div which says un-important, hide div which says important

                               $("#support").hide();
                               $("#dont_support").show();                               
                           }
                           else
                           if (  html == "error_getting_vote" )
                           {
                               $('&lt;div /&gt;').html('Error getting existing votes.').dialog();
                           }
                           else
                           {
                               // Now make a call to AJAX to get the count of votes
                               $.ajax({    
                                   type: "POST",
                                   url: "/problems/get_vote_count.php",
                                   data: dataString,
                                   success: function(html)   
                                   {
                                       var class_name = ".votes_"+problem_id;

                                       $(class_name).text(html);                                   
                                   }
                                });                                
                           }                        
                      },
                      error: function(html) 
                      {
                          $("#loading").hide();
                      } // End of error case    
                }); // Closing inner AJAX call.
            },
            error: function(data)
            {
                $("#loading").hide();
                $("#loginpopup").dialog( {title: 'Please Login To Vote'} );

                return false;
            } // End of error
        }); // End of outer AJAX.

return false;
};    
</code></pre>

<p>You see in the if for this: if ( html == "already_voted" )</p>

<p>the popup does come up, but for some reason the .hide and the .show functions right below it don't work.</p>

<p>Here is an example page where this happens:
<a href="http://www.problemio.com/problems/problem.php?problem_id=213" rel="nofollow">http://www.problemio.com/problems/problem.php?problem_id=213</a></p>

<p>Any idea why?</p>
