title: Javascript: Object's this.var inside jQuery method
body: <p>I can't figure this one out:</p>
  
  <p>I have a function, e.g.</p>
  
  <pre>
  function test () {
    this.rating = 0;
    $j('#star_rating a').click(function() {
      alert(this.rating);
    });
  }
  
  var foo = new test();
  </pre>
  
  <p>On click it alerts "undefined". What is wrong? Please help.</p>