/* VOATEK \uc0ac\uc5c5\uc18c\uac1c (2026-11-11) */
/* \uc0ac\uc5c5\uc18c\uac1c \uc2dc\uc548 v2 (2026-11-10) \u2014 \ud0ed\ubcc4 A\uc548 / B\uc548 */
(function () {
'use strict';
var doc = document, RM = matchMedia('(prefers-reduced-motion: reduce)').matches;
var $ = function (s, c) { return (c || doc).querySelector(s); };
var $$ = function (s, c) { return Array.prototype.slice.call((c || doc).querySelectorAll(s)); };
var IMG = (window.VT_IMG || '/bizdemo79551/img/_des/de17/');
function src(f) { return f === 'VOATEK_certi_12.jpg' && window.VT_TM ? window.VT_TM : IMG + f; }
function esc(s) { return String(s).replace(/[&<>"]/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"' }[c]; }); }
/* reveal */
var io = RM || !window.IntersectionObserver ? null : new IntersectionObserver(function (es) { es.forEach(function (e) { if (e.isIntersecting) { e.target.classList.add('is-in'); io.unobserve(e.target); } }); }, { rootMargin: '0px 0px -8% 0px' });
function reveal(root) { $$('.reveal, [data-stagger]', root).forEach(function (el) { if (!io) el.classList.add('is-in'); else if (!el.classList.contains('is-in')) io.observe(el); }); }
/* ---------- \uc0ac\uc5c5\ubd84\uc57c B ---------- */
var rows = $$('#fbRows li'), pic = $('#fbPic');
function setRow(li) {
rows.forEach(function (r) { r.classList.toggle('on', r === li); });
if (pic && pic.getAttribute('src') !== li.dataset.img) { pic.classList.add('sw'); setTimeout(function () { pic.src = li.dataset.img; pic.classList.remove('sw'); }, RM ? 0 : 180); }
}
rows.forEach(function (li) {
var b = $('button', li);
b.addEventListener('click', function () { setRow(li); });
li.addEventListener('mouseenter', function () { if (matchMedia('(hover:hover)').matches) setRow(li); });
});
var sol = $('#fbSol');
if (sol) $$('.fb-seg button', sol).forEach(function (b) {
b.addEventListener('click', function () {
sol.dataset.s = b.dataset.s;
$$('.fb-seg button', sol).forEach(function (x) { x.setAttribute('aria-selected', x === b); });
$$('.fb-panel', sol).forEach(function (p) { p.hidden = p.dataset.s !== b.dataset.s; });
});
});
/* ---------- \ub4f1\ub85d\uba74\ud5c8\uc99d (\ud68c\uc0ac\uc18c\uac1c\uc11c \uae30\uc900) ---------- */
// img \uc5c6\ub294 \ud56d\ubaa9\uc740 \uc99d\uc11c \uc774\ubbf8\uc9c0\ub97c \ubc1b\uc73c\uba74 \ud30c\uc77c\uba85\ub9cc \ub123\uc73c\uba74 \ub428
var LIC = [
{ k: 'reg', en: 'REGISTRATION', t: '\ub4f1\ub85d \u00b7 \uc778\uc815', d: '\uc0ac\uc5c5 \uc218\ud589\uc744 \uc704\ud55c \ub4f1\ub85d\uacfc \uae30\uad00 \uc778\uc815', items: [
{ img: 'VOATEK_certi_01.jpg', t: '\uc0ac\uc5c5\uc790\ub4f1\ub85d', s: '\uc0ac\uc5c5\uc790\ub4f1\ub85d\uc99d' },
{ img: 'VOATEK_certi_04.jpg', t: '\uacf5\uc7a5\ub4f1\ub85d', s: '\uacf5\uc7a5\ub4f1\ub85d\uc99d\uba85\uc11c' },
{ img: 'VOATEK_certi_08.jpg', t: '\uc815\ubcf4\ud1b5\uc2e0\uacf5\uc0ac\uc5c5 \ub4f1\ub85d', s: '\uc815\ubcf4\ud1b5\uc2e0\uacf5\uc0ac\uc5c5\ub4f1\ub85d\uc99d' },
{ img: 'VOATEK_certi_06.jpg', t: '\uc5f0\uad6c\uac1c\ubc1c\uc804\ub2f4\ubd80\uc11c', s: '\uc5f0\uad6c\uac1c\ubc1c\uc804\ub2f4\ubd80\uc11c \uc778\uc815\uc11c' },
{ img: 'VOATEK_certi_05.jpg', t: 'MAIN-BIZ', s: '\uacbd\uc601\ud601\uc2e0\ud615 \uc911\uc18c\uae30\uc5c5 \ud655\uc778\uc11c' },
{ img: 'VOATEK_certi_07.jpg', t: 'INNO-BIZ', s: '\uae30\uc220\ud601\uc2e0\ud615 \uc911\uc18c\uae30\uc5c5 \ud655\uc778\uc11c' },
{ img: 'VOATEK_certi_09.jpg', t: '\uc911\uc18c\uae30\uc5c5 \ud655\uc778', s: '\uc911\uc18c\uae30\uc5c5\ud655\uc778\uc11c' }] },
{ k: 'ip', en: 'INTELLECTUAL PROPERTY', t: '\uc9c0\uc2dd\uc7ac\uc0b0', d: '\uc790\uccb4 \uac1c\ubc1c \uae30\uc220\uacfc \ube0c\ub79c\ub4dc', items: [
{ img: 'VOATEK_certi_10.jpg', t: '\ud2b9\ud5c8 \uc81c10-2294496\ud638', s: '\ub514\uc9c0\ud138 \ud504\ub85c\uc138\uc11c' },
{ img: 'VOATEK_certi_11.jpg', t: '\ud2b9\ud5c8 \uc81c10-2294497\ud638', s: '\uc2a4\ud53c\ucee4' },
{ img: 'VOATEK_certi_12.jpg', t: '\uc0c1\ud45c\ub4f1\ub85d \uc81c40-1840833\ud638', s: 'MYFIX' }] },
{ k: 'prod', en: 'CERTIFICATION', t: '\uc778\uc99d', d: '\uacbd\uc601\uc2dc\uc2a4\ud15c\uacfc \uc81c\ud488 \uc778\uc99d', items: [
{ img: 'VOATEK_certi_03.jpg', t: 'ISO 9001', s: '\ud488\uc9c8\uacbd\uc601\uc2dc\uc2a4\ud15c \uc778\uc99d\uc11c' },
{ img: 'VOATEK_certi_02.jpg', t: 'ISO 14001', s: '\ud658\uacbd\uacbd\uc601\uc2dc\uc2a4\ud15c \uc778\uc99d\uc11c' }], rows: [['KC \uc778\uc99d', 'MYFIX \uc804 \uc81c\ud488']] },
{ k: 'univ', en: 'PARTNERSHIP', t: '\uc0b0\ud559 \ud611\ub825', d: '\ub300\ud559 3\uacf3\uacfc \uc778\uc7ac\u00b7\uae30\uc220 \ud611\ub825', items: [
{ img: 'VOATEK_certi_201.jpg', t: '\ub300\ub9bc\ub300\ud559\uad50', s: 'RISE \uc9c0\uc0b0\ud559\uc5f0 \ud611\ub825 \ud611\uc57d' },
{ img: 'VOATEK_certi_202.jpg', t: '\ub3d9\uc544\ubc29\uc1a1\uc608\uc220\ub300\ud559\uad50', s: '\uc0b0\ud559\ud611\ub825 \uac00\uc871\ud68c\uc0ac \ud611\uc57d' },
{ img: 'VOATEK_certi_203.jpg', t: '\ud55c\uad6d\uc601\uc0c1\ub300\ud559\uad50', s: '\uac00\uc871\ud68c\uc0ac \ud611\uc57d' }] }
];
var PEOPLE = {
en: 'TECHNICAL STAFF', t: '\uae30\uc220 \uc778\ub825', d: '\uc124\uacc4\uc640 \uae30\uc220 \uc9c0\uc6d0\uc744 \ub9e1\ub294 \uc804\ubb38 \uc778\ub825',
rows: [['\uc815\ubcf4\ud1b5\uc2e0 \uae30\uc220\uc790', '\ud2b9\uae09 1 \u00b7 \uc911\uae09 1 \u00b7 \ucd08\uae09 3'], ['\ubc29\uc1a1\ud1b5\uc2e0\uc735\ud569 \uacf5\ud559\ubc15\uc0ac', '\ubcf4\uc720'], ['\uc74c\ud5a5\uc5d4\uc9c0\ub2c8\uc5b4 1\uae09', '\ubcf4\uc720'], ['\uc18c\uc74c\uc9c4\ub3d9\uae30\uc0ac', '\ubcf4\uc720']]
};
var flat = [];
LIC.forEach(function (g) { g.items.forEach(function (it) { it.g = g.t; it.gk = g.k; if (it.img) it.i = flat.push(it) - 1; }); });
function docCard(it, dark) {
if (!it.img) return '
' + esc(it.icon) + '\uc99d\uc11c \uc774\ubbf8\uc9c0 \ub4f1\ub85d \uc608\uc815
' + esc(it.t) + '' + esc(it.s) + '';
return '';
}
var lg = $('#licGroups');
if (lg) {
lg.innerHTML = LIC.map(function (g) {
var body = '' + (g.items.length ? '
' + g.items.map(function (it) { return docCard(it); }).join('') + '
' : '')
+ (g.rows ? '
' + g.rows.map(function (r) { return '- ' + r[0] + '
- ' + r[1] + '
'; }).join('') + '
' : '') + '
';
return '' + g.en + '' + g.t + '
' + g.d + '
' + body + '
';
}).join('') + '' + PEOPLE.en + '' + PEOPLE.t + '
' + PEOPLE.d + '
' + PEOPLE.rows.map(function (r) { return '- ' + r[0] + '
- ' + r[1] + '
'; }).join('') + '
';
}
var lwG = $('#lwGrid'), lwC = $('#lwChips');
if (lwG) {
var cats = [{ k: 'all', t: '\uc804\uccb4' }].concat(LIC.filter(function (g) { return g.items.length; }).map(function (g) { return { k: g.k, t: g.t }; }));
lwC.innerHTML = cats.map(function (c, i) { return ''; }).join('');
var all = []; LIC.forEach(function (g) { all = all.concat(g.items); });
lwG.innerHTML = all.map(function (it) { return docCard(it).replace('' + esc(it.g) + ''); }).join('');
lwC.addEventListener('click', function (e) {
var b = e.target.closest('button'); if (!b) return;
$$('button', lwC).forEach(function (x) { x.setAttribute('aria-selected', x === b); });
$$('li', lwG).forEach(function (li) { li.hidden = b.dataset.k !== 'all' && li.dataset.k !== b.dataset.k; });
});
$('#lwPeople').innerHTML = '' + PEOPLE.en + '' + PEOPLE.t + '
' + PEOPLE.d + '
' + PEOPLE.rows.concat([['KC \uc778\uc99d', 'MYFIX \uc804 \uc81c\ud488']]).map(function (r) { return '- ' + r[0] + '
- ' + r[1] + '
'; }).join('') + '
';
}
var lb = $('#lb'), li = 0;
function show(i) { li = (i + flat.length) % flat.length; $('#lbImg').src = src(flat[li].img); $('#lbImg').alt = flat[li].s; $('#lbCap').textContent = flat[li].t + ' \u00b7 ' + flat[li].s; }
doc.addEventListener('click', function (e) { var b = e.target.closest('#license button[data-i]'); if (!b) return; show(+b.dataset.i); lb.hidden = false; $('.lb-x', lb).focus(); });
if (lb) {
$('.lb-prev', lb).addEventListener('click', function () { show(li - 1); });
$('.lb-next', lb).addEventListener('click', function () { show(li + 1); });
lb.addEventListener('click', function (e) { if (e.target.closest('[data-close]')) lb.hidden = true; });
}
/* ---------- \uc601\uc0c1\uc790\ub8cc ---------- */
var V = {
myfix: [['tXnpME6WbaU', 'SAG Speaker Festival 2026 STAGE215 \uc2dc\uc5f0'], ['sfsjqDXi4K4', '\uba40\ud2f0\uc874 \uc570\ud504'], ['QpbHUYzko7E', 'BXP \ud30c\uc6cc\ub4dc \ubbf9\uc11c'], ['xJtLMADntgk', 'STAGE215 \uceec\ub7fc\uc2a4\ud53c\ucee4'], ['FIm3yLKbY28', 'STAGE1 \ud3ec\ud130\ube14 \uc2a4\ud53c\ucee4 \uc0ac\uc6a9 \uac00\uc774\ub4dc'], ['upRQGhSWRhI', '\uc288\uc5b4 vs \ub9c8\uc774\ud53d\uc2a4 \ubb34\uc120\ub9c8\uc774\ud06c \ube44\uad50'], ['GI5QcuhSMNA', 'UR-222D 2\ucc44\ub110 \ubb34\uc120\ub9c8\uc774\ud06c \uc0ac\uc6a9 \ubc29\ubc95'], ['FSAJ-XvZ9QU', 'FM212A \uc774\ub3d9\ud615 \uc570\ud504 \uc0ac\uc6a9 \ubc29\ubc95'], ['M8blK5b1TDY', 'DAP-4080 \uc5f0\uacb0 \ubc0f \uc138\ud305 \ubc29\ubc95'], ['9r101G6Lx1o', 'SURGE2 \ubbf8\ub2c8 \uc570\ud504'], ['AJHVz1gVaBA', 'PD-50T \ud32c\ub358\ud2b8 \uc2a4\ud53c\ucee4'], ['vfQK1m36zwU', 'CG-910G \ubb34\uc120\ub9c8\uc774\ud06c \uc0ac\uc6a9 \ubc29\ubc95'], ['F9k5R5uld7I', 'WA-R8 \uc2e4\uc678\uc6a9 \ubc29\uc218 \uc2a4\ud53c\ucee4'], ['NHcH6nVmdpw', 'VC-100 \uc2a4\ud53c\ucee4 \ubcfc\ub968\uc870\uc808\uae30'], ['g33igkNZYDo', 'WS-30\u00b7WS-40 \uc0c9\uc18c\ud3f0 \ub9c8\uc774\ud06c'], ['j5UmNlQO48g', 'CPA10 DSP \uc124\uce58 \ubc29\ubc95']],
onstage: [['h6AlMJXKu5Q', 'MB5002 1\ucc44\ub110 \ubb34\uc120\ub9c8\uc774\ud06c \uac00'], ['r-Z6GtyDSKo', 'MSA9800 & MS9312 \ub9c8\uc774\ud06c \uc2a4\ud0e0\ub4dc'], ['p5-qYAWCrsw', 'SS8000 \uc2a4\ud53c\ucee4/\uc870\uba85 \uc2a4\ud0e0\ub4dc'], ['wwHVP3YCBEE', 'SMS7500 \uc2a4\ud53c\ucee4 \uc2a4\ud0e0\ub4dc \uc6b0\ub4dc'], ['IELzzpnR4MQ', 'LPT7000 \ub2e4\ubaa9\uc801 \uc2a4\ud0e0\ub4dc'], ['exVZWKFd818', 'DT8000 \uae30\ud0c0 \uc2a4\ud234 \uc758\uc790'], ['4WKARD8fTp8', 'UTC5500'], ['m9XwE8lz2aI', 'ASWS58'], ['TIUxqu-7h8M', 'VLD360'], ['QU6WQu6iP1o', 'UTC5500 + UCA1500'], ['q7t7qcImvIE', 'SS7745'], ['z9ZmrZ345_U', 'SMS4500P'], ['RAiXmvd5Iqk', 'SS8800B+'], ['Oj_6MQcyVOU', 'SSP7900']]
};
var BN = { myfix: 'MYFIX', onstage: 'On-Stage' };
function th(id) { return 'https://i.ytimg.com/vi/' + id + '/hqdefault.jpg'; }
// A
var vm = $('#vm');
function vbtn(id, t, b) { return ''; }
var vCur = 'myfix';
function emb(v, lazy) { return ''; }
var vg = $('#vidGrid');
function vPlay(i, auto) {
var L = V[vCur], v = L[i];
$('#vfFrame').innerHTML = '';
$('#vfNo').textContent = BN[vCur] + ' \u00b7 ' + String(i + 1).padStart(2, '0') + ' / ' + String(L.length).padStart(2, '0');
$('#vfTitle').textContent = v[1];
$$('#vidGrid li').forEach(function (x, k) { x.classList.toggle('on', k === i); });
}
function renderV(b) {
vCur = b;
$$('.vid-tabs button').forEach(function (x) { x.setAttribute('aria-selected', x.dataset.b === b); });
vg.innerHTML = V[b].map(function (v, i) { return '' + esc(v[1]) + ''; }).join('');
vPlay(0, false);
}
if (vg) {
$$('.vid-tabs button').forEach(function (x) { x.addEventListener('click', function () { renderV(x.dataset.b); }); });
vg.addEventListener('click', function (e) { var b = e.target.closest('.vthumb[data-k]'); if (!b) return; vPlay(+b.dataset.k, true); $('#vfPlayer').scrollIntoView({ behavior: RM ? 'auto' : 'smooth', block: 'center' }); });
renderV('myfix');
}
// B : \ud50c\ub808\uc774\uc5b4 + \uc7ac\uc0dd\ubaa9\ub85d
var vpL = $('#vpList'), vpF = $('#vpFrame'), vpB = 'myfix';
function vpSet(i, play) {
var v = V[vpB][i];
$$('li', vpL).forEach(function (x, k) { x.classList.toggle('on', k === i); });
$('#vpBrand').textContent = BN[vpB] + ' \u00b7 ' + String(i + 1).padStart(2, '0') + ' / ' + String(V[vpB].length).padStart(2, '0');
$('#vpTitle').textContent = v[1];
vpF.innerHTML = play ? ''
: '';
}
function vpRender(b) {
vpB = b;
$$('.vp-tabs button').forEach(function (x) { x.setAttribute('aria-selected', x.dataset.vb === b); });
vpL.innerHTML = V[b].map(function (v, i) { return ''; }).join('');
vpSet(0, false);
}
if (vpL) {
$$('.vp-tabs button').forEach(function (x) { x.addEventListener('click', function () { vpRender(x.dataset.vb); }); });
vpL.addEventListener('click', function (e) { var b = e.target.closest('button[data-k]'); if (b) vpSet(+b.dataset.k, true); });
vpF.addEventListener('click', function (e) { var b = e.target.closest('button[data-k]'); if (b) vpSet(+b.dataset.k, true); });
vpRender('myfix');
}
doc.addEventListener('keydown', function (e) {
if (e.key !== 'Escape') return;
if (lb) lb.hidden = true;
if (vm && !vm.hidden) { vm.hidden = true; $('#vmFrame').innerHTML = ''; }
});
/* live: \ud0ed\uc740 \ud398\uc774\uc9c0 \ub9c1\ud06c, \uc804\uccb4 reveal */
reveal(doc);
var hb = (location.hash || '').slice(1);
if (hb && $('.vid-tabs [data-b="' + hb + '"]')) $('.vid-tabs [data-b="' + hb + '"]').click();
})();
/* \uc124\uce58\uc0ac\ub840 \ud398\uc774\uc9c0 (2026-10-23) \u2014 \ub370\uc774\ud130: js/cases-data.js (\uba54\uc778\uacfc \uacf5\ud1b5) */
(function () {
'use strict';
var doc = document, body = doc.body;
var RM = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var $ = function (s, c) { return (c || doc).querySelector(s); };
var $$ = function (s, c) { return Array.prototype.slice.call((c || doc).querySelectorAll(s)); };
if (!document.getElementById('grid')) return;
var D = window.VOATEK_CASES || { cats: [], items: [] };
var CAT = {}; D.cats.forEach(function (c) { CAT[c.k] = c.label; });
var PAGE = 12;
/* toast / preview toggle */
var toastEl = $('#toast') || doc.createElement('div'), toastT;
function toast(m) { toastEl.textContent = m; toastEl.classList.add('on'); clearTimeout(toastT); toastT = setTimeout(function () { toastEl.classList.remove('on'); }, 2600); }
$$('[data-toast]').forEach(function (b) { b.addEventListener('click', function () { toast(b.dataset.toast); }); });
var pv = $('#pvToggle'); if (pv) pv.addEventListener('change', function () { body.classList.toggle('pv-off', !pv.checked); });
/* header (\ud398\uc774\uc9c0\uc5d0 \uc790\uccb4 \ud5e4\ub354\uac00 \uc788\uc744 \ub54c\ub9cc) */
var hd = $('#hd'), burger = $('.hd-burger'), mnav = $('#mnav'), lastY = scrollY, bar = $('#bar');
function onScroll() {
if (hd && burger) {
var y = scrollY, open = burger.getAttribute('aria-expanded') === 'true';
hd.classList.toggle('solid', y > 40 || open);
if (!open) {
if (y > 420 && y - lastY > 6) hd.classList.add('hide');
else if (lastY - y > 6 || y < 420) hd.classList.remove('hide');
}
body.classList.toggle('hd-show', !hd.classList.contains('hide'));
lastY = y;
}
if (bar) bar.classList.toggle('stuck', bar.getBoundingClientRect().top <= (body.classList.contains('hd-show') ? 70 : 2));
}
addEventListener('scroll', onScroll, { passive: true }); onScroll();
if (burger) burger.addEventListener('click', function () {
var open = burger.getAttribute('aria-expanded') !== 'true';
burger.setAttribute('aria-expanded', open); burger.setAttribute('aria-label', open ? '\uba54\ub274 \ub2eb\uae30' : '\uba54\ub274 \uc5f4\uae30');
mnav.hidden = !open; body.style.overflow = open ? 'hidden' : ''; onScroll();
});
/* card */
function esc(s) { return String(s).replace(/[&<>"]/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"' }[c]; }); }
function card(it) {
var led = it.cat === 'led';
var catTxt = led ? 'LED' + esc(it.venue || '') : esc(CAT[it.cat]) + ' \u00b7 ' + esc(it.type);
return '';
}
/* reveal */
var io = RM ? null : new IntersectionObserver(function (es) {
es.forEach(function (e) { if (e.isIntersecting) { e.target.classList.add('in'); io.unobserve(e.target); } });
}, { rootMargin: '0px 0px -8% 0px' });
function reveal(list) {
list.forEach(function (el, i) {
if (RM) { el.classList.add('in'); return; }
el.style.transitionDelay = (i % 3) * 70 + 'ms'; io.observe(el);
});
}
/* LED band */
var ledRow = $('#ledRow');
ledRow.innerHTML = D.items.filter(function (i) { return i.cat === 'led'; }).slice(0, 4).map(card).join('');
reveal($$('.cc', ledRow));
/* tabs */
var tabs = $('#tabs'), grid = $('#grid'), q = $('#q'), more = $('#more'), count = $('#count'), empty = $('#empty');
var cur = 'all', shown = 0, list = [];
tabs.innerHTML = D.cats.map(function (c) {
var n = c.k === 'all' ? D.items.length : D.items.filter(function (i) { return i.cat === c.k; }).length;
return '';
}).join('');
function filter() {
var kw = q.value.trim().replace(/\s/g, '').toLowerCase();
list = D.items.filter(function (i) {
return (cur === 'all' || i.cat === cur) && (!kw || i.name.replace(/\s/g, '').toLowerCase().indexOf(kw) > -1);
});
// \uc804\uccb4 \ubcf4\uae30: LED\ub294 \uc704 LED \uc601\uc5ed\uc5d0 \uba3c\uc800 \ubcf4\uc774\ubbc0\ub85c \ubaa9\ub85d\uc5d0\uc11c\ub294 \uc74c\ud5a5 \ucd5c\uc2e0\uc21c \ub4a4\uc5d0 \ubc30\uce58
if (cur === 'all') list = list.filter(function (i) { return i.cat !== 'led'; }).concat(list.filter(function (i) { return i.cat === 'led'; }));
grid.innerHTML = ''; shown = 0; page();
count.innerHTML = (cur === 'all' ? '\uc804\uccb4' : CAT[cur]) + ' ' + list.length + '\uac74';
empty.hidden = list.length > 0;
}
function page() {
var next = list.slice(shown, shown + PAGE);
grid.insertAdjacentHTML('beforeend', next.map(card).join(''));
shown += next.length;
reveal($$('.cc:not(.in)', grid));
more.parentNode.hidden = shown >= list.length;
}
function setCat(k, scroll) {
if (!CAT[k]) k = 'all';
cur = k;
$$('button', tabs).forEach(function (b) { b.setAttribute('aria-selected', b.dataset.f === k); });
filter();
var u = new URL(location.href); if (k === 'all') u.searchParams.delete('cat'); else u.searchParams.set('cat', k);
try { history.replaceState(null, '', u); } catch (e) {}
if (scroll) $('#list').scrollIntoView({ behavior: RM ? 'auto' : 'smooth' });
}
tabs.addEventListener('click', function (e) { var b = e.target.closest('button'); if (b) setCat(b.dataset.f); });
$$('[data-go]').forEach(function (b) { b.addEventListener('click', function () { setCat(b.dataset.go, true); }); });
var qT; q.addEventListener('input', function () { clearTimeout(qT); qT = setTimeout(filter, 150); });
more.addEventListener('click', page);
/* modal */
var modal = $('#modal'), mIdx = -1, lastFocus = null, ctx = [];
function fill() {
var it = ctx[mIdx]; if (!it) return;
gal = it.imgs && it.imgs.length ? it.imgs : [it.img]; gIdx = 0; showPic(it);
$('#mThumbs').innerHTML = gal.length > 1 ? gal.map(function (s, k) { return ''; }).join('') : '';
modal.classList.toggle('is-multi', gal.length > 1);
$('#mTitle').textContent = it.name;
$('#mTags').innerHTML = it.cat === 'led' ? 'LED\uc804\uad11\ud310' : '' + esc(it.type) + '';
$('#mCat').textContent = it.cat === 'led' ? 'LED\uc804\uad11\ud310 \u00b7 ' + (it.venue || '') : CAT[it.cat];
$('#mType').textContent = it.type;
$('#mDate').textContent = it.date || ''; $('#mDateRow').hidden = !it.date;
try { history.replaceState(null, '', '#' + it.id); } catch (e) {}
}
var gal = [], gIdx = 0;
function showPic(it) {
it = it || ctx[mIdx];
$('#mImg').src = gal[gIdx]; $('#mImg').alt = it.name + ' \uc124\uce58 \ud604\uc7a5 ' + (gIdx + 1);
$('#mCount').textContent = (gIdx + 1) + ' / ' + gal.length;
$$('#mThumbs button').forEach(function (b, k) { b.setAttribute('aria-current', k === gIdx); });
}
function gStep(d) { if (gal.length < 2) return; gIdx = (gIdx + d + gal.length) % gal.length; showPic(); }
$('#mThumbs').addEventListener('click', function (e) { var b = e.target.closest('button[data-g]'); if (b) { gIdx = +b.dataset.g; showPic(); } });
$('#gPrev').addEventListener('click', function () { gStep(-1); });
$('#gNext').addEventListener('click', function () { gStep(1); });
var tx = null;
$('.cs-m-img').addEventListener('touchstart', function (e) { tx = e.touches[0].clientX; }, { passive: true });
$('.cs-m-img').addEventListener('touchend', function (e) { if (tx === null) return; var dx = e.changedTouches[0].clientX - tx; if (Math.abs(dx) > 40) gStep(dx < 0 ? 1 : -1); tx = null; });
function openCase(id, from) {
ctx = from && from.length ? from : D.items;
mIdx = ctx.findIndex(function (i) { return i.id === id; });
if (mIdx < 0) { ctx = D.items; mIdx = ctx.findIndex(function (i) { return i.id === id; }); }
if (mIdx < 0) return;
lastFocus = doc.activeElement; fill();
modal.hidden = false; body.style.overflow = 'hidden'; $('.cs-x', modal).focus();
}
function closeCase() {
modal.hidden = true; body.style.overflow = '';
try { history.replaceState(null, '', location.pathname + location.search); } catch (e) {}
if (lastFocus) lastFocus.focus();
}
function step(d) { mIdx = (mIdx + d + ctx.length) % ctx.length; fill(); }
doc.addEventListener('click', function (e) {
var b = e.target.closest('.cc button'); if (b) openCase(b.dataset.id, b.closest('#ledRow') ? D.items.filter(function (i) { return i.cat === 'led'; }) : list);
if (e.target.closest('[data-close]')) closeCase();
});
$('#mPrev').addEventListener('click', function () { step(-1); });
$('#mNext').addEventListener('click', function () { step(1); });
doc.addEventListener('keydown', function (e) {
if (modal.hidden) return;
if (e.key === 'Escape') closeCase();
if (e.key === 'ArrowLeft') { if (gal.length > 1) gStep(-1); else step(-1); }
if (e.key === 'ArrowRight') { if (gal.length > 1) gStep(1); else step(1); }
if (e.key === 'Tab') { // focus trap
var f = $$('button, a[href]', modal).filter(function (x) { return x.offsetParent; }), a = f[0], z = f[f.length - 1];
if (e.shiftKey && doc.activeElement === a) { e.preventDefault(); z.focus(); }
else if (!e.shiftKey && doc.activeElement === z) { e.preventDefault(); a.focus(); }
}
});
var sx = 0; modal.addEventListener('touchstart', function (e) { sx = e.touches[0].clientX; }, { passive: true });
modal.addEventListener('touchend', function (e) { var dx = e.changedTouches[0].clientX - sx; if (Math.abs(dx) > 60) step(dx < 0 ? 1 : -1); });
/* init: ?cat=led / #c012 */
var p = new URLSearchParams(location.search);
var CODE = { c1: 'etc', c2: 'hall', c3: 'public', c4: 'church', c5: 'edu', c7: 'hotel' }; // \uba54\uc778 \ub9c1\ud06c(\uce74\ud39824 \ubd84\ub958 \ucf54\ub4dc) \ud638\ud658
setCat(p.get('cat') || CODE[p.get('com_board_category_code')] || 'all');
if (location.hash.length > 1) { var h = location.hash.slice(1); if (D.items.some(function (i) { return i.id === h; })) openCase(h, list); }
})();
/* ===== sndb : sound system boards (B layout, 2026-11-12) ===== */
(function () {
var R = document.getElementById('sndb'); if (!R) return;
var raw = document.getElementById('sndbRaw'), V = document.getElementById('sndbView');
var Q = location.search;
if (/com_board_basic=(write_form|update_form|reply_form|delete_form|pass_form|comment)/.test(Q) || !V) { R.className += ' is-raw'; return; }
var BID = R.getAttribute('data-board'), SUB = R.getAttribute('data-sub'), TITLE = R.getAttribute('data-title') || '', PG = location.pathname;
var DL = { download_01: '\uc774\ubbf8\uc9c0', download_02: '\uc0ac\uc591\uc11c', download_03: '\uc2dc\ubc29\uc11c', download_04: '\ub3c4\uba74', download_05: '\ub9e4\ub274\uc5bc', download_06: '\uc81c\ud488 \uc124\uba85 \uc601\uc0c1' };
var IC = {
dl: '',
yt: '',
l: '',
r: '',
s: '',
go: ''
};
function esc(s) { return String(s == null ? '' : s).replace(/[&<>"]/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"' }[c]; }); }
function clean(s) { return String(s || '').replace(/\s+/g, ' ').trim(); }
function ext(h) { var m = String(h).split('?')[0].match(/\.([a-z0-9]{2,5})$/i); return m ? m[1].toUpperCase() : 'LINK'; }
function isYt(d) { return /youtu/.test(d.h) || d.t === '\uc81c\ud488 \uc124\uba85 \uc601\uc0c1'; }
function lines(el) {
var h = el.innerHTML.replace(/<(script|style)[\s\S]*?<\/\1>/gi, '').replace(/
/gi, '\n').replace(/<\/(div|p|li|tr|h\d)>/gi, '\n').replace(/<[^>]+>/g, '')
.replace(/ /g, ' ').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, '&');
return h.split('\n').map(clean).filter(Boolean);
}
function parsePost(p, name) {
var o = { name: name || '', sub: '', brand: '', feat: [], dl: [], links: [], imgs: [] };
var tb = p.querySelectorAll('.title_box');
if (tb.length) { o.name = clean(tb[0].textContent) || o.name; if (tb[1]) o.sub = clean(tb[1].textContent); }
var bl = p.querySelector('img[src*="logo"]'); if (bl) o.brand = bl.getAttribute('src');
var L = lines(p), f = [];
L.forEach(function (s) { if (/^[\u00b7\u2022\u3186\-]/.test(s)) f.push(s.replace(/^[\u00b7\u2022\u3186\-]\s*/, '')); });
if (!f.length) { var i = L.indexOf('\ube0c\ub79c\ub4dc'); f = L.slice(i >= 0 ? i + 1 : 0).filter(function (s) { return s !== o.name && s !== o.sub && s.length > 3 && s.charAt(0) !== '('; }); }
o.feat = f.slice(0, 16);
var seen = {};
[].forEach.call(p.querySelectorAll('a[href]'), function (a) {
var h = a.getAttribute('href'); if (!h || h.charAt(0) === '#' || /^javascript/i.test(h)) return;
var im = a.querySelector('img'), k = im && (im.getAttribute('src') || '').match(/download_0\d/);
if (k) { o.dl.push({ t: DL[k[0]] || '\uc790\ub8cc', h: h }); return; }
if (seen[h]) return; seen[h] = 1;
if (im && /\.(jpe?g|png|gif|webp)$/i.test(h)) return;
o.links.push({ t: /smartstore|shop/i.test(h) ? '\uc1fc\ud551\ubab0 \ubc14\ub85c\uac00\uae30' : clean(a.textContent) || '\uad00\ub828 \ub9c1\ud06c', h: h });
});
var u = {};
[].forEach.call(p.querySelectorAll('img'), function (im) {
var s = im.getAttribute('src') || ''; if (!s || /download_0|logo|\.gif(\?|$)/i.test(s) || u[s]) return; u[s] = 1; o.imgs.push(s);
});
return o;
}
function fetchDoc(u, cb) {
var x = new XMLHttpRequest(); x.open('GET', u, true); x.responseType = 'arraybuffer';
x.onload = function () { try { var t = new TextDecoder('euc-kr').decode(x.response); cb(new DOMParser().parseFromString(t, 'text/html')); } catch (e) { cb(null); } };
x.onerror = function () { cb(null); }; x.send();
}
function store(k, v) { try { localStorage.setItem(k, JSON.stringify({ t: Date.now(), d: v })); } catch (e) {} }
function load(k, ttl) { try { var v = JSON.parse(localStorage.getItem(k)); if (v && Date.now() - v.t < ttl) return v.d; } catch (e) {} return null; }
function idxOf(h) { var m = String(h).match(/com_board_idx=(\d+)/); return m ? m[1] : ''; }
/* gallery */
function gal(o, fb) {
var a = o.imgs.length ? o.imgs : (fb ? [fb] : []); if (!a.length) return '';
return ' + ')
' +
(a.length > 1 ? '
' : '') +
'
1 / ' + a.length + '' +
(a.length > 1 ? '
' + a.map(function (s, i) { return '
'; }).join('') + '
' : '') + '
';
}
function galInit(box, o, fb) {
var g = box.querySelector('.gal'); if (!g) return;
var a = o.imgs.length ? o.imgs : [fb], i = 0, m = g.querySelector('.gal-main img'), c = g.querySelector('.gal-cnt');
function go(k) { i = (k + a.length) % a.length; m.src = a[i]; c.textContent = (i + 1) + ' / ' + a.length; [].forEach.call(g.querySelectorAll('.gal-th button'), function (b, j) { b.className = j === i ? 'on' : ''; }); }
g.addEventListener('click', function (e) { var b = e.target.closest('button'); if (!b) return; if (/\bp\b/.test(b.className)) go(i - 1); else if (/\bn\b/.test(b.className)) go(i + 1); else if (b.getAttribute('data-k')) go(+b.getAttribute('data-k')); });
var sx = null, st = m.parentNode;
st.addEventListener('touchstart', function (e) { sx = e.touches[0].clientX; }, { passive: true });
st.addEventListener('touchend', function (e) { if (sx === null) return; var dx = e.changedTouches[0].clientX - sx; if (Math.abs(dx) > 40) go(i + (dx < 0 ? 1 : -1)); sx = null; });
}
function adminBar() {
var ks = ['modify', 'write', 'reply', 'delete', 'admin_move', 'admin_copy'], out = [];
[].forEach.call(raw.querySelectorAll('a'), function (a) { var im = a.querySelector('img'); var s = im ? im.getAttribute('src') || '' : ''; for (var i = 0; i < ks.length; i++) if (s.indexOf('/' + ks[i] + '.gif') > -1) { out.push(a); break; } });
if (!out.length) return null;
var bar = document.createElement('div'); bar.className = 'sb-admin';
bar.innerHTML = '\uad00\ub9ac\uc790';
out.forEach(function (a) { var c = a.cloneNode(true); bar.appendChild(c); });
var t = document.createElement('button'); t.type = 'button'; t.textContent = '\uae30\ubcf8 \uac8c\uc2dc\ud310 \ubcf4\uae30';
t.onclick = function () { R.className = /is-raw/.test(R.className) ? R.className.replace(' is-raw', '') : R.className + ' is-raw'; };
bar.appendChild(t);
return bar;
}
/* ---------- read ---------- */
if (/com_board_basic=read_form/.test(Q)) {
var post = raw.querySelector('#post_area');
if (!post) { R.className += ' is-raw'; return; }
var o = parsePost(post, '');
var nav = {};
[].forEach.call(raw.querySelectorAll('a'), function (a) { var im = a.querySelector('img'); var s = im ? im.getAttribute('src') || '' : ''; ['prev', 'list', 'next'].forEach(function (k) { if (s.indexOf('/' + k + '.gif') > -1 && !nav[k]) nav[k] = a.getAttribute('href'); }); });
var rows = o.dl.concat(o.links);
V.innerHTML = '' +
'' + gal(o) + '
' +
'' + esc(TITLE) + '
' + esc(o.name) + '
' + (o.sub ? '
' + esc(o.sub) + '
' : '') +
(o.brand ? '
\ube0c\ub79c\ub4dc  + ')
' : '') +
'
' + o.feat.map(function (f) { return '- ' + esc(f) + '
'; }).join('') + '
' +
'
\uc790\ub8cc \ub2e4\uc6b4\ub85c\ub4dc
' + (rows.length ? '
' : '
\ub4f1\ub85d\ub41c \uc790\ub8cc\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.
') + '
';
galInit(V, o);
var ab = adminBar(); if (ab) V.appendChild(ab);
R.className += ' is-read';
return;
}
/* ---------- list ---------- */
var items = [], map = {};
[].forEach.call(raw.querySelectorAll('a[href*="read_form"]'), function (a) {
var h = a.getAttribute('href'), id = idxOf(h); if (!id) return;
var o = map[id]; if (!o) { o = map[id] = { idx: id, href: h, img: '', name: '' }; items.push(o); }
var im = a.querySelector('img'); if (im && !o.img) o.img = im.getAttribute('src');
var t = clean(a.textContent); if (t && !o.name) o.name = t;
});
var SC = ({"11":{"c":{"c11":["\uc0c1\uae09","\uc911\uae09","\uc911\uae09 \ucda9\uc804\uc2dd","\ubcf4\uae09\ud615","\uc545\uae30\uc6a9"],"c5":["\uc548\ud14c\ub098 \ubd84\ubc30\uae30","\uc548\ud14c\ub098","\ubd80\uc2a4\ud130\u00b7\uc2a4\ud50c\ub9ac\ud130"],"c4":["\uc778\uc774\uc5b4","\ucef4\ud329\ud2b8 \uc778\uc774\uc5b4"],"c12":["\ucf58\ub374\uc11c \uad6c\uc988\ub125","\ub2e4\uc774\ub098\ubbf9"]},"h":["ED-900B","MB-900B","MC-910","MC-920","ED-900H","EW-901R","EW-902R","EW-904R","MH-901C(D)","MB-910C","MB-920C","WH-920C (D)","WR-910C","WR-920C","CG-910"],"o":["\uc0c1\uae09","\uc911\uae09","\uc911\uae09 \ucda9\uc804\uc2dd","\ubcf4\uae09\ud615","\uc678\uc7a5 \ubc30\ud130\ub9ac \uad6c\ub3d9","\uc545\uae30\uc6a9","\ubb34\uc120 \ud68c\uc758\uc6a9","\uc548\ud14c\ub098 \ubd84\ubc30\uae30","\uc548\ud14c\ub098","\ubd80\uc2a4\ud130\u00b7\uc2a4\ud50c\ub9ac\ud130","\uc778\uc774\uc5b4","\ucef4\ud329\ud2b8 \uc778\uc774\uc5b4","\ucf58\ub374\uc11c \uad6c\uc988\ub125","\ub2e4\uc774\ub098\ubbf9"],"m":{"HW-910":["\uc0c1\uae09","HW"],"HW-920":["\uc0c1\uae09","HW"],"UR-222S":["\uc0c1\uae09","UR"],"UR-222D":["\uc0c1\uae09","UR"],"PW-910":["\uc911\uae09","PW"],"PW-920":["\uc911\uae09","PW"],"CG-920":["\uc911\uae09 \ucda9\uc804\uc2dd","CG"],"GW-902":["\uc911\uae09 \ucda9\uc804\uc2dd","GW"],"GW-901C":["\uc911\uae09 \ucda9\uc804\uc2dd","GW"],"LW-902R":["\ubcf4\uae09\ud615","LW"],"BW-2R":["\ubcf4\uae09\ud615","BW-2R"],"FR-4R":["\ubcf4\uae09\ud615","FR-4R"],"MW2-901HA":["\uc545\uae30\uc6a9",""],"MW-901G":["\uc545\uae30\uc6a9",""],"CN-90C/D":["\ubb34\uc120 \ud68c\uc758\uc6a9","CN-90"],"CN-90S":["\ubb34\uc120 \ud68c\uc758\uc6a9","CN-90"],"WD-908F":["\uc548\ud14c\ub098 \ubd84\ubc30\uae30",""],"WD-916F":["\uc548\ud14c\ub098 \ubd84\ubc30\uae30",""],"WA-801":["\uc548\ud14c\ub098",""],"WA-901":["\uc548\ud14c\ub098",""],"AP-1":["\ubd80\uc2a4\ud130\u00b7\uc2a4\ud50c\ub9ac\ud130",""],"AP-12":["\ubd80\uc2a4\ud130\u00b7\uc2a4\ud50c\ub9ac\ud130",""],"X-EAR":["\uc778\uc774\uc5b4","X-ear"],"DW-901R":["\ucef4\ud329\ud2b8 \uc778\uc774\uc5b4","DW"],"DW-901B":["\ucef4\ud329\ud2b8 \uc778\uc774\uc5b4","DW"],"MG-63":["\ucf58\ub374\uc11c \uad6c\uc988\ub125",""],"MG-58":["\ucf58\ub374\uc11c \uad6c\uc988\ub125",""],"MD-48":["\ub2e4\uc774\ub098\ubbf9",""],"MD-58":["\ub2e4\uc774\ub098\ubbf9",""]}}})[BID] || { o: [], m: {} }, SM = SC.m;
var HID = {}; (SC.h || []).forEach(function (x) { HID[x] = 1; });
var SN = {}; Object.keys(SM).forEach(function (k) { var s = SM[k][1]; if (s && !HID[k]) SN[s] = (SN[s] || 0) + 1; });
items = items.filter(function (o) { return !HID[o.name]; });
var curCat = (Q.match(/com_board_category_code=(\w+)/) || [])[1] || '';
var cats = [].map.call(raw.querySelectorAll('.sul_menu a'), function (a) { var h = a.getAttribute('href'); return { name: clean(a.textContent), href: h, code: (h.match(/com_board_category_code=(\w+)/) || [])[1] || '' }; });
var curName = TITLE; cats.forEach(function (c) { if (c.code === curCat && c.code) curName = c.name; });
var side = cats.length > 1;
V.innerHTML = '' + (side ? '
' : '') + '
' + esc(curCat ? curName : '\uc804\uccb4 \uc81c\ud488') + '' + items.length + '
' +
items.map(function (o) {
return '
 + ')
' + esc(o.name) + '' + ((SM[o.name] || [])[1] && SN[SM[o.name][1]] > 1 ? '' + esc(SM[o.name][1]) + ' Series' : '') + '
';
}).join('') + '
\uac80\uc0c9 \uacb0\uacfc\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.
';
var ab2 = adminBar(); if (ab2) V.appendChild(ab2);
R.className += ' is-list';
/* sub categories (2nd level): toggle arrows + client-side filter */
(function () {
if (!side || !SC.c) return;
var cn = {}; Object.keys(SM).forEach(function (k) { var s = SM[k][0]; if (s && !HID[k]) cn[s] = (cn[s] || 0) + 1; });
var want = ''; try { want = decodeURIComponent((location.hash.match(/s=([^&]+)/) || [])[1] || ''); } catch (e) {}
function apply(box, s) {
[].forEach.call(box.children, function (x) { x.className = s && x.getAttribute('data-s') === s ? 'on' : ''; }); var k = 0;
[].forEach.call(V.querySelectorAll('.b-row'), function (r) { var ok = !s || r.getAttribute('data-sub') === s; r.hidden = !ok; if (ok) k++; });
V.querySelector('.b-top strong').innerHTML = esc(curName + (s ? ' \u203a ' + s : '')) + '' + k + '';
V.querySelector('.sb-empty').hidden = k > 0;
}
[].forEach.call(V.querySelectorAll('.b-side a'), function (a) {
var code = a.getAttribute('data-code'), subs = (SC.c[code] || []).filter(function (s) { return cn[s]; }); if (subs.length < 2) return;
var act = code === curCat, box = document.createElement('div'); box.className = 'b-sub'; box.hidden = !act;
box.innerHTML = subs.map(function (s) { return ''; }).join('');
a.parentNode.insertBefore(box, a.nextSibling);
var tg = document.createElement('span'); tg.className = 'b-tg' + (act ? ' open' : ''); tg.setAttribute('role', 'button'); tg.setAttribute('tabindex', '0'); tg.setAttribute('aria-label', 'toggle');
tg.innerHTML = '';
a.insertBefore(tg, a.querySelector('b'));
function tog(e) { e.preventDefault(); e.stopPropagation(); box.hidden = !box.hidden; tg.className = 'b-tg' + (box.hidden ? '' : ' open'); }
tg.addEventListener('click', tog); tg.addEventListener('keydown', function (e) { if (e.key === 'Enter' || e.key === ' ') tog(e); });
box.addEventListener('click', function (e) {
var b = e.target.closest ? e.target.closest('button') : null; if (!b) return; var s = b.getAttribute('data-s');
if (!act) { location.href = a.getAttribute('href') + '#s=' + encodeURIComponent(s); return; }
apply(box, b.className === 'on' ? '' : s);
});
if (act && want && subs.indexOf(want) > -1) apply(box, want);
});
})();
/* category counts */
if (side) {
var ck = 'sndbc2:' + BID, cc = load(ck, 6 * 3600e3);
function paintC(c) { [].forEach.call(V.querySelectorAll('.b-side a'), function (a) { var k = a.getAttribute('data-code'); if (c[k] != null) a.querySelector('b').textContent = c[k]; }); }
if (cc) paintC(cc); else {
var res = {}, left = cats.length;
cats.forEach(function (c) { fetchDoc(c.href, function (d) { if (d) { var s = {}; [].forEach.call(d.querySelectorAll('a[href*="read_form"]'), function (a) { var i = idxOf(a.getAttribute('href')); if (i) { var tx = clean(a.textContent); if (tx) s[i] = tx; else if (!s[i]) s[i] = 1; } }); res[c.code] = Object.keys(s).filter(function (k) { return !HID[s[k]]; }).length; } if (--left === 0) { store(ck, res); paintC(res); } }); });
}
}
/* search */
var inp = V.querySelector('.srch input');
inp.addEventListener('input', function () {
var q = inp.value.toLowerCase().trim(), n = 0;
[].forEach.call(V.querySelectorAll('.b-row'), function (r) { var ok = !q || r.textContent.toLowerCase().indexOf(q) > -1; r.hidden = !ok; if (ok) n++; });
V.querySelector('.sb-empty').hidden = n > 0;
});
/* lazy detail */
var queue = [], busy = 0, TTL = 6 * 3600e3;
function fill(r, o) {
r.querySelector('.s').textContent = o.sub || '';
r.querySelector('ul').innerHTML = o.feat.slice(0, 3).map(function (f) { return '' + esc(f) + ''; }).join('');
var fs = o.dl.concat(o.links);
r.querySelector('.b-files').innerHTML = fs.map(function (d) {
var y = isYt(d), dl = o.dl.indexOf(d) > -1 && !y;
return '' + esc(d.t) + '' + (y ? IC.yt : dl ? ext(d.h) : IC.go) + '';
}).join('');
if (o.imgs.length > 1) { var f = r.querySelector('.fig'); if (!f.querySelector('.pc')) f.insertAdjacentHTML('beforeend', '' + o.imgs.length + ' PHOTOS'); }
}
function pump() {
while (busy < 3 && queue.length) {
(function (r) {
var id = r.getAttribute('data-idx'), it = map[id]; busy++;
fetchDoc(it.href, function (d) {
busy--; var p = d && d.getElementById('post_area');
var o = p ? parsePost(p, it.name) : { sub: '', feat: [], dl: [], links: [], imgs: [] };
store('sndb:' + BID + ':' + id, o); fill(r, o); pump();
});
})(queue.shift());
}
}
function want(r) {
var id = r.getAttribute('data-idx'), c = load('sndb:' + BID + ':' + id, TTL);
if (c) fill(r, c); else { queue.push(r); pump(); }
}
var rows2 = V.querySelectorAll('.b-row');
if ('IntersectionObserver' in window) {
var io = new IntersectionObserver(function (es) { es.forEach(function (e) { if (e.isIntersecting) { io.unobserve(e.target); want(e.target); } }); }, { rootMargin: '400px 0px' });
[].forEach.call(rows2, function (r, i) { if (i < 8) want(r); else io.observe(r); });
} else[].forEach.call(rows2, want);
})();
/* ===== csb : customer support boards (A layout, 2026-11-12) ===== */
(function () {
var R = document.getElementById('csb'); if (!R) return;
var raw = document.getElementById('csbRaw'), V = document.getElementById('csbView');
var Q = location.search;
if (!raw || !V || /com_board_basic=(write_form|update_form|reply_form|delete_form|pass_form|comment)/.test(Q)) { R.className += ' is-raw'; return; }
var KIND = R.getAttribute('data-kind'), PG = location.pathname, SUB = R.getAttribute('data-sub'), BID = R.getAttribute('data-board');
var HIDE = R.getAttribute('data-hide') ? new RegExp(R.getAttribute('data-hide'), 'i') : null;
function esc(s) { return String(s == null ? '' : s).replace(/[&<>"]/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"' }[c]; }); }
function clean(s) { return String(s || '').replace(/\s+/g, ' ').trim(); }
function ext(h) { var m = String(h).split('?')[0].match(/\.([a-z0-9]{2,5})$/i); return m ? m[1].toLowerCase() : 'file'; }
function idxOf(h) { var m = String(h).match(/com_board_idx=(\d+)/); return m ? m[1] : ''; }
function fetchDoc(u, cb) {
var x = new XMLHttpRequest(); x.open('GET', u, true); x.responseType = 'arraybuffer';
x.onload = function () { try { cb(new DOMParser().parseFromString(new TextDecoder('euc-kr').decode(x.response), 'text/html')); } catch (e) { cb(null); } };
x.onerror = function () { cb(null); }; x.send();
}
function store(k, v) { try { localStorage.setItem(k, JSON.stringify({ t: Date.now(), d: v })); } catch (e) {} }
function load(k, ttl) { try { var v = JSON.parse(localStorage.getItem(k)); if (v && Date.now() - v.t < ttl) return v.d; } catch (e) {} return null; }
function filesOf(p) {
var out = [], seen = {};
[].forEach.call(p.querySelectorAll('a[href]'), function (a) { var h = a.getAttribute('href'); if (!h || seen[h]) return; if (/_document\/|\.(zip|pdf|exe|pptx?|hwp|dwg|xlsx?|docx?)$/i.test(h) && !/read_form|write_form|update_form/.test(h)) { seen[h] = 1; out.push(h); } });
return out;
}
function cell(tr, cls, fb) { var e = tr.querySelector('td.' + cls); return e ? clean(e.textContent) : (fb || ''); }
function textOf(el) { var c = el.cloneNode(true); [].forEach.call(c.querySelectorAll('script,style'), function (x) { x.parentNode.removeChild(x); }); return c.textContent; }
function rowsOf(doc) {
var out = [];
[].forEach.call(doc.querySelectorAll('tr'), function (tr) {
if (tr.querySelector('tr')) return; var a = tr.querySelector('a[href*="read_form"]'); if (!a) return;
var c = [].map.call(tr.children, function (td) { return clean(td.textContent); });
var id = idxOf(a.getAttribute('href')); if (!id) return;
out.push({ idx: id, href: a.getAttribute('href'), no: cell(tr, 'bbsno', c[1]), cat: cell(tr, 'bbscategory', c[2]), title: clean(a.textContent) || cell(tr, 'bbsnewf5', c[3]), date: cell(tr, 'bbsetc_dateof_write', c[c.length - 1]) });
});
return out;
}
function adminBar() {
var ks = ['modify', 'write', 'reply', 'delete', 'admin_move', 'admin_copy'], out = [];
[].forEach.call(raw.querySelectorAll('a'), function (a) { var im = a.querySelector('img'); var s = im ? im.getAttribute('src') || '' : ''; for (var i = 0; i < ks.length; i++) if (s.indexOf('/' + ks[i] + '.gif') > -1) { out.push(a); break; } });
if (!out.length) return null;
var bar = document.createElement('div'); bar.className = 'cb-admin'; bar.innerHTML = '\uad00\ub9ac\uc790';
out.forEach(function (a) { bar.appendChild(a.cloneNode(true)); });
var t = document.createElement('button'); t.type = 'button'; t.textContent = '\uae30\ubcf8 \uac8c\uc2dc\ud310 \ubcf4\uae30';
t.onclick = function () { R.className = /is-raw/.test(R.className) ? R.className.replace(' is-raw', '') : R.className + ' is-raw'; };
bar.appendChild(t); return bar;
}
var DL = '↓';
/* ---------- read ---------- */
if (/com_board_basic=read_form/.test(Q)) {
var post = raw.querySelector('#post_area'); if (!post) { R.className += ' is-raw'; return; } post = post.closest('td.board_description') || post;
var title = '', date = '', cat = '';
var nav = {};
[].forEach.call(raw.querySelectorAll('a'), function (a) { var im = a.querySelector('img'); var s = im ? im.getAttribute('src') || '' : ''; ['prev', 'list', 'next'].forEach(function (k) { if (s.indexOf('/' + k + '.gif') > -1 && !nav[k]) nav[k] = a.getAttribute('href'); }); });
var cur = idxOf(Q), ck = load('csb3:' + BID + ':list', 6 * 3600e3);
if (ck) ck.forEach(function (r) { if (r.idx === cur) { title = r.title; date = r.date; cat = r.cat; } });
[].forEach.call(raw.querySelectorAll('td.board_bgcolor'), function (td) { var t = clean(td.textContent), v = td.nextElementSibling ? clean(td.nextElementSibling.textContent) : ''; if (!v) return; if (t === '\uc81c\ubaa9') title = v; else if (t === '\uce74\ud14c\uace0\ub9ac') cat = v; else if (/\uc791\uc131\uc77c|\ub4f1\ub85d\uc77c/.test(t)) date = v; });
var files = filesOf(post);
var body = post.cloneNode(true);
[].forEach.call(body.querySelectorAll('a[href]'), function (a) { if (files.indexOf(a.getAttribute('href')) > -1 && !clean(a.textContent)) { var pa = a.parentNode; a.remove(); if (pa && pa !== body && !pa.children.length && !clean(pa.textContent)) pa.remove(); } });
V.innerHTML = '' +
'' + (cat ? '' + esc(cat) + '' : '') + (title ? '' + esc(title) + '
' : '') + (date ? '' : '') + '' +
'' + (files.length ? '' : '') + '' +
'';
V.querySelector('.cb-body').appendChild(body);
var ab = adminBar(); if (ab) V.appendChild(ab);
R.className += ' is-read';
return;
}
/* ---------- list ---------- */
var first = rowsOf(raw);
var cats = [].map.call(raw.querySelectorAll('.sul_menu a'), function (a) { var h = a.getAttribute('href'); return { name: clean(a.textContent), code: (h.match(/com_board_category_code=(\w+)/) || [])[1] || '' }; }).filter(function (c) { return c.code; });
V.innerHTML = '\ubd88\ub7ec\uc624\ub294 \uc911...
';
var ab2 = adminBar(); if (ab2) V.appendChild(ab2);
R.className += ' is-list';
var all = [], seen = {}, page = 1, MAXP = 12;
function addRows(rs) { var n = 0; rs.forEach(function (r) { if (seen[r.idx]) return; seen[r.idx] = 1; if (HIDE && HIDE.test(r.title + ' ' + r.cat)) return; all.push(r); n++; }); return n; }
addRows(first);
var hasMore = !!raw.querySelector('a[href*="com_board_page=2"]');
function nextPage() {
if (!hasMore || page >= MAXP) return done();
page++;
fetchDoc(PG + '?sub=' + SUB + '&com_board_page=' + page, function (d) {
if (!d) return done();
var rs = rowsOf(d); var before = Object.keys(seen).length; addRows(rs);
if (Object.keys(seen).length === before) return done();
nextPage();
});
}
var st = { cat: '', q: '' };
function done() { store('csb3:' + BID + ':list', all); render(); fillAll(); }
function render() {
var q = st.q.toLowerCase();
var L = all.filter(function (r) { return (!st.cat || r.cat === st.cat) && (!q || (r.title + ' ' + (r.body || '')).toLowerCase().indexOf(q) > -1); });
var box = V.querySelector('.cb-list');
if (KIND === 'data') {
var chips = '';
box.innerHTML = chips + (L.map(function (r) {
var f = r.files && r.files[0];
return '';
}).join('') || '\uac80\uc0c9 \uacb0\uacfc\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.
');
} else {
box.innerHTML = (L.map(function (r) {
return '' + esc(r.no) + '' + esc(r.title) + '
' + esc(r.body || '') + '
';
}).join('') || '\ub4f1\ub85d\ub41c \uae00\uc774 \uc5c6\uc2b5\ub2c8\ub2e4.
');
}
}
V.addEventListener('click', function (e) { var c = e.target.closest('[data-c]'); if (c) { st.cat = c.getAttribute('data-c'); render(); } });
V.addEventListener('input', function (e) { if (e.target.type === 'search') { st.q = e.target.value; var p = e.target.selectionStart; render(); var i = V.querySelector('.cb-srch input'); i.focus(); try { i.setSelectionRange(p, p); } catch (er) {} } });
/* body excerpt + file per row */
var queue = [], busy = 0, TTL = 6 * 3600e3;
function fillAll() { all.forEach(function (r) { var c = load('csb3:' + BID + ':' + r.idx, TTL); if (c) { r.body = c.body; r.files = c.files; } else queue.push(r); }); render(); pump(); }
function pump() {
while (busy < 3 && queue.length) {
(function (r) {
busy++;
fetchDoc(r.href, function (d) {
busy--; var p = d && d.getElementById('post_area'); if (p) p = p.closest('td.board_description') || p;
var body = p ? clean(textOf(p)).replace(/^_$/, '').slice(0, 160) : '', files = p ? filesOf(p) : [];
r.body = body; r.files = files; store('csb3:' + BID + ':' + r.idx, { body: body, files: files });
if (!queue.length && !busy) render(); else if (busy === 0) render();
pump();
});
})(queue.shift());
}
if (!queue.length && !busy) render();
}
nextPage();
})();