var jsSlide = true;
var jsSlideCurrent = 0;
var jsSlideSize = 330;
var jsSlideMax = 0;

function ThinQSlideLeft(Count)
{
    jsSlideMax = Count-1;
    if (jsSlide)
    {
        jsSlide = false;
        if (jsSlideCurrent < (Count-1))
        {
            for (i=0; i<Count; i++) new Effect.MoveBy( 'ThinQSlideContentBox'+i, 0, jsSlideSize*-1 , {duration: 1.0} );
            jsSlideCurrent++;
        }        
        new PeriodicalExecuter(function(pe)
        {
            jsSlide = true;
            pe.stop();
        }, 2);
    }
    //  update bol    
    ThinQSlideBol();
}

function ThinQSlideRight(Count)
{
    jsSlideMax = Count-1;
    if (jsSlide)
    {
        jsSlide = false;        
        if (jsSlideCurrent > 0)
        {
            for (i=0; i<Count; i++) new Effect.MoveBy( 'ThinQSlideContentBox'+i, 0, jsSlideSize , {duration: 1.0} );
            jsSlideCurrent--;
        }
        new PeriodicalExecuter(function(pe)
        {
            jsSlide = true;
            pe.stop();
        }, 2);        
    }
    //  update bol    
    ThinQSlideBol();
}

function ThinQSlideGo(P, Count)
{
    //  set the max
    jsSlideMax = Count-1;
    //  calculate the factor
    var Factor = (jsSlideCurrent - P) * jsSlideSize;
    //  scroll
    if (Factor != 0 && jsSlide)
    {
        jsSlide = false;
        if (jsSlideCurrent < (Count-1)) for (i=0; i<Count; i++) new Effect.MoveBy( 'ThinQSlideContentBox'+i, 0, Factor , {duration: 1.0} );
        jsSlideCurrent = P;
        new PeriodicalExecuter(function(pe)
        {
            jsSlide = true;
            pe.stop();
        }, 2);
        
    }        
    //  update bol
    ThinQSlideBol();
}

function ThinQSlideBol()
{
    //  Check for left & right
    if (jsSlideCurrent == 0)         $('ThinQSlideLeftImg').src  = 'http://www.paymans-online.nl/_img/thinqslide_left0.gif';  else $('ThinQSlideLeftImg').src  = 'http://www.paymans-online.nl/_img/thinqslide_left1.gif';
    if(jsSlideCurrent == jsSlideMax) $('ThinQSlideRightImg').src = 'http://www.paymans-online.nl/_img/thinqslide_right0.gif'; else $('ThinQSlideRightImg').src = 'http://www.paymans-online.nl/_img/thinqslide_right1.gif';
    
    //  Update bol
    for (var i=0; i<= jsSlideMax; i++) $('ThinQSlideNumber'+i).src = 'http://www.paymans-online.nl/_img/thinqslide_bol0.gif';
    $('ThinQSlideNumber'+jsSlideCurrent).src = 'http://www.paymans-online.nl/_img/thinqslide_bol1.gif';
}