$(document).ready(function () {
    function formatText(index, panel) {
        if (index == 6) {
            addButtons();
        };
        return index + "item";
    };
    function addButtons() {
        var intCounter = 0;
        $('div.thumbNav ul li').each(function () {
            intCounter++;
            $(this).addClass('button' + intCounter);
        });
    };

    $('.anythingSlider').anythingSlider({
        easing: "swing",                    // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                     // This turns off the entire FUNCTIONALY, not just if it starts running or not
        startStopped: false,                // If autoPlay is on, this can force it to start stopped
        delay: 15000,                       // How long between slide transitions in AutoPlay mode
        animationTime: 700,                // How long the slide transition takes
        hashTags: false,                    // Should links change the hashtag in the URL?
        buildNavigation: true,              // If true, builds and list of anchor links to link to each slide
        pauseOnHover: true,                 // If true, and autoPlay is enabled, the show will pause on hover
        //startText: "Start",               // Start text
        //stopText: "Stop",                 // Stop text
        navigationFormatter: formatText     // Details at the top of the file on this use (advanced use)
    });

    $('#readMore').click(function () {
        $('#ronit-letter').show("scale", {}, 200, function () {
            $('#ronit-letter').css('background', 'none');
            $('.ronit-letter-content-bg, .ronit-letter-picture').removeAttr('style');
            $('.closeTop, .closeBottom').css('display', 'block');
        });
        return false;
    });

    $('.closeTop a, .closeBottom a').click(function () {
        $('.closeTop, .closeBottom').css('display', 'none');
        $('.ronit-letter-picture, .ronit-letter-content-bg').css('display', 'none');
        $('#ronit-letter').hide();
        return false;
    });
});

