';
$('.board-category').html($html);
$('.board-category ul li').each(function () {
if ($(this).find('a').attr('href').indexOf($ca_current) > -1 && $ca_current != '') $(this).addClass('is-active');
});
if (!$('.board-category .is-active').length) $('.board-category ul li:first-child').addClass('is-active');
} else {
$('.board-category').remove();
}
}
$('.gallery_etc').each(function() {
$(this).html($.trim($(this).text().replace('[','').replace(']','').split(':')[1]));
});
});
// image button to text button
$(document).ready(function () {
var $btn_keywords = ['삭제', '이동', '복사', '글쓰기', '검색', '이전', '목록보기', '다음', '수정', '작성완료', '취소', '스팸신고', '답글쓰기', '댓글달기'];
var $btn_type_input = $("input[type=image]"),
$btn_type_img = $("img");
$btn_type_input.each(function () {
var $src = $(this).attr('src');
if ($src.indexOf('search.gif') > -1) {
$(this).before('');
$(document).on('click', '#btn-search', function () {
$(this).next('input[type=image]').trigger('click');
});
$(this).hide();
}
if ($src.indexOf('confirm.gif') > -1) {
$(this).before('');
$(this).hide();
}
if ($src.indexOf('comment_write.gif') > -1) {
$(this).before('');
$(document).on('click', '#btn-comment-write', function () {
$(this).next('input[type=image]').trigger('click');
});
$(this).hide();
}
});
$btn_type_img.each(function () {
var $src = $(this).attr('src');
var $event = $(this).attr('onclick');
if ($src.indexOf('btn_sdel.gif') > -1) {
$(this).before("");
$(this).remove();
}
if ($src.indexOf('move.gif') > -1) {
$(this).before("");
$(this).remove();
}
if ($src.indexOf('copy.gif') > -1) {
$(this).before("");
$(this).remove();
}
if ($src.indexOf('prev.gif') > -1) {
$(this).parent().addClass('btn btn-default').text($btn_keywords[5]);
}
if ($src.indexOf('list.gif') > -1) {
$(this).parent().addClass('btn btn-secondary').text($btn_keywords[6]);
}
if ($src.indexOf('next.gif') > -1) {
$(this).parent().addClass('btn btn-default').text($btn_keywords[7]);
}
if ($src.indexOf('spam.gif') > -1) {
$(this).before('');
$(this).remove();
}
if ($src.indexOf('modify.gif') > -1) {
$(this).parent().addClass('btn btn-warning').text($btn_keywords[8]);
}
if ($src.indexOf('delete.gif') > -1) {
$(this).parent().addClass('btn btn-warning').text($btn_keywords[0]);
}
if ($src.indexOf('reply.gif') > -1) {
$(this).parent().addClass('btn btn-secondary').text($btn_keywords[12]);
}
if ($src.indexOf('write.gif') > -1) {
$(this).parent().addClass('btn btn-secondary').text($btn_keywords[3]);
}
if ($src.indexOf('btn_confirm.gif') > -1) {
$(this).parent().addClass('btn btn-primary btn-lg').text($btn_keywords[9]);
}
if ($src.indexOf('cancel.gif') > -1) {
$(this).parent().addClass('btn btn-secondary btn-lg').text($btn_keywords[10]);
}
});
});
// list board header attributes
$(document).ready(function() {
$('.att_title').each(function() {
$(this).attr('rel', $.trim($(this).text().replace(/\s/g,'')));
});
});
// product b type (overlay)
$(document).ready(function() {
if ( $('.type-b-row').length ) {
var $subject = [];
var $category = [];
$('.type-b-row .bbsnewf5').each(function(i) {
var $markup = '';
$subject[i] = $(this).find('.gallery_title').text();
$category[i] = $(this).find('.gallery_etc').text();
$markup = '
';
$markup += '
';
$markup += '
';
$markup += '
' + $category[i] + '
';
$markup += '
' + $subject[i] + '
';
$markup += '
';
$markup += '
';
$markup += '
';
$(this).find('> table tr').not(':eq(0)').remove();
$(this).find('> table tr').eq(0).find('a').append($markup);
});
}
});
// window load handler
$(window).on('load', function() {
if ( $('#sub-hero').length ) $('#sub-hero').addClass('is-loaded');
page_load_complete();
});
// window resize handler
$(window).on('resize', function() {
footer_init();
});
});
document.addEventListener('DOMContentLoaded', function() {
var popup = document.getElementById('popup');
var closePopupBtn = document.getElementById('closePopupBtn');
var hideForTodayBtn = document.getElementById('hideForToday');
// Check if the popup should be displayed today
var lastPopupDate = localStorage.getItem('lastPopupDate');
var today = new Date().toDateString();
if (lastPopupDate !== today) {
popup.style.display = 'block';
}
closePopupBtn.addEventListener('click', function() {
popup.style.display = 'none';
});
hideForTodayBtn.addEventListener('click', function() {
// Hide the popup for today and save the date in local storage
popup.style.display = 'none';
localStorage.setItem('lastPopupDate', today);
});
// Close the popup if the user clicks outside of it
window.addEventListener('click', function(event) {
if (event.target == popup) {
popup.style.display = 'none';
}
});
});