$(document).ready(function(){ //Laungage $(function(){ var $lang = $(".language .default"); $lang.bind("click focus", function(){ var chk = $(this).hasClass("on"); if (chk!=true){ $(this).addClass("on"); //$(this).next().slideDown(); $(this).next().show(); } else { //$(this).next().slideUp(); $(this).next().hide(); $(this).removeClass("on"); } return false; }); $lang.next().find("li:last").focusout(viewOut); $lang.parent().mouseleave(viewOut); function viewOut(){ //$lang.next().slideUp(); $lang.next().hide(); $lang.removeClass("on"); }; }); //GNB $(function(){ var $obj = $("#gnb>li>a"); $obj.bind("mouseenter focus",function(){ $(this).addClass("on"); var onChk = $(this).next().is("ol:visible"); if (onChk==true){ //$(this).removeClass("on"); } else { //$obj.next().slideUp("fast", "easeOutSine"); $obj.next().hide(); $obj.removeClass("on"); $(this).addClass("on"); //$(this).next().slideDown("fast", "easeOutBack"); $(this).next().show(); } }); $obj.next().find("li:last").focusout(function(){ $obj.removeClass("on"); }); $obj.parent().bind("mouseleave", function(){ $obj.removeClass("on"); //$obj.next().slideUp("fast", "easeOutSine"); $obj.next().hide(); }); $(".menu4_8").focusout(function(){ //$obj.next().slideUp("fast", "easeOutSine"); $obj.next().hide(); }); // }); //oldCM $(function(){ var $str = $(".tab2Contents .title"); var $play = $(".tab2Contents .thumb a"); var $mv = $("#oldMV"); var $time = $("#timeCM"); var $day = $("#dayCM"); var $tab = $(".tabStyle2 li a"); var $title = $("#titleCM"); $tab.click(function(){ $(".tab2Contents").hide(); $($(this).attr("href")).show(); $tab.removeClass("on"); $(this).addClass("on"); return false; }); $str.each(function(i){ var chk = $str.eq(i).text().length; if (chk>=26){ $str.eq(i).text($str.eq(i).text().slice(0,24) + '...'); } }); $play.click(function(){ var thisSrc = $mv.attr("src"); $(".scrapCM").hide(); $(".btnCM a").removeClass("on"); /*$("body, html").animate({scrollTop:$mv.offset().top}, "slow"); $mv.attr("src", "http://www.youtube.com/embed/" + $(this).attr("href")); $title.html($(this).parent().next().text());*/ var thisChk = $(this).parent().parent().find(".ir_text").html(); if (thisChk != null){ $day.html($(this).parent().parent().find(".old").text()); $time.html($(this).parent().parent().find(".time").text()); } //return false; }); $(".btnCM a").click(function(){ var onChk = $(this).next().is(":visible"); if (onChk == true){ $(this).next().hide(); $(this).removeClass("on"); } else { $(this).next().show(); $(this).addClass("on"); } $(this).next().find("p").text($mv.parent().html()); return false; }); $(".infoCM .btn .more").toggle(function(){ $(".viewCM .moreView").show(); $(this).text("¼û±â±â"); },function(){ $(".viewCM .moreView").hide(); $(this).text("´õº¸±â"); }); }); // $(function(){ var $str = $(".printList .title"); var $click = $(".printList .thumb a"); $click.find("img").click(function(){ //$(".printCM .thumb img").attr("src",$(this).attr("src")); $("body, html").animate({scrollTop:$(".printCM .thumb img").offset().top}, "slow"); $(".printCM .title").html($(this).parent().parent().next().text()); return; }); //string $str.each(function(i){ var chk = $str.eq(i).text().length; if (chk>=26){ $str.eq(i).text($str.eq(i).text().slice(0,24) + '...'); } }); }); // RnD Map $(function(){ $("#cv1").animate({width:0},1500); $("#cv2").delay(500).animate({width:0},1000); $("#cv3").delay(700).animate({width:0},800); $(".rndCenter .linkWrap li a").click(function(){ $("body, html").animate({scrollTop:$($(this).attr("href")).offset().top -50}, "slow"); return false; }); }); // quickTop $(function(){ var $btn = $("#quick .btnTop"); $btn.click(function(){ $("body, html").animate({scrollTop:0}, 400); }); }); // netWork jQuery(function(){ var article = $('.map-jquery .article'); article.addClass('hide'); article.find('.text').slideUp(0); $('.map-jquery .article a').click(function(){ var myArticle = $(this).parents('.article:first'); if(myArticle.hasClass('hide')){ article.addClass('hide').removeClass('show'); // effect article.find('.text').slideUp(0); // effect myArticle.removeClass('hide').addClass('show'); myArticle.find('.text').slideDown(200); } else { myArticle.removeClass('show').addClass('hide'); myArticle.find('.text').slideUp(0); } }); $('.map-jquery a.close').click(function(){ article.addClass('hide').removeClass('show'); article.find('.text').slideUp(0); }); }); /* quick call */ initMoving(document.getElementById("quick"), 169, 1, 10); // }); /* quick*/ function initMoving(target, position, topLimit, btmLimit) { if (!target) return false; var obj = target; obj.initTop = position; obj.topLimit = topLimit; obj.bottomLimit = document.documentElement.scrollHeight - btmLimit; obj.style.position = "absolute"; obj.top = obj.initTop; //obj.left = obj.initLeft; if (typeof(window.pageYOffset) == "number") { obj.getTop = function() { return window.pageYOffset; }; } else if (typeof(document.documentElement.scrollTop) == "number") { obj.getTop = function() { return document.documentElement.scrollTop; }; } else { obj.getTop = function() { return 0; }; } if (self.innerHeight) { obj.getHeight = function() { return self.innerHeight; }; } else if(document.documentElement.clientHeight) { obj.getHeight = function() { return document.documentElement.clientHeight; }; } else { obj.getHeight = function() { return 500; }; } obj.move = setInterval(function() { if (obj.initTop > 0) { pos = obj.getTop() + obj.initTop; } else { pos = obj.getTop() + obj.getHeight() + obj.initTop; //pos = obj.getTop() + obj.getHeight() / 2 - 15; } if (pos > obj.bottomLimit) pos = obj.bottomLimit; if (pos < obj.topLimit) pos = obj.topLimit; interval = obj.top - pos; obj.top = obj.top - interval / 3; obj.style.top = obj.top + "px"; }, 30); } // function getCookie(name) { var Found = false ; var start, end ; var i = 0 ; while(i <= document.cookie.length) { start = i ; end = start + name.length ; if(document.cookie.substring(start, end) == name) { Found = true ; break ; } i++ ; } if(Found == true) { start = end + 1 ; end = document.cookie.indexOf(";", start) ; if(end < start) end = document.cookie.length ; return document.cookie.substring(start, end) ; } return "" ; } function pop_inquiry() { var inquiryCookie=getCookie("Inquiry"); // ÄíŰ³×ÀÓ ÁöÁ¤ if (inquiryCookie != "no"){ window.open("/kor/util/popup/pop_inquiry.jsp", 'popup', "width=430,height=403"); } }