// URL 파라미터 불러오기
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
/* ----------------- 메뉴 관련 스크립트 ----------------- */
$(document).ready(function() {
var allMenu = $("#all-menu");
var menuMask = $("#menuMask");
var wrapper = $("body");
var mnuEasing = "easeInOutExpo";
// 전체메뉴 열기
function allMenuOpen() {
if(!allMenu.hasClass('open')) {
allMenu.addClass('open');
allMenu.stop().animate({right:0}, 500, mnuEasing);
menuMask.stop().fadeIn(500);
}
}
// 전체메뉴 닫기
function allMenuClose() {
var menuWidth = allMenu.outerWidth();
allMenu.removeClass('open');
allMenu.stop().animate({right:-menuWidth + 'px'}, 500, mnuEasing);
menuMask.stop().fadeOut(500);
}
$("#header .btn-allmenu").click(function() {
allMenuOpen();
});
allMenu.find('.btnClose').click(function() {
allMenuClose();
});
menuMask.click(function() {
allMenuClose();
});
$("#all-menu > .inner > .depth1 > li > a").click(function(e) {
if($(this).next('ul').length) {
e.preventDefault();
if(!$(this).parent().hasClass('active')) {
$("#all-menu > .inner > .depth1 > li").removeClass('active');
$("#all-menu > .inner > .depth1 > li > ul").stop().slideUp(350);
$(this).parent().addClass('active');
$(this).siblings('ul').stop().slideDown(350);
} else {
$("#all-menu > .inner > .depth1 > li").removeClass('active');
$("#all-menu > .inner > .depth1 > li > ul").stop().slideUp(350);
}
}
});
});
/* ----------------- 메뉴 및 탭 활성화 스크립트 ----------------- */
$(document).ready(function() {
var url = $(location).attr('href');
if(url.indexOf('member') < 0) {
var depth1 = getUrlParameter('top') - 1;
var depth2 = getUrlParameter('sub') - 1;
$("#all-menu .depth1 > li").eq(depth1).addClass('on active');
$("#all-menu .depth1 > li").eq(depth1).find('ul').children().eq(depth2).addClass('active');
$("#all-menu .depth1 > li").eq(depth1).find('ul').css('display','block');
}
});
/* ----------------- 메인페이지 전용 스크립트 ----------------- */
// BEFORE&AFTER 섹션 탭 기능
$(document).ready(function() {
$("#section1 .tab-list > li").click(function() {
var tab_index = $(this).index();
$("#section1 .tab-list > li").removeClass('active');
$(this).addClass('active');
$("#rollingBox > .rolling-box").removeClass('active');
$("#rollingBox > .rolling-box").eq(tab_index).addClass('active');
});
});
// BEFORE&AFTER 섹션 롤링
$(document).ready(function() {
var slide_index = [];
var count = [];
var elem;
var winWidth = $(window).width();
var item_size;
var easeEffect = "easeInOutCubic";
// 인덱스 배열 초기화
$("#rollingBox .rolling-box").each(function(i) {
slide_index[i] = 0;
count[i] = $(this).find('.imgList').children().length;
i++;
});
// 슬라이더 사이즈 처리
function sliderSizing() {
var wrapperWidth = $("#rollingBox").width();
$("#rollingBox .rolling-box").each(function(i) {
$(this).find('.imgList').css({'width':count[i] * wrapperWidth + 'px', 'left':-slide_index[i]*wrapperWidth});
$(this).find('.imgList').children().css('width', wrapperWidth + 'px');
});
}
// 개별 페이지네이션 생성
function initPaging() {
var item = "
";
$("#rollingBox .rolling-box").each(function(i) {
for(z=0; z= count[index]) {
slide_index[index] = 0;
}
elem.find('.imgList').stop().animate({'left':-(item_size*slide_index[index]) + 'px'}, 400, easeEffect);
elem.find('.pagination').children().removeClass('active');
elem.find('.pagination').children().eq(slide_index[index]).addClass('active');
}
// 이전 버튼 클릭
$("#section1 .control-box .prev").click(function() {
elem = $("#rollingBox .rolling-box.active > .imgList");
var active_index = elem.index();
if(!elem.is(':animated')) {
slide_index[active_index]--;
slide(active_index);
}
});
// 다음 버튼 클릭
$("#section1 .control-box .next").click(function() {
elem = $("#rollingBox .rolling-box.active > .imgList");
var active_index = elem.index();
if(!elem.is(':animated')) {
slide_index[active_index]++;
slide(active_index);
}
});
// 페이지네이션 클릭
$(document).on('click touchend', '#rollingBox .rolling-box .pagination > li', function() {
elem = $("#rollingBox .rolling-box.active > .imgList");
var active_index = elem.index();
var pindex = $(this).index();
if(!elem.is(':animated')) {
slide_index[active_index] = pindex;
slide(active_index);
}
});
initPaging();
sliderSizing();
$(window).resize(function() {
sliderSizing();
});
});
// 둘러보기 스크립트
$(document).ready(function() {
var old_images = [];
// 최초 상태의 각 탭 메인 썸네일을 변수에 저장
$("#facilitySlider .big-thumb .thumb-list > li").each(function(i) {
old_images[i] = $(this).find('img').attr('src');
i++;
});
// 1단계 : 층별 탭 클릭시 보여지는 탭 내용을 교체 & 각 층의 대표 이미지로 초기화
$("#facilitySlider .big-thumb .floor-tab > li").click(function() {
var tab_index = $(this).index();
$("#facilitySlider .big-thumb .floor-tab > li").removeClass('active');
$(this).addClass('active');
$("#facilitySlider .big-thumb .thumb-list > li").removeClass('active');
$("#facilitySlider .big-thumb .thumb-list > li").eq(tab_index).find('img').attr('src', old_images[tab_index]);
$("#facilitySlider .big-thumb .thumb-list > li").eq(tab_index).addClass('active');
$("#facilitySlider .floor-container > .floor-info .thumb-list > li").removeClass('selected');
$("#facilitySlider .floor-container > .floor-info").removeClass('active');
$("#facilitySlider .floor-container > .floor-info").eq(tab_index).addClass('active');
});
// 2단계 : 각 층별 내부 썸네일 클릭시 대형 썸네일 교체
$("#facilitySlider .floor-container > .floor-info .thumb-list > li").click(function() {
var thumb_img = $(this).find('img').attr('src');
$("#facilitySlider .floor-container > .floor-info .thumb-list > li").removeClass('selected');
$(this).addClass('selected');
$("#facilitySlider .big-thumb .thumb-list > li.active").find('img').attr('src', thumb_img);
});
});
// 게시판 카테고리 자동 생성
$(document).ready(function() {
var cate_link = [],
cate_title = [],
currentURL = $(location).attr('pathname'),
param = "?&com_board_category_code=",
currentParam = "",
insertHTML = "",
idx = 0;
if($("select[name='com_board_category_code']").length > 0) {
currentParam = getUrlParameter('com_board_category_code');
$("select[name='com_board_category_code'] > option").each(function() {
cate_link[idx] = $(this).val();
cate_title[idx] = $(this).text();
idx++;
});
insertHTML = '';
insertHTML += '
';
insertHTML += '
';
$(".brd_category").before(insertHTML);
$.each(cate_link, function(m, key) {
if(key == currentParam) {
$(".board_tab > a").text(cate_title[m]);
$(".board_tab > ul > li[data-category='" + key + "']").addClass('on');
}
});
if(!currentParam) { $(".board_tab > ul > li:first").addClass('on'); }
}
});
// 리스트형 게시판 머릿말 속성 부여
$(document).ready(function() {
if($(".tbl_list").length) {
$(this).find('.att_title').each(function() {
var title = $(this).find('font').text();
$(this).attr('rel', title);
});
}
});
// PC링크 -> 모바일 링크 치환 스크립트
$(document).ready(function() {
var temp_no = $(location).attr('pathname').split('/')[1];
// 마이페이지 버튼 경로 모바일 경로로 치환
$("button[onclick*='engage_list']").attr('onclick','location.href="/' + temp_no + '/mobile/member/engage_list.php"');
// 확인 버튼 경로 모바일 경로로 치환
$("button[onclick*='counsel/sub3']").attr('onclick','location.href="/' + temp_no + '/mobile/counsel/sub3.php"');
// 로그인 버튼 경로 모바일 경로로 치환
$("#link-login").attr('onclick','location.href="/' + temp_no + '/mobile/member/login.php"');
// 회원가입 버튼 경로 모바일 경로로 치환
$("#link-join").attr('href','/' + temp_no + '/mobile/member/join.php');
});
$(document).ready(function(){
// 서브페이지 드롭다운 클릭시
$(".sub_tab > a").click(function() { if(!$(this).hasClass('open')) { $(this).addClass('open'); $(this).next('ul').css('display','block'); } else { $(this).removeClass('open'); $(this).next('ul').css('display','none'); } });
// 서브페이지 탭 클릭시
$(".sub_tab > ul > li > a").click(function() { $(".sub_tab > a").removeClass('open'); $(".sub_tab > a").text($(this).text()); $(".sub_tab > ul").css('display','none'); $(".sub_tab > ul > li").removeClass('on'); $(this).parent().addClass('on'); });
// 서브페이지 드롭다운 활성화
$(".sub_tab > a").html($(".sub_tab > ul > li.on a").html());
});
// ===== 2026-09-28 right quick bar (mobile): blog / tel / top (creanswer, https://creanswer.com) =====
(function(){
if (document.getElementById('crQuickBar')) return;
var css = '/* 2026-09-28 quick bar mobile (creanswer) */.r-menu{position:fixed;right:3%;bottom:3%;z-index:10000;display:flex;flex-direction:column;align-items:flex-end;}.r-menu a{display:block;line-height:0;margin-bottom:6px;}.r-menu a.q-btn{width:120px;height:48px;border-radius:9px;overflow:hidden;box-shadow:0 3px 10px rgba(0,0,0,.18);}.r-menu a.q-btn img{width:100%;height:100%;display:block;}.r-menu a.t-btn{width:44px;height:44px;border-radius:50%;margin-bottom:0;box-shadow:0 3px 10px rgba(0,0,0,.18);}.r-menu a.t-btn img{width:100%;height:100%;display:block;}';
var st = document.createElement('style'); st.type='text/css'; st.id='crQuickBarCss';
if (st.styleSheet) { st.styleSheet.cssText = css; } else { st.appendChild(document.createTextNode(css)); }
document.getElementsByTagName('head')[0].appendChild(st);
function mount(){
if (document.getElementById('crQuickBar')) return;
var d = document.createElement('div'); d.id='crQuickBar'; d.className='r-menu';
d.innerHTML = '

';
document.body.appendChild(d);
var t = d.querySelector('.t-btn');
if (t) t.onclick = function(e){ if(e&&e.preventDefault) e.preventDefault(); if (window.jQuery) { jQuery('html,body').stop().animate({scrollTop:0},600); } else { window.scrollTo(0,0); } return false; };
}
if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', mount); } else { mount(); }
})();