function SaveReferrer() {
  var ignorePattern = /^https?:\/\/(www\.)?(nscnotes|nationwidesecuredcapital)\.com/i;
  if (typeof document["referrer"] != "undefined" && !ignorePattern.test(document.referrer)) {
    document.cookie = "HTTP_REFERER=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT";
    document.cookie = "HTTP_REFERER=" + escape(document.referrer) + ";path=/";
  }
}

function SaveReferrerAndRedirect(url) {
  SaveReferrer();
  window.location.replace(url);
}
