$(document).ready(function()
{
    //THIS IS FOR THE SEO FOOTERS
    //hide the all of the elements with class read-more-body
    $(".read-more-body").hide();
    //toggle the componenet with class read-more-link
    $(".read-more-link").click(function()
    {
        $(".read-more-body").slideToggle(600);
    });

    $('.read-more-link').toggle(function() {
        $(".read-more-link").html("<img class='read-more-img' src='" + website_url + "images/graphics/icon-read-less.png' alt='Read about our phone systems' />");
    }, function() {
        $(".read-more-link").html("<img class='read-more-img' src='" + website_url + "images/graphics/icon-read-more.png' alt='Read about our phone systems' />");
    });
    
    //THIS IS FOR THE ASTERISK ACADEMY SECTION
    //hide the all of the elements with class read-more-body
    $(".academy-read-more-body").hide();
    
    //toggle the componenet with class read-more-link
    $(".academy-read-more-link").click(function()
    {
        $(this).parents(".academy-read-more-box").children(".academy-read-more-body").slideToggle(600);
        
        
        if ($(this).hasClass("academy-chapter-title")) {
            
            //console.log("We clicked the title");
            
            //swap images - +
            if ($(this).prev().children("img").attr('src') == website_url + 'images/graphics/icon-read-more.png')
                $(this).prev().children("img").attr('src', website_url + 'images/graphics/icon-read-less.png');
            else
                $(this).prev().children("img").attr('src', website_url + 'images/graphics/icon-read-more.png');
            
            
        } else {
            
            //console.log("We clicked the image");
            
            //swap images - +
            if ($(this).children("img").attr('src') == website_url + 'images/graphics/icon-read-more.png')
                $(this).children("img").attr('src', website_url + 'images/graphics/icon-read-less.png');
            else
                $(this).children("img").attr('src', website_url + 'images/graphics/icon-read-more.png');
        }
        
            
    });
});

