title: Changing url when opening and closing fancybox
body: <p>I am using this code with fancybox 1.3.7. When fancybox opens url changes to the corresponding div (/page#div-id), when it closes it is supposed to go back to /page but the commented function doesn't work. I had to use a temporary value as shown below. How can I fix this?</p>
  
  <pre><code>window.onload = function(){
      function showfb(id) {
          if (/^#.*/.test(id)) {
              $(id).show();
              $.fancybox({
                  href: id,
                  type:'inline',
                  position: 'center',
                  'transitionIn': 'fade', // elastic, none, ease, fade
                  'transitionOut': 'fade',
                  onClosed: function(){
                      //$(id).hide();
                      window.location.hash = "_"; // temporary
                  }
              });
          }
      }
      showfb(location.hash);
      $('a.profile').click(function(e){
              showfb($(this).attr('href'));
      });
  };
  </code></pre>