(function($){

    var removeFilter = function()
    {
        if ($.browser.msie) this.style.removeAttribute('filter');
    };

    $(function(){
        
        // Back-up in case nth-child isn't supported.
        $("div.content-minor ul li:nth-child(odd)").addClass("odd");
        $("div.content-minor ul li:nth-child(even)").addClass("even");

        var expander = $("<a>", {
            href: '#',
            html: 'More &raquo;'
        })

        var intro = $("#introduction")
            .children(":not(:first)")
                .hide()
            .end()
            .children(":first")
                .append(' ')
                .append(expander)
            .end();

        expander.click(function(){            

            intro.children(":not(:first)").fadeIn(400, removeFilter);
            expander.hide();

            return false;
            
        });

        // The animation.
        var protecting = $("#protecting")            
            .css('display', 'block')
            .css('opacity', 0);

        var ingenuity = $("#ingenuity")            
            .css('display', 'block')
            .css('opacity', 0);      

        var since1970 =
            $("#since-1970")            
            .css('display', 'block')          
            .css('opacity', 0);

        var delay = 1500;
        var duration = 1000;

        var step1, step2;

        step1 = function() {
            protecting
            .add(ingenuity)
            .add(since1970)
            .delay(delay)
            .animate({
                opacity: 1                
            }, {
                duration: duration,
                complete: step2
            })
        };        

        step2 = function() {
            protecting            
            .add(since1970)
            .delay(delay)
            .animate({
                opacity: 0
            }, {
                duration: duration
            });
        };

        step1();

    });    
    
})(jQuery);


