// "use strict"; - someday we'll be futureproof
// most of this will probably go by the wayside

// this should be *just* annoying enough for robots
function mail(user, host, tld, subject) {
    var email = 'mailto:' + user + '@' + host + '.' + tld + '?subject=' + subject;
    window.location = email;
}

// lets see what you're running
function iecheck() {
    $(document).ready(function() {
        var $browserupgrade = $('#browserupgrade');
        if (jQuery.browser.msie && parseInt(jQuery.browser.version,10) <= 8) {
            var message = 'Ahoy hoy! You should download <a href=\'http:\/\/www.google.com/chrome/\'>Chrome</a>, <a href=\'http:\/\/www.getfirefox.com/\'>Firefox</a>, or <a href=\'http:\/\/www.apple.com/safari/\'>Safari</a>';
            $($browserupgrade).css('display','block').html(message).after("<br />");
        }
    });
}

// here or there
function selfOrBlank() {
    $(document).ready(function() {
        var site = /www.cowbird.org/i;
        $('a').each(function() {
            if (site.test(this.href)) {
                $(this).attr('target','_self');
            }
            else if (this.href !== "") {
                $(this).attr('target','_blank');
            }
        });
    });
}

/* via http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar/ */
/mobile/i.test(navigator.userAgent) && setTimeout(function () { window.scrollTo(0, 1); }, 1000);
