title: jQuery function calling twice
body: <p>I've got this jquery code, and once I call it the first part of the function initiates, but then right after that the second part initiates; it's like the if statement isn't working. Have i got any problems with my code?</p>
  
  <pre><code>$(".pinPane").click(function() 
  {
      if ($('.pinPane').hasClass('open')) 
      {
          var htable = $('#content-panel-content').height();
          var wtable = $('#content-panel-content').width();
          var panew = wtable - 2;
          var paneh = htable * 0.7;
          var tableh = htable * 0.3;
          $('.pane')
              .height(paneh)
              .width(panew)
              .addClass('panepinned')
              .removeClass('shadow');
          $('#content-panel-content').height(tableh);
          $('.pinPane').addClass('cls').removeClass('open');
      } 
      else 
      {
          $('#content-panel-content').css('height', '100%');
          $('.pane').css('height', '100%').css('height', '-=200px');
          $('.pane').css('width', '100%').css('width', '-=40px');
      };
  });
  </code></pre>