(function () {
if (window.__gaPN) return;
function ready() {
var as = Array.prototype.slice.call(document.querySelectorAll('a'));
var hasPN = as.some(function (a) { return a.textContent.trim() === 'Prev' && a.getAttribute('href') === 'javascript:;'; })
&& as.some(function (a) { return a.textContent.trim() === 'Next' && a.getAttribute('href') === 'javascript:;'; });
if (!hasPN) return;
window.__gaPN = 1;
var path = location.pathname.replace(/\/+$/, '');
var URL = '/nportal/fwebapi/product/product/es/findPage?appId=143150160001&templateId=product';
function post(body) { return fetch(URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) }).then(function (r) { return r.json(); }); }
var chain = Promise.resolve({ list: [] });
var all = [];
var p = Promise.resolve();
for (var from = 0; from < 600; from += 200) {
(function (f) {
p = p.then(function () { return post({ appId: '143150160001', templateId: 'product', size: 200, from: f, sort: [], query: [] }).then(function (r) { var l = (r.data && r.data.list) || []; all = all.concat(l.map(function (x) { return { t: x.title, cat: x.categoryName, href: x.href }; })); if (l.length < 200) throw 'done'; }); });
})(from);
}
p.catch(function () {}).then(function () {
var cur = null;
for (var i = 0; i < all.length; i++) { var h = (all[i].href || '').replace(/\/+$/, ''); if (h === path) { cur = all[i]; break; } }
if (!cur) return;
var sib = all.filter(function (x) { return x.cat === cur.cat && x.href; });
var idx = -1;
for (var j = 0; j < sib.length; j++) { if ((sib[j].href || '').replace(/\/+$/, '') === path) { idx = j; break; } }
if (idx < 0) return;
var prev = sib[idx - 1], next = sib[idx + 1];
function apply(label, none, item) {
if (!item || !label) return;
if (none) { none.textContent = item.t; none.setAttribute('href', item.href); }
label.setAttribute('href', item.href);
}
var as2 = Array.prototype.slice.call(document.querySelectorAll('a'));
as2.forEach(function (a, k) {
var t = a.textContent.trim();
if ((t === 'Prev' || t === 'Next') && a.getAttribute('href') === 'javascript:;') {
var none = null;
for (var m = k + 1; m <= k + 3 && m < as2.length; m++) { if (as2[m].textContent.trim() === 'None' && as2[m].getAttribute('href') === 'javascript:;') { none = as2[m]; break; } }
apply(a, none, t === 'Prev' ? prev : next);
}
});
document.addEventListener('keydown', function (e) {
if (e.target && /INPUT|TEXTAREA|SELECT/.test(e.target.tagName)) return;
if (e.key === 'ArrowLeft' && prev) location.href = prev.href;
if (e.key === 'ArrowRight' && next) location.href = next.href;
});
});
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', ready); else ready();
var mo = new MutationObserver(function () { if (!window.__gaPN) ready(); });
document.addEventListener('DOMContentLoaded', function () { mo.observe(document.body, { childList: true, subtree: true }); });
})();
(function () {
if (window.__gaNavDD) return; window.__gaNavDD = 1;
var CSS = '.ga-dd{position:relative!important}.ga-dd-panel{display:none;position:absolute;top:100%;left:0;background:#fff;border:1px solid #ececec;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.08);padding:14px 18px;z-index:99990;min-width:430px}.ga-dd:hover .ga-dd-panel{display:flex;gap:30px}.ga-dd-col{min-width:185px}.ga-dd-h{font-size:12px;color:#F97316;font-weight:600;margin:0 0 8px;letter-spacing:.02em}.ga-dd-col a{display:block;padding:6px 8px;font-size:13px;color:#1A1814;text-decoration:none;border-radius:6px;line-height:1.4}.ga-dd-col a:hover{background:#FFF3E8;color:#F97316}@media (max-width:768px){.ga-dd-panel{display:none!important}}';
var DATA = {
'Ceramic Basins': [
{ h: 'By Installation', items: [['Thin Edge Basins', '/thin-edge-basins'], ['Medium Edge Basins', '/medium-edge-basins'], ['Art Basins', '/Products/art-basin'], ['Under Counter Basins', '/under-counter-basins'], ['Wall-Hung Basins', '/wall-hung-basins'], ['All Ceramic Basins', '/Products/ceramic-basins']] },
{ h: 'By Series', items: [['ETNA Series', '/etna-series'], ['WS Series', '/ws-series'], ['LINDA Series', '/linda-series'], ['MINI Series', '/mini-series'], ['MARBLE Series', '/marble-series'], ['G Series', '/medium-edge-basins']] }
],
'Smart Toilets': [
{ h: 'Smart Toilets', items: [['Smart Toilet ST-U6', '/smart-toilet-u6'], ['Smart Toilet ST-01', '/smart-toilet-s01'], ['All Smart Toilets', '/Products/smart-toilets']] }
]
};
function build() {
var nav = document.querySelector('[class*="e_navigationA"]') || document.querySelector('header');
if (!nav) return false;
var links = Array.prototype.slice.call(nav.querySelectorAll('a'));
var allOk = true;
Object.keys(DATA).forEach(function (label) {
var a = links.find(function (x) { return x.textContent.trim() === label; });
if (!a) { allOk = false; return; }
var li = a.closest('li') || a.parentElement;
if (li.querySelector('.ga-dd-panel')) return;
li.classList.add('ga-dd');
var panel = document.createElement('div'); panel.className = 'ga-dd-panel';
DATA[label].forEach(function (col) {
var d = document.createElement('div'); d.className = 'ga-dd-col';
var h = document.createElement('p'); h.className = 'ga-dd-h'; h.textContent = col.h; d.appendChild(h);
col.items.forEach(function (itm) { var l = document.createElement('a'); l.href = itm[1]; l.textContent = itm[0]; d.appendChild(l); });
panel.appendChild(d);
});
li.appendChild(panel);
});
return allOk;
}
function init() {
if (!document.getElementById('ga-dd-style')) { var s = document.createElement('style'); s.id = 'ga-dd-style'; s.textContent = CSS; document.head.appendChild(s); }
if (build()) return;
var mo = new MutationObserver(function () { if (build()) mo.disconnect(); });
mo.observe(document.documentElement, { childList: true, subtree: true });
setTimeout(function () { mo.disconnect(); }, 25000);
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init); else init();
})();
(function () {
if (window.__gaSbHover) return; window.__gaSbHover = 1;
function bind(box) {
if (box.__gaBound) return; box.__gaBound = 1;
box.querySelectorAll('li.p_c_item').forEach(function (li) {
var ul = li.querySelector(':scope > ul.p_c_content');
if (!ul) return;
li.addEventListener('mouseenter', function () { ul.style.display = 'block'; });
li.addEventListener('mouseleave', function () { ul.style.display = ''; });
});
}
function init() {
var boxes = document.querySelectorAll('.e_categoryB-57, .e_categoryB-58');
if (!boxes.length) return false;
boxes.forEach(bind);
return true;
}
if (init()) return;
var mo = new MutationObserver(function () { if (init()) mo.disconnect(); });
mo.observe(document.documentElement, { childList: true, subtree: true });
setTimeout(function () { try { mo.disconnect(); } catch (e) {} }, 25000);
})();