( function() { var sendCookie = function() { var cookieId = Bloomerang.Util.getCookie('bloomerangConstituent'); var accountId = Bloomerang.Util.getQueryStringValue('blm_aid'); var success = function(result) { if(result.IsSuccess) { document.cookie = 'bloomerangConstituent=' + result.CookieId + '; expires=' + new Date('2038/01/01').toUTCString() + '; path=/'; var secureDonationLink = jQuery('#bloomerangSecureDonationLink'); if(secureDonationLink.length > 0 && secureDonationLink.attr('href').indexOf('BloomerangCookieId') == -1) { secureDonationLink.attr('href', secureDonationLink.attr('href') + '&BloomerangCookieId=' + result.CookieId); } } }; var visit = { CookieId: cookieId, AccountId: accountId, Url: window.location.href, Referrer: document.referrer }; Bloomerang.useKey('pub_c1608cb5-29f6-11ed-99a7-0a5c558975e5'); Bloomerang.Api._post('v1/WebsiteVisit/', visit, success); }; var startBloomerangLoad = function() { if (window.bloomerangLoadStarted == undefined) { window.bloomerangLoadStarted = true; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'https://crm.bloomerang.co/Content/Scripts/Api/Bloomerang-v2.js?nocache=1730300639'; document.getElementsByTagName('head')[0].appendChild(script); waitForBloomerangLoad(sendCookie); } else { waitForBloomerangLoad(sendCookie); } }; var waitForBloomerangLoad = function(callback) { if (typeof(Bloomerang) === 'undefined' || !Bloomerang._isReady) { setTimeout(function () { waitForBloomerangLoad(callback) }, 500); } else { if (true) { callback(); } else { window.bloomerangLoadStarted = undefined; Bloomerang = undefined; // The version of Blomerang.js is not what we want. So blow it away and reload. startBloomerangLoad(); } } }; startBloomerangLoad();})();