/**
 * Fix up
 * 
 *     <span class="email">
 *         <span class="uname">user</span>
 *         <span class="atsign">[at]</span>
 *         <span class="domain">doman.com</span>
 *     </span>
 * 
 * into
 *
 *     <a href="mailto:user@domain.com">user@domain.com</a>
 *
 */
var replace_emails = function()
{
    $('span.email').each(function(){
        var uname    = $(this).children('.uname').html(),
            domain   = $(this).children('.domain').html(),
            email    = uname + '@' + domain,
            linktext = '<a href="mailto:'
                       + email + '">' 
                       + email + '</a>';
        $(this).after(linktext)
               .remove()
        ;
    });
};



/**
 * get rid of margin-top on first h2 in first column
 */
var remove_first_h2_margin_top = function()
{
    $('#column1 h2:first').css('margin-top',0);
};


// load things up
$(remove_first_h2_margin_top);
$(replace_emails);
