(function () {
// 1) Basic bot filter (extend if you like)
function isBot() {
return /(bot|crawl|spider|google|bing|slurp|yandex|facebook|linkedin|pinterest|preview|whatsapp|discord|telegram|headless|puppeteer)/i
.test(navigator.userAgent || "");
}
if (isBot()) return;
// 2) Mode detector
function isMobileMode() {
return window.matchMedia("(max-width: 767px)").matches ||
/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent || "");
}
// 3) Your ad configs (swap keys/sizes to match your network units)
const AD = {
mobile: { key: "aa6d52a6037d0558c2a19dc52b6aa824", width: 320, height: 50 }, // 320x50
desktop: { key: "a49752dcde88f4fde5987d25efbb7168", width: 468, height: 60 } // 468x60
};
// 4) Create container if it doesn't exist
function ensureContainer() {
let container = document.getElementById("ad-container");
if (!container) {
container = document.createElement("div");
container.id = "ad-container";
container.style.display = "none";
document.body.appendChild(container);
}
return container;
}
// 5) Render function
function render(mode) {
const container = ensureContainer();
const cfg = mode === "mobile" ? AD.mobile : AD.desktop;
// Set global atOptions for ad network
window.atOptions = {
key: cfg.key,
format: "iframe",
height: cfg.height,
width: cfg.width,
params: {}
};
// Clear previous ad/script then inject
container.innerHTML = "";
container.style.display = "block";
const s = document.createElement("script");
s.src = `//selfportraitproved.com/${cfg.key}/invoke.js`;
s.async = true;
container.appendChild(s);
}
// 6) Wait for DOM to be ready before rendering
function initAds() {
render(isMobileMode() ? "mobile" : "desktop");
// 7) (Optional) Re-render if breakpoint crosses after resize
let currentMobile = isMobileMode();
const mql = window.matchMedia("(max-width: 767px)");
if (mql.addEventListener) {
mql.addEventListener("change", (e) => {
const nowMobile = e.matches;
if (nowMobile !== currentMobile) {
currentMobile = nowMobile;
render(currentMobile ? "mobile" : "desktop");
}
});
} else if (mql.addListener) { // older browsers
mql.addListener((e) => {
const nowMobile = e.matches;
if (nowMobile !== currentMobile) {
currentMobile = nowMobile;
render(currentMobile ? "mobile" : "desktop");
}
});
}
}
// 8) Execute when DOM is ready
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", initAds);
} else {
initAds();
}
})();
The wait for a little one is sadly going to last a bit longer. Fredrik Eklund revealed on Tuesday, Sept. 15, that the surrogate he and husband Derek Kaplan were working with has miscarried.
“I’m sad to share we’ve had a failed pregnancy,” the star of Bravo’s Million Dollar Listing New York, 38, shared in a heartbreaking Instagram post of a photo of himself with artist Kaplan, 40, looking out at a beautiful sunset, his husband’s hand resting sweetly on his head. “I have cried so much that I can’t cry anymore. We were pregnant with twins but we’re not anymore.”
The couple’s dream to have children, specifically a little girl that Eklund would name Milla, has been well-documented by Bravo, from sharing their decision to grow their family, to the struggle to find the right surrogate.
“I chose to share this here, because I made this quest for Milla (and hopefully her sibling) public a long time ago,” the superstar New York real estate broker wrote. He went on to explain that he and his husband have been receiving congratulations and gifts every day since they announced the happy news in April.
👉 For more insights, check out this resource.
“The last couple of days I couldn’t take it anymore, to upkeep this perception of happiness and success when I’ve been a total sad mess inside,” he wrote. “I’ve felt like a failure and that I’ll never get to where I want to go: for me and Derek to finally become parents.”
👉 Discover more in this in-depth guide.
Despite the heartbreaking setback, the reality personality isn’t ready to give up.
“We will try again. We have to. I’m not giving up. We’re just not going to give up! We have to go on and simply try again,” Eklund added.