﻿$(document).ready(function() {
    try {
        $("a").each(function() {
            // Track external links
            var current = $(this);
            if (current.attr("onclick") == "" || current.attr("onclick") == null) {
                if (current.attr("href") != null && current.attr("href") != "" && current.attr("href").indexOf("javascript:") != 0 && current.attr("href").indexOf("store.") == -1 && location.host != this.host.replace(/\:80$/i, "")) {                    
                    var url = $(this).attr("href").replace(/^http\:\/\/(www\.)*/i, "")
                    $(this).click(function() {
                        var location = BaseUrl + "ExternalURL.aspx?RedirectURL=" + escape($(this).attr("href"));
                        window.open(location, "ExternalURL");
                        return false;
                    })
                }
            }

        });
    }
    catch (er) {
    }
});
