$J(document).ready(function(){
    
    $J('.reklamaBlokNazev1').click(function(){
        $J('.reklamaBlokText1').slideToggle('fast',function(){});
    });

    $J('.reklamaBlokNazev2').click(function(){
        $J('.reklamaBlokText2').slideToggle('fast',function(){});
    });

    $J('.reklamaBlokNazev3').click(function(){
        $J('.reklamaBlokText3').slideToggle('fast',function(){});
    });

    prohlidkaJdi(1);

});

var tourSize;
var tourIndex;
function refreshProhlidka(tourSize)
{
    $J('.tour .slider').removeClass('inactive');
    if (tourIndex == 1)
    {
        $J('.tour .slider.left').addClass('inactive');
    }
    if (tourIndex == tourSize)
    {
        $J('.tour .slider.right').addClass('inactive');
    }
}

function prohlidkaJdi(newIndex, tourSize)
{
    if (newIndex < 1 || newIndex > tourSize)
    {
        return;
    }
    tourIndex = newIndex;
    $J('.tour .view').scrollTo($J('.tour .item')[newIndex - 1], 400);
    $J('.tour-contents .item').removeClass('selected');
    $J($J('.tour-contents .item')[newIndex - 1]).addClass('selected');
    refreshProhlidka(tourSize);
}

function prohlidkaPosuv(dir, tourSize)
{
    prohlidkaJdi(tourIndex + dir, tourSize);
}


