title: hidding elements in a layout page mvc3
body: <p>ok so im having a hard time hiding some layout sections (divs in my layout page and im using mvc3). </p>
  
  <p>I have this js fragment which is basically the main logic: </p>
  
  <pre><code>$('.contentExpand').bind('click', function () {
              $.cookie('right_container_visible', "false");
          });
  
          //Cookies Functions========================================================
          //Cookie for showing the right container
          if ($.cookie('right_container_visible') === 'false') {
              if ($('#RightContainer:visible')) {
                  $('#RightContainer').hide();
              }
              $.cookie('right_container_visible', null);
          } else {
              if ($('#RightContainer:hidden')) {
                  $('#RightContainer').show();
              }
          }
  </code></pre>
  
  <p>as you can see, im hidding the container whenever i click into some links that have a specific css. This seems to work fine for simple tests. But when i start testing it like </p>
  
  <p>.contentExpand click --> detail button click --> .contentExpand click --> [here unexpected issue: the line $.cookie('right_container_visible', null); is read but it doesnt set the vaule to null as if its ignoring it]</p>
  
  <p>Im trying to understand whats the right logic to implement this. Anyone knows how i can solve this?</p>