$(document).ready(function() {

    // Navigation menus

    $('.menu').hover(
        function () {
            $("ul",this).fadeIn(200);
        },
        function () {
            $("ul",this).fadeOut(200);
        }
    );

    // Latest tweets

    twitterlib.timeline('farm2family', {limit: 3}, function(tweets, options) {

        for (var i = 0; i < options.limit; i++) {

            article = $("<article></article>");
            p       = $("<p></p>");
            address = $("<address></address>");
            anchor  = $("<a></a>");

            p.html(this.ify.clean(tweets[i].text));

            anchor.prop("href", "http://twitter.com/farm2family/status/" + tweets[i].id_str);
            anchor.html("Posted " + this.time.relative(tweets[i].created_at));

            address.append(anchor);
            article.append(p).append(address);

            $("#tweets").append(article);

        };

    });

});
