$(function() {

    $('#banner-left-slider').cycle({
        fx: 'fade',
        speed: 2500,
        timeout: 5000
    });


    $(function () {
        $("#accordion").accordion({
            collapsible: true,
            active: false,
            autoHeight: false
        });
    });


 //   $('#projects .project:nth-child(3n+3)').addClass('third-project');
    
    // page header titles
    var path = window.location.pathname.match(/\/(.+?)(\/|$)/);
    var titleElement = $('#banner-left .title h1');
    
    if (path && path[1]) {
        var page = path[1].toLowerCase();
        var title = titleElement.html();

        switch (page)
        {
            case 'about-us':
                title = 'About <strong>Us</strong>';
                break;
            case 'projects':
                title = '<strong>Projects</strong>';
                break;
            case 'accreditation':
                title = '<strong>Accreditation</strong>';
                break;
            case 'jfc-policy':
                title = 'JFC <strong>Policy</strong>';
                break;
            case 'careers':
                title = '<strong>Careers</strong>';
                break;
            case 'community':
                title = '<strong>Community</strong>';
                break;
            case 'contact-us':
                title = '<strong>Contact Us</strong>';
                break;
            case 'magazine':
                title = '<strong>Magazine</strong>';
                break;
            default:
                title = 'Welcome to <strong>JFC</strong>';
                break;
        }
        
        titleElement.html(title);
    }
    
    titleElement.show();
});
