$(function () {
    var killScroll = false;
    
    /*** Homepage slide plugin call ***/
    $('#slides').slides({
        play: 5000,
        pause: 2500,
        slideSpeed: 600,
        hoverPause: true,
        preload: true
    });
    /*** Add span in any lists so they can be styled  ***/
    $('.additional-info li').each(function () {
        $(this).html("<span>" + $(this).html() + "</span>");
    });

    $('.main-text').ellipsis({ live: true });

    $('.read-more').click(function () {
        var article = $(this).parent().parent();
        if (article.hasClass('expanded')) {
            article.height('155px');
            article.find('.main-text').height('60px');
            article.find('.additional-info').css('display', 'none');
            article.removeClass('expanded');
            $(this).text(readMore);
            $('.main-text').ellipsis({ live: true });
        }
        else {
            article.height('100%');
            //article.animate('height','100%');
            article.find('.main-text').height('100%');
            article.find('.additional-info').css('display', 'block');
            article.addClass('expanded');
            $(this).text(readLess);
            $('.main-text').ellipsis({ live: false });
        }
        //call the Cufon replace again as we are changing text
        Cufon.replace('.read-more', { color: "#CA2F25" });

    });

});
























