title: jquery variable in function
body: <p>On pageload I set a variable</p>
  
  <pre><code>$(document).ready(function() {
    var inv_count = 3;
    });
  </code></pre>
  
  <p>When I try to refer to that variable inside functions though, it doesn't work.</p>
  
  <pre><code>function blah(a,b) {
     alert (inv_count);
     }
  </code></pre>
  
  <p>Why is this? And how can I get around it?</p>
  
  <p>(rookie here)</p>