increase var as number
<p>I got the following code:</p>

<pre><code>window.setInterval(function(){
    var id = $('.slidermenu.currentone').attr('data-id');
    var newid = parseInt(id) + 1;
    //alert(newid + ' - ' + id);

    $('.slidermenu.currentone').animate({backgroundColor: 'white'}, 'slow');
    $('.slidermenu.currentone').removeClass("currentone");
    $('slidermenu[date-id='+newid+']').animate({backgroundColor: '#f3f3f3'}, 'slow');
    $('slidermenu[date-id='+newid+']').addClass("currentone");
    $('#activeimage img.currentone').fadeOut('slow');
    $('#activeimage img.currentone').removeClass("currentone");
    $('#activeimage img[data-id='+newid+']').fadeIn('slow');
    $('#activeimage img[data-id='+newid+']').addClass("currentone");
}, 3000);
</code></pre>

<p>Im trying to make a fucntion which runs each 3 second, and then make my slider show the next image. well, it works pretty good first time it runs. But second time, it just doesn't work.</p>

<p>I think the problem might be with making the <code>var newid</code> have the number of from <code>id</code>, plus <code>1</code>.</p>

<p>Hope someone can help me.</p>

<p>Also, I actually need it to do this up to number 5, and then after that goes down to number 1 again.</p>

<p>Thanks in advanced.</p>
