Why is this simple jQuery not working?
<p>I am trying to send the user to either google or yahoo depending on which link they clicked, if they clicked the 1st one they will be taken to google, and if they clicked the seond they will be taken to yahoo.</p>

<p>So for the window.location function I am using a variable called website which I'm defining based on which link the user clicked. But it's not working. The variable isn't being recognized:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function(){

        // define the variable website based on which link is clicked
        $('a').eq(0).click(function() {
            var website = 'http://google.com';
        });
        $('a').eq(1).click(function() {
            var website = 'http://yahoo.com';
        });

        $('a').click(function() {
            window.location = website;
        });

    });
&lt;/script&gt;

&lt;a href="#"&gt;Link 1&lt;/a&gt;
&lt;br /&gt;
&lt;a href="#"&gt;Link 2&lt;/a&gt;
</code></pre>
