// 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');
});