﻿//common
String.prototype.startsWith = function(t, i) {
    if (i == false) {
        return
(t == this.substring(0, t.length)); } else { return (t.toLowerCase()
== this.substring(0, t.length).toLowerCase()); } }

String.prototype.endsWith = function(t, i) { if (i==false) { return (t
== this.substring(this.length - t.length)); } else { return
(t.toLowerCase() == this.substring(this.length -
t.length).toLowerCase()); } } 

//links
$(document).ready(function() {
    $('a').each(function() {
        if ($(this).attr('href')) {
            if ($(this).attr('href').startsWith('http://'))
                $(this).attr('target', '_blank');
            else if ($(this).attr('href').indexOf('/share/?t=') >= 0)
                $(this).attr('target', '_blank');
        }
    });
});