<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Electricalandelectronics.org</title>
  <link
    href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css"
    rel="stylesheet"
  />
  <link rel="icon" href="https://cdn-icons-png.freepik.com/512/10151/10151875.png" type="image/png" />
  <style>
    body {
      background-color: #f9fdfb;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      padding-top: 3rem; /* offset for the floating header */
    }

    .floating-header {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      background-color: #0f0;
      color: #0f5132;
      text-align: center;
      padding: 0.5rem 1rem;
      font-size: 0.95rem;
      z-index: 1050;
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .header {
      padding: 3rem 1rem 0rem;
      text-align: center;
    }

    .mission {
      max-width: 700px;
      margin: 1.5rem auto 2rem auto;
      font-size: 1.2rem;
      color: #4b6043;
    }

    .product-list {
      padding: 0rem 0rem;
    }

    .footer {
      text-align: center;
      padding: 2rem 1rem;
      font-size: 0.9rem;
      color: #6c757d;
      background-color: #eef5ed;
      margin-top: 2rem;
    }
  </style>
</head>
<body>
  <div class="floating-header">
    <a href="https://www.afternic.com/forsale/electricalandelectronics.org?utm_source=bizbox&utm_medium=bizbox&utm_campaign=bizbox&traffic_type=bizbox&traffic_id=bizbox" class="text-black text-decoration-none d-block" target="_blank">
      The domain electricalandelectronics.org is for sale. To purchase, call Afternic.com at +1-855-201-2286. Click here for more details.
    </a>
  </div>
  <div class="container">
    <header class="header">
      <h1 class="display-5 fw-bold text-success">Electricalandelectronics.org</h1>
      <h2 class="text-center mb-4 text-success">Mission</h2>
      <p class="mission">In a world pulsating with innovation, electricalandelectronics.org was born from a vision: to illuminate the path for both aspiring and seasoned engineers. With a commitment to fostering growth and exploration in the realms of electrical engineering and electronics, our mission is to bridge the gap between curiosity and expertise. We aim to empower our community with insightful resources, ensuring that every spark of curiosity kindles a flame of understanding.</p>
    </header>
    <section class="product-list">
      <h2 class="text-center mb-4 text-success">Check out these cool products</h2>
      <script src="https://img1.wsimg.com/traffic-assets/js/tccl.min.js" integrity="sha256-d6HXsgKXdPlIwYlPrWetPCxAdYRfhPDkkrrnVM+YiZU=" crossorigin="anonymous"></script>
<script src="https://img1.wsimg.com/traffic-assets/js/tccl-tti.min.js" integrity="sha256-PDekqjz2qq5pIaS3UMDk+B/TONaHi+kLD68vkhA5yyM=" crossorigin="anonymous"></script>
<style>
  body,
  html {
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* overflow: hidden; */
  }

  .carousel-container {
    display: flex;
    flex-direction: column;
    /* height: 100vh; */
  }

  .search-container {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding-right: 10px;
  }

  #product-search {
    width: 300px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-size: 16px;
  }

  .fixed-paragraph {
    margin: 20px 0;
    text-align: center;
  }

  .product-scrollable {
    flex: 1;
    padding-right: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
  }

  .product-scrollable::-webkit-scrollbar {
    width: 6px; /* Thin scrollbar */
  }

  .product-scrollable::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 10px;
  }

  .product-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  .carousel-track {
    display: grid;
    gap: 15px;
    padding: 10px 0;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .product-tile {
    box-sizing: border-box;
    width: 100%;
    height: 340px;
    text-align: center;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .product-tile img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f7f7f7;
  }

  .product-info p {
    display: -webkit-box;
    -webkit-line-clamp: 3;   /* Limits text to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

  @media (max-width: 1500px) and (min-width: 1200px) {
    .product-scrollable {
      grid-template-columns: repeat(4, 1fr);
    }
  }

  @media (max-width: 1199px) and (min-width: 900px) {
    .product-scrollable {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  @media (max-width: 899px) and (min-width: 600px) {
    .product-scrollable {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (max-width: 599px) {
    .product-scrollable {
      grid-template-columns: 1fr;
    }
  }

  .product-tile {
    box-sizing: border-box;
    width: 100%; /* Fill available grid space */
    height: 340px;
    text-align: center;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .product-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
  }

  .product-tile img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f7f7f7;
  }

  .product-info {
    font-size: 15px;
    color: #333;
  }

  .product-info strong {
    font-size: 16px;
    color: #000;
    display: block;
  }

  .product-info p {
    margin: 5px 0;
  }

  .related-domains {
    text-align: center;
    margin: 20px;
  }

  .related-domain-card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }

  .related-domain-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    width: 230px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
  }

  .related-domain-card:hover {
    transform: scale(1.05);
  }

  .related-domain-card a {
    text-decoration: none;
    color: #333;
  }

  .related-domain-card h4 {
    margin: 10px 0;
    font-size: 18px;
  }

  .related-domain-card p {
    font-size: 14px;
    color: #666;
  }


</style>

<div class="carousel-container">
  <div class="search-container">
    <input
            type="text"
            id="product-search"
            placeholder="Search products..."
            oninput="filterProducts()"
    />
  </div>

  <div class="product-scrollable">
    <div class="carousel-track" id="carousel-track"></div>
  </div>

  <p class="fixed-paragraph">
    As an Amazon Associate, this website earns from qualified purchases.
  </p>

</div>

<div class="related-domains">
  <h3>Explore Related Websites</h3>
  <div class="related-domain-card-container">
    <div class="related-domain-card">
      <a href="https://freemaxplayer.com?utm_source=linknet"
         target="_blank" onclick="relatedDomainsClickHandler(&#39;freemaxplayer.com&#39;)">
        <h4>freemaxplayer.com</h4>
      </a>
    </div>
    <div class="related-domain-card">
      <a href="https://essalem-electronics.com?utm_source=linknet"
         target="_blank" onclick="relatedDomainsClickHandler(&#39;essalem-electronics.com&#39;)">
        <h4>essalem-electronics.com</h4>
      </a>
    </div>
    <div class="related-domain-card">
      <a href="https://bxb-z.org?utm_source=linknet"
         target="_blank" onclick="relatedDomainsClickHandler(&#39;bxb-z.org&#39;)">
        <h4>bxb-z.org</h4>
      </a>
    </div>
    <div class="related-domain-card">
      <a href="https://computerland.org?utm_source=linknet"
         target="_blank" onclick="relatedDomainsClickHandler(&#39;computerland.org&#39;)">
        <h4>computerland.org</h4>
      </a>
    </div>
  </div>
</div>

<script>

  const contextWindow = window;

  function hasImpressionEventAlreadyFired() {
    return contextWindow.__pageImpressionEventFired === true;
  }

  function markImpressionEventAsFired() {
    contextWindow.__pageImpressionEventFired = true;
  }

  // Function to wait for parent window to fully initialize
  function waitForParentInitialization(callback, maxAttempts = 50) {
    let attempts = 0;

    function checkParentInitialization() {
      attempts++;

      // Check if parent window and critical objects are available
      if (contextWindow &&
          contextWindow['_signalsDataLayer'] && contextWindow['_signalsDataLayer']['loaded']) {
          if (!hasImpressionEventAlreadyFired()) {
            console.log('Parent window is ready and impression event not yet fired. Firing impression event now!');
            callback();
            markImpressionEventAsFired();
          } else {
            console.log('Impression event already fired, skipping...');
          }
        return;
      }

      if (attempts < maxAttempts) {
        // Not ready yet, check again after a short delay
        setTimeout(checkParentInitialization, 100);
      } else {
        console.log('Failed to detect parent initialization after ' + maxAttempts + ' attempts');
      }
    }

    // Start checking
    checkParentInitialization();
  }

  function isFirstVisit() {
    const STORAGE_KEY = 'hasVisitedBefore';

    try {
      const hasVisited = localStorage.getItem(STORAGE_KEY);

      if (hasVisited === 'true') {
        return false; // Not the first visit
      } else {
        localStorage.setItem(STORAGE_KEY, 'true');
        return true; // First visit
      }

    } catch (e) {
      console.warn('Storage access failed. Treating as first visit.', e);
      return true; // Assume first visit if storage isn't available
    }
  }

  function getParentURLQueryParameter(queryParamName) {
    try {
      const parentSearch = contextWindow.location.search;
      const urlParams = new URLSearchParams(parentSearch);
      const queryParamValue = urlParams.get(queryParamName);
      return queryParamValue ? queryParamValue : '';
    } catch (e) {
      // Cross-origin access error or something else
      return '';
    }
  }

  // any events not joinable by userid should be joined by sessionJoinKey.
  // Intended for external events that can't be instrumented with userid/gamekey/strategy id.
  // Any events found should inherit the property of the event to which they're joined.
  // can be added to any EndGame event
  function generateSessionJoinKey() {
    const length = 16; // Length of the session join key. length 16 should be enough uniqueness for more than 100 million sessions.
    const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
    let result = '';
    for (let i = 0; i < length; i++) {
      result += chars.charAt(Math.floor(Math.random() * chars.length));
    }
    return 'eg.sessionjoinkey.' + result;
  }

  const WalletBitmask = {
    PHANTOM_SOLANA: 1 << 0,
    PHANTOM_EVM:    1 << 1,
    METAMASK:       1 << 2,
    COINBASE:       1 << 3,
    SOLFLARE:       1 << 4,
    TRUST:          1 << 5,
    BACKPACK:       1 << 6,
    XDEFI:          1 << 7,
  };

  // Detection logic for each wallet
  const walletDetectors = [
    {
      tag: 'phantom solana',
      bit: WalletBitmask.PHANTOM_SOLANA,
      detect: (p) => p.solana?.isPhantom,
    },
    {
      tag: 'phantom evm',
      bit: WalletBitmask.PHANTOM_EVM,
      detect: (p) => p.phantom?.ethereum,
    },
    {
      tag: 'metamask',
      bit: WalletBitmask.METAMASK,
      detect: (p) => p.ethereum?.isMetaMask && !!p.ethereum?._metamask, //does not distinguish between actual metamask and coinbase or phantom spoofing metamask for compatibility reasons
    },
    {
      tag: 'coinbase',
      bit: WalletBitmask.COINBASE,
      detect: (p) => !!p.coinbaseWalletExtension,
    },
    {
      tag: 'solflare',
      bit: WalletBitmask.SOLFLARE,
      detect: (p) => p.solflare?.isSolflare,
    },
    {
      tag: 'trust',
      bit: WalletBitmask.TRUST,
      detect: (p) => p.ethereum?.isTrust,
    },
    {
      tag: 'backpack',
      bit: WalletBitmask.BACKPACK,
      detect: (p) => p.backpack?.isBackpack,
    },
    {
      tag: 'xdefi',
      bit: WalletBitmask.XDEFI,
      detect: (p) => p.xfi?.ethereum || window.xfi?.solana,
    },
  ];

  function detectWalletsBitmask() {
    let bitmask = 0;

    for (const { bit, detect, tag } of walletDetectors) {
      try {
        if (detect(contextWindow)) {
          bitmask |= bit;
        }
      } catch (e) {
        console.warn('Error:', e);
      }
    }

    return bitmask;
  }

  // Start detection immediately
  waitForParentInitialization(function() {
    //console.log('Firing impression');
    // This will be called once the parent window is fully initialized


    const walletBitMask = detectWalletsBitmask();
    //console.log('Detected wallet bitmask: ', walletBitMask);

    //Add traffic source to the impression event
    const utmSource = getParentURLQueryParameter('utm_source');
    const utmCampaign = getParentURLQueryParameter('utm_campaign');
    const isUserFirstVisit = isFirstVisit();
    //console.log('Is this the user\'s first visit? ', isUserFirstVisit);
    const sessionJoinKey = generateSessionJoinKey();
    contextWindow['_signalsDataLayer'].push({
      schema: 'add_event',
      version: 'v1',
      data: {
        type: 'impression',
        eid: "endgame.v1.event",
        custom_properties: {
          endGameEventKey: 'page_load', //todo: add utmsource subeventkey
          endGameGameKey: "bizbox",
          endGameStrategyKey: "simple_products_above_the_fold",
          ventureVertical: "no_vertical_specified",
          utmSource: utmSource,
          utmCampaign: utmCampaign,
          isFirstVisit: isUserFirstVisit,
          walletBitMask: walletBitMask,
          sessionJoinKey: sessionJoinKey //this value should be generated fresh for each session and not cross session boundaries
        },
      },
    });

    //Update Airo link.
    function updateParentLinkHref(link, isMerge, newParams) {
      try {
        if (!link || !link.href) return;

        const url = new URL(link.href);

        // Clear all query params if merge is false
        if (!isMerge) {
          url.search = ''; // Removes all query params
        }

        // Add/overwrite specified params
        for (const [key, value] of Object.entries(newParams)) {
          url.searchParams.set(key, value);
        }

        link.href = url.toString();
      } catch (e) {
        console.warn('Unable to access or modify parent document:', e);
      }
    }

    const parentDoc = contextWindow.document;
    const gdAiroLink = parentDoc.querySelector('a[data-aid="FOOTER_POWERED_BY_AIRO_RENDERED_LINK"]');
    //Update query parameters for endgame tracking. Do this for any and all GD links.
    updateParentLinkHref(gdAiroLink,
        false,
        {
          utm_source: 'endgame',
          utm_campaign: sessionJoinKey,
          //utm_medium: 'applications', //compatibility with main attribution logic
          utm_terms: "eg.v1.bizbox.simple_products_above_the_fold"
        }
    );

    if (gdAiroLink) {
<!--        debugLog('Found gdAiroLink');-->
        gdAiroLink.addEventListener('click', (e) => {
<!--          debugLog("GD Airo Link clicked!");-->
          // Replace direct access with safe function
          contextWindow['_signalsDataLayer'].push({
            schema: 'add_event',
            version: 'v1',
            data: {
              type: 'click',
              eid: "endgame.v1.event",
              custom_properties: {
                endGameEventKey: 'gd_product_footer_click',
                endGameGameKey: "bizbox",
                endGameStrategyKey: "simple_products_above_the_fold",
                ventureVertical: "no_vertical_specified",
                sessionJoinKey: sessionJoinKey
              },
            }
          });
        });
      }
  });

  document.addEventListener('DOMContentLoaded', function(e) {
    const debugLog = (message) => {
      console.log('DEBUG: ' + message);
    };

    debugLog("Bizbox DOMContentLoaded fired");

    /*<![CDATA[*/
    const products = [{"image":"https:\/\/m.media-amazon.com\/images\/I\/41EJW4zQhhL._SL500_.jpg","id":"1","title":"MOGAOPI Electronic Component Kit Total 1390 Pcs, LED Diodes, Metal Film Resistors, Electrolytic Capacitor Package, Commo...","priceAsOfDate":"Mar 28, 2025","price":"$25.99","asin":"B09237GYCD","url":"https:\/\/www.amazon.com\/dp\/B09237GYCD?tag=gd-bb-p2b-20\u0026linkCode=osi\u0026th=1\u0026psc=1","brand":"MOGAOPI","rating":""},{"image":"https:\/\/m.media-amazon.com\/images\/I\/41Znx4H6BzL._SL500_.jpg","id":"2","title":"YUEONEWIN 1400Pcs Basic Electronics Component Assortment Kit, Electrolytic Capacitor, Ceramic Capacitor, LED Diode, Comm...","priceAsOfDate":"Mar 28, 2025","price":"$19.96","asin":"B09YTSR9Z9","url":"https:\/\/www.amazon.com\/dp\/B09YTSR9Z9?tag=gd-bb-p2b-20\u0026linkCode=osi\u0026th=1\u0026psc=1","brand":"YUEONEWIN","rating":""},{"image":"https:\/\/m.media-amazon.com\/images\/I\/51VWJj0DzFL._SL500_.jpg","id":"3","title":"Molence DIY Electronics Components Kit Assortment, Resistors 1818PCS, LED, Triode, Capacitors, Diodes, PCB, Potentiomete...","priceAsOfDate":"Mar 28, 2025","price":"$32.99","asin":"B08RXQNT2P","url":"https:\/\/www.amazon.com\/dp\/B08RXQNT2P?tag=gd-bb-p2b-20\u0026linkCode=osi\u0026th=1\u0026psc=1","brand":"Molence","rating":""},{"image":"https:\/\/m.media-amazon.com\/images\/I\/610KT6r9PgL._SL500_.jpg","id":"4","title":"BOJACK 37 Values 480 Pcs Electronics Component Fun Kit with Power Supply Module, Jumper Wire,Precision Potentiometer,830...","priceAsOfDate":"Mar 28, 2025","price":"$15.99","asin":"B099MQV8ZW","url":"https:\/\/www.amazon.com\/dp\/B099MQV8ZW?tag=gd-bb-p2b-20\u0026linkCode=osi\u0026th=1\u0026psc=1","brand":"BOJACK","rating":""},{"image":"https:\/\/m.media-amazon.com\/images\/I\/41pWU9l6F6L._SL500_.jpg","id":"5","title":"Electronic Component Assortment Kit, Total 1410Pcs, Metal Film Resistors, LED Diodes, Common Diodes, Electrolytic Capaci...","priceAsOfDate":"Mar 28, 2025","price":"$19.87","asin":"B0DCTLLCW8","url":"https:\/\/www.amazon.com\/dp\/B0DCTLLCW8?tag=gd-bb-p2b-20\u0026linkCode=osi\u0026th=1\u0026psc=1","brand":"aubenai","rating":""},{"image":"https:\/\/m.media-amazon.com\/images\/I\/51QU1d9YlML._SL500_.jpg","id":"6","title":"Molence 5162pcs DIY Electronics Components Kit Assortment, Resistors, Inductors, Capacitors, LED, Triode, ICS, Diodes, P...","priceAsOfDate":"Mar 28, 2025","price":"$119.99","asin":"B09RZYM66H","url":"https:\/\/www.amazon.com\/dp\/B09RZYM66H?tag=gd-bb-p2b-20\u0026linkCode=osi\u0026th=1\u0026psc=1","brand":"Molence","rating":""},{"image":"https:\/\/m.media-amazon.com\/images\/I\/51f2m1-f-lL._SL500_.jpg","id":"7","title":"2300PCS XXXXL Complete Set DIY Electronics Component Assortment Box Kit,IC,Solder,Solder Sucker,PCB,Breadboard,Jumper Wi...","priceAsOfDate":"Mar 28, 2025","price":"$61.31","asin":"B0CT5LCN2H","url":"https:\/\/www.amazon.com\/dp\/B0CT5LCN2H?tag=gd-bb-p2b-20\u0026linkCode=osi\u0026th=1\u0026psc=1","brand":"perfsign","rating":""},{"image":"https:\/\/m.media-amazon.com\/images\/I\/51RAQq1O5oL._SL500_.jpg","id":"8","title":"ELEGOO 120pcs Multicolored Dupont Wire 40pin Male to Female, 40pin Male to Male, 40pin Female to Female Breadboard Jumpe...","priceAsOfDate":"Mar 28, 2025","price":"$6.98","asin":"B01EV70C78","url":"https:\/\/www.amazon.com\/dp\/B01EV70C78?tag=gd-bb-p2b-20\u0026linkCode=osi\u0026th=1\u0026psc=1","brand":"ELEGOO","rating":""},{"image":"https:\/\/m.media-amazon.com\/images\/I\/510vFCSfPqL._SL500_.jpg","id":"9","title":"Lesnow solder wick braid 10ft Length Desoldering Wick Braid Remover Tool Solder Sucker 1 piece No-Clean soldering Wick W...","priceAsOfDate":"Mar 28, 2025","price":"$8.99","asin":"B094GZ6CPZ","url":"https:\/\/www.amazon.com\/dp\/B094GZ6CPZ?tag=gd-bb-p2b-20\u0026linkCode=osi\u0026th=1\u0026psc=1","brand":"Lesnow","rating":""},{"image":"https:\/\/m.media-amazon.com\/images\/I\/51IQUMUqKuS._SL500_.jpg","id":"10","title":"2200 pcs Electronic Component Assortment Kit, Capacitors, Resistors, Transistors, Inductors, Diodes, Potentiometer, IC, ...","priceAsOfDate":"Mar 28, 2025","price":"$68.80","asin":"B08MDQ973T","url":"https:\/\/www.amazon.com\/dp\/B08MDQ973T?tag=gd-bb-p2b-20\u0026linkCode=osi\u0026th=1\u0026psc=1","brand":"ZEBULON","rating":""}];
    /*]]>*/

    const track = document.getElementById('carousel-track');

    const renderProducts = (filteredProducts = products) => {
      track.innerHTML = '';
      filteredProducts.forEach((product) => {
        const item = document.createElement('div');
        item.classList.add('product-tile');
        item.innerHTML = `
                  <a href="${product.url}" target="_blank">
                      <img src="${product.image}" alt="${product.title}">
                  </a>
                  <div class="product-info">
                      <strong>${product.brand}</strong>
                      <p>${product.title}</p>
                      <p>Price: ${product.price}</p>
                      <p>(as of ${product.priceAsOfDate})</p>
                  </div>
              `;

        item.addEventListener('click', function (event) {
          debugLog('firing amazon click event');
          if (!event.target.closest('a')) {
            window.open(product.url, '_blank');
          }
          contextWindow['_signalsDataLayer'].push({
            schema: 'add_event',
            version: 'v1',
            data: {
              type: 'click',
              eid: "endgame.v1.event",
              custom_properties: {
                endGameEventKey: 'amazon_product_click',
                endGameGameKey: "bizbox",
                endGameStrategyKey: "simple_products_above_the_fold",
                ventureVertical: "no_vertical_specified",
                asin: `${product.asin}`
              },
            },
          });
        });

        track.appendChild(item);
      });
    };

    const productSearchBox = document.getElementById('product-search');
    productSearchBox.addEventListener("focus", () => {
      debugLog("firing focus event");
      // Replace direct access with safe function
      contextWindow['_signalsDataLayer'].push({
        schema: 'add_event',
        version: 'v1',
        data: {
          type: 'click',
          eid: "endgame.v1.event",
          custom_properties: {
            endGameEventKey: 'product_search_focus',
            endGameGameKey: "bizbox",
            endGameStrategyKey: "simple_products_above_the_fold",
            ventureVertical: "no_vertical_specified"
          },
        },
      });
    });


    window.filterProducts = () => {
      const query = document
              .getElementById('product-search')
              .value.toLowerCase();
      const filteredProducts = products.filter(
              (product) =>
                      product.title.toLowerCase().includes(query) ||
                      product.brand.toLowerCase().includes(query)
      );
      renderProducts(filteredProducts);
    };

    renderProducts();

    // Helper function to find link by domain name using regex
    function findSalesLinkByDomain(parentDocument, domainName) {
      // Escape special regex characters in the domain name
      const escapedDomain = domainName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
      // Create a regex that looks for the domain in a URL context
      const domainRegex = new RegExp(`[^a-zA-Z0-9](${escapedDomain})[^a-zA-Z0-9]|^(${escapedDomain})|^(${escapedDomain})[^a-zA-Z0-9]|[^a-zA-Z0-9](${escapedDomain})$`);

      // Get all anchor elements in the parent doc
      const allLinks = parentDocument.querySelectorAll('a[href]');

      // Find the first link that matches our regex
      for (let i = 0; i < allLinks.length; i++) {
        const href = allLinks[i].getAttribute('href');
        if (href && domainRegex.test(href)) {
          debugLog('Found matching link with href:', href);
          return allLinks[i];
        }
      }

      return null;
    }

    const link = findSalesLinkByDomain(contextWindow.document, "electricalandelectronics.org");

    if (link) {
      debugLog('Found top banner a tag using regex. Adding listener');
      link.addEventListener('click', (e) => {
        debugLog("Sales banner clicked!");
        // Replace direct access with safe function
        contextWindow['_signalsDataLayer'].push({
          schema: 'add_event',
          version: 'v1',
          data: {
            type: 'click',
            eid: "endgame.v1.event",
            custom_properties: {
              endGameEventKey: 'salesbanner_click',
              endGameGameKey: "bizbox",
              endGameStrategyKey: "simple_products_above_the_fold",
              ventureVertical: "no_vertical_specified"
            },
          }
        });
      });
    }
  });

  // Update the related domains click handler too
  function relatedDomainsClickHandler(targetDomain) {
    console.log('firing linknet click for domain: ' + targetDomain);
    // Replace direct access with safe function
    contextWindow['_signalsDataLayer'].push({
      schema: 'add_event',
      version: 'v1',
      data: {
        type: 'click',
        eid: "endgame.v1.event",
        custom_properties: {
          endGameEventKey: 'linknet_click',
          endGameGameKey: "bizbox",
          endGameStrategyKey: "simple_products_above_the_fold",
          ventureVertical: "no_vertical_specified",
          targetDomain: targetDomain
        },
      },
    });
  }
</script>

    </section>
    <p>
        Blog: coming soon!
    </p>
    <footer class="footer">
      Copyright &copy; electricalandelectronics.org.  All rights reserved.
    </footer>
  </div>
</body>
</html>
