/**********************************************
* ½ºÅÄ´Ùµå¹ÝÀÀÇü SD001 ¸ðµâ ½ºÅ©¸³Æ®
* ¹öÀü : 1.7
* ¸±¸®Áî : 2017-10-26
* º» ½ºÅ©¸³Æ®ÀÇ ÀúÀÛ±ÇÀº µµÆ®ÇǾƿ¡ ÀÖ½À´Ï´Ù.
**********************************************/
/*--------------------- °øÅë ½ºÅ©¸³Æ® ---------------------*/
/* ÆäÀÌÁö·Î´õ */
var pageLoad = function() {
var pageLoader = $("#page-loader");
pageLoader.find('.spinner').fadeOut(500, function() {
pageLoader.addClass('hide');
var removeTimer = setTimeout(function() { pageLoader.remove(); }, 1100);
});
}
$(window).bind('load', function() {
pageLoad();
});
/*--------------------- Çì´õ ½ºÅ©¸³Æ® ---------------------*/
$(document).ready(function() {
var header = $("#header");
var subnav = $("#lnb > .lnb > li > .subnav");
var subnavH = subnav.children().height();
var navbg = $("#lnb > .subnav-bg");
var maxCount = 0;
var maxHeight = 0;
var openBtn = $("#lnb > .btnOpenMenu");
var calcBgHeight = function() {
var winWidth = $(window).width();
if(winWidth > 1024) maxHeight = 0;
$("#lnb > .lnb > li").each(function() {
if($(this).find('.subnav').height() > maxHeight) maxHeight = $(this).find('.subnav').height();
});
maxHeight = maxHeight + 60;
navbg.css('height', maxHeight);
}
var removeStyle = function() {
subnav.removeAttr('style');
navbg.removeAttr('style');
};
$("#lnb > .lnb > li").mouseenter(function() {
var winWidth = $(window).width();
if(winWidth > 1024) {
header.addClass('on');
subnav.stop().slideDown(400);
navbg.stop().slideDown(400);
}
});
header.mouseleave(function() {
var winWidth = $(window).width();
if(winWidth > 1024) {
subnav.stop().slideUp(400);
navbg.stop().slideUp(400);
header.removeClass('on');
}
});
$(window).bind('scroll', function() {
var scrTop = $(this).scrollTop();
var headerSize = header.height();
if(scrTop >= headerSize) {
if(!header.hasClass('fixed')) header.addClass('fixed');
} else {
header.removeClass('fixed');
}
});
$(window).bind('load resize', function() {
removeStyle();
calcBgHeight();
}).resize();
var openMenu = function() {
var topDepth = $.urlParam('tm') - 1,
subDepth = $.urlParam('sm') - 1;
openBtn.addClass('open');
$("#lnb").addClass('open');
if(topDepth !== -1 && subDepth !== -1) {
$("#lnb > .lnb > li:eq(" + topDepth + ")").addClass('open');
$("#lnb > .lnb > li:eq(" + topDepth + ") > .subnav").css('display','block');
}
$("#lnb > .lnb-overlay").stop().fadeIn(400);
};
var closeMenu = function() {
openBtn.removeClass('open');
$("#lnb").removeClass('open');
$("#lnb > .lnb-overlay").stop().fadeOut(400, function() {
removeStyle();
});
};
$("#lnb > .lnb-overlay").click(function() {
closeMenu();
});
openBtn.click(function() {
if(!openBtn.hasClass('open')) {
openMenu();
} else {
closeMenu();
}
});
$("#lnb > .lnb > li > a").bind('click touchend', function(e) {
var winWidth = $(window).width();
if(winWidth < 1025) {
if($(this).siblings('.subnav').length) e.preventDefault();
if(!$(this).parent().hasClass('open')) {
$("#lnb > .lnb > li > .subnav").stop().slideUp(300);
$("#lnb > .lnb > li").removeClass('open');
$(this).parent().addClass('open');
$(this).siblings('.subnav').stop().slideDown(300);
} else {
$(this).parent().removeClass('open');
$(this).siblings('.subnav').stop().slideUp(300);
}
}
});
});
$(document).ready(function(){
var topBar = $("#topBar").offset();
$(window).scroll(function(){
var docScrollY = $(document).scrollTop()
var barThis = $("#topBar")
var fixNext = $("#fixNextTag")
if( docScrollY > topBar.top ) {
barThis.addClass("top_bar_fix");
fixNext.addClass("pd_top_80");
}else{
barThis.removeClass("top_bar_fix");
fixNext.removeClass("pd_top_80");
}
});
})
/*--------------------- ǪÅÍ ½ºÅ©¸³Æ® ---------------------*/
$(document).ready(function() {
var scrBtn = $("#btnTop");
$(window).bind('scroll', function() {
var scrTop = $(this).scrollTop();
var headerSize = $("#header").height();
var footerPos = $("#footer").offset().top - $(this).height();
if(scrTop >= headerSize && scrTop < footerPos) {
if(!scrBtn.hasClass('show')) scrBtn.addClass('show');
} else {
scrBtn.removeClass('show');
}
});
scrBtn.bind('click touchend', function() {
$("html, body").stop().animate({scrollTop:0}, 600, 'easeOutQuart');
});
$("#footer .footer-bottom .dropdown > a").bind('click', function() {
if(!$(this).parent().hasClass('open')) {
$(this).parent().addClass('open');
} else {
$(this).parent().removeClass('open');
}
});
$(document).click(function(e) {
if(!$(e.target).is('#footer .footer-bottom .dropdown > a, #footer .footer-bottom .dropdown > ul')) $("#footer .footer-bottom .dropdown").removeClass('open');
});
});
/*--------------------- ¼ºêÆäÀÌÁö ½ºÅ©¸³Æ® ---------------------*/
$.urlParam = function(name){
var results = new RegExp('[\?&]' + name + '=([^]*)').exec(window.location.href);
if (results==null){
return null;
}
else{
return decodeURI(results[1]) || 0;
}
}
$(document).ready(function() {
if($("#subVisual").length) $("#subVisual").addClass('load');
var depthActive = function() {
var topCount = $("#lnb > .lnb > li").length,
subCount = 0;
topName = [],
subName = [],
topURL = [],
subURL = [],
topDepth = $.urlParam('tm') - 1,
subDepth = $.urlParam('sm') - 1,
topHTML = "",
subHTML = "";
$("#lnb > .lnb > li").each(function(i) {
topName[i] = $(this).children('a').text();
topURL[i] = $(this).children('a').attr('href');
i++;
});
topHTML += '
';
$("#breadcrumbs .depth1").append(topHTML);
if(topDepth !== -1 && subDepth !== -1) {
subCount = $("#lnb > .lnb > li:eq(" + topDepth + ")").find('ul').children().length;
$("#lnb > .lnb > li:eq(" + topDepth + ")").find('ul').children().each(function(i) {
subName[i] = $(this).find('a').text();
subURL[i] = $(this).find('a').attr('href');
i++;
});
subHTML += '';
$("#breadcrumbs .depth2").append(subHTML);
$("#breadcrumbs .depth1 > a").text($("#lnb > .lnb > li:eq(" + topDepth + ")").find('a:first').text());
$("#breadcrumbs .depth2 > a").text($("#lnb > .lnb > li:eq(" + topDepth + ")").find('ul').children().eq(subDepth).find('a').text());
$("#lnb > .lnb > li:eq(" + topDepth + ")").addClass('on open');
$("#lnb > .lnb > li:eq(" + topDepth + ")").find('ul').children().eq(subDepth).addClass('on');
}
};
var visualActive = function() {
var topDepth = $.urlParam('tm');
if($("#subVisual").length) {
var imgPath = "../img/";
var imgName = "subvisual";
var imgExt = "jpg";
var depth_title = $("#lnb > .lnb > li:eq(" + (topDepth - 1) + ")").find('a:first').text();
/*$("#subVisual .visual_img").attr('src', imgPath + imgName + topDepth + '.' + imgExt);
$("#subVisual .title > h2").text(depth_title);*/
}
};
$("#breadcrumbs .container > div > a").click(function(e) {
e.preventDefault();
if(!$(this).parent().hasClass('open')) {
$("#breadcrumbs .container > div").removeClass('open');
$("#breadcrumbs .container > div > ul").stop().slideUp(350);
$(this).parent().addClass('open');
$(this).siblings('ul').stop().slideDown(350);
} else {
$(this).parent().removeClass('open');
$(this).siblings('ul').stop().slideUp(350);
}
})
$(document).on('click', function(e) {
if(!$(e.target).is('#breadcrumbs .container > div > a, #breadcrumbs .container > div > ul')) {
$("#breadcrumbs .container > div").removeClass('open');
$("#breadcrumbs .container > div > ul").stop().slideUp(350);
}
});
depthActive();
visualActive();
});
// BUSINESS - »ç¾÷¼Ò°³ ÆäÀÌÁö
$(document).ready(function() {
var playButton = $("#play-promo-video");
var videoURL;
var videoHTML = '';
var hoverItem = $("section.business-detail .detail-items > li");
$("#play-promo-video").click(function() {
if(!playButton.data('source')) {
alert('¿µ»ó ÁغñÁßÀÔ´Ï´Ù.');
} else {
videoURL = playButton.data('source');
videoHTML += '';
$(this).addClass('btn-load');
if($("#promo-wrapper").length) $("#promo-wrapper").remove();
$("#container section.business-detail").append(videoHTML);
$("#promo-wrapper iframe").load(function() {
$("#promo-wrapper").fadeIn(300);
$("#promo-wrapper").addClass('play');
playButton.removeClass('btn-load');
});
}
});
$(document).on('click', '#promo-wrapper > .mask-layer, #promo-wrapper .btn-close', function() {
$("#promo-wrapper").removeClass('play');
playButton.removeClass('btn-load');
var removeSet = setTimeout(function() {
$("#promo-wrapper").fadeOut(300, function() {
$("#promo-wrapper").remove();
});
}, 300);
});
hoverItem.mouseenter(function() {
hoverItem.addClass('off');
$(this).removeClass('off').addClass('on');
}).mouseleave(function() {
hoverItem.removeClass('on off');
});
});
// BUSINESS - »ç¾÷ºÐ¾ß ÆäÀÌÁö
$(document).ready(function() {
var clientWrap = $("#container .business-part3 #client-slide > .slides");
var el = $("#container .business-part3 #client-slide > .slides > ul");
var clientCount = el.children().length;
var clientIndex = 0;
var el_size;
var li_size;
var btnPrev = $("#container .business-part3 #client-slide .controller .prev");
var btnNext = $("#container .business-part3 #client-slide .controller .next");
var buttonPreload = function() {
btnPrev.addClass('disabled');
};
var clientResizing = function() {
var winWidth = $(window).width();
if(winWidth > 768) {
li_size = clientWrap.width() / 4;
} else {
li_size = clientWrap.width() / 2;
}
el.children().css({width:li_size});
el.css({width:li_size*clientCount, left:-li_size*clientIndex});
};
var clientSlide = function() {
var winWidth = $(window).width();
var minusCount = 0;
if(winWidth > 768) {
minusCount = 4;
} else {
minusCount = 2;
}
btnPrev.removeClass('disabled');
btnNext.removeClass('disabled');
el.stop().animate({left:-li_size*clientIndex}, 450, function() {
if(clientIndex < 1) {
btnPrev.addClass('disabled');
} else if(clientIndex >= clientCount - minusCount) {
btnNext.addClass('disabled');
}
});
};
btnPrev.click(function() {
if(!el.is(':animated') && !$(this).hasClass('disabled')) {
clientIndex--;
clientSlide();
}
});
btnNext.click(function() {
if(!el.is(':animated') && !$(this).hasClass('disabled')) {
clientIndex++;
clientSlide();
}
});
buttonPreload();
clientResizing();
$(window).bind('resize', function() {
clientResizing();
});
});
// °Ô½ÃÆÇ Àü¿ë ½ºÅ©¸³Æ®
$(document).ready(function() {
var imgToButton = function() {
var inputStyle = $("input[type=image]"),
imgStyle = $("img");
inputStyle.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();
}
});
imgStyle.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('ÀÌÀü');
}
if(src.indexOf('list.gif') > -1) {
$(this).parent().addClass('btn btn-default').text('¸ñ·Ïº¸±â');
}
if(src.indexOf('next.gif') > -1) {
$(this).parent().addClass('btn btn-default').text('´ÙÀ½');
}
if(src.indexOf('spam.gif') > -1) {
$(this).before('');
$(this).remove();
}
if(src.indexOf('modify.gif') > -1) {
$(this).parent().addClass('btn btn-admin').text('¼öÁ¤');
}
if(src.indexOf('delete.gif') > -1) {
$(this).parent().addClass('btn btn-admin').text('»èÁ¦');
}
if(src.indexOf('reply.gif') > -1) {
$(this).parent().addClass('btn btn-default').text('´ä±Û¾²±â');
}
if(src.indexOf('write.gif') > -1) {
$(this).parent().addClass('btn btn-function').text('±ÛÀÛ¼º');
}
if(src.indexOf('btn_confirm.gif') > -1) {
$(this).parent().addClass('btn btn-function').text('Á¢¼öÇϱâ');
}
if(src.indexOf('cancel.gif') > -1) {
$(this).parent().addClass('btn btn-default').text('Ãë¼Ò');
}
});
}
var setRelation = function() {
var board = $("table[class^=tbl-brd]");
var header = board.find('.att_title');
header.each(function() {
$(this).attr('rel', $.trim($(this).text()));
});
}
var setPhotoOverlay = function() {
var inner = $(".photo-grid-inner");
var posts = inner.children('table');
var subject = [],
category = [];
var overlay = '';
posts.each(function(i) {
var _this = $(this);
if(_this.find('.gallery_subject').length) {
subject[i] = $.trim(_this.find('.gallery_title').text());
category[i] = $.trim(_this.find('.gallery_etc').text().replace('[','').replace(']',''));
overlay += '';
overlay += '';
overlay += '
' + subject[i] + '
';
overlay += '' + category[i] + '';
overlay += '';
_this.find('.gallery_subject').parent('tr').remove();
_this.find('.gallery_etc').parent('tr').remove();
_this.find('.bbsnewf5 > table tr:first-child > td a').append(overlay);
i++;
overlay = '';
}
if(!_this.hasClass('board')) _this.addClass('sort-items');
});
}
var setCategory = function() {
var cate_name = [];
var cate_id = [];
var cate_link = '';
var cateItems = $(".board-category select option");
var currURL = $(location).attr('pathname');
var topDepth = $.urlParam('tm');
var subDepth = $.urlParam('sm');
var param = '?tm=' + topDepth + '&sm=' + subDepth + '&com_board_category_code=';
var currCategory = $.urlParam('com_board_category_code');
if(cateItems.length) {
cateItems.each(function(i) {
cate_id[i] = $(this).val();
cate_name[i] = $(this).text();
i++;
});
cate_link = '';
$(".board-category").html(cate_link);
$(".board-category > ul > li[data-category=" + currCategory + "]").addClass('active');
if(!currCategory) $(".board-category > ul > li:first-child").addClass('active');
}
}
var faqPosts = $(".tbl-brd-faq .titdesign");
var loadAnswer = function() {
if(faqPosts.length) {
var replyRows = '';
var reply = [];
var replyURL = [];
faqPosts.each(function(i) {
var $this = $(this);
replyURL[i] = $this.find('a').attr('href');
$.ajax({
url: replyURL[i],
async: false,
cache: false,
dataType: 'html',
type: 'GET',
contentType: 'application/x-www-form-urlencoded;charset=euc-kr',
beforeSend: function(jqXHR) {
jqXHR.overrideMimeType('application/x-www-form-urlencoded;charset=euc-kr');
},
success: function(data) {
reply[i] = $(data).find('#post_area').html();
replyRows += '';
replyRows += '';
replyRows += ' A ';
replyRows += '' + reply[i] + ' ';
replyRows += ' | ';
replyRows += '
';
$this.after(replyRows);
replyRows = '';
},
error: function(response) {
console.log(response);
}
})
i++;
});
}
}
faqPosts.click(function(e) {
var row = $(this).find('.bbsnewf5');
if(!$(".board_admin_bgcolor").length) {
e.preventDefault();
if(!row.hasClass('open')) {
$('.bbsnewf5').removeClass('open');
$('.reply-row').removeClass('open');
row.addClass('open');
$(this).next('.reply-row').addClass('open');
} else {
$('.bbsnewf5').removeClass('open');
$(this).next('.reply-row').removeClass('open');
}
}
});
imgToButton();
setRelation();
setCategory();
setPhotoOverlay();
loadAnswer();
});
// Áø·á°ú¸ñ ÅÇÀ̵¿
function fnMove(seq){
var offset = $("#pcdiv" + seq).offset();
$('html, body').animate({scrollTop : offset.top}, 1000);
}