Variable is undefined whereas it defined
<p>The code below gives an undefined error on console for the variable <code>mystyle</code>. I don't get it as i defined the variable.</p>

<pre><code>jQuery( '.styles_div' ).each( function() {
switch (styles) {
    case 'style1':
        var mystyle = $('#stylewrap').append('&lt;div class="style1"&gt;&lt;/div&gt; ');
        break;
    case 'style2':
        var mystyle = $('#stylewrap').append('&lt;div class="style2"&gt;&lt;/div&gt; ');
        break;
}
$("#search").autocomplete({
    delay: 0,
    minLength: 3,
    search: function( event, ui ) {mystyle.show();},
    ...
})
});
</code></pre>
