// JavaScript Document

jQuery(document).ready(function($) {

    (function($) {
        $.fn.verticalAlign = function() {
            return this.each(function(i) {
                var oh = $(this).height();
                var wh = $(window).height();
                var middle = (wh - oh) / 2;
                if (middle > 0) {
                    $(this).css('margin-top', middle);
                } else {
                    $(this).css('margin-top', 0);
                }
            });
        };
    })(jQuery);

    $(window).load(function() {
        $("#content").verticalAlign();

        var showContent = function() {
            $('#content').fadeIn(750);
        };
        setTimeout(showContent, 250);

    });

    $(window).bind('resize', function() {
        $("#content").verticalAlign();
    });

    $("#email").each(function() {
        this.href = this.href.replace(/\s*\[at\]\s*/, '@').replace(/\s*\[dot\]\s*/g, '.');
    });
});
