$(function()
{
    $('.blog-entries-list h3:first, .blog-entries-list p:last').addClass('no-border');

    /**
     * ...
     */
    Custom.init();

    /**
     * ...
     */
    $('.follow-link').hoverIntent(function()
    {
        $(this).animate({ marginTop: '-75px', opacity: 1.0 });
    }, function()
    {
        $(this).animate({ marginTop: '-50px', opacity: 0.65 });
    });

    /**
     * ...
     */
    $("ul.subnav").parent().addClass('has-drop-down').hoverIntent(function() {
        $(this).addClass('hover').find("ul.subnav").slideDown('fast').show();
    }, function()
    {
        $(this).removeClass('hover').find("ul.subnav").slideUp('normal');
    });

    /**
     * ...
     */
    $.blockUI.defaults.css = {};

    $('.top-nav .login').click(function(e)
    {
        $(this).addClass('on');
        e.preventDefault();

        var offset = $('#login').show().offsetParent().offset();
        $('#login').hide();

        $.blockUI({
            message: $('#login'),
            css: { top: offset.top + 'px', left: offset.left + 'px' },
            overlayCSS: { opacity: '0.7' },
            baseZ: 998 // make sure dialog is always on top
        });

        $('#login').find('input:first').trigger('focus');
    });

    $('.close-login').click(function(e)
    {
        e.preventDefault();
        $('.top-nav .login').removeClass('on');
        $('#login').fadeOut();
        $.unblockUI();
    });

    /**
     * Add default values to inputs
     *
     * @note    Specify default values with the "rel" attribute, i.e:
     *          <input type="text" name="email" value="" rel="Email..." />
     * @see     http://www.unwrongest.com/projects/defaultvalue/
     */
    $('input.defaultValue, textarea.defaultValue').defaultValue();

    /**
     * ...
     */
    $('a.dummy').click(function(e)
    {
        e.preventDefault();
    });
});

