var lnbInterval, lnbDuration = 15000; var curTwoNum; $(function(){ getURL(); // on 붙은 게 포커싱 //console.log(twoNum); curTwoNum = twoNum; if (twoNum > -1) { $("#lnb>ul>li").eq(twoNum).find(".lnbTwo").stop(true, true).slideDown(300).end().addClass("on"); $("#lnb>ul>li").eq(twoNum).find(".lnbTwo>a").eq(threeNum).addClass("on"); } $("#lnb>ul>li").each(function(q){ $(this).children("a").click(function(e){ // 하위 메뉴가 없을 경우 링크를 태우고 // 하위 메뉴가 있을 경우 링크 X 2014-01-23 if ($(this).next("div").size()>0) { e.preventDefault(); if(q != curTwoNum) { if (curTwoNum > -1) { $("#lnb>ul>li").eq(curTwoNum).removeClass("on"); $("#lnb>ul>li").eq(curTwoNum).find(".lnbTwo").stop(true, true).slideUp(300); } curTwoNum = q; $("#lnb>ul>li").eq(curTwoNum).addClass("on"); $("#lnb>ul>li").eq(curTwoNum).find(".lnbTwo").stop(true, true).slideDown(300); } } }) }) $("#lnb").mouseleave(function(){ clearInterval(lnbInterval); lnbInterval = setInterval("lnbOut()", lnbDuration); }).mouseenter(function(){ clearInterval(lnbInterval); }); }) function lnbOut() { if (twoNum > -1) { if(curTwoNum != twoNum) { $("#lnb>ul>li").eq(curTwoNum).removeClass("on"); $("#lnb>ul>li").eq(curTwoNum).find(".lnbTwo").stop(true, true).slideUp(300); curTwoNum = twoNum; $("#lnb>ul>li").eq(curTwoNum).addClass("on"); $("#lnb>ul>li").eq(curTwoNum).find(".lnbTwo").stop(true, true).slideDown(300); } } } function getURL() { // 회사소개 if(location.pathname.indexOf("all.php") > -1) { oneNum = 0; twoNum = 0; }; if(location.pathname.indexOf("info04.php") > -1) { oneNum = 0; twoNum = 1; }; if(location.pathname.indexOf("map.php") > -1) { oneNum = 0; twoNum = 2; }; if(location.pathname.indexOf("organization.php") > -1) { oneNum = 0; twoNum = 3; }; if(location.pathname.indexOf("license.php") > -1) { oneNum = 0; twoNum = 4; }; if(location.pathname.indexOf("awards.php") > -1) { oneNum = 0; twoNum = 5; }; if(location.pathname.indexOf("contact_us.php") > -1) { oneNum = 0; twoNum = 6; }; // 제품소개-------------------------------------------------------------------- if(location.pathname.indexOf("prod1.php") > -1) { oneNum = 1; twoNum = 0; threeNum = 0; }; if(location.pathname.indexOf("sub13.php") > -1) { oneNum = 1; twoNum = 1; threeNum = 0; }; if(location.pathname.indexOf("sub14.php") > -1) { oneNum = 1; twoNum = 1; threeNum = 1; }; if(location.pathname.indexOf("sub24.php") > -1) { oneNum = 1; twoNum = 2; threeNum = 0; }; if(location.pathname.indexOf("sub26.php") > -1) { oneNum = 1; twoNum = 3; threeNum = 0; }; if(location.pathname.indexOf("sub27.php") > -1) { oneNum = 1; twoNum = 3; threeNum = 1; }; if(location.pathname.indexOf("sub28.php") > -1) { oneNum = 1; twoNum = 3; threeNum = 2; }; if(location.pathname.indexOf("sub29.php") > -1) { oneNum = 1; twoNum = 3; threeNum = 3; }; if(location.pathname.indexOf("sub30.php") > -1) { oneNum = 1; twoNum = 4; threeNum = 0; }; if(location.pathname.indexOf("sub31.php") > -1) { oneNum = 1; twoNum = 4; threeNum = 1; }; if(location.pathname.indexOf("sub32.php") > -1) { oneNum = 1; twoNum = 5; threeNum = 0; }; if(location.pathname.indexOf("sub33.php") > -1) { oneNum = 1; twoNum = 5; threeNum = 1; }; if(location.pathname.indexOf("sub34.php") > -1) { oneNum = 1; twoNum = 5; threeNum = 2; }; if(location.pathname.indexOf("sub35.php") > -1) { oneNum = 1; twoNum = 5; threeNum = 3; }; if(location.pathname.indexOf("sub36.php") > -1) { oneNum = 1; twoNum = 5; threeNum = 4; }; if(location.pathname.indexOf("sub37.php") > -1) { oneNum = 1; twoNum = 5; threeNum = 5; }; if(location.pathname.indexOf("sub38.php") > -1) { oneNum = 1; twoNum = 5; threeNum = 6; }; if(location.pathname.indexOf("sub39.php") > -1) { oneNum = 1; twoNum = 5; threeNum = 7; }; if(location.pathname.indexOf("sub40.php") > -1) { oneNum = 1; twoNum = 5; threeNum = 8; }; if(location.pathname.indexOf("sub41.php") > -1) { oneNum = 1; twoNum = 6; threeNum = 0; }; if(location.pathname.indexOf("sub42.php") > -1) { oneNum = 1; twoNum = 6; threeNum = 1; }; if(location.pathname.indexOf("sub43.php") > -1) { oneNum = 1; twoNum = 6; threeNum = 2; }; if(location.pathname.indexOf("sub44.php") > -1) { oneNum = 1; twoNum = 6; threeNum = 3; }; // 보유기술 if(location.pathname.indexOf("fnr_process.php") > -1) { oneNum = 2; twoNum = 0; threeNum = 0; }; if(location.pathname.indexOf("mbr_process.php") > -1) { oneNum = 2; twoNum = 0; threeNum = 1; }; if(location.pathname.indexOf("rainwater_system.php") > -1) { oneNum = 2; twoNum = 0; threeNum = 2; }; if(location.pathname.indexOf("pollution_system.php") > -1) { oneNum = 2; twoNum = 0; threeNum = 3; }; if(location.pathname.indexOf("purifying_system.php") > -1) { oneNum = 2; twoNum = 0; threeNum = 4; }; if(location.pathname.indexOf("cjr_process.php") > -1) { oneNum = 2; twoNum = 0; threeNum = 5; }; if(location.pathname.indexOf("bio_tron.php") > -1) { oneNum = 2; twoNum = 1; threeNum = 0; }; if(location.pathname.indexOf("gsf_filter.php") > -1) { oneNum = 2; twoNum = 1; threeNum = 1; }; if(location.pathname.indexOf("uv_disinfection.php") > -1) { oneNum = 2; twoNum = 1; threeNum = 2; }; if(location.pathname.indexOf("am_filter.php") > -1) { oneNum = 2; twoNum = 1; threeNum = 3; }; if(location.pathname.indexOf("fine_bubble.php") > -1) { oneNum = 2; twoNum = 1; threeNum = 4; }; if(location.pathname.indexOf("ro_pretreatment.php") > -1) { oneNum = 2; twoNum = 2; threeNum = 0; }; if(location.pathname.indexOf("ozone_system.php") > -1) { oneNum = 2; twoNum = 2; threeNum = 1; }; if(location.pathname.indexOf("poll_pureness.php") > -1) { oneNum = 2; twoNum = 2; threeNum = 2; }; if(location.pathname.indexOf("uv_photocatalytic.php") > -1) { oneNum = 2; twoNum = 3; threeNum = 0; }; if(location.pathname.indexOf("auto_system.php") > -1) { oneNum = 2; twoNum = 4; }; // 사업실적 if(location.pathname.indexOf("results.php") > -1) { oneNum = 3; twoNum = 0; }; if(location.pathname.indexOf("personal_results.php") > -1) { oneNum = 3; twoNum = 1; }; if(location.pathname.indexOf("septic_results.php") > -1) { oneNum = 3; twoNum = 2; }; if(location.pathname.indexOf("heavywater_results.php") > -1) { oneNum = 3; twoNum = 3; }; if(location.pathname.indexOf("wastewater_results.php") > -1) { oneNum = 3; twoNum = 4; }; if(location.pathname.indexOf("rainwater_results.php") > -1) { oneNum = 3; twoNum = 5; }; if(location.pathname.indexOf("cleanwater_results.php") > -1) { oneNum = 3; twoNum = 6; }; if(location.pathname.indexOf("watersupply_results.php") > -1) { oneNum = 3; twoNum = 7; }; if(location.pathname.indexOf("maintenance_results.php") > -1) { oneNum = 3; twoNum = 8; }; // 연구개발 if(location.pathname.indexOf("rnd.php") > -1) { oneNum = 4; twoNum = 0; }; // 고객지원 if(location.pathname.indexOf("notice.php") > -1) { oneNum = 5; twoNum = 0; }; if(location.pathname.indexOf("partners.php") > -1) { oneNum = 5; twoNum = 1; }; };