/* Global Navigation Bar */ function gnbFnc(){ var topmenu = $('.topmenu'); var topmenus = topmenu.find('li.topbtn'); var topmenusA = topmenus.find('a'); var topmenusUl = topmenus.find('ul'); topmenus.bind('mouseenter',function(){ topmenusA.removeClass('hover') topmenus.removeClass('on'); $(this).addClass('on'); topmenusUl.stop().animate({"height": 230 + "px","padding-top": 15 + "px"},300); }) topmenu.bind('mouseleave focusout',function(e){ topmenusUl.stop().animate({"height": 0 + "px","padding-top": 0 + "px"},300) topmenus.removeClass('on'); }) topmenusA.bind('focusin',function(){ topmenus.removeClass('on'); topmenusA.removeClass('hover') $(this).addClass('hover').closest('.topbtn').addClass('on') topmenusUl.stop().css({"height": 230 + "px","padding-top": 15 + "px"},300); }) } function gnb(dep1, dep2, dep3){ var $header = $("#header_wrap"); var $gnb = $(".topmenu"); var $gnb_1dep = $(".topmenu > li"); var $gnb_2dep = $(".topmenu > li > ul > li"); $header.css({'height':'96px'}); if (dep1) { $gnb_1dep.eq(dep1-1).addClass('active').attr('title','ÇöÀç È°¼ºÈ­ µÇ¾îÀÖ´Â 1Â÷ ¸Þ´ºÀÔ´Ï´Ù.'); if (dep2) { $gnb_1dep.eq(dep1-1).find('ul li').eq(dep2-1).find('a').addClass('active2').attr('title','ÇöÀç È°¼ºÈ­µÇ¾î ÀÖ´Â 2Â÷ ¸Þ´ºÀÔ´Ï´Ù.'); } } /* //gnb ¸®¼Â */ function lnb(dep1, dep2){ $('body').append("
"); var temp_lnb = $('#temp_lnb'); var $lnb = $('.lnb'), $lnbBox = $('.leftmenu'), $lnb_1dep = $('.lnb > li'), $lnb_2dep = $('.lnb li .lnb_dep2 > li'), $onLnb_1dep = $lnb_1dep.eq(dep1-1), $onLnb_2dep = $lnb_1dep.eq(dep1-1).find('.lnb_dep2'), $lnb_1depBtn = $lnb_1dep.find('>a'), dep1Cnt = dep1, dep2Cnt = dep2 //$lnb_1dep.find('img').clone().appendTo(temp_lnb) $lnb_1dep.find('img').each(function(){ $(this).clone().appendTo(temp_lnb); $(this).clone().attr('src',on).appendTo(temp_lnb); }) temp_lnb.remove(); $('.lnb_dep2').hide(); function initLnb(){ //$('.lnb_dep2').css('display','none'); //$('.lnb_dep2').stop().slideUp(); $('.lnb_dep2').hide(); $lnb_1dep.removeClass('on').find('> a > img').each(off) $lnb_1dep.eq(dep1-1).addClass('on').find('> a > img').each(on); if(dep2){ //$onLnb_2dep.css('display','block'); //$onLnb_2dep.slideDown(); $onLnb_2dep.show(); $onLnb_2dep.find('li').eq(dep2-1).addClass('on').find('> a > img').each(on); } } initLnb(); $lnb_1dep.bind('click', function(e){ //if( $(this).index() != dep1 - 1){ e.stopPropagation(); //$lnb_1dep.find('> a > img').each(off); $(this).siblings().find('> a > img').each(off); $(this).find('> a > img').each(on); // 2013-08-27 $(this).addClass('active'); //$(this).closest('li').siblings().find('ul').stop().slideUp(); $(this).closest('li').siblings().find('ul').stop().hide(); //$(this).find('ul').slideDown(); $(this).find('ul').show(); //} }); $(window).bind('keyup',function(e){if(e.keyCode == 16){isTab = false}}) $lnb_1dep.find('>a').bind('keydown',function(e){ if($(this).parent().index() != 0){ if(e.keyCode == 9 && e.shiftKey){ e.preventDefault(); $lnb_1dep.eq($(this).closest('li').index() - 1).find(' > a').trigger('focus').next('ul.lnb_dep2').find('li:last-child > a').focus(); } } }) $lnb_1dep.bind('focusin', function(e){ //if( $(this).index() != dep1 - 1){ e.stopPropagation(); $lnb_1dep.find('> a > img').each(off); $(this).find('> a > img').each(on); // 2013-08-27 $(this).addClass('active'); $(this).closest('li').siblings().find('ul').stop().hide(); $(this).find('ul').stop().show(); //} }); $lnb_2dep.bind('mouseenter focusin', function(e){ if( !$(this).hasClass('on')){ $onLnb_2dep.find('li').removeClass('on'); $(this).find('> a > img').each(on); // 2013-08-27 $(this).addClass('on'); } }); $lnb_2dep.bind('mouseleave focusout', function(e){ //if( !$(this).hasClass('on')){ $(this).removeClass('on'); $(this).find('> a > img').each(off); //} }); $lnbBox.bind('mouseleave',function(e){ initLnb(); }) $('ul.location li:first-child a').bind('focusin',function(){ $('.lnb_dep2').hide(); $lnb_1dep.find('> a > img').each(off); $lnb_1dep.eq(dep1-1).addClass('on').find('> a > img').each(on); if(dep2){ $onLnb_2dep.show(); $onLnb_2dep.find('li').eq(dep2-1).addClass('on').find('> a > img').each(on); } }) $lnb.find('li').eq(0).find('>a').bind('keydown',function(e){ if(e.keyCode == 9 && e.shiftKey){ $('.lnb_dep2').hide(); $lnb_1dep.find('> a > img').each(off); $lnb_1dep.eq(dep1-1).addClass('on').find('> a > img').each(on); if(dep2){ $onLnb_2dep.show(); $onLnb_2dep.find('li').eq(dep2-1).addClass('on').find('> a > img').each(on); } } }) /* $lnb.find('li:last > a').bind('blur',function(e){ $('.lnb_dep2').stop().hide(); $lnb_1dep.eq(dep1-1).addClass('on').find('> a > img').each(on); if(dep2){ $onLnb_2dep.stop().show(); $onLnb_2dep.find('li').eq(dep2-1).addClass('on').find('> a > img').each(on); } }) */ } lnb(dep2, dep3); } /* on _ off javascript */ function on(){ this.src = this.src.replace("_off","_on"); } function off(){ this.src = this.src.replace("_on","_off"); } /* skip navigation */ function skip_navigating(){ $("#skip_nav").attr("tabindex",0).focus(); $("a[href^='#']").click(function(evt){ var anchortarget = $(this).attr("href"); if (anchortarget != "#") { $(anchortarget).attr("tabindex", 0).focus(); $(anchortarget).removeAttr("tabindex"); } }); /* if (window.location.hash) { $(window.location.hash).attr("tabindex", -1).focus(); } */ $("#skip_nav a").focus(function(){ $("#skip_nav a").removeClass("on"); $(this).addClass("on"); }) $("#skip_nav a").blur(function(){ $("#skip_nav a").removeClass("on"); }) } /* À̹ÌÁö on off */ function over_img(img,n){ if (n == "on") { var hover = "_on"; }else{ var hover = "_off"; } if (img.parent().hasClass("home") == false && img.parent().hasClass("on") == false && img.hasClass("on") == false){ menuimg = img.find("img"); if (menuimg.attr("src").indexOf(".jpg") > 0){ menuimg_type = ".jpg"; }else if (menuimg.attr("src").indexOf(".gif") > 0){ menuimg_type = ".gif"; }else if (menuimg.attr("src").indexOf(".png") > 0){ menuimg_type = ".png"; } menuimg_src = menuimg.attr("src").split("_off")[0]; menuimg_src = menuimg_src.split("_on")[0]; menuimg.attr("src",menuimg_src+hover+menuimg_type); } } /* tabbox */ var isClick= false; function tabbox(){ var $tabBtn = $(".tabbox > li > a"); function onImgFnc(kind){return kind.find('img').attr('src').replace('_off','_on') } function offImgFnc(kind){ return kind.attr('src').replace('_on','_off') } $tabBtn.bind("click focus",function(e){ e.preventDefault(); $(this).closest("li").siblings().removeClass("on").find('> a >img').each(function(){ $(this).attr('src',offImgFnc($(this))); }); $(this).parent().addClass("on").find('> a > img').attr('src',onImgFnc($(this))); $(".tabbox .tab_con").hide(); $(this).siblings(".tab_con").show(); $(".tabbox").css("min-height",$(this).next().height()+57); }); $(window).load(function(){ //$faqtabBtn.eq(0).click(); if(!isClick){ $tabBtn.eq(0).click(); //$tbBtn.eq(0).trigger('click'); } }); } /* tab_pop */ var isClick= false; function pop_tab(){ var $tabBtn = $(".pop_tab > li > a"); function onImgFnc(kind){return kind.find('img').attr('src').replace('_off','_on') } function offImgFnc(kind){ return kind.attr('src').replace('_on','_off') } $tabBtn.bind("click focus",function(e){ e.preventDefault(); $(this).closest("li").siblings().removeClass("on").find('> a >img').each(function(){ $(this).attr('src',offImgFnc($(this))); }); $(this).parent().addClass("on").find('> a > img').attr('src',onImgFnc($(this))); $(".pop_tab .con").hide(); $(this).siblings(".con").show(); }); $(window).load(function(){ //$faqtabBtn.eq(0).click(); if(!isClick){ $tabBtn.eq(0).click(); //$tbBtn.eq(0).trigger('click'); } }); } /* faq */ function fnqFnc(){ $('.faq_box > dt > a').bind('click',function(){ $('.faq_box > dt > a').removeClass('on'); $(this).addClass('on').closest('.faq_box').find('dd').hide(); $(this).parent().next().show(); $(this).closest('ul.faq').height($(this).closest('dl').height() + 57 ); return false; }) } /* slide gallery */ function slideGallery(){ $('.slide_wrap').each(function(){ var isSlideMove = true; var ThisSlide = $(this); var ThisCont = $(this).find('ul.ul_set'); var ThisCellW = ThisCont.find('li').outerWidth()+10; var btnLeft = ThisSlide.find('.btnprev'); var btnRight = ThisSlide.find('.btnnext'); var ovBoxW = ThisCont.closest('div').innerWidth()+12; var ThisLength = ThisCont.find('li').length; var ThisContW = (ThisCellW * ThisLength); ThisCont.css({'width': ThisContW + 'px','left':'0px'}) btnLeft.bind('click',function(){ if(isSlideMove && ThisCont.css('left') < '0px'){ isSlideMove = false; ThisCont.animate({ "left" : "+=" + ThisCellW + "px"},function(){ isSlideMove = true; }); } return false; }) btnRight.bind('click',function(){ if(isSlideMove && parseInt(ThisCont.css('left')) > (-ThisContW+ovBoxW)){ //if(isSlideMove){ isSlideMove = false; ThisCont.animate({ "left" : "-=" + ThisCellW + "px"},function(){ isSlideMove = true; }); } return false; }) }) } function selectBoxFnc(){ var selSet = $('.select_set'); var selOkBtn = selSet.find('a.select_ok'); var selWrap = $('.select_wrap'); selWrap.find('li.select_cell').eq(0).css({'display':'block'}); selOkBtn.bind('click',function(){ var thisOption = selSet.find('select[name=input_select]').attr('value'); selWrap.find('li.select_cell').hide(); selWrap.find('li.cell_' + thisOption).show(); }) } /*brd_link*/ function brd_link(){ var brd_linkUl = $('.brd_link'); brd_linkUl.find('dl').each(function(){ var thisDl = $(this); thisDl.find('dd').wrapInner(''); }) } /*location map view*/ function locateMapView(){ } /*btnFnc03 - company > location fnc*/ function btnFnc03(target){ var FncObj = target; var btnFncSet = $('.btn_type03'); var btnFncSetLi = btnFncSet.find(' > li'); var btn03a = btnFncSet.find('li a'); var targetLi = target.find('li.domesticLi'); var dep2con = btnFncSet.find('.btn_type03d2') var clickCnt = 0; targetLi.append("") btnFncSet.find('.btn_type03d2').css({"display":"block"}); btnFncSet.find('.btn_type03d2').css({"display":"none"}); target.blur(function(){ $('ul.domestic_ul li.domesticLi').attr('tabindex',''); }) var setCheck; var isOn2Dps = false; btnFncSetLi.bind('mouseenter focusin',function(){ //btnFncSet.find('.btn_type03d2').css({"display":"none"}); //dep2con.css({"display":"none"}) $(this).siblings().find('.btn_type03d2').css({"display":"none"}); $(this).find('.btn_type03d2').css({"display":"block"}); //$('.btn_type03d2 > li').css({"float":"none"}); //$('.btn_type03d2 > li').css({"float":"left"}); isOn2Dps = true; }) btnFncSetLi.bind('mouseleave focusout',function(){ isOn2Dps = false; //$(this).find('.btn_type03d2').css({"display":"none"}); clearTimeout(setCheck); setCheck = setTimeout(function(){ if(isOn2Dps == false){ //dep2con.css({"display":"none"}) } },2000) }) dep2con.bind('focusin',function(){ console.log('eeeee'); $(this).find('li').css({"float":"none"}); $(this).find('li').css({"float":"left"}); }) btn03a.bind('click',function(e){ e.preventDefault(); var ThisBtn = $(this); //clickCnt = btnFncSet.find('li').index(ThisBtn.closest('li')); clickCnt = parseInt(ThisBtn.parent().attr('class').split('cnt')[1]-1); btn03a.removeClass('on'); ThisBtn.addClass('on').next().css({"display":"block"}); //2nd depth if(ThisBtn.parent().hasClass('d2')){ clickCnt = clickCnt-1; ThisBtn.closest('li.d1').find('>a').addClass('on'); } if(clickCnt == 6){ btnFncSet.find('li').eq(3).find('a').addClass('on'); } targetLi.eq(clickCnt).css({"opacity":"1","display":"block"}).attr('tabindex','0').focus().siblings().css({"opacity":"0","display":"none"}).attr('tabindex','-1'); //FncObj.removeClass($('ul.domestic_ul').attr('class').split('domestic_ul ')[1]).addClass('pos_0'+clickCnt)//.find('li:visible').attr('tabindex','0').focus(); $('ul.domestic_ul').attr('class','domestic_ul pos_0' + clickCnt); var FncObjcontW = FncObj.find('li.domesticLi').eq(clickCnt-1).outerWidth(); FncObj.css({"width": FncObjcontW + "px"}) }) btn03a.bind('focusin',function(){ btn03a.removeClass('atv'); $(this).addClass('atv'); }) locateMapView(); } /** * popup °ü·Ã script **/ function windowOpen(url) { /* if(url!="") { window.open(url).focus(); } */ if( url != "") { var htcWin = top.window.open(url); if(htcWin) htcWin.focus(); } } //½ºÅ©·Ñ¹Ù ¾ø°í À§Ä¡ ÁöÁ¤ ÀϹÝÆ˾÷ function popwin_position(url,w,h,h_percent,w_percent) { var ScreenW = window.screen.width; var ScreenH = window.screen.height; var top = ScreenH*(h_percent*0.1); var left = ScreenW*(w_percent*0.1); window.open(url,"","top="+ top +",left="+ left +",width="+ w +",height="+ h +",scrollbars=no,resizable=no,toolbar=no"); } //½ºÅ©·Ñ¹Ù ¾ø´Â ÀϹÝÆ˾÷ function popwin(url,w,h) { window.open(url,'','width='+w+',height='+h+',scrollbars=no,resizable=no,toolbar=no,top=100,left=100'); } //½ºÅ©·Ñ¹Ù ÀÖ´Â ÀϹÝÆ˾÷ function popwin_roll(url,w,h) { window.open(url,'','width='+w+',height='+h+',scrollbars=yes,resizable=no,toolbar=no,top=10,left=10'); } //âÀ̸§ÀÌ ÀÖ¾î¾ß ÇÏ´Â Æ˾÷ function popwin_name(url,name,w,h) { window.open(url,name,'width='+w+',height='+h+',scrollbars=yes,resizable=no,toolbar=no,location=no,top=10,left=10'); } //½ºÅ©·Ñ¹Ù ¾ø°í âÀ̸§ ÀÖ´Â Æ˾÷ function popsn(url,name,w,h) { window.open(url,name,'width='+w+',height='+h+',scrollbars=no,resizable=no,copyhistory=no,toolbar=no,top=10,left=10'); } //½ºÅ©·Ñ¹Ù ÀÖ°í âÀ̸§ ÀÖ´Â Æ˾÷ function popsy(url,name,w,h) { window.open(url,name,'width='+w+',height='+h+',scrollbars=yes,resizable=no,copyhistory=no,toolbar=no,top=10,left=10'); } /* ÇÁ¸°Æ®Çϱ⠹öÆ° */ function printFnc(){ var btnPrint = $('a.btn_print'); btnPrint.bind('click',function(){ window.print(); /* $('body').append("