clearTimeout is not working for some reason
<p>I am not sure what is wrong with my code here, I've set the variable global but the clear timeout is still not working here.</p>

<p>Thank you,
Kelvin</p>

<pre><code>var myslide = null;
$(document).ready(function () {
    var current = null;

    $('ul#panel li a').click(function () {
        stopAuto();
        $('ul#panel li a').removeClass('active');
        $(this).addClass('active');
        current = $(this).attr('href');
        $('#wrapperSlide').clearQueue();
        $('#wrapperSlide').scrollTo($(current), 800);
        return false;
    });

    if (current==null)
    { 
        $("ul#panel li").each(function(i){
        var counter1 = i+1;
        var timer1 = counter1 * 5000;
        myslide = setTimeout(function(){
        setLoop1(counter1);
        },timer1);
    });
    } else {
        $('#wrapperSlide').clearQueue();
        return false;
    }
});
</code></pre>

<p>these are the functions for looping the slide images and stop auto  </p>

<pre><code>  function setLoop1(counter)
{     
      var counter4 = counter;
      var myID = $('a#'+counter4).attr('href');
      $('ul#panel li a').removeClass('active');
      $('a#'+counter4).addClass('active');
      $('#wrapperSlide').scrollTo($(myID), 800);
}

//function to stop the auto slide

function stopAuto() {

    clearTimeout(myslide);
}
</code></pre>
