title: How to change a javascript variable?
body: <p>I'm trying to change a variable depending on what it's current value is:</p>
  
  <pre><code>window.addEventListener("popstate", function(e) {     
      if (direction === leftnav){
          direction = rightnav
      }
      else{
         direction = leftnav
      };
  
      loadPage(location.pathname);
  });
  </code></pre>
  
  <p>this doesn't seem to work somehow :s
  can someone help me with this?
  Thanks in advance :)</p>
  
  <p>EDIT: here is the full  js file: <a href="http://pastebin.com/7zZseW74" rel="nofollow">http://pastebin.com/7zZseW74</a></p>
  
  <p>EDIT 2: what seems to happen is that the loadPage function just does not seem to fire...</p>