/*********************************************************************************************************
## Sub Script ##
* º» ½ºÅ©¸³Æ®ÀÇ ÀúÀÛ±ÇÀº (ÁÖ)À¥½º¸®ÆÛºí¸¯¿¡ ÀÖ½À´Ï´Ù.
* º» ½ºÅ©¸³Æ®¸¦ ¹«´ÜÀ¸·Î ÀÌ¿ë(¶Ç´Â µµ¿ë)Çϰųª º¹Á¦ ¶Ç´Â ¼öÁ¤ »ç¿ë½Ã ÀúÀ۱ǹý¿¡ ÀǰŠó¹ú¹ÞÀ» ¼ö ÀÖ½À´Ï´Ù.
* ±¸¸Å ÈÄ¿¡µµ Á¦ 2Â÷ »çÀÌÆ® µî ¶óÀ̼±½º°¡ Àû¿ëµÇÁö ¾Ê´Â »çÀÌÆ®¿¡ ´ëÇÏ¿© »ç¿ëÀº ±ÝÁöµÇ¾î ÀÖ½À´Ï´Ù.
* À§ »çÇ׿¡ ´ëÇÏ¿© À§¹Ý½Ã Àý´ë ÇÕÀÇ´Â ¾ø½À´Ï´Ù !
* date : 2017-03-15
* author : Park Soo Hyun (shpark7502@naver.com)
*********************************************************************************************************/
var getUrlParameter = function(t) {
var e, a, n = decodeURIComponent(window.location.search.substring(1)),
i = n.split("&");
for (a = 0; a < i.length; a++)
if (e = i[a].split("="), e[0] === t) return void 0 === e[1] ? !0 : e[1]
};
$(function() {
function t() {
TweenMax.to(o.eq(l), c, {
autoAlpha: 0
}), l = ++l % o.length, TweenMax.to(o.eq(l), c, {
autoAlpha: 1
}), TweenMax.delayedCall(d, t)
}
function e() {
var t, e = [],
a = [],
i = 0;
for ($("#gnb > li").each(function() {
e[i] = $(this).children("a").attr("href"), a[i] = $(this).children("a").text(), i++
}), n = 0; n < i; n++) t = '
' + a[n] + "", $("#nav .depth1 .mnuList").append(t)
}
function a() {
var t, e = [],
a = [],
i = $("#container").data("menu") - 1,
r = 0;
for ($("#gnb ul.sub").each(function() {
if ($(this).parent().index() == i)
for (r = 0; r < $(this).children().length; r++) e[r] = $(this).children().eq(r).find("a").attr("href"), a[r] = $(this).children().eq(r).find("a").text()
}), n = 0; n < r; n++) t = '' + a[n] + "", $("#nav .depth2 .mnuList").append(t)
}
function i() {
var t = getUrlParameter("top") - 1,
e = $("#nav .depth1 ul.mnuList li").eq(t).text();
$("#nav .depth1 > a > span").text(e)
}
function r() {
var t = getUrlParameter("sub") - 1,
e = $("#nav .depth2 ul.mnuList li").eq(t).text();
$("#nav .depth2 > a > span").text(e)
}
function s() {
var t = $("#nav .depth1 > a > span").text(),
e = $("#nav .depth2 > a > span").text();
$("#sub_visual > .title > .inner > h2").text(t), $("#sub_visual > .title > .inner > h3").text(e)
}
var o = $("#sub_visual > ul > li"),
l = 0,
d = 4,
c = 1.3;
TweenMax.set(o.filter(":gt(0)"), {
autoAlpha: 0
}), TweenMax.delayedCall(d, t), e(), a(), $("#nav .dropdown > a").click(function() {
$(this).parent(".dropdown").hasClass("open") ? ($(this).parent(".dropdown").removeClass("open"), $(this).siblings("ul.mnuList").stop(!0, !1).fadeOut(200)) : ($("#nav .dropdown").removeClass("open"), $("#nav .dropdown > ul.mnuList").stop(!0, !1).fadeOut(200), $(this).parent(".dropdown").addClass("open"), $(this).siblings("ul.mnuList").stop(!0, !1).fadeIn(200))
}), $("#leftBar a.dropdown").click(function(t) {
t.preventDefault(), $(this).hasClass("open") ? ($(this).removeClass("open"), $("#lnb").stop(!0, !1).slideUp(300)) : ($(this).addClass("open"), $("#lnb").stop(!0, !1).slideDown(300))
}), $(window).load(function() {
i(), r(), s()
})
});