//¼ýÀÚ ÄÞ¸¶ function setComma(str){ var str = String(str); var str_len = str.length; var return_str = ''; var val = ''; var j = 0; for(i=str_len;i>0;i--){ if(str.substring(i,i-1) != ',') val = str.substring(i,i-1) + val; } str_len = val.length; for(i=str_len; i>0; i--){ if(j%3 == 0 && j != 0) return_str = val.substring(i,i-1) + ',' + return_str; else return_str = val.substring(i,i-1) + return_str; j++; } return return_str; } //ÀÚµ¿ ÄÞ¸¶ Âï±â function autoAddComma(obj) { if(event.keyCode == 37 || event.keyCode == 39 ) { return; } var strValue = obj.value.replace(/,|\s+/g,''); if(isNaN(strValue)) { alert(strValue.concat('¼ýÀÚ°¡ ¾Æ´Õ´Ï´Ù.')); return false; } var commaValue = setComma(strValue); obj.value = commaValue; } //À̺¥Æ® ÁÂÇ¥ function getEventXY(e){ var loc = new Array(); loc['x'] = 0; loc['y'] = 0; if(e==null) e=window.event; if(e.pageX || e.pageY) { loc['x'] = e.pageX; loc['y'] = e.pageY; }else if(e.clientX || e.clientY) { if(document.documentElement.scrollTop) { loc['x'] = e.clientX+document.documentElement.scrollLeft; loc['y'] = e.clientY+document.documentElement.scrollTop; } else { loc['x'] = e.clientX+document.body.scrollLeft; loc['y'] = e.clientY+document.body.scrollTop; } } return loc; } //µðÀÚÀλóÇ° ¸®½ºÆ®È­¸éÀÇ ÅǸ޴º function tabProductDisplay(id) { switch(id) { case 'newProductListBlock': document.getElementById('bestNewProductTab').className = 'tab_newdesign'; document.getElementById('newProductListBlock').style.display = 'block'; document.getElementById('bestProductListBlock').style.display = 'none'; break; case 'bestProductListBlock': default: document.getElementById('bestNewProductTab').className = 'tab_bestdesign'; document.getElementById('newProductListBlock').style.display = 'none'; document.getElementById('bestProductListBlock').style.display = 'block'; break; } } //»óÇ°»ó¼¼ÀÇ ÅǸ޴º function tabDesignProductDetailDisplay(id) { switch(id) { case 'designProductAgreement': document.getElementById('designProductAgreementTab').src = '../img/design/tab_menu_top_4_on.gif'; document.getElementById('designProductAgreement').style.display = 'block'; document.getElementById('designProductDetailContentTab').src = '../img/design/tab_menu_top_1_off.gif'; document.getElementById('designProductDetailContent').style.display = 'none'; break; case 'designProductDetailContent': document.getElementById('designProductAgreementTab').src = '../img/design/tab_menu_top_4_off.gif'; document.getElementById('designProductAgreement').style.display = 'none'; document.getElementById('designProductDetailContentTab').src = '../img/design/tab_menu_top_1_on.gif'; document.getElementById('designProductDetailContent').style.display = 'block'; default: break; } } //µðÀÚÀÎ Ä«Å×°í¸®º° °Ë»ö function designCategorySearch(obj) { if(!obj.cid.value) { obj.scid[0].selected = true; } obj.searchProductName.value = ''; obj.searchPriceFrom.value = ''; obj.searchPriceTo.value = ''; obj.submit(); } //µðÀÚÀλóÇ° °Ë»ö submint function designProductSearchFormSubmit(obj) { if(!obj.cid.value) { obj.cid[0].selected = true; } //°¡°Ý´ë°Ë»ö ',' ¾ø¾Ö±â var searchPriceFromVal = obj.searchPriceFrom.value.replace(/,|\s+/g,''); var searchPriceToVal = obj.searchPriceTo.value.replace(/,|\s+/g,''); if(searchPriceFromVal || searchPriceToVal) { if(isNaN(searchPriceFromVal) || !searchPriceFromVal) { alert('µðÀÚÀÎ °¡°Ý°Ë»ö ½ÃÀÛ°ªÀ» ¼ýÀÚ·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.'); obj.searchPriceFrom.focus(); return false; } if(isNaN(searchPriceToVal) || !searchPriceToVal) { alert('µðÀÚÀÎ °¡°Ý°Ë»ö Á¾·á°ªÀ» ¼ýÀÚ·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.'); obj.searchPriceTo.focus(); return false; } } obj.searchPriceFrom.value = searchPriceFromVal; obj.searchPriceTo.value = searchPriceToVal; return true; } function selectBoxView(obj) { if(document.getElementById(obj).style.display == 'none') { document.getElementById(obj).style.display = 'block'; } else { document.getElementById(obj).style.display = 'none'; } }