/**********************************************
* ½ºÅÄ´Ùµå¹ÝÀÀÇü SD002 ¸ðµâ ½ºÅ©¸³Æ®
* ¹öÀü : 1.4
* ¸±¸®Áî : 2017-11-09
* º» cssÀÇ ÀúÀÛ±ÇÀº µµÆ®ÇǾƿ¡ ÀÖ½À´Ï´Ù.
**********************************************/
/*--------------------- Çì´õ ½ºÅ©¸³Æ® ---------------------*/
$(document).ready(function() {
var header = $("#header");
var subnav = $("#lnb > .lnb > li > .subnav");
var openBtn = $("#header .btnOpenMenu");
$(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');
}
});
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(450);
};
var closeMenu = function() {
openBtn.removeClass('open');
$("#lnb").removeClass('open');
$("#lnb > .lnb-overlay").stop().fadeOut(450);
};
$("#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) {
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 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');
});
});
/* °øÅë ½ºÅ©¸³Æ® */
$(document).ready(function() {
var pageLoader = $("#page-loader");
var spinner = $("#page-loader > .spinner");
$("body").addClass('locked');
$(window).bind('load', function() {
// ÆäÀ̵å ÀÌÆåÆ®
spinner.fadeOut(450);
pageLoader.delay(450).fadeOut(1200, function() {
pageLoader.remove();
});
$("body").removeClass('locked');
});
});
/*--------------------- ¸ÞÀÎÆäÀÌÁö ½ºÅ©¸³Æ® ---------------------*/
// Å°ºñÁÖ¾ó ½ºÅ©·Ñ
$(document).ready(function() {
$("#keyVisual .scroll-down").click(function() {
$("html, body").stop().animate({scrollTop:$("#mainContainer #section1").offset().top}, 600, 'easeOutQuart');
});
});
// Æз²·¢½º ¿µ¿ª
$(document).ready(function() {
$("#mainContainer #section6").parallax("50%", 0.2);
});
// ÃÖ½Å±Û ÅÇ
$(document).ready(function() {
var tab_item = $("#section7 .tab-items > li > a");
var tab_el = $("#section7 .article-tab");
var showAll = $("#section7 .link-all");
showAll.attr('href', $("#section7 .tab-items > li:first-child > a").attr('href'));
tab_item.click(function(e) {
var tab_index = $(this).parent().index();
e.preventDefault();
tab_item.parent().removeClass('active');
$(this).parent().addClass('active');
tab_el.stop().fadeOut(500).removeClass('active');
tab_el.eq(tab_index).stop().fadeIn(500).addClass('active');
showAll.attr('href', $(this).attr('href'));
});
tab_el.eq(0).css({display:'block'});
});
// µå·Ó´Ù¿î ó¸®
$(document).ready(function() {
var dd_el = $(".main-dropdown");
var setDropdown = function() {
dd_el.each(function() {
var dd_title = $(this).find('.dropdown-list').children().eq(0).text();
$(this).children('a').text(dd_title);
});
}
var openDropdown = function(obj) {
obj.addClass('active');
}
var closeDropdown = function(obj) {
obj.removeClass('active');
}
var changeDropdown = function(obj, elem) {
var dd_title = elem.text();
obj.children('a').text(dd_title);
}
$(".main-dropdown > a").click(function() {
var obj = $(this).parent();
if(!obj.hasClass('active')) {
openDropdown(obj);
} else {
closeDropdown(obj);
}
});
$(".main-dropdown > .dropdown-list > *").click(function() {
var obj = $(this).parents('.main-dropdown');
changeDropdown(obj, $(this));
closeDropdown(obj);
});
setDropdown();
});
// °¶·¯¸® ¼Ó¼º ºÎ¿©
$(document).ready(function() {
var post = $("#mainContainer #section2 .works-grid > table");
post.each(function() {
var type = $(this).find('.board_output_gallery_subject').parent().clone().children().remove().end().text();
$(this).addClass('iso-box').addClass(type);
});
})
// °¶·¯¸® Á¤·Ä
$(document).ready(function(){
var items = $("#mainContainer #section2 .works-grid");
var gridSize = 4;
var filterType = '';
var setWorkGrid = function() {
var winWidth = $(window).width();
if(winWidth > 1024) {
gridSize = 4;
} else {
gridSize = 2;
}
items.imagesLoaded( function() {
items.isotope({
filter: filterType,
itemSelector: '.iso-box',
masonry: {
columnWidth: winWidth / gridSize,
gutter: 0
}
});
});
$("#mainContainer #section2 .works-tab > li").click(function() {
filterType = $(this).data('type');
$("#mainContainer #section2 .works-tab > li").removeClass('active');
$(this).addClass('active');
items.isotope({
filter: filterType,
itemSelector: '.iso-box',
masonry: {
columnWidth: winWidth / gridSize,
gutter: 0
}
});
});
}
setWorkGrid();
$(window).bind('resize', function() {
setWorkGrid();
}).resize();
});
// Ŭ¶óÀ̾ðÆ® ½½¶óÀ̵å
$(function() {
var clientWrap = $("#mainContainer #main-client-slide");
var el = $("#mainContainer #main-client-slide > .slides");
var clientCount = el.children().length;
var clientIndex = 0;
var el_size;
var li_size;
var btnPrev = $("#mainContainer #section8 .prev > a");
var btnNext = $("#mainContainer #section8 .next > a");
var buttonPreload = function() {
btnPrev.addClass('disabled');
};
var clientResizing = function() {
var winWidth = $(window).width();
if(winWidth > 1024) {
li_size = (clientWrap.width() + 30) / 6;
} else if(winWidth > 768 && winWidth < 1025) {
li_size = (clientWrap.width() + 30) / 4;
} else {
li_size = (clientWrap.width() + 30) / 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 > 1024) {
minusCount = 7;
} else if(winWidth > 768 && winWidth < 1025) {
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 form = $("#mainContainer #section9 .form-container");
var name_field = form.find('input[name=name]'),
phone_field = form.find('input[name=phone_no1]'),
mail_field = form.find('input[name=receiver_email]'),
desc_field = form.find('textarea[name=description]');
name_field.attr('placeholder','Name');
phone_field.attr('placeholder','Phone');
mail_field.attr('placeholder','Email');
desc_field.attr('placeholder','Message');
});
/*--------------------- ¼ºêÆäÀÌÁö ½ºÅ©¸³Æ® ---------------------*/
$.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() {
$(window).bind('load', 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();
});