function sliderToggle() {

    // Get current button
    var currentButton = $(this);

    // Get the buttons subsequent element
    var myNextContent = currentButton.next();

    // Find out if next element has desired class
    if (!myNextContent.hasClass("lower_extra_content")) {
        // extra content not found
        return;
    }

    // Switch open close instruction
    var myShowCopy = currentButton.find('div.show_copy');
    var myHideCopy = currentButton.find('div.hide_copy');

    var ie7 = false /*@cc_on || @_jscript_version <= 5.7 @*/;

    if (myShowCopy.is(':visible')) {
        // Slide open extra content and toggle button
        if (ie7) {
            myNextContent.show();
            myShowCopy.hide();
            myHideCopy.show();
        } else {
            myNextContent.slideDown('slow', function () {
                myShowCopy.hide();
                myHideCopy.show();
            });
        }

    } else if (myShowCopy.is(':hidden')) {
        // Slide close extra content and toggle button
        if (ie7) {
            myNextContent.hide();
            myShowCopy.show();
            myHideCopy.hide();
        } else {
            myNextContent.slideUp('slow', function () {
                myShowCopy.show();
                myHideCopy.hide();
            });
        }
    }
}

function accordionToggle() {

    // Get current button
    var currentButton = $(this);

    // Get the buttons subsequent element
    var myNextContent = currentButton.next();

    // Find out if next element has desired class
    if (!myNextContent.hasClass("accordion_content")) {
        // extra content not found
        return;
    }

    var ie7 = false /*@cc_on || @_jscript_version <= 5.7 @*/;

    // Slide open extra content and toggle button
    if (ie7) {
        $(".accordion .accordion_content").not(myNextContent).hide();
        myNextContent.show();
    } else {
        $(".accordion .accordion_content").not(myNextContent).slideUp("slow");
        myNextContent.slideDown('slow');
    }
}

$(function () {

    // Hide all extra content divs
    $('div.lower_extra_content').hide();

    // Hide all hide_copy divs
    $('div.hide_copy').hide();

    // Apply click function to toggle buttons
    $('div.content_toggle').click(sliderToggle);

    $(".accordion .accordion_content").not($(".accordion .accordion_content.default")).hide();
    $(".accordion .accordion_toggle").click(accordionToggle);

    /* Fix anchor to an element that may have been moved by preceding code. */
    if (window.location.hash) {
        window.location.hash = window.location.hash;
    }

});
