var assistGoodNames = new Array(); var goodInfoList = new Array(); var goodItemInfoList = new Array(); //품목 try { document.execCommand("BackgroundImageCache", false, true);} catch(err) {} //탑메뉴 function top2menuView(a) { //2차메뉴보기 if(this.id){ eidStr = this.id; eidNum=eidStr.substring(eidStr.lastIndexOf("m",eidStr.length)+1,eidStr.length); a = parseInt(eidNum); } top2menuHideAll(); top1Menu = document.getElementById("top1m"+a); top2Menu = document.getElementById("top2m"+a); $("#top1m"+a).parent().addClass("on"); if(a<100){ann='0'+a;} else {ann=''+a;} if (a=0) { //메인은2차메뉴활성화안함 } else { if (top1Menu) { //top1Menu.getElementsByTagName("img")[0].src=top1Menu.getElementsByTagName("img")[0].src.replace("_off.","_on."); //if (top2Menu) { top2Menu.style.display = 'inline'; } $("#lnb .top2m").show(); $('#lnb, #header_bg').addClass('on'); } } } function top2menuHide(a) { //2차메뉴감추기 if(this.id){ eidStr = this.id; eidNum=eidStr.substring(eidStr.lastIndexOf("m",eidStr.length)+1,eidStr.length); a = parseInt(eidNum); } top2menuHideAll(); top1Menu = document.getElementById("top1m"+a); top2Menu = document.getElementById("top2m"+a); if(a<100){ann='0'+a;} else {ann=''+a;} $("#top1m"+a).parent().removeClass("on"); //$('#header_bg').removeClass(); if (top1Menu) { //top1Menu.getElementsByTagName("img")[0].src=top1Menu.getElementsByTagName("img")[0].src.replace("_on.","_off."); //if (top2Menu) { top2Menu.style.display = 'none'; } $("#lnb .top2m").hide(); $('#lnb, #header_bg').removeClass('on'); } } function top2menuHideAll() { //2차메뉴모두감추기 top1menuEl = document.getElementById("top1menu").childNodes; for (var i=1;i<=top1menuEl.length;i++) { top1Menu = document.getElementById("top1m"+i); top2Menu = document.getElementById("top2m"+i); if(i<100){inn='0'+i;} else {inn=''+i;} if (top1Menu) { //top1Menu.getElementsByTagName("img")[0].src=top1Menu.getElementsByTagName("img")[0].src.replace("_on.","_off."); if (top2Menu) { top2Menu.style.display = 'none'; } $("#lnb .top2m").hide(); $('#lnb, #header_bg').removeClass('on'); $('#top1menu li').removeClass('on'); } } } function initTopMenu(d1,d2,color) { d1n = d1; d2n = d2; colorn = color; d1nn = (d1n<100) ? '0'+d1n : d1n; d2nn = (d2n<100) ? '0'+d2n : d2n; var topMenuSize = $('.topMenuLi').length+1; for (var i=1; i < topMenuSize; i++) { top1Menu = document.getElementById("top1m"+i); top2Menu = document.getElementById("top2m"+i); top1Menu.onmouseover = top1Menu.onfocus = top2menuView; top1Menu.onmouseout = top2menuHide; top2Menu.onmouseover = top2menuView; top2Menu.onmouseout = top2menuHide; } var subMenuSize = $('.topSubm').length; $("#topSubMenu"+subMenuSize).focusout(function() { top2menuHide(); }); //$('.topSubm').on("blur", alert("11")); top2MenuCurr = document.getElementById("top2m"+d1n); if (top2MenuCurr) {// top2MenuCurr.style.display = 'inline'; $("#lnb .top2m").show(); $('#lnb, #header_bg').addClass('on'); } top2MenuCurrAct = document.getElementById("top2m"+d1n+"m"+d2n); if (top2MenuCurrAct) { top2MenuCurrAct.getElementsByTagName("a")[0].style.color=colorn; } if (top2MenuCurrAct) { top2MenuCurrAct.getElementsByTagName("a")[0].style.fontWeight="bold"; } } // 탭메뉴 공통적으로 사용 //ex) tabOn(1,1); function tabOn(tabid,a) { for (var i=1;i<=10;i++) { if(i<10){inn="0"+i;} else {inn=""+i;} tabMenu = document.getElementById("tab"+tabid+"m"+i); tabContent = document.getElementById("tab"+tabid+"c"+i); tabMore = document.getElementById("tab"+tabid+"more"+i); if (tabMenu) { //객체가존재하면 if (tabMenu.tagName=="IMG") { tabMenu.src = tabMenu.src.replace("_on.", "_off."); } //이미지일때 if (tabMenu.tagName=="A") { tabMenu.className=""; } //앵커일때 } if (tabContent) { tabContent.style.display="none"; } if (tabMore) { tabMore.style.display="none"; } } if(a<10){ann="0"+a;} else {ann=""+a;} tabMenu = document.getElementById("tab"+tabid+"m"+a); tabContent = document.getElementById("tab"+tabid+"c"+a); tabMore = document.getElementById("tab"+tabid+"more"+a); // alert(tabMenu.tagName); if (tabMenu) { //객체가존재하면 if (tabMenu.tagName=="IMG") { tabMenu.src = tabMenu.src.replace("_off.", "_on."); } //이미지일때 if (tabMenu.tagName=="A") { tabMenu.className="on"; } //앵커일때 } if (tabContent) { tabContent.style.display="block"; } if (tabMore) { tabMore.style.display="block"; } } function goContent(){ $('#contents').focus(); } function goMainContent(){ $('#contents').focus(); } $(document).ready(function(){ //이미지 롤오버 $(".overimg").mouseover(function (){ var file = $(this).attr('src').split('/'); var filename = file[file.length-1]; var path = ''; for(var i=0 ; i < file.length-1 ; i++){ path = ( i == 0 )?path + file[i]:path + '/' + file[i]; } $(this).attr('src',path+'/'+filename.replace('_off.','_on.')); }).mouseout(function(){ var file = $(this).attr('src').split('/'); var filename = file[file.length-1]; var path = ''; for(var i=0 ; i < file.length-1 ; i++){ path = ( i == 0 )?path + file[i]:path + '/' + file[i]; } $(this).attr('src',path+'/'+filename.replace('_on.','_off.')); }); /* 배너모음 */ var bannerAuto=null; function rightBanner(){ $(".banner_img").stop().animate( {left:"-=151px"},0,function(){ var $bannerObj=$(".banner_img li:first").clone(true); $(".banner_img li:first").remove(); $(".banner_img").css("left",0); $(".banner_img").append($bannerObj); } ); if(bannerAuto)clearTimeout(bannerAuto); bannerAuto=setTimeout(rightBanner,3000); } function leftBanner(){ $(".banner_img").stop().animate( {left:"0px"},0,function(){ var $bannerObj=$(".banner_img li:last").clone(true); $(".banner_img li:last").remove(); $(".banner_img").css("left","0"); $(".banner_img").prepend($bannerObj); } ); if(bannerAuto)clearTimeout(bannerAuto); bannerAuto=setTimeout(rightBanner,3000); } $(document).ready(function(){ bannerAuto=setTimeout(rightBanner,3000); $leftB=$(".banner_control .prev_banner a"); $rightB=$(".banner_control .next_banner a"); $pauseB=$(".banner_control .pause_banner a"); $bannerP_btn=$(".banner_control .pause_banner a img"); var bPlay = false; $leftB.click(function(){ if (bPlay == true){ clearTimeout(bannerAuto); }else{ clearTimeout(bannerAuto); leftBanner(); return false; } }); $rightB.click(function(){ if (bPlay == true){ clearTimeout(bannerAuto); }else{ clearTimeout(bannerAuto); rightBanner(); return false; } }); $pauseB.click(function(){ if (bPlay == false){ clearTimeout(bannerAuto); $bannerP_btn.attr("src","/tprice/images/portal/common/banner_btn_play.gif"); $bannerP_btn.attr("alt","배너재생"); bPlay = true; }else{ bPlay = false; $bannerP_btn.attr("src","/tprice/images/portal/common/banner_btn_stop.gif"); $bannerP_btn.attr("alt","배너일시정지"); bannerAuto=setTimeout(rightBanner,1500); } }); $(".banner_img li a").bind("mouseover focusin", function(){ clearTimeout(bannerAuto); $bannerP_btn.attr("src","/tprice/images/portal/common/banner_btn_play.gif"); $bannerP_btn.attr("alt","배너재생"); }); $(".banner_img li a").bind("mouseleave focusout", function(){ bPlay = false; bannerAuto=setTimeout(rightBanner,1500); $bannerP_btn.attr("src","/tprice/images/portal/common/banner_btn_stop.gif"); $bannerP_btn.attr("alt","배너일시정지"); }); }); // 메인화면 상단 자동완성 검색어 조회 $.ajax({ type:"POST", url:"/tprice/common/code/getAutoCompleteGoodNameList.do", dayaType:"json", success:function(data) { goodNameList = data.autoCompleteGoodNameList; $.each(goodNameList, function(i) { assistGoodNames.push(goodNameList[i].GOOD_NAME); goodInfoList[i] = new Array(); goodInfoList[i] = [goodNameList[i].GOOD_ID ,goodNameList[i].GOOD_NAME ,goodNameList[i].GOOD_SMLCLS_CODE ,goodNameList[i].GOOD_SMLCLS_NAME ,goodNameList[i].GOOD_MIDCLS_CODE ,goodNameList[i].GOOD_MIDCLS_NAME ,goodNameList[i].FILE_RGTN_SEQ ]; }); } ,failure:function(data) { } }); // 검색어 자동완성 적용 $("#schWord").autocomplete({ source: assistGoodNames, focus: function () { // prevent value inserted on focus //자동완성 검색 키워를 입력하여 콤보박스 형태로 자동완성되었을때 //Key Down, Key Up 으로 선택시 입력 Text 박스에 입력한 //자동완성 키워드가 리셋되는 형상을 방지 하기위해 return false 함. //focus: function () 을 사용하지 않거나 사용하되 return true 를 하면 // 입력 Text 박스에 입력한 자동완성 키워드가 리셋 됨. // placeholder 도입으로 주석처리 by 황인환 2018-04-20 // 주석처리로 인해 키보드 조작이 안되서 다시 원복 by 황인환 2020-04-22 return false; } }); $('#schWord').keydown(function(key){ if(key.keyCode == 13) { $("#btn_searchTop").click(); } }); // 검색 버튼 $("#btn_searchTop").click(function(){ var goodName = $("#schWord").val(); var goodId = ""; var goodSmlclsCode = ""; var goodClassCode = ""; for(var i=0; ili>ul>li").length == 13){ $("#side_menu ul>li>ul>li").each(function(index){ var url = $(this).children("a").attr("href"); var goodClassCode = url.substr(url.length-9,9); var topRate = 198; topRate += index * 26; var innerHtml = ""; innerHtml += '
'; innerHtml += ''; innerHtml += '
'; $(this).append(innerHtml); }); } }, failure:function(data){} }); //품목 팝업 호버 $("#side_menu ul ul li").hover(function(){ $("div.side_goodItem:not(:animated)",this).slideDown(); },function(){ $("div.side_goodItem",this).hide(); }); });