function rollover2clicksort(objnm , k , sorting , selected){ var obj = getids(objnm); for(var x = 0 ; x < obj.length ; ++x){ var ob = obj[x]; if(typeof(ob) == 'undefined') continue; if(k == x){ var y = selected == '1' ? ((parseInt(x) + 1) * 11) : (parseInt(x) + 1); var nptt = new RegExp('_bt' + ((parseInt(x) + 1) * 11) , 'gi'); var nowstat = ob.src.search(nptt); var z = nowstat > -1 ? ((parseInt(x) + 1) * 11) : (parseInt(x) + 1); var rep = new RegExp('_bt' + z , 'gi'); ob.src = ob.src.replace(rep , '_bt' + y); nptt = new RegExp('_1.gif' , 'gi'); nowstat = ob.src.search(nptt); z = nowstat > -1 ? '_1.gif': '_2.gif'; var rep = new RegExp(z , 'gi'); obj[x].src = obj[x].src.replace(rep , '_' + sorting + '.gif'); } else{ var nptt = new RegExp('_bt' + ((parseInt(x) + 1) * 11) , 'gi'); var nowstat = ob.src.search(nptt); var z = nowstat > -1 ? ((parseInt(x) + 1) * 11) : (parseInt(x) + 1); var rep = new RegExp('_bt' + z , 'gi'); ob.src = ob.src.replace(rep , '_bt' + (parseInt(x) + 1)); } } } function toggleeffect(tdiv){ if(getid(tdiv).innerHTML.replace(/^\s+|\s+$/g, "") == ""){ button = '1,1,1'; buttonfunction = 'setcategory'; var params = "loadfile=category_tree&button=" + button + "&buttonfunction=" + buttonfunction + "&cate_display=" + getcategory_init_params[tablenm]['cate_display'] + "&linkfunction=coloring(this , '000000' , 'e31d1d');" + getcategory_init_params[tablenm]['linkfunction'] + "&tablenm=" + tablenm + "&code=" + pinid + "&depth=" + depth + "&treeobjnm=" + getcategory_init_params[tablenm]['innertarget']; var t = frm; frm = undefined; new igearajax().reload('&' + params , tdiv , undefined , function(rt){ }); frm = t; } viewcrtl(getid(tdiv).id , '' , true); } function treedraw(tablenm , tail){ this.spot = tail; this.spot2 = ''; this.tablenm = tablenm; this.treediv1nm = "tree1_" + tail + '_'; this.treediv2nm = "tree2_" + tail + '_'; this.treediv3nm = "tree3_" + tail + '_'; this.treeimgnm = "tree2icon_" + tail + '_'; this.txtspot = "tree_" + tail + '_txtspot'; this.selecteditem = ''; this.skin = "default"; } treedraw.prototype = { toggle : function(pinid , img){ toggleeffect(this.treediv3nm + pinid); imgobj = typeof(img.src != 'undefined') ? img : getid(this.treeimgnm + pinid); this.toggleimage(imgobj); }, toggleimage : function(imgobj){ var basenm = basename(imgobj.src); imgobj.src = frontimagedir + "cca/" + (basenm != 'folder.gif' ? (basenm == 'folder_explore.gif' ? 'folder_database.gif' : 'folder_explore.gif') : 'folder.gif'); }, write : function(data , topvisible){ getid(this.spot).innerHTML = (topvisible == true ? "
\
\ \ \
" : '') + data; }, getpos : function(obj){ var pobj = obj.parentNode; var pos = ''; for(var i = 0 ; i < pobj.childNodes.length ; ++i){ if(pobj.childNodes[i] == obj){ pos = i; break; } } return {'index' : pos , 'parent' : pobj}; }, move : function(cmd , step){ if(typeof(step) == 'undefined') step = 1; if(this.selecteditem == ''){ dyn_alert(flang_part_javascript[30110]); return; } var div1 = this.treediv1nm + this.selecteditem; var div2 = this.treediv2nm + this.selecteditem; var div3 = this.treediv3nm + this.selecteditem; var nobj = getid(div1); var tobj = this.getpos(getid(div1)); if(!tobj.parent.parentNode.parentNode.parentNode.parentNode.id) tobj = this.getpos(tobj.parent.parentNode.parentNode.parentNode); var pobj = tobj.parent; var nindex = tobj.index; try{ switch(cmd){ case "up": if(nindex < 1){ return; } var pindexobj = typeof(pobj.childNodes[nindex - step].id) != 'undefined' ? pobj.childNodes[nindex - step] : pobj.childNodes[nindex - step - 1]; pobj.insertBefore(pobj.childNodes[nindex] , pindexobj); break; case "down" : if(nindex > pobj.childNodes.length - 2){ return; } var pindexobj = typeof(pobj.childNodes[nindex + step].id) != 'undefined' ? pobj.childNodes[nindex + step] : pobj.childNodes[nindex + step + 1]; pobj.insertBefore(pindexobj , pobj.childNodes[nindex]); break; default : return false; break; } }catch(e){} var retdata = []; var x = $("[tree_info]"); for(var i = 0 ; i < x.length ; ++i){ retdata[i] = encodeURIComponent('treestatusdata[' + i + ']') + '=' + encodeURIComponent($(x).eq(i).attr("tree_info")); } return retdata; }, category_sort : function(wh){ var mov = wh > 0 ? 'up' : 'down' var treedt = this.move(mov , Math.abs(wh)); if(typeof(treedt) != 'undefined'){ var params = 'loadfile=category_sort&' + treedt.join('&'); new Ajax.Request(fcommon + 'floadajax.php' , {parameters : params , method : 'post' , onComplete : function(rt){ }}); } } } function getcatetree(tablenm , pinid , depth , linkfunction , exec , innertarget , topvisible , cate_display , multiple , checkbox){ if(getid('loadingbuff') == null) buffimg(); if(is_empty(innertarget)) innertarget = 'category_tree'; if(is_empty(pinid)) pinid = ''; if(is_empty(depth)) depth = ''; if(is_empty(cate_display)) cate_display = ''; if(is_empty(multiple)) multiple = ''; if(is_empty(checkbox)) checkbox = ''; if(is_empty(tablenm) || !tablenm) tablenm = 'default'; button = '0,0'; buttonfunction = 'setcategory'; if(typeof(tdraw) == 'undefined') tdraw = []; var params = "setupload_predir=product&loadfile=product_category_tree&button=" + button + "&buttonfunction=" + buttonfunction + "&cate_display=" + cate_display + "&linkfunction=coloring(this , '000000' , 'e31d1d');" + linkfunction + "&tablenm=" + tablenm + "&multiple=" + multiple + "&checkbox=" + checkbox + "&code=" + pinid + "&depth=" + depth + "&treeobjnm=" + innertarget; new Ajax.Request(fcommon + "floadajax.php" , { parameters : params , method : 'post' , onComplete : function(rt){ try{ tdraw[innertarget] = new treedraw(tablenm , innertarget); tdraw[innertarget].write(rt.responseText , topvisible); if(typeof(exec) == 'function') exec(); }catch(e){ dyn_alert(e.message); } }}); return true; } function frm_modify(tablenm , pinid , depth , url , innertarget , multiple , checkbox){ if(typeof(drawdata) == 'undefined') drawdata = []; if(is_empty(innertarget)) innertarget = 'product_category_tree'; tdraw[innertarget].selecteditem = typeof(pinid) != 'undefined' ? pinid : ''; if(typeof(drawdata[pinid]) != 'undefined'){ frm_modify_input(drawdata[pinid] , innertarget , multiple , checkbox); }else{ tdraw[innertarget].selecteditem = pinid; var params = "setupload_predir=product&loadfile=product_category_tree&returnjson=1&tablenm=" + tablenm + "&code=" + pinid + "&depth=" + depth + url; var rst = new Ajax.Request(fcommon + 'floadajax.php' , { parameters : params , method : 'post' , onComplete : function(rt){ try{ var rst = json_decode(rt.responseText); rst = typeof(rst['cate']) != 'undefined' ? rst['cate'] : rst['subcate']; rst = getkeymatchdata(0 , rst); drawdata[pinid] = rst; frm_modify_input(rst , innertarget , multiple , checkbox); }catch(e){ alert(e.message); } }}); } } function frm_modify_input(tdata , innertarget , multipleflag , checkboxflag){ var tid = tdraw[innertarget]; tid.spot2 = innertarget + '_apply'; var target = getid(tid.spot2); var xid = getids(tid.txtspot); var txt = []; var intxt; var itembox = "item_" + tid.spot2 + "_" + tdata['pinid']; if(typeof(multiple) == 'undefined') multiple = {}; if(typeof(checkbox) == 'undefined') checkbox = {}; multiple[innertarget] = typeof(multipleflag) == 'undefined' ? true : (multipleflag == 'true' || multipleflag == true ? true : false); checkbox[innertarget] = typeof(checkboxflag) == 'undefined' ? false : (checkboxflag == 'true' || checkboxflag == true ? true : false); if(getid(itembox) != null){ dyn_alert(flang_part_javascript[30009]); return; } if(multiple[innertarget] == false && target.innerHTML != ''){ dyn_alert(flang_part_javascript[30040]); return; } for(var i = 0 ; i < xid.length ; ++i){ intxt = typeof(xid[i].innerHTML) != 'undefined' ? xid[i].innerHTML : ''; switch(xid[i].getAttribute('parentcode')){ case tdata['acode'] : txt[txt.length] = tdata['pinid'] == tdata['acode'] ? '' + intxt + '' : intxt; break; case tdata['bcode'] : txt[txt.length] = tdata['pinid'] == tdata['bcode'] ? '' + intxt + '' : intxt; break; case tdata['ccode'] : txt[txt.length] = tdata['pinid'] == tdata['ccode'] ? '' + intxt + '' : intxt; break; case tdata['dcode'] : txt[txt.length] = tdata['pinid'] == tdata['dcode'] ? '' + intxt + '' : intxt; break; case tdata['ecode'] : txt[txt.length] = tdata['pinid'] == tdata['ecode'] ? '' + intxt + '' : intxt; break; case tdata['fcode'] : txt[txt.length] = tdata['pinid'] == tdata['fcode'] ? '' + intxt + '' : intxt; break; case tdata['gcode'] : txt[txt.length] = tdata['pinid'] == tdata['gcode'] ? '' + intxt + '' : intxt; break; } } try{ target.innerHTML += "
" + (checkbox[innertarget] == true ? "" : "") + txt.join(" > ") + " \
"; target.scrollTop = getbottom(target); }catch(e){alert(e.message);} } function getproductprice(prtdiv , frm){ if(typeof(frm) == 'undefined') frm = document.writefrm; var chg_addprice = 0; var qty = is_int(frm.ordqty.value) ? frm.ordqty.value : 1; if( parseInt(_max_ordqty) > 0){ if(parseInt(qty) > parseInt(_max_ordqty)){ dyn_alert('입력하신 수량이 최대구매수량('+_max_ordqty+'개)을 초과하여
구매가능한 수량으로 자동조정되었습니다.'); frm.ordqty.value = qty = _max_ordqty; } } var retdata = 0; if(frm.pricestruc.value == '1' || frm.pricestruc.value == '3'){ if(frm.is_set_product.value != 1){ retdata += parseFloat(frm.sellprice.value); }else{ retdata += get_setproduct_price(1);//2019-03-06 김관노 1 로 패치 } } if((frm.pricestruc.value == '2' || frm.pricestruc.value == '3') && frm.is_set_product.value != 1){ var chgoptprice = getids('chgoptprice[]'); var optprice , price; for(var i = 0 ; i < chgoptprice.length ; ++i){ if(chgoptprice[i] == null) continue; optprice = (chgoptprice[i].tagName).toLowerCase() == 'select' ? chgoptprice[i].options[chgoptprice[i].options.selectedIndex].value : ((chgoptprice[i].tagName).toLowerCase() == 'input' && chgoptprice[i].checked == true ? chgoptprice[i].value : ''); if(optprice){ price = optprice.split('!@#'); if(price[1]){ var intype = (chgoptprice[i].tagName).toLowerCase(); if(intype == 'select'){ var optstatus = $(chgoptprice[i].options[chgoptprice[i].options.selectedIndex]).attr('optstatus'); }else if(intype == 'input'){ if(chgoptprice[i].checked == true){ var optstatus = $(chgoptprice[i]).attr('optstatus'); } } if(optstatus == '2' || optstatus == '4'){ parent.dyn_alert(flang_part_javascript[35004]); if(intype == 'select'){ $("[name='chgoptprice\\[\\]']").eq(i).find("option:eq(0)").attr("selected" , "selected") }else if(intype == 'input'){ $(chgoptprice[i]).attr("checked" , false) } return; } retdata += parseFloat(price[1]); chg_addprice += parseFloat(price[1]); } } } } if(getid('vls_stockoptprice') != null) retdata += parseFloat(getid('vls_stockoptprice').value ? getid('vls_stockoptprice').value : 0); var addprice = parseFloat(retdata - ( frm.pricestruc.value == '1' || frm.pricestruc.value == '3' ? parseFloat(frm.sellprice.value) : retdata)); addprice *= qty; var p_retdata = 0; var txob = $(frm).find(".optionview").find(".txt_persellprice"); if(txob.length > 0){ var sump = 0; var p_sump = 0; txob.each(function(){ var opt_base_price = parseInt($(this).html().replace(/,/gi , '')); sump+= parseInt($(this).html().replace(/,/gi , '')); if( $("input[name='bridge_info']:checked").length > 0 ) { var opt_qty = $(this).closest('.tem_option_spot').find('.optordqty').val(); var opt1 = $(this).attr('opt1'); var opt4 = $(this).attr('opt4'); var tem_regex = /[^0-9]/g; var opt4 = opt4.replace(tem_regex,'') ? opt4.replace(tem_regex,'') : 1; var opt_price = $("input[name='bridge_info']:checked").attr(opt1); var opt_per_price = 0; if( opt_price && !isNaN(opt_price) ){ opt_per_price = ($("input[name='bridge_info']:checked").attr(opt1) * opt4) * opt_qty; p_sump += opt_per_price; } else { opt_per_price = Number($(this).attr('price')) * opt_qty; p_sump += opt_per_price; } if( opt_per_price > 0 && opt_base_price != opt_per_price ){ var per_html = '
'+ number_format(opt_per_price) +'
'; $(this).closest('.tem_option_spot').find('.opt_cadcam_sellprice').remove(); $(this).closest('.tem_option_spot').find('.opt_org_sellprice').addClass('opt_through'); $(this).parent().parent().append(per_html); } } }); retdata = sump; p_retdata = p_sump; } if( p_retdata > 0 ) { $('.goods_total').css({'margin-bottom':'0px'}) $('.goods_total span').css({'text-decoration':'line-through','color':'#ddd'}) $('.goods_total b').css({'text-decoration':'line-through','color':'#ddd'}) $('.goods_point_total').removeClass('displaynone'); $('#point_totalprice_low').text(number_format(p_retdata)); } else { $('.goods_total span').css({'text-decoration':'','color':''}) $('.goods_total b').css({'text-decoration':'none','color':'unset'}) $('.goods_point_total').addClass('displaynone'); } if(getid('txt_totaladdprice') != null && addprice >= 0){ getid('txt_totaladdprice').innerHTML = number_format(addprice); if(addprice > 0) { getid('spot_txt_area').style.display = 'none'; getid('spot_txt_totaladdprice').style.display = ''; }else{ getid('spot_txt_area').style.display = 'none'; getid('spot_txt_totaladdprice').style.display = 'none'; } } if(getid('vls_stockoptprice') != null && parseFloat(getid('vls_stockoptprice').value) >= 0){ getid('txt_stockopttransprice').innerHTML = number_format(getid('txt_stockopttransprice').value); if(parseFloat(getid('vls_stockoptprice').value) > 0) { getid('spot_txt_area').style.display = 'none'; getid('txt_stockopttransprice').style.display = ''; }else{ getid('spot_txt_area').style.display = 'none'; getid('txt_stockopttransprice').style.display = 'none'; } } try{ }catch(e){} if( $('.optionview').is(':visible') == false ){ retdata -= addprice; } var dev_retdata = txob.length > 0 ? retdata : retdata * qty; if( txob.length == 0 && typeof(frm.directdiscount) != 'undefined' ) { dev_retdata -= (frm.directdiscount.value * qty); } if( typeof(getid('single_ord_price')) != 'undefined' ){ getid('single_ord_price').innerHTML = number_format(dev_retdata); } if(typeof(_mgrade) != 'undefined'){ try{ var gradeperc = gradediscount = 0; if(_mgrade.is_gdiscount == 1 && !in_array('2' , _mgrade.skipdiscount)){ if(_mgrade.gdiscountunit != 'p'){ if(txob.length > 0){ txob.each(function(){ gradediscount+= parseFloat(_mgrade.gdiscount); }); gradeperc = parseFloat(_mgrade.gdiscount && dev_retdata > 0 ? _mgrade.gdiscount / dev_retdata * 100 : 0); }else{ gradediscount = parseFloat(_mgrade.gdiscount); gradeperc = parseFloat(_mgrade.gdiscount && dev_retdata > 0 ? _mgrade.gdiscount / dev_retdata * 100 : 0); } } else{//%단위 할인 gradediscount = dev_retdata * _mgrade.gdiscount / 100; gradeperc = _mgrade.gdiscount; } if(_mgrade.gdiscountlimit !='0' && _mgrade.gdiscountlimit < gradediscount){ gradediscount = _mgrade.gdiscountlimit; } gradediscount = dropfloor(gradediscount , 0); getid('txt_grpdiscount').innerHTML = number_format(parseInt(gradediscount)); getid('txt_grpdiscount_perc').innerHTML = _mgrade.gdiscountunit == 'p' ? parseFloat(gradeperc)+0 : number_format(parseInt(gradeperc)); getid('txt_totalbuyprice_low').innerHTML = number_format(parseInt(dev_retdata - gradediscount > 0 ? dev_retdata - gradediscount : 0)); } else{ getid('txt_totalbuyprice_low').innerHTML = number_format(dev_retdata); } }catch(e){ } } else if(getid('txt_totalbuyprice_low') != null){ getid('txt_totalbuyprice_low').innerHTML = number_format(dev_retdata); } if(getid('txt_save_wallet') != null && getid('txt_save_wallet_perc') != null){ var wallet_p = parseFloat(getid('txt_save_wallet_perc').innerHTML.replace(/,/gi , '')); getid('txt_save_wallet').innerHTML = number_format(dev_retdata > 0 ? parseInt(dev_retdata * wallet_p / 100) : 0); } else if(getid('txt_save_wallet') != null){ var wallet = parseInt(getid('txt_save_wallet').getAttribute('wallet_cash')); getid('txt_save_wallet').innerHTML = number_format(parseInt(wallet * qty)); } frm.totalprice.value = retdata; frm.chg_addprice.value = chg_addprice; if(prtdiv != null){ prtdiv.innerHTML = number_format(dropfloor(dev_retdata , 0)); } return dev_retdata; } function soldout_txt(e){ this.soldout_filter = function(o , optmapkey , pseq){ if( !pseq){ alert("옵션 에러"); return false; } var getStockamt = stockamt[pseq]; var getStockoptjson = stockoptjson[pseq]; var getOptmap = optmap[pseq]; var stockkey = getOptmap[optmapkey]; if( typeof(stockkey) != "undefined"){ $(".optradio[optvls='"+$(o).val()+"']").attr("disabled" , false); if( getStockoptjson[stockkey]['optdisprice'] > 0 && typeof(getStockoptjson[stockkey]['optdisprice']) != 'undefined' ) { $(o).html( $(o).html() + ' (옵션할인 : ' + getStockoptjson[stockkey]['optdisprice'] + '원)' ); } if( getStockamt[stockkey] < 1 || getStockoptjson[stockkey]['optstatus'] == '2'){ if( $(".optradio[optvls='"+$(o).val()+"']").length > 0){ $(".optradio[optvls='"+$(o).val()+"']").attr("disabled" , true); } $(o).html($(o).html() + flang_part_javascript['35003']).attr("disabled" , true);//css({"background" : "#cc0000" , "color" : "#f0f0f0"}). } if( getStockoptjson[stockkey]['optstatus'] == '3' ){ $(o)[0].setAttribute('del' , '1');//2018-02-12 김관노 추가 $('.optradio[optvls="'+$(o)[0].value+'"]').closest('.optimgdiv').css('display','none'); } else if( getStockoptjson[stockkey]['opt_view'] == 'n' ) { $(o).addClass('displaynone'); $('.select_stock').find("option[value='" + $(o).attr('value') + "']").addClass('displaynone'); } else if(getStockoptjson[stockkey]['optstatus'] == '4'){//일시품절 $(o).html( $(o).html() + flang_part_javascript['35044'] ).attr("disabled" , true);//css({"background" : "#cc0000" , "color" : "#f0f0f0"}). } } } this.recoveryHtml = function(o){ var sel = $(o).find('option:selected').val(); $(o).html($(o).data("ORGHTML")); $(o).find("option[value='" + sel + "']").attr("selected" , true); } this.stockoptpriceinfoV2 = function(optmapkey , pseq){ if(typeof(_vls_stockoptprice) == "undefined") _vls_stockoptprice = {}; if(typeof(_vls_stockopttransprice) == "undefined") _vls_stockopttransprice = {}; var getOptmap = optmap[pseq]; var getStockoptprice = stockoptprice[pseq]; var getStockopttransprice = stockopttransprice[pseq]; var getStockopttprice = stockopttprice[pseq]; var getStockoptdisprice = stockoptdisprice[pseq]; var stockkey = getOptmap[optmapkey]; var optPrice = parseFloat(getStockoptprice[stockkey] ? getStockoptprice[stockkey] : 0); var optTransPrice = parseFloat(getStockopttransprice[stockkey] ? getStockopttransprice[stockkey] : 0); if(getStockopttprice[stockkey] > 0) { optPrice = optPrice * getStockopttprice[stockkey]; } if( getStockoptdisprice !== null ){ if( getStockoptdisprice[stockkey] > 0 && typeof(getStockoptdisprice) != 'undefined' ) { if( getid('vls_stockoptdcprice') != null) getid('vls_stockoptdcprice').value = getStockoptdisprice[stockkey]; } } _vls_stockoptprice[pseq] = optPrice; _vls_stockopttransprice[pseq] = optTransPrice; var T_optPrice = 0; var T_optTransPrice = 0; for (var i in _vls_stockoptprice) { T_optPrice+=_vls_stockoptprice[i]; } for (var i in _vls_stockopttransprice) { T_optTransPrice+=_vls_stockopttransprice[i]; } if( $('.set_product_item_price[pseq='+pseq+']').length > 0 ) { let discount_range = $('.set_product_item_price[pseq='+pseq+']').attr('discount_range'); let discount_price = $('.set_product_item_price[pseq='+pseq+']').attr('discount_price'); if( discount_range == 1 ) { T_optPrice = T_optPrice - (T_optPrice * ( discount_price/100) ) } } if( getid('vls_stockoptprice') != null) getid('vls_stockoptprice').value = T_optPrice; if( getid('vls_stockopttransprice') != null) getid('vls_stockopttransprice').value = T_optTransPrice; if( getid('txt_stockoptprice') != null) getid('txt_stockoptprice').innerHTML = number_format(T_optPrice); if( getid('txt_stockopttransprice') != null) getid('txt_stockopttransprice').innerHTML = number_format(T_optTransPrice); } if(typeof(e) == "undefined"){ var parent_ob = document.writefrm; }else{ var parent_ob = $(e).closest(".options").length > 0 ? $(e).closest(".options") : document.writefrm; } $(parent_ob).find("[name='optstock1'] , [name='optstock2'] , [name='optstock3'], [name='optstock4']").each(function(){ if( !$(this).data("ORGHTML")){ var tmp = 0; $(this).find("option").each(function(i){$(this).attr("ix" , i);tmp++;}); $(this).data("OrgOptLength" , tmp); $(this).data("ORGHTML" , $(this).html()); } }); var pStockObject = new product_StockOpt(parent_ob); var _this = this; var optInfo= {}; var checkOpt = {}; var stock1s = pStockObject.getStokc1Opts(); stock1s.each(function(){ optInfo = pStockObject.getRelationStockOpt($(this)); if(optInfo.check_stock_num == 4) _this.recoveryHtml(optInfo.stock4); else if(optInfo.check_stock_num == 3) _this.recoveryHtml(optInfo.stock3); else if(optInfo.check_stock_num == 2) _this.recoveryHtml(optInfo.stock2); else if(optInfo.check_stock_num == 1) _this.recoveryHtml(optInfo.stock1); checkOptInfo = pStockObject.getCheckOpt(optInfo); $(checkOptInfo.stockOb).find("option").each(function(i){ _this.soldout_filter($(this) , checkOptInfo.optmapkey[i] , optInfo.pseq); }); $(".optradio[optvls='"+$(checkOptInfo.stockOb).find("option[del=1]").val()+"']").closest("ul.optimgdiv").hide(); $(checkOptInfo.stockOb).find("option[del=1]").remove();//2018-02-12 김관노 추가 var selOptMapKey = optInfo.optstock1_selindex + optInfo.optstock2_selindex + optInfo.optstock3_selindex + optInfo.optstock4_selindex; _this.stockoptpriceinfoV2(selOptMapKey , optInfo.pseq); }); return true; } function stockoptpriceinfo(prtprice , prttransprice , vls_price , vls_transprice){ return false; if(typeof(frm) == 'undefined') frm = document.writefrm; var optstock1 = getid('optstock1') != null ? getid('optstock1') : ''; var optstock2 = getid('optstock2') != null ? getid('optstock2') : ''; var optstock3 = getid('optstock3') != null ? getid('optstock3') : ''; var key = 1; var seloptstock1 , seloptstock2 , seloptstock3 = '';q var optstock1_selindex = getid('optstock1') != null && optstock1.options.selectedIndex != 0 ? optstock1.options.selectedIndex : ''; var optstock2_selindex = getid('optstock2') != null && optstock2.options.selectedIndex != 0 ? optstock2.options.selectedIndex : ''; var optstock3_selindex = getid('optstock3') != null && optstock3.options.selectedIndex != 0 ? optstock3.options.selectedIndex : ''; var key = '' , stockkey = ''; if(optstock3){ optchknum_map = optmap; stockkey = optstock1.options.selectedIndex.toString() + optstock2.options.selectedIndex.toString() + optstock3.options.selectedIndex.toString(); key = optchknum_map[stockkey]; } else if((optstock1 && optstock1.options.selectedIndex) && !optstock2){ key = optstock1.options.selectedIndex; }else if(optstock2 && (optstock1.options.selectedIndex && optstock2.options.selectedIndex)){ key = (optstock1.options.selectedIndex - 1) * (optstock2.options.length-1) + optstock2.options.selectedIndex; } if(prtprice != null) prtprice.innerHTML = number_format(stockoptprice[key] ? stockoptprice[key] : 0); if(prttransprice != null) prttransprice.innerHTML = number_format(stockopttransprice[key] ? stockopttransprice[key] : 0); if(vls_price != null) vls_price.value = stockoptprice[key] ? stockoptprice[key] : 0; if(vls_transprice != null) vls_transprice.value = stockopttransprice[key] ? stockopttransprice[key] : 0; return {'price' : stockoptprice[key] , 'transprice' : stockopttransprice[key]} } function frm_categorybox_summary(){ if(getid('category_box') != null){ var x = getid('category_box').options; var catinfo = new Array(); for(var i = 0 ; i < x.length ; ++i){ catinfo[i] = x[i].value.replace(/[\^]\![\^]/ , ''); } return "&category=" + catinfo.join('^!^'); } } function product_valuation_checkout(frm){ var editor = typeof frm.comments != 'undefined' ? frm.comments : frm.mainedit_text_0; if(!is_checked(getids('valuation'))){ dyn_alert(flang_part_javascript[35021]); return true; } else if(!frm.title.value){ dyn_alert(flang_part_javascript[35022]); return true; } else if(!editor.value){ dyn_alert(flang_part_javascript[35023]); return true; } } function product_qna_checkout(frm){ if(frm.w_type.options.selectedIndex == 0){ parent.dyn_alert("질문유형을 선택해 주십시요."); return true; } else if(!frm.qna_title.value){ parent.dyn_alert(flang_part_javascript[35029]); return true; } else if(!frm.mainedit_text_0.value){ parent.dyn_alert(flang_part_javascript[35030]); return true; } } function product_detail_cartoption_draw(items , o){ _jq(function($){ for(var i = 0 ; i < items.length ; i++){ var item = items[i]; var opt = []; var jopt = item.json_options || {}; var key = { 'pinid' : item.pinid, 'duplicateid' : item.duplicateid||'', 'product_seq' : item.product_seq }; $(jopt).each(function(i){ if(!this.nm || !this.vls) return; this.nm = this.nm.replace(new RegExp("<" , 'gi') , '<').replace(new RegExp(">" , 'gi') , '>'); this.vls = this.vls.replace(new RegExp("<" , 'gi') , '<').replace(new RegExp(">" , 'gi') , '>'); this.nm = strip_tags(this.nm); this.vls = strip_tags(this.vls); this.is_last = $(jopt).length == (i+1) ? true : false; opt.push(this.nm + ' : ' + this.vls + ''); }); key = $.toJSON != null ? $.toJSON(key) : key; var uniq = encodeURIComponent(key + opt.join('//')); var multi_chk = item.essen + "-" + item.multi_opttype; if($(".optinfo[uniq='" + uniq + "']").length > 0 || (item.multi_opttype == 1 && $(".optinfo[multi_chk='" + multi_chk + "']").length > 0)){ continue; } $(o).each(function(){ var ul = $(this); var adpoint = item.opttype == "def_opt" ? "f" : ($(ul).find("li[opttype='def_opt']").length == 0 ? "f" : false); item.uniq = uniq; item.multi_chk = multi_chk; if( item.duplicateid == 'gift' ) { item.json_options[0].vls = item.json_options[0].vls + ' (사은품)'; } item.selectopt = opt; item.adpoint = adpoint; item.gift = item.duplicateid == 'gift' ? 'y' : 'n'; item.number_totalprice = number_format((item.totalprice-item.dc_price) * item.ordqty); var clone = $("#option_bs_template"); var html = Mustache.to_html(clone.html() , item); if(item.opttype == "chg_opt" && $(ul).find("[opttype='def_opt']").length > 0){ var tmp = $(ul).find("[opttype='def_opt']").eq(0); tmp.after(html); }else{ $(ul).append(html); } if( item.duplicateid == 'gift' && item.ordqty < 1 ) { $(ul).children().eq($(ul).children().length-1).addClass('displaynone'); } }); }//end for getproductprice(getid('totalbuyprice') , frm);//합계재구성 var sel_opt_cnt = $(".options").find("[name='chgoptprice[]'] , [name='defopt[]']").filter("[certainflag=2]").length + $(".options").find(".set_product_item").length; if( $('.optstock4').length > 0 ) { $("[name='optstock4'], .select_stock").children("[value='']").attr("selected" , true); } else if( $('.optstock4').length == 0 && $('.optstock3').length > 0 ){ $("[name='optstock3'], .select_stock").children("[value='']").attr("selected" , true); } else if( $('.optstock3').length == 0 && $('.optstock2').length > 0 ) { $("[name='optstock2'], .select_stock").children("[value='']").attr("selected" , true); } else { $("[name='optstock1'] , [name='optstock2'] , [name='optstock3'] , [name='optstock4'], .select_stock").children("[value='']").attr("selected" , true); } $("select").filter("[name='defopt[]'] , [name='chgoptprice[]']").children("[value='']").attr("selected" , true); $("input[type=checkbox]").filter("[name='defopt[]'] , [name='chgoptprice[]']").attr("checked" , false); $("input[type=text]").filter("[name='defopt[]']").val(''); $('.set_n_opt').val('') }); } function setoptionbox(optnm , optckpass ){ optnm = optnm || '.options'; var opts = $(optnm).find(':input'); var optpass = optckpass == true ? true : ''; var is_set_product = typeof(frm.is_set_product) != "undefined" ? frm.is_set_product.value : ''; $(optnm).find(':input:not([type=hidden]):not([notdrawopt]):not([type=text]) , input[type=text]:last').each(function(){ if(typeof f == "undefined") var f = $(document.writefrm); if(typeof def_fs == "undefined") { if(is_set_product == 1){ var def_fs = f.find(":not('.optinfo'):not('[name=\"chgprice_optvls\\[\\]\"]'):not('[name=\"defopt_optnm\\[\\]\"]'):not('[name=\"defopt_optvls\\[\\]\"]'):not('[name=\"optstock1\"]'):not('[name=\"optstock2\"]')"); }else{ var def_fs = f.find(":not('.optinfo'):not('[name=\"chgprice_optvls\\[\\]\"]')"); } } if(typeof chg_fs == "undefined") var chg_fs = f.find(":not('.optinfo'):not('[name=\"optstock1\"]'):not('[name=\"optstock2\"]'):not('[name=\"defopt_optnm\\[\\]\"]')"); if(typeof optionview == "undefined"){ var optionview = $('.optionview'); var basic_opt_text = optionview.children("ul").children(".txt"); } $(this).change(function(){ var set_gift = 'n'; var m_gift_qty = 0; if( $('#is_set_product').val() == '1' ) { var current_ordqty = 0; $('.optordqty').each(function(idx,ele){ if( !isNaN($(ele).val()) ) { current_ordqty += Number($(ele).val()); } }) if( current_ordqty > _max_ordqty && _max_ordqty != 0 ) { dyn_alert('최대구매수량을 초과하였습니다.'); $('.optstock').each(function(idx,ele){ $(ele).val(''); }) return false; } var m_seq = $(this).attr('pseq'); var m_max_qty = $(this).attr('max_qty'); m_gift_qty = $(this).attr('gift_qty'); var m_min_qty = $(this).attr('min_qty'); var m_qty = 0; $('.optinfo[seq='+m_seq+']').each(function(idx,item){ m_qty += parseInt($(item).closest('li').find('.tem_option_wrap').find('input#optordqty\\[\\]').val()); }) if( m_gift_qty > 0 ){ set_gift = 'y'; var set_gift_qty = Math.floor( m_min_qty/m_gift_qty); } if( m_max_qty <= m_qty && m_max_qty != 0 ) { dyn_alert('최대구매수량을 초과하였습니다.'); $('.optstock').each(function(idx,ele){ $(ele).val(''); }) return false; } } var attrclass = $(this).attr("class"); if(attrclass != undefined){ if(attrclass.match(/set_product_item/)){ var pseq = $(this).attr("pseq"); produt_opt_active_swap(pseq , $(this).val() == '' ? false : true); soldout_txt(); getproductprice(getid('totalbuyprice') , frm);//합계재구성 } } var tot_item = [];//2015-07-15 추가 var check_opt = new in_cartsubmitcheck(f[0]).checkout(optpass , $(this)); if( check_opt ){ if ( typeof(check_opt) != 'object' ){ dyn_alert("필수사항을 확인해 주세요."); } return false; } var parents = $(this).closest("#options_wing_spot").length > 0 ? $("#options_wing_spot") : f ; var d = {'def' :{} , 'chgprice' : {} , 'defopt' : {} , 'optstock' : {}}; var data = []; var chg_data = []; var chgpricen = $(parents).find(getids('chgprice_optnm[]')); var chgpricev = $(parents).find(getids('chgprice_optvls[]')); var chgpricec = $(parents).find(getids('chgprice_certainflag[]')); $(chgpricev).each(function(i){ if($(this).val()){ var x = $(this).val().split('^!^'); var chgprice_opttype = $(this).attr("opttype"); $(x).each(function(j){ var v = x[j].split('!@#'); d['chgprice'][i] = { 'nm' : $(chgpricen[i]).val().replace(new RegExp("<" , 'gi') , '<').replace(new RegExp(">" , 'gi') , '>'), 'vls' : v[1] + '(+' + number_format(v[2]) + ')', 'price' : v[2] , 'chgprice_optvls' : x[j] , 'chgprice_optvls_key' : i , 'chgprice_essen' : v[3] , 'chgprice_multi_opttype' : chgprice_opttype , 'certainflag' : $(chgpricec[i]).val() } chg_data.push(d['chgprice'][i]); }); } }); var ProductOpts = []; var set_product_item_prices = $(".set_product_item_price"); var set_product_items = $(".set_product_item"); var optstock1 = $(parents).find("[name='optstock1']"); $(optstock1).each(function(){ var set_item_info = $(set_product_items).filter("[pseq=" + $(this).attr("pseq") + "]"); if(is_set_product){ if(set_item_info.length > 0 && set_item_info.find("option:selected").val() == ''){ return true; } } var v = $(this).val().split('^!^'); if( typeof(v[1]) == "undefined") return true;; var vv = (v[1]).split('!@#'); d['optstock'][0] = {}; d['optstock'][0].nm = (v[0]).replace(new RegExp("<" , 'gi') , '<').replace(new RegExp(">" , 'gi') , '>'); d['optstock'][0].vls = vv[1]; if(is_set_product){ d['optstock'][0].pseq = $(this).attr('pseq'); d['optstock'][0].max_qty = $(this).attr('max_qty'); } data.push(d['optstock'][0]); ProductOpts.push({name : 'optstock1[' + $(this).attr("pseq") + ']' , value : $(this).val() }); }); var optstock2 = $(parents).find("[name='optstock2']"); $(optstock2).each(function(){ if(is_set_product){ var set_item_info = $(set_product_items).filter("[pseq=" + $(this).attr("pseq") + "]"); if(set_item_info.length > 0 && set_item_info.find("option:selected").val() == ''){ return true; } } var v = $(this).val().split('^!^'); if( typeof(v[1]) == "undefined") return true;; var vv = (v[1]).split('!@#'); d['optstock'][1] = {}; d['optstock'][1].nm = (v[0]).replace(new RegExp("<" , 'gi') , '<').replace(new RegExp(">" , 'gi') , '>'); d['optstock'][1].vls = vv[1]; if(is_set_product){ d['optstock'][1].pseq = $(this).attr('pseq'); d['optstock'][1].max_qty = $(this).attr('max_qty'); } data.push(d['optstock'][1]); ProductOpts.push({name : 'optstock2[' + $(this).attr("pseq") + ']' , value : $(this).val() }); }); var optstock3 = $(parents).find("[name='optstock3']"); $(optstock3).each(function(){ if(is_set_product){ var set_item_info = $(set_product_items).filter("[pseq=" + $(this).attr("pseq") + "]"); if(set_item_info.length > 0 && set_item_info.find("option:selected").val() == ''){ return true; } } var v = $(this).val().split('^!^'); if( typeof(v[1]) == "undefined") return true;; var vv = (v[1]).split('!@#'); d['optstock'][2] = {}; d['optstock'][2].nm = (v[0]).replace(new RegExp("<" , 'gi') , '<').replace(new RegExp(">" , 'gi') , '>'); d['optstock'][2].vls = vv[1]; if(is_set_product){ d['optstock'][2].pseq = $(this).attr('pseq'); } data.push(d['optstock'][2]); ProductOpts.push({name : 'optstock3[' + $(this).attr("pseq") + ']' , value : $(this).val() }); }); var optstock4 = $(parents).find("[name='optstock4']"); $(optstock4).each(function(){ if(is_set_product){ var set_item_info = $(set_product_items).filter("[pseq=" + $(this).attr("pseq") + "]"); if(set_item_info.length > 0 && set_item_info.find("option:selected").val() == ''){ return true; } } var v = $(this).val().split('^!^'); if( typeof(v[1]) == "undefined") return true;; var vv = (v[1]).split('!@#'); d['optstock'][3] = {}; d['optstock'][3].nm = (v[0]).replace(new RegExp("<" , 'gi') , '<').replace(new RegExp(">" , 'gi') , '>'); d['optstock'][3].vls = vv[1]; if(is_set_product){ d['optstock'][3].pseq = $(this).attr('pseq'); } data.push(d['optstock'][3]); ProductOpts.push({name : 'optstock4[' + $(this).attr("pseq") + ']' , value : $(this).val() }); }); var defoptn = $(parents).find(getids('defopt_optnm[]')); var defoptv = $(parents).find(getids('defopt_optvls[]'));//2018-08-29 변경 $(defoptv).each(function(i){ var tmp = $(this).val().split("^!^"); for(var k = 0 ; k < tmp.length; k++){ var v = tmp[k].split('!@#'); if(v[0]){ var nm = $(defoptn[i]).val().replace(new RegExp("<" , 'gi') , '<').replace(new RegExp(">" , 'gi') , '>'); d['defopt'][k] = { 'nm' : nm, 'vls' : v[0] } data.push(d['defopt'][k]); ProductOpts.push({name : 'defopt_optnm[' + $(this).attr("pseq") + '][' + i + ']' , value : nm }); ProductOpts.push({name : 'defopt_optvls[' + $(this).attr("pseq") + '][' + i + ']' , value : tmp[k] }); } } }); if(is_set_product == 1){ $(set_product_item_prices).each(function(){ var mypseq = $(this).attr("pseq"); var a = $(".optstock1").filter("[pseq=" + mypseq +"]").length; var b = $(".optstock2").filter("[pseq=" + mypseq +"]").length; var c = $("[name='defopt[]']").filter("[pseq='" + mypseq + "']").length; if( (a+b+c) == 0){ if( $(this).attr("is_required") == 2){ var set_item_info = $(set_product_items).filter("[pseq=" + mypseq + "]"); if( set_item_info.find("option:selected").val()){ data.push({nm : '상품명' , vls : decodeURIComponent($(this).attr("pnm")), pseq :mypseq, max_qty : $(set_item_info).attr("max_qty") }); } }else{ data.push({nm : '상품명' , vls : decodeURIComponent($(this).attr("pnm")), pseq :mypseq, max_qty : $(set_item_info).attr("max_qty") }); } } }); } if($(f)[0].pricestruc.value == 3 && optstock1.length == 0 && defoptn.length == 0){ d["def"][0] = { "nm" : $(f)[0].productnm.value, "vls" : "본품" } data.push(d["def"][0]); } if(data.length > 0){ if(is_set_product == 1){ var sa = get_setproduct_price(); }else{ var sa = parseFloat(f.find('#sellprice').length > 0 ? f.find('#sellprice').val() : 0); } var sb = parseFloat(getid('vls_stockoptprice') != null ? parseFloat(getid('vls_stockoptprice').value) : 0); var sc = parseFloat(getid('is_apply_directdiscount') != null && getid('is_apply_directdiscount').value ? parseFloat(getid('directdiscount').value) : 0); var sd = parseFloat(getid('vls_stockoptdcprice') != null ? parseFloat(getid('vls_stockoptdcprice').value) : 0); var def_totprice = sa + sb; def_totprice = isNaN(def_totprice) ? 0 : def_totprice; var fs = def_fs.serializeArray(); let set_fs = def_fs.serializeArray(); for(var i=0 ; i < fs.length ; i++){ if(fs[i].name == "totalprice") fs[i].value = def_totprice; if(fs[i].name == "optstock1") fs[i].value = $(parents).find("[name='optstock1']").val(); if(fs[i].name == "optstock2") fs[i].value = $(parents).find("[name='optstock2']").val(); } for(var i=0 ; i < set_fs.length ; i++){ if(set_fs[i].name == "totalprice") set_fs[i].value = 0; if(set_fs[i].name == "optstock1") set_fs[i].value = $(parents).find("[name='optstock1']").val(); if(set_fs[i].name == "optstock2") set_fs[i].value = $(parents).find("[name='optstock2']").val(); } fs.push({"name" : "cart_pricestruc" , "value" : "1"}); set_fs.push({"name" : "cart_pricestruc" , "value" : "1"}); if(is_set_product == 1){ for(var i = 0 ; i < ProductOpts.length; i++){ fs.push(ProductOpts[i]); set_fs.push(ProductOpts[i]); } } var ordqty = f.find('#ordqty').val(); var optchknum = 0; if(is_set_product == 1){ optchknum = $(this).find('option').index($(this).find('option:selected')) ? $(this).find('option').index($(this).find('option:selected')) : 0; ordqty = m_min_qty; } var item = { 'pinid' : f.find('#pinid').val(), 'duplicateid' : '', 'product_seq' : f.find('#seq').val(), 'opttype' : 'def_opt', 'ordqty' : ordqty, 'gift_qty' : m_gift_qty, 'optchknum' : optchknum, 'totalprice' : def_totprice, 'dc_price' : sd, 'opt1' : $("#optstock1 option:checked").text(), 'opt4' : $("#optstock4 option:checked").text(), 'json_options' : data, 'certainflag' : "1", 'all' : $.param(fs) }; if(is_set_product == 1){ item.seq = data[0].pseq; item.max_qty = data[0].max_qty; } basic_opt_text.addClass('displaynone'); optionview.removeClass('displaynone'); tot_item.push(item); if( set_gift == 'y' ) { var gift_data = data; set_fs.push({name:'gift',value:'y'}); var item = { 'pinid' : f.find('#pinid').val(), 'duplicateid' : 'gift', 'product_seq' : f.find('#seq').val(), 'opttype' : 'def_opt', 'ordqty' : set_gift_qty, 'totalprice' : '0', 'dc_price' : '0', 'optchknum' : optchknum, 'opt1' : $("#optstock1 option:checked").text(), 'opt4' : $("#optstock4 option:checked").text(), 'json_options' : gift_data, 'certainflag' : "1", 'all' : $.param(set_fs) }; item.seq = gift_data[0].pseq; tot_item.push(item); } } if(chg_data.length > 0){ $(chg_data).each(function(j){ var fs = chg_fs.serializeArray(); var tmp_chgprice_optvls_key = 0; for(var i=0 ; i < fs.length ; i++){ if(fs[i].name == "totalprice") fs[i].value = chg_data[j].price; else if(fs[i].name =="chgprice_optvls[]"){ if(chg_data[j].chgprice_optvls_key == tmp_chgprice_optvls_key) fs[i].value = chg_data[j].chgprice_optvls; else fs[i].value = ""; tmp_chgprice_optvls_key++; } } fs.push({"name" : "cart_pricestruc" , "value" : "2"}); var item = { 'pinid' : f.find('#pinid').val(), 'duplicateid' : '', 'product_seq' : f.find('#seq').val(), 'opttype' : 'chg_opt', 'ordqty' : f.find('#ordqty').val(), 'essen' : chg_data[j].chgprice_essen , 'multi_opttype' : chg_data[j].chgprice_multi_opttype, 'totalprice' : chg_data[j].price, 'dc_price' : '0', 'json_options' : [chg_data[j]], 'certainflag' : $(f)[0].pricestruc.value != "2" ? chg_data[j].certainflag : "2", 'all' : $.param(fs) }; basic_opt_text.addClass('displaynone'); optionview.removeClass('displaynone'); tot_item.push(item); });//end each }; if( tot_item.length > 0 ){ $('.spot_ordqty').hide(); } product_detail_cartoption_draw(tot_item , $('.optionview').children("ul")); }); }); $(document).on('click' , 'button.btn_reloadopt' , function(){ var optnm = $(this).attr('optspot') || '.options'; $(optnm).find(':input:not([type=hidden]):not([notdrawopt]):not([type=text]) , input[type=text]:last').eq(0).data('reload' , true).change().data('reload' , null); }); } function colorchipinit(s){ if(s.flag == 1){ var o = $('.stockoption_colorchip'); $.each(s.data , function(k){ var oo = o.eq(k); $(oo).removeClass('displaynone').data('optionpos' , parseInt(k)).find('.tit').html($('.stockoption').eq(k).addClass('displaynone').find('.tit').html()); var c = '
'; var len = $('.optstock').eq(k).children().length; $(this).each(function(xx){ if(len-1 <= xx) return; switch(this.chiptype){ case 'file': c += "
"; break; case 'color': c += "
"; break; } }); c += '
'; $(oo).find('.items').html(c).find('ul > li').addClass('floatleft'); $(oo).find('.items dl > dd').mouseover(function(){ $(this).children().css('border' , '3px #a0a0a0 solid'); }).mouseleave(function(){ var kk = $(this).parents('dl').children().index(this)+1; var j = $('.optstock').eq(($(this).parents("#stockoption_colorchip").data('optionpos')))[0].options.selectedIndex; if(kk != j) $(this).children().css('border' , '3px transparent solid'); }).click(function(){ var oo = $(this).parents(".stockoption_colorchip"); var k = $(this).parents('dl').children().index(this)+1; $(oo).find('.itemnm').html($(this).attr('title')); $('.optstock').eq($(this).parents("#stockoption_colorchip").data('optionpos')).children().eq(k).attr('selected' , 'selected').change(); $(oo).find('.items dl > dd').children().css('border' , '3px transparent solid'); $(this).children().css('border' , '3px #a0a0a0 solid'); }); }); } } function cartoption_btn_action(up , down , del , bs_ordqty){ bs_ordqty = bs_ordqty || 1; bs_qtyunit = _bs_qtyunit || 1; _jq(function($){ $(up).unbind('click').live('click' , function(){ var indexs = get_length(up , this); $(".optionview").find(up).each(function(ix){ if(indexs.indexOf(ix) < 0 ){ return true; } var qty_alert = 0; if( $('#is_set_product').val() == '1' ) { var m_seq = $(this).closest('li').find('.optinfo').attr('seq'); var m_optchknum = $(this).closest('li').find('.optinfo').attr('optchknum'); var m_max_qty = $(this).closest('li').find('.optinfo').attr('max_qty'); var m_qty = 0; var is_gift = $(this).closest('li').find('.optinfo').attr('gift'); if( is_gift == 'y' ) { dyn_alert('사은품은 수량변경이 안됩니다.'); return true; } $('.optinfo[seq='+m_seq+']').each(function(idx,item){ m_qty += parseInt($(item).closest('li').find('.tem_option_wrap').find('input#optordqty\\[\\]').val()); }) if( m_max_qty <= m_qty && m_max_qty != 0 ) { qty_alert = 1; } } var qty = $(this).closest(".tem_option_wrap").find('input#optordqty\\[\\]'); if( qty_alert != 0 ) { dyn_alert('입력하신 수량이 최대구매수량을 초과하여
구매가능한 수량으로 자동조정되었습니다.'); qty.val(qty.val()); return true; } var unit = parseInt(bs_ordqty); qty.val(parseInt(qty.val())+bs_qtyunit)[0].defaultValue = qty.val(); var pspot = $(this).closest("[opttype]"); if( $(pspot).attr('opttype') != 'chg_opt'){ if( parseInt(_max_ordqty) > 0){ if( parseInt(qty.val()) > parseInt(_max_ordqty)){ dyn_alert('입력하신 수량이 최대구매수량('+_max_ordqty+'개)을 초과하여
구매가능한 수량으로 자동조정되었습니다.'); qty.val(_max_ordqty); } if( $('#is_set_product').val() == '1' ) { var current_ordqty = 0; $('.optordqty').each(function(idx,ele){ if( !isNaN($(ele).val()) ) { current_ordqty += Number($(ele).val()); } }) if( current_ordqty > _max_ordqty ) { dyn_alert('입력하신 수량이 최대구매수량('+_max_ordqty+'개)을 초과하여
구매가능한 수량으로 자동조정되었습니다.'); qty.val(qty.val()-1); } } } } var gift_qty = $(this).closest('li').find('.optinfo').attr('gift_qty'); if( is_gift == 'n' && gift_qty > 0 ) { var gift = Math.floor(qty.val()/gift_qty); if( gift > 0 ) { $('.optinfo[seq='+m_seq+'][gift=y][optchknum='+m_optchknum+']').parent().removeClass('displaynone'); } $('.optinfo[seq='+m_seq+'][gift=y][optchknum='+m_optchknum+']').siblings('.tem_option_wrap').find('input#optordqty\\[\\]').val(gift); } $(".optionview").find('div.txt_persellprice:eq(' + ix + ')').html(number_format(($(".optionview").find('div.txt_persellprice:eq(' + ix + ')').attr('price') - $(".optionview").find('div.txt_persellprice:eq(' + ix + ')').attr('dc_price')) * qty.val())); }); getproductprice(getid('totalbuyprice') , frm);//합계재구성 }); $(down).unbind('click').live('click' , function(){ var indexs = get_length(down , this); $(".optionview").find(down).each(function(ix){ if(indexs.indexOf(ix) < 0 ){ return true; } var is_gift = $(this).closest('li').find('.optinfo').attr('gift'); if( is_gift == 'y' ) { dyn_alert('사은품은 수량변경이 안됩니다.'); return true; } var qty = $(this).closest(".tem_option_wrap").find('input#optordqty\\[\\]'); var unit = parseInt(bs_ordqty); qty.val(qty.val()-unit > 1 ? qty.val()-bs_qtyunit : unit)[0].defaultValue = qty.val(); var m_seq = $(this).closest('li').find('.optinfo').attr('seq'); var gift_qty = $(this).closest('li').find('.optinfo').attr('gift_qty'); if( is_gift == 'n' && gift_qty > 0 ) { var gift = Math.floor(qty.val()/gift_qty); if( gift == 0 ) { dyn_alert('최소구매수량 아래로 구매가 불가능합니다'); qty.val(parseInt(qty.val())+1); return true; } $('.optinfo[seq='+m_seq+'][gift=y]').siblings('.tem_option_wrap').find('input#optordqty\\[\\]').val(gift); } $(".optionview").find('div.txt_persellprice:eq(' + ix + ')').html(number_format(($(".optionview").find('div.txt_persellprice:eq(' + ix + ')').attr('price') - $(".optionview").find('div.txt_persellprice:eq(' + ix + ')').attr('dc_price')) * qty.val())); }); getproductprice(getid('totalbuyprice') , frm);//합계재구성 }); $(del).unbind('click').live('click' , function(){ var indexs = get_length(del , this); $(".optionview").find(del).each(function(ix){ if(indexs.indexOf(ix) < 0 ){ return true; } var is_gift = $(this).closest('li').find('.optinfo').attr('gift'); if( is_gift == 'y' ) { } var pspot = $(this).closest("[opttype]"); if($(pspot).attr('certainflag') == '1' && $(pspot).attr('opttype') == 'chg_opt'){ dyn_alert('필수항목입니다'); return false; } var parents = $(this).closest(".optionview"); var def_opt = $(parents).find("[opttype='def_opt']"); var c = $(def_opt).eq(0); if( $(".optradio:checked").length > 0 ){ } pspot.attr("del_opt" , 1); if( $('#is_set_product').val() == '1' ) { var m_seq = $(this).closest('li').find('.optinfo').attr('seq'); var m_optchknum = $(this).closest('li').find('.optinfo').attr('optchknum'); $('.optinfo[seq='+m_seq+'][gift=y][optchknum='+m_optchknum+']').closest('[opttype]').attr("del_opt" , 1); } var cf = $(parents).find("[opttype='chg_opt']"); if($(c)[0] == $(pspot)[0]){ var def_opt = $(def_opt).filter(":not([del_opt])"); if(def_opt.length > 0){ if(cf.length > 0) def_opt.eq(0).after(cf); }else cf.remove(); } if($(parents).find("[opttype='chg_opt']").length == 0) $(parents).find("[name='chgoptprice\\[\\]'] option:eq(0)").attr("selected" , "selected") if( $(".optionview").find("li").length == 1 ){ $(".optionview").addClass("displaynone"); $("#spot_txt_area").addClass("displaynone"); $('.chgoptprice').val(''); if( $('.spot_ordqty').attr('viewctrl') != 1 ){ $(".spot_ordqty").show(); } } }); $("[opttype]").filter("[del_opt]").remove(); getproductprice(getid('totalbuyprice') , frm);//합계재구성 }); function get_length(e , _this){ var ob = $(".optionview"); var totlen_wrap = ob.length; var element_len = ob.find(e).length; var event_idx = ob.find(e).index(_this); var avg = element_len / totlen_wrap; var index = []; if(event_idx <= (avg-1)){ index.push(event_idx , event_idx+avg); }else{ index.push(event_idx-avg , event_idx); } return index; } }) } function send(loadfile , t , addurl , frm){ frm = typeof(frm) == 'undefined' ? document.writefrm : frm; if(typeof(addurl) == 'undefined') addurl = ''; var isfile = is_readyupload(); frm.loadfile.value = loadfile; if(isfile == true && t != true){ frm.action = fcommon + "floadajax.php?upload=y&targetfrm=" + frm.id + "&resultexecutefunc=send('" + loadfile + "', true)"; frm.submit(); }else{ var category = frm_categorybox_summary(); var cartsubmitcheck = new in_cartsubmitcheck(frm); var x = _getparams(addurl); switch(loadfile){ case 'product_cart_proc': if($('.optionview > ul').children(":not('.txt')").length == 0){ $(".options").find(':input:not([type=hidden]):not([notdrawopt]):not(select) , select:not(:disabled)').last().change(); } if(typeof(x.skipcheckout) == 'undefined'){ var is = false; if(_jq(function($){ var is_optmodify = $('.optionview>ul').children(":not('.txt')").length > 0 ? true : false; var rcode = ''; $('input.optordqty').each(function(){ if($(this).attr('init') != $(this).val()){ is_optmodify = true; } }); if( frm.is_set_product.value == 1 ) { $('.set_min').each(function(idx,ele){ if( $(this).val() > 0 ) { let m_qty = 0; let pseq = $(this).attr('pseq'); $('.optinfo[seq='+pseq+']').each(function(idx,item){ m_qty += parseInt($(item).closest('li').find('.tem_option_wrap').find('input#optordqty\\[\\]').val()); }); if( $(this).val() > m_qty ) { let set_product_nm = $('.set_product_item option[value='+pseq+']').text(); dyn_alert(set_product_nm + ' 상품의 최소 구매 수량을 확인해주세요'); is = true; return false; } } }); if( is == true ) return; } if(frm.is_set_product.value == 1) is_optmodify = true; if(is_optmodify && (getid('is_option').value || frm.is_set_product.value == 1) && typeof(x.act) == "undefined"){ send('product_cart_multi_proc' , '' , addurl + "&act=1"); is = true; return; } else { if(cartsubmitcheck.checkout()){ is = true; return; } } })){}; } else is = false; if(is == true) return; break; case "product_cart_multi_proc": var seq = getids('selector[]'); var str = ''; var is = 0; for(var i = 0 ; i < seq.length; ++i){ if(seq[i].checked)is++; str += seq[i].checked == true ? '&selector[]=' + seq[i].value :''; } if(!is && typeof(x.act) == "undefined"){ dyn_alert('제품을 선택해 주십시요.'); return false; }else if(x.act == "1"){ if($(".optinfo").length== 1){ if(cartsubmitcheck.checkout() == true){ return false; } } } break; case "product_coordinate_cart_proc": if(cartsubmitcheck.checkout() == true){ return false; } break; case 'product_valuation': editortrans(); var frm = document.popwritefrm ? document.popwritefrm : document.writefrm; if(product_valuation_checkout(frm)){ return; } break; case 'product_qna': editortrans(); if(product_qna_checkout(document.writefrm)){ return; } break; } if(getid('loadingbuff') == null) buffimg(); var params = form2urlquerystring(frm) + '&' + addurl + (typeof(category) != 'undefined' ? category : ''); if(str) params = params + str; new Ajax.Request( fcommon + 'floadajax.php' , {parameters : params , method : 'post' , onComplete : function(rt){ try{ var getdata = rt.responseXML; var resultcode_block = getdata.getElementsByTagName("resultcode"); var resultcode = resultcode_block[0].childNodes[0].nodeValue; var exp_params = _getparams(params); try{ var jsitem_block = getdata.getElementsByTagName("jsitem"); if(jsitem_block.length > 0) var jsitem = json_decode(jsitem_block[0].childNodes[0].nodeValue); }catch(e){} switch(loadfile){ case 'product_cart_proc': if(typeof(exp_params['ncheckout']) != 'undefined' && exp_params['ncheckout']){ if(resultcode == '90005' || resultcode == '35034' || resultcode == '91005'){ try{ submitframe.location.href = ncheckurl + 'ordersend'; return; }catch(e){}; } else { parent.dyn_alert(flang_part_javascript[resultcode]); } } else { if(resultcode == '90005'){ if(typeof(exp_params['notredirect']) == 'undefined'){ resultcode_block = getdata.getElementsByTagName("redirect"); var redirect = resultcode_block[0].childNodes[0].nodeValue; parent.location.href = redirect ? redirect : 'product_cart.php'; } else{ parent.dyn_confirm(flang_part_javascript['35036'] , 'parent.location.href = \'' + front +'product/product_cart.php\';(1' , 'parent.ovl.action(\'true\'); parent.$(\'.btn_optclose\').click(); cancel_confirm(' , true); } } else parent.dyn_alert(flang_part_javascript[resultcode]); } break; case 'product_cart_multi_proc': if(typeof(exp_params['ncheckout']) != 'undefined' && exp_params['ncheckout'] && (resultcode == '90005' || resultcode == '91005')){ try{ submitframe.location.href = ncheckurl + 'ordersend'; return; }catch(e){}; }else{ var resultArray = ['35048', '35049', '35060', '35050', '35051', '35062', '35061']; if(resultcode == '90005'){ parent.dyn_confirm(flang_part_javascript['35036'] , 'location.href = \'' + front +'product/product_cart.php\';(1' , 'parent.ovl.action(\'true\'); parent.$(\'.btn_optclose\').click(); cancel_confirm(' , true); } else if(resultcode == '91005'){ resultcode_block = getdata.getElementsByTagName("redirect"); var redirect = resultcode_block[0].childNodes[0].nodeValue; location.href = redirect; } else if( resultArray.indexOf(resultcode) != -1 ){ parent.dyn_alert(flang_part_javascript[resultcode]); return false; } else{ try{ var result_block = getdata.getElementsByTagName("resultmessage"); var resultmessage = result_block[0].childNodes[0].nodeValue; if(typeof resultmessage != 'undefined'){ dyn_alert(resultmessage); if(resultcode == '90001'){ parent.location.href = front + "order/order_form.php"; return false; }else{ parent.location.href = front + "product/product_cart.php"; return false; } }else{ parent.dyn_alert(flang_part_javascript[resultcode]); } }catch(e){ parent.dyn_alert(flang_part_javascript[resultcode]); }; } } break; case 'product_valuation': if(resultcode == '90008'){ parent.getpagedata(1 , '&loadfile=product_valuation_list_paging' , true , top.document.valuationfrm); parent.popovl.action(true); } parent.dyn_alert(flang_part_javascript[resultcode]); break; case 'product_recommendation_proc': if( resultcode == '90005' ){ var result_block = getdata.getElementsByTagName("rdata"); var resultcnt = result_block[0].childNodes[0].nodeValue; if( $('.ico-rec').length > 0 || $('.rec').length > 0){ $('.ico-rec').addClass('on'); $('.ico-rec').text(resultcnt); getpagedata(1, '&loadfile=product_valuation_paginglist', true, document.listfrm); } else{ $('.btn-rec').addClass('on'); } } dyn_alert(flang_part_javascript[resultcode]); break; case 'product_qna': if(resultcode == '90009'){ parent.getpagedata(1 , '&loadfile=product_qna_list_paging' , true , top.document.qnafrm , 'paging_datalist_q'); parent.ovl.action(true); } parent.dyn_alert(flang_part_javascript[resultcode]); break; case 'product_callbacksmsincome_proc': case 'product_wishlist_proc': if(loadfile == 'product_wishlist_proc' && exp_params['ncheckout_wish']){ if(resultcode == '90006'){ try{ var wncheck = window.open(ncheckurl + 'wishlist' , '_ncheckout_wish'); return; }catch(e){}; } else { var wncheck = window.open('about:blank', '_ncheckout_wish'); wncheck.close(); parent.dyn_alert(flang_part_javascript[resultcode]); } } else { if(resultcode == 90006){ if($('.btn-heart').length != 0) { $('.btn-heart').css('background',$('.btn-heart').css('background').replace('ico-heart', 'ico-heart_on')); } parent.dyn_confirm(flang_part_javascript['35035'] , 'parent.location.replace(\'' + front +'mypage/mypage_wishlist.php\'' , '' , true); } else if(resultcode == 90004){ if($('.btn-heart').length != 0) { $('.btn-heart').css('background',$('.btn-heart').css('background').replace('ico-heart_on', 'ico-heart')); } parent.dyn_alert(flang_part_javascript[resultcode]); } else{ parent.dyn_alert(flang_part_javascript[resultcode]); } } break; case "product_option_chk": if(resultcode == '90005' || resultcode == '90001'){ parent.location.href = front + "order/order_form.php"; }else{ var result_block = getdata.getElementsByTagName("resultmessage"); var resultmessage = result_block[0].childNodes[0].nodeValue; var resultArray = ['35048', '35049', '35060', '35050', '35051', '35062', '35061'] if( resultArray.includes(resultcode) ) { parent.location.href = front + "product/product_cart.php"; } return false; } break; case "minishop_proc": if(resultcode == '90002'){ dyn_alert(flang_part_javascript[resultcode]); setTimeout("location.reload();" , 1000); }else{ dyn_alert(flang_part_javascript[resultcode]); } break; case "product_plan_comment_proc": dyn_alert(flang_part_javascript[resultcode]); if(resultcode == 90005){ $(".comments").val(''); $(".comments_txtcnt").html('0'); $("#profile_img_upload").val(''); parent.location.reload(); } break; case "extra_exjoin": dyn_alert(flang_part_javascript[resultcode]); if( resultcode == '90001' ) $(".main_ques").hide(); break; } frm.loadfile.value = ''; }catch(e){ parent.dyn_alert(e.message); } }}); } } function basket_estimate(){ window.open("/front/product/product_estimate.php","basket_estimate","height=800,width=800,scrollbars=yes"); } function setcoordibtnqty(){ $('button.btn_bsqtyup').click(function(){ var seq = $(this).attr('seq'); var sellprice = parseInt($(".sellprice[seq='"+seq+"']").attr("sellprice")); var totsellprice = parseInt($(".totsellprice").attr("sellprice")); var k = $('button.btn_bsqtyup').index(this); var q = $('.input_ordqty').eq(k); var unit = parseInt(q.attr('bs_qtyunit')); var qty = parseInt(q.val()); var boqty = parseInt(q.attr('bs_ordqty')); q.val(q.val() == boqty && qty % unit != 0 ? unit : qty + unit)[0].defaultValue = q.val(); q.keyup(); $(".sellprice[seq='"+seq+"']").html(number_format(sellprice*(qty + unit))); totcoordi_calc(); }); $('button.btn_bsqtydown').click(function(){ var seq = $(this).attr('seq'); var sellprice = parseInt($(".sellprice[seq='"+seq+"']").attr("sellprice")); var totsellprice = parseInt($(".totsellprice").attr("sellprice")); var k = $('button.btn_bsqtydown').index(this); var q = $('.input_ordqty').eq(k); var boqty = parseInt(q.attr('bs_ordqty')); var unit = parseInt(q.attr('bs_qtyunit')); var qty = parseInt(q.val()); q.val(qty - unit > boqty ? qty - unit : boqty)[0].defaultValue = q.val(); q.keyup(); if(qty - unit >= boqty){ $(".sellprice[seq='"+seq+"']").html(number_format(sellprice*(qty - unit))); } totcoordi_calc(); }); } function totcoordi_calc(){ var totsellprice = 0; $(".sellprice").each(function(i){ var sellprice = $(".sellprice").eq(i).html().replace(/,/gi , ''); totsellprice += parseInt(sellprice); }); $(".totsellprice").html(number_format(totsellprice)); } function loginchk(type){ if(_revieinfo.is_set == '1'){ if(!_revieinfo.memid){ dyn_alert(flang_part_javascript['35038']); location.href=front+'member/member_login.php'; return false; } } switch(type){ case "ptreview": location.href=front+"board/board_write.php?tid=photoreview&product_seq="+_revieinfo.seq+"&pinid="+_revieinfo.pinid; return false; break; case "review": _popup('product_valuation_detail.php?product_seq='+_revieinfo.seq+"&pinid="+_revieinfo.pinid , 700 , 700 , true , undefined); return false; break; case "qna": _popup('product_qna_detail.php?product_seq='+_revieinfo.seq+"&pinid="+_revieinfo.pinid , 740 , 600 , true , undefined); return false; break; } } function getdenycode(obj , vlsobj){ vlsobj.value = ''; var params = 'loadfile=product_denyautoregist&objid=' + (typeof(obj.id) != 'undefined' ? obj.id : obj.name); var ajaxresult = new Ajax.Request(fcommon + 'floadajax.php' , { parameters : params , method : 'post' , onComplete : function(rt){ var getdata = rt.responseXML.getElementsByTagName("resultcode"); var resultcode = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("cryptdata"); var cryptdata = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("getkey"); var getkey = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("getkey_index"); var getkey_index = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("getregistkey"); var getregistkey = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("privatekey"); var privatekey = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("cryptseq"); var cryptseq = getdata[0].childNodes[0].nodeValue; var totstrcode = new String(getkey); var spanresult = new String(getkey_index); var enc_data = cryptdata; var retdata = strkey = spanresultdata = ""; for(var i = 0 ; i < totstrcode.length ; ++i){ spanresultdata = ""; for(var j = 0 ; j < spanresult.length ; ++j){ strkey = spanresult.substr(j , 1); if(i == strkey){ spanresultdata = "" + totstrcode.substr(i , 1) + ""; } } retdata += !spanresultdata ? totstrcode.substr(i , 1) : spanresultdata; } obj.innerHTML = " \n" + retdata; if(typeof(vlsobj) != 'undefined' && privatekey != 'null') vlsobj.value = privatekey; }}); } function directdc(prtdiv , frm){ if(getid('is_apply_directdiscount').value){ var qty = is_int(frm.ordqty.value) ? frm.ordqty.value : 1; var txob = $(".optionview").find(".txt_persellprice"); var retdata = 0; var directdiscountp = parseFloat(getid('directdiscount').value); var tmp_totalbuyprice = $('#totalbuyprice').html().replace(/,/gi , ''); if(tmp_totalbuyprice > 0){ if(tmp_totalbuyprice > directdiscountp){ retdata = tmp_totalbuyprice - directdiscountp; dyn_alert('정상적으로 적용되었습니다.'); $(".is_directdiscount").html(directdiscountp); if(prtdiv != null) prtdiv.innerHTML = number_format(dropfloor((txob.length > 0 ? retdata : retdata * qty) , 0)); frm.totalprice.value = retdata; }else{ dyn_alert('총상품금액이 할인액보다 클경우만 적용됩니다. '); return false; } } } } function send_valuation_comment(loadfile , seq){ if(getid('loadingbuff') == null) buffimg(); var frmnm = "valuationfrm"; var frm = getid(frmnm); frm.commentseq.value = ''; if($(".f_name"+seq).val() == ''){ dyn_alert(flang_part_javascript['30019']); return false; } if($(".f_pass"+seq).val() == ''){ dyn_alert(flang_part_javascript['30018']); $(".f_pass"+seq).focus(); return false; } if($(".comments"+seq).val() == ''){ dyn_alert(flang_part_javascript['30016']); $(".comments"+seq).focus(); return false; } if($(".valuation_privatekey"+seq).val() == ''){ dyn_alert(flang_part_javascript['37004']); $(".valuation_privatekey"+seq).focus(); return false; } frm.loadfile.value = loadfile; var params = form2urlquerystring(frm) + (typeof(url) != 'undefined' ? ("&" + url) : '') new Ajax.Request( fcommon + 'floadajax.php' , {parameters : params , method : 'post' , onComplete : function(rt){ var getdata = rt.responseXML; var resultcode_block = getdata.getElementsByTagName("resultcode"); var resultcode = resultcode_block[0].childNodes[0].nodeValue; switch(resultcode){ case "90005": dyn_alert(flang_part_javascript[resultcode]); get_valuation_comment('' , '' , '1'); frm.update_vseq.value = ''; break; default: dyn_alert(flang_part_javascript[resultcode]); break; } }}); } function comment_modify_input(key){ var tmp = $("#percommentdata"+key).html(); $(".write_cont").html(tmp); var frm = getid('valuationfrm'); frm.update_vseq.value = key; } function send_valuation_comment_delete(seq , url , list){ if(getid('loadingbuff') == null) buffimg(); var frmnm = list ? "commentfrm" : "valuationfrm" var frm = getid(frmnm); frm.commentseq.value = seq; frm.loadfile.value = "product_valuation_comment_delete"; var params = form2urlquerystring(frm) + (typeof(url) != 'undefined' ? ("&" + url) : '') new Ajax.Request( fcommon + 'floadajax.php' , {parameters : params , method : 'post' , onComplete : function(rt){ var getdata = rt.responseXML; var resultcode_block = getdata.getElementsByTagName("resultcode"); var resultcode = resultcode_block[0].childNodes[0].nodeValue; if(resultcode == '10000'){ parent.ovl.action(true); get_valuation_comment('' , 'delete' , '1'); } dyn_alert(flang_part_javascript[resultcode]); }}); } function get_valuation_comment(seq , del , comt_use){ var frm = del ? parent.getid('valuationfrm') : getid('valuationfrm'); var seq= frm.valuation_seq.value; frm.loadfile.value = "product_valuation_comment_data"; var params = form2urlquerystring(frm); if(getid('loadingbuff') == null) buffimg(); new Ajax.Request( fcommon + 'floadajax.php' , {parameters : params , method : 'post' , onComplete : function(rt){ del ? parent.getid('commentdata'+seq).innerHTML = rt.responseText : getid('commentdata'+seq).innerHTML = rt.responseText; if(comt_use == 1){ getdenycode_valuation(del ? parent.getid('chksum'+seq) : getid('chksum'+seq) , del ? parent.getid('valuation_privatekey'+seq) : getid('valuation_privatekey'+seq)); } if(del){ parent.$(".lencnt"+seq).html( "(" + parent.$(".comment_wrap_"+seq +" > ul").length + ")") ; }else{ $(".lencnt"+seq).html( "(" + $(".comment_wrap_"+seq +" > ul").length + ")") ; } }}); } function getdenycode_valuation(obj , vlsobj){ var params = 'loadfile=product_valuation_denyautoregist&objid=' + (typeof(obj.id) != 'undefined' ? obj.id : obj.name); var ajaxresult = new Ajax.Request(fcommon + 'floadajax.php' , { parameters : params , method : 'post' , onComplete : function(rt){ var getdata = rt.responseXML.getElementsByTagName("resultcode"); var resultcode = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("cryptdata"); var cryptdata = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("getkey"); var getkey = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("getkey_index"); var getkey_index = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("getregistkey"); var getregistkey = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("privatekey"); var valuation_privatekey = getdata[0].childNodes[0].nodeValue; getdata = rt.responseXML.getElementsByTagName("cryptseq"); var cryptseq = getdata[0].childNodes[0].nodeValue; var totstrcode = new String(getkey); var spanresult = new String(getkey_index); var enc_data = cryptdata; var retdata = strkey = spanresultdata = ""; for(var i = 0 ; i < totstrcode.length ; ++i){ spanresultdata = ""; for(var j = 0 ; j < spanresult.length ; ++j){ strkey = spanresult.substr(j , 1); if(i == strkey){ spanresultdata = "" + totstrcode.substr(i , 1) + ""; } } retdata += !spanresultdata ? totstrcode.substr(i , 1) : spanresultdata; } obj.innerHTML = " \n" + retdata; if(typeof(vlsobj) != 'undefined' && valuation_privatekey != 'null') vlsobj.value = valuation_privatekey; }}); } var product_StockOpt = function(parentOb){this.parentOb = typeof(parentOb) != "undefined" ? parentOb : document.writefrm;}; product_StockOpt.prototype = { getStokc1Opts : function(){ return $(this.parentOb).find("[name='optstock1']");// optstock1 은 세트상품으로 인해 여러개 존재 할수 있음 }, getRelationStockOpt : function(stock1){ var pseq = $(stock1).attr("pseq"); var stock1 = $(stock1);// var stock2 = $(this.parentOb).find("[name='optstock2']").filter("[pseq=" + pseq +"]");//나의 연관 stock2 var stock3 = $(this.parentOb).find("[name='optstock3']").filter("[pseq=" + pseq +"]");//나의 연관 stock3 var stock4 = $(this.parentOb).find("[name='optstock4']").filter("[pseq=" + pseq +"]");//나의 연관 stock3 var stock1_len = $(stock1).length; var stock2_len = $(stock2).length; var stock3_len = $(stock3).length; var stock4_len = $(stock4).length; var optstock1_selindex = $(stock1).find("option:selected").attr("ix"); var optstock2_selindex = $(stock2).length > 0 ? $(stock2).find("option:selected").attr("ix") : '1'; var optstock3_selindex = $(stock3).length > 0 ? $(stock3).find("option:selected").attr("ix") : '1'; var optstock4_selindex = $(stock4).length > 0 ? $(stock4).find("option:selected").attr("ix") : '1'; var check_stock_num = ''; if(stock1_len > 0 && stock2_len > 0 && stock3_len > 0 && stock4_len > 0){ check_stock_num = '4'; } else if(stock1_len > 0 && stock2_len > 0 && stock3_len > 0 ){ check_stock_num = '3'; }else if( stock1_len > 0 && stock2_len > 0 && stock3_len == 0){ check_stock_num = '2'; }else if( stock1_len > 0 && stock2_len == 0){ check_stock_num = '1'; } return { 'pseq' : pseq , 'stock1' : stock1 , 'stock2' : stock2 , 'stock3' : stock3 , 'stock4' : stock4 , 'optstock1_selindex' : optstock1_selindex , 'optstock2_selindex' : optstock2_selindex , 'optstock3_selindex' : optstock3_selindex, 'optstock4_selindex' : optstock4_selindex, 'stock1_len' : stock1_len , 'stock2_len' : stock2_len , 'stock3_len' : stock3_len , 'stock4_len' : stock4_len , 'check_stock_num' : check_stock_num } }, getCheckOpt : function(info){ if(typeof(info.pseq) == "undefined"){ var info = this.getRelationStockOpt(info);//연관 옵션 정보에서 기본 정보 GET } var rt = {}; var optmapkey = []; if( info.check_stock_num == 4 ) { $(info.stock4).find("option").each(function(i){ optmapkey[i] = info.optstock1_selindex + info.optstock2_selindex + + info.optstock3_selindex + i; }); rt = { 'stockOb' : info.stock4 , 'optmapkey' : optmapkey }; } else if(info.check_stock_num == 3){ $(info.stock3).find("option").each(function(i){ optmapkey[i] = info.optstock1_selindex + info.optstock2_selindex + i + info.optstock4_selindex; }); rt = { 'stockOb' : info.stock3 , 'optmapkey' : optmapkey }; }else if( info.check_stock_num == 2){ $(info.stock2).find("option").each(function(i){ optmapkey[i] = info.optstock1_selindex + i + info.optstock3_selindex + info.optstock4_selindex; }); rt = { 'stockOb' : info.stock2 , 'optmapkey' : optmapkey }; }else if( info.check_stock_num == 1){ $(info.stock1).find("option").each(function(i){ optmapkey[i] = i + info.optstock2_selindex + info.optstock3_selindex + info.optstock4_selindex; }); rt = { 'stockOb' : info.stock1 , 'optmapkey' : optmapkey }; } return rt; }, } function produt_opt_active_swap(pseq , active){ $(".optstock1").filter("[pseq=" + pseq +"]").attr('disabled' , active == 1 ? false : true).find("option[value='']").attr("selected" , true); $(".optstock2").filter("[pseq=" + pseq +"]").attr('disabled' , active == 1 ? false : true).find("option[value='']").attr("selected" , true); $("[name='defopt[]']").filter("[pseq='" + pseq + "']").attr("disabled" , active == 1 ? false : true).find("option[value='']").attr("selected" , true); $("[name='optradio1[" + pseq + "]").attr("disabled" , active == 1 ? false : true).prop("checked" , false); $("[name='optradio2[" + pseq + "]").attr("disabled" , active == 1 ? false : true).prop("checked" , false); } function get_setproduct_price(qy){ var qty = typeof(qy) == "undefined" ? 1 : parseInt(qy); var price = 0;//총 합 var aprice = 0; var bprice = 0; var dis_price = 0; var set_check_op = 0; $(".set_product_item_price").each(function(){ var op_item = $(this).closest('.set_product_select'); if( op_item.find('.optstock1').val() ) { set_check_op++; } }); $(".set_product_item_price").each(function(){ var discount_price = $(this).attr("discount_price"); var pseq = $(this).attr("pseq");//제품번호 var product_price = parseFloat($(this).val()) * qty; var op_item = $(this).closest('.set_product_select'); if( set_check_op > 0 ) { if( op_item.find('.optstock1').val() ) { aprice += product_price; } } else { if( op_item.find('.optstock1').length == 0 ) { var sel_ob = $(".set_product_item[pseq='" + pseq + "']"); if(sel_ob.val()){ aprice += product_price; } } } }); price = aprice; return price; } function getplancomment(s){ var start = 0; var index_new_paging = parseInt($(".index_new_paging").html()); if( s ){ start = index_new_paging * parseInt(10); } var frm = getid('writefrm'); var params = "ppcseq=" + frm.ppcseq.value + "&loadfile=product_plan_comment_list_paging&_historypass=1&start="+ start; if(getid('loadingbuff') == null) buffimg(); new Ajax.Request(fcommon + 'floadajax.php' , {parameters : params , method : 'post' , onComplete : function(rt){ $("#commentdata").append(rt.responseText); if( index_new_paging == 0 ){ index_new_paging = 1; } else{ index_new_paging += 1; } $(".index_new_paging").html(index_new_paging); }}); } function plancomment_delete(seq){ if(getid('loadingbuff') == null) buffimg(); var frmnm = "writefrm"; var frm = getid(frmnm); frm.loadfile.value = "product_plan_comment_delete"; var params = form2urlquerystring(frm) + "&seq="+seq; new Ajax.Request( fcommon + 'floadajax.php' , {parameters : params , method : 'post' , onComplete : function(rt){ var getdata = rt.responseXML; var resultcode_block = getdata.getElementsByTagName("resultcode"); var resultcode = resultcode_block[0].childNodes[0].nodeValue; dyn_alert(flang_part_javascript[resultcode]); switch(resultcode){ case "10000": frm.loadfile.value = ''; parent.location.reload(); break; } }}); } function plancomment_update(ele, seq){ var frmnm = "writefrm"; var frm = getid(frmnm); var text = $(ele).closest('.img_w').find('.cont').text(); frm.commentseq.value = seq frm.comments.value = text; } __parent = parent !== self && typeof(parent.dyn_alert) == 'undefined' ? self : parent; jQuery.fn.observer = function(f , rf){ if(rf == null) $(this).bind('DOMSubtreeModified' , f); else{ $(document).on('DOMSubtreeModified' , this , f); } return true; }; navigator.brw= (function(){ var ua= navigator.userAgent, tem, M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*([\d\.]+)/i) || []; if(/trident/i.test(M[1])){ tem= /\brv[ :]+(\d+(\.\d+)?)/g.exec(ua) || []; return 'IE '+(tem[1] || ''); } M= M[2]? [M[1], M[2]]:[navigator.appName, navigator.appVersion, '-?']; if((tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1]; return M.join(' '); })(); _tyAjax = function(){ this.init(); }; _tyAjax.prototype = { '_history' : false, 'full_trace_value' : '', 'circle_wrap' : {}, 'buffdiv' : {}, 'init' : function(){ var _this = this; $.ajaxSetup( { beforeSend : function(x){ var nm = $('meta[name^=tysync_]').attr('name'); if(nm != null) x.setRequestHeader(nm , $('meta[name^=tysync_]').attr('content')); }, complete : function(rt , stat){}, success : function(rt , stat){ _this.buffimg(_this.buffdiv , true); } } ); }, 'buffimg' : function(o , off){ var _this = this; var oid = $(o).eq(0).attr("id"); if (oid != undefined && oid.match(/^igear_ovlwhitespace/)){ return false; } this.buffdiv = o; var buffo = $('.buffimg'); var backlayer = $('#backlayer'); if(buffo.length == 0 && off == true){ _this.circle_buff_progress(false);//2020-02-24 kkn 종료 if(backlayer.length > 0){ backlayer.hide(); } return; } var getbrwsz = getbrwsize(); var getscrollsz = getscrollsize(); var csize = getoffsetsize('container_all'); var all = false; var gap = 150; if(getbrwsz.height < csize.height - 100){ this.buffdiv = $('div#container_all'); var pos = {'top' : getscrollsz.top + getbrwsz.height / 2 - 20 , 'left' : parseInt(getbrwsz.width / 2) - gap}; } else { all = true; var sz = {'width' : parseInt(o.css('width')) , 'height' : parseInt(o.css('height'))}; var pos = { 'left' : (sz.width == undefined ? 0 : (parseInt(sz.width / 2) - gap)) , 'top' : (sz.height == undefined ? 0 : parseInt(getbrwsz.height / 2- 20))// (sz.height / 2) - 100 }; } if(buffo.length == 0){ if(false && (document.location.href).search(/\/backoffice\//) == -1 ){ var imsrc = typeof(_loadingimg) != 'undefined' && _loadingimg.search('\.gif|\.jpg') != -1 ? _loadingimg : frontimagedir + "dynimic/loading.gif"; $(this.buffdiv).prepend((all == true ? "
" : '') + "
" + blang_javascript[30100] + "
" + (all == true ? "
" : '')); }else{ if(backlayer.length == 0){ var odiv = document.createElement("DIV"); var overlay_opacity = '50'; odiv.style.width = getbrwsz.width + "px"; odiv.style.height = new String(getbrwsz.height > $("body").outerHeight() ? getbrwsz.height : $("body").outerHeight()) + "px"; odiv.style.backgroundColor = "#3c3c3c"; odiv.name = odiv.id = 'backlayer'; odiv.style.top = "0px"; odiv.style.left = "0px"; odiv.style.filter = "alpha(opacity=" + overlay_opacity + ")"; odiv.style.MozOpacity = overlay_opacity / 100; odiv.style.opacity = overlay_opacity / 100; odiv.style.position = "absolute"; odiv.style.zIndex = '9998'; odiv.style.display = "block"; odiv.style.textAlign = "center"; document.body.appendChild(odiv); }else{ var odiv = backlayer[0]; odiv.style.width = getbrwsz.width + "px"; odiv.style.height = new String(getbrwsz.height > $("body").outerHeight() ? getbrwsz.height : $("body").outerHeight()) + "px"; backlayer.show(); } var msg = msg ? msg : blang_javascript[30101]; var imgsrc = typeof(_loadingimg) != 'undefined' && _loadingimg.search('\.gif|\.jpg') != -1 ? _loadingimg : frontimagedir + "dynimic/loading.gif"; if(typeof(odiv) != "undefined"){//2018-03-21 김관노 추가 this.circle_buff_init(pos);//2020-02-21 kkn 원형 로딩바 } } } else buffo.css('left' , pos.left).css('top' , pos.top); if(buffo.length > 0){ $(buffo).css("left" , ($(buffo).css("left").replace("px" , ""))-($(buffo).width()/2)); } if(off == true){ if(backlayer.length > 0){ backlayer.hide(); } buffo.remove(); } }, 'circle_buff_init' : function(position){ this.circle_wrap = $(".circle-wrap");//와꾸 var circle_inside_circle = $(this.circle_wrap).find(".inside-circle"); var circle_wrap_width_half = parseInt(this.circle_wrap.width()/2); var circle_wrap_height_half = parseInt(this.circle_wrap.height()/2); if($(this.circle_wrap).is(":visible") == false){ this.circle_wrap.show(); $(circle_inside_circle).html("0%"); } this.circle_wrap.css({"top" : (position.top - circle_wrap_height_half - 75) + "px"});// , "left" : (position.left - circle_wrap_width_half + 150) + "px" if(this.full_trace_value){ this.circle_buff_progress(true) } }, 'circle_buff_progress' : function(is_interval){ var _this = this; connect_fail_cnt = 0; var pre_progress_percent = 0; var circle_inside_circle = $(this.circle_wrap).find(".inside-circle"); var circle_fill_mask = $(this.circle_wrap).find(".circle .mask.full , .circle .fill"); if(is_interval){ var progress_func = function(){ $.ajax({ url: plugin + 'cloudcache/getstatus.php', cache: false, data: {'_full_trace_value' : _this.full_trace_value}, type: 'POST', success: function(rt){ try{ if( typeof(progress_interval) != "undefined") clearInterval(progress_interval); var rt = json_decode(rt); if(connect_fail_cnt >= 2){ if(typeof(_circle_interval) != "undefined"){ clearInterval(_circle_interval); } _this.circle_wrap.hide(); dyn_alert(blang_javascript[44447]);//서버와의 연결에 실패 return false; } if( !rt || rt["Ticket"] == false ){ connect_fail_cnt ++ ; } else{ var T = rt['Ticket'] - (rt['TicketAtThatTime']-1); var B = rt['Ticket'] - (rt['NowRunTicket'] -1 ); var n = parseInt(Math.round( (T - B) / T * 100 )); if( n >= 100) n = 100; if( n < 100){ progress_interval = setInterval(function(){ try{ if (pre_progress_percent >= n || isNaN(pre_progress_percent)) { if( typeof(progress_interval) != "undefined") clearInterval(progress_interval); }else{ pre_progress_percent++; $(circle_inside_circle).html(pre_progress_percent + "%") $(circle_fill_mask).css({"transform" : "rotate(" + (180 * n / 100) +"deg)"}); } }catch(e){ if( typeof(progress_interval) != "undefined") clearInterval(progress_interval); } }, 10); } if(n >= 100){ $(circle_inside_circle).html("100%"); $(circle_fill_mask).css({"transform" : "rotate(180deg)"}); if( typeof(_circle_interval) != "undefined") { clearInterval(_circle_interval); } setTimeout(function() { _this.circle_wrap.fadeOut();}, 500);//2020-05-15 return false; } } } catch(e){ if( typeof(_circle_interval) != "undefined") { clearInterval(_circle_interval); } } }//end success }); }//end func if( typeof(_circle_interval) != "undefined") clearInterval(_circle_interval); _circle_interval = setInterval(progress_func, 500); } else{//체크 value 없으면 status 체크 안함 무조건 100% $(circle_inside_circle).html("100%"); $(circle_fill_mask).css({"transform" : "rotate(180deg)"}); if(_this.circle_wrap.length > 0) setTimeout(function() { _this.circle_wrap.fadeOut(); }, 200); } }, 'send' : function(file , params){ this.full_trace_value = '';//초기화 if(_getparams(params.parameters)._full_trace_value){ this.full_trace_value = _getparams(params.parameters)._full_trace_value; } var _this = this; _this.buffimg($('div#container_all')); var exec = params.onComplete; $.ajax( { type : params.method || 'POST', url : file, data : params.parameters, error : function(rt , stat , opt , err){ var error = {type : 'ajax post send' , message: rt.responseText , err : err , url : file , data : params.parameters,ua : navigator.userAgent }; if(rt.responseText) alert(rt.responseText); _this.buffimg(_this.buffdiv , true); }, complete : function(rt , stat){}, success : function(m , stat , rt){ if(_getparams()._bug){ alert(rt.responseText); print_rr('' + rt.responseText + ''); }; try{ if(typeof(exec) == 'function'){ if(rt.readyState != 4 && typeof(rt.responseXML) == 'undefined'){ alert(rt.responseText); return; } exec(rt); } else if(typeof(exec) == 'string') eval(exec); }catch(e){ dyn_alert(e.message); } if(typeof(frm) != 'undefined') frm.setAttribute('is_callback' , ''); _this.buffimg(_this.buffdiv , true); } } ); }, 'reload' : function(o , file , params){ var full_trace_value = this.full_trace_value = '';//초기화 if(_getparams(params.parameters)._full_trace_value){ full_trace_value = this.full_trace_value = _getparams(params.parameters)._full_trace_value; } var url = window.location.pathname; var _this = this; if($(o).length > 0) _this.buffimg($(o)); var q = window.location.search.split('?')[1]||''; if(_getparams(q).contentonly || _getparams(params.parameters)._historypass){ if((params.method).toLowerCase() == 'post'){ $(o).load(file , _getparams(params.parameters , true) , function(r , t , x){_blankimg(); typeof(params.onComplete) == 'function' ? params.onComplete(r , t , x) : ''; }); } else{ $(o).load(file , function(r , t , x){ _blankimg(); typeof(params.onComplete) == 'function' ? params.onComplete(r , t , x) : ''; }); } } else{ if(!_this._history){ $.history.init(function(hash){ if(!hash){ return; } var prevHash = ''; if( this._options.newHash ) { prevHash = hash; hash = this._options.newHash; full_trace_value = ''; this._options.newHash = ''; } if((params.method).toLowerCase() == 'post'){ if(hash && hash.indexOf('loadfile') == "-1"){ _this.buffimg(_this.buffdiv , true); return false; } var reqHash = _getparams((hash.indexOf('%3D') != "-1" ? decodeURIComponent(hash) : hash), true); if( full_trace_value ) reqHash._full_trace_value = full_trace_value; $(o).load(file , reqHash , function(r , t , x){ _this.buffimg(_this.buffdiv , true);//2020-03-24 kkn add _blankimg(); typeof(params.onComplete) == 'function' ? params.onComplete(r , t , x) : ''; });//2018-05-24 김관노 파람 value에 &(%26) 적용 을 위해 indexof('%3D') *주의 : hash 값이 IE 는 urlencode 상태 , chrome 는 urldecode 된 상태 에 주의 } else{ $(o).load(file , function(r , t , x){ _blankimg(); typeof(params.onComplete) == 'function' ? params.onComplete(r , t , x) : ''; }); } }, { unescape: ",/" }); _this._history = true; var winhash = window.location.href.split('#')[1]||''; if(winhash == '') (window).location.hash = encodeURIComponent(params.parameters + (_getparams(params.parameters)['page'] ? "" : "&page=1")); } else { if( !_getparams(params.parameters).page) var req = params.parameters + '&page=' + _getparams(params.parameters)['page']; req = params.parameters + '&_tm=' + (new Date().getTime()); var op = $.history._options; op.newHash = req; $.history._options = op; $.history.load(req); } } } } Ajax = jQuery.extend(new _tyAjax , { 'Request' : function(file , params){ if ( document.location.href.indexOf("/front/") > 0 ) params.parameters = add_full_trace_value(params.parameters) return Ajax.send(file , params); } } , { 'Updater' : function(o , file , params){ if ( document.location.href.indexOf("/front/") > 0 ) params.parameters = add_full_trace_value(params.parameters) Ajax.reload($(typeof(o) == 'string' && (o).substr(0,1) != '#' ? '#' + o : o) , file , params); } }, { 'History' : {} }); Form = jQuery.extend({} ,{ 'serialize' : function(f){ return $(f).serialize(); } }); function pagehistory(){} function add_full_trace_value(parameters){ var loadfile = _getparams(parameters)['loadfile']; if( loadfile && loadfile != 'zipcode' ) { var affix = document.location.href.indexOf("/front/") > 0 ? 'F_' : 'B_'; parameters+= "&_full_trace_value=" + (affix + loadfile + "^" + parseInt( Math.random() * 100000)); } return parameters; } function trim(str){return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');} function trims(str) { str = str.replace(/^\s+/, ''); for (var i = str.length - 1; i >= 0; i--) { if (/\S/.test(str.charAt(i))) { str = str.substring(0, i + 1); break; } } return str;} RegExp.escape = function(str) { var specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g"); return str.replace(specials, "\\$&"); } if( window.console == undefined ){ console = { log : function(){} }; } inmenu = function(){ var n = []; var target = {}; }; inmenu.prototype = { n : [], target : {}, add : function(html , key){ var key = key == undefined ? 0 : key; if(isNaN(key)) return false; this.n[key] = this.n[key] == undefined ? [] : this.n[key]; this.n[key][this.n[key].length] = html; }, folder : function(k){ var insub = getids('_inmenu_sub'); for(var i = 0 ; i < insub.length ; ++i){ insub[i].parentNode.setAttribute('k' , i); insub[i].parentNode.onmouseover = function(){ var k = this.getAttribute('k'); insub[k].style.display = ''; } insub[i].parentNode.onmouseout = function(){ var k = this.getAttribute('k'); insub[k].style.display = 'none'; } } }, write : function(){ this.target = getids('_inmenu'); for(var i = 0 ; i < this.target.length ; ++i){ var html = ''; this.folder(); } } } function json_encode(str){ return $.toJSON != null ? $.toJSON(str) : str; } function json_apply(data){ return json_decode(decodeURIComponent(data)); } function stripcomma(){ var ag = arguments; for(var i = 0 ; i < ag.length ; ++i){ if(ag[i] == null) continue; var p = function(e){var ob = typeof(e.target) != 'undefined' ? e.target : e.srcElement; ob.value = (ob.value).replace(/,/gi , '')}; addevent(ag[i] , 'keyup' , p); addevent(ag[i] , 'blur' , p); } } function slidetop(p){ try{ var poffset = typeof(p) != 'undefined' && p != null ? getnowoffset(p) : getnowoffset(getid('paging_datalist')); var sc = getscrollsize(); var poffsettop = parseInt(poffset.top); if(sc.top <= poffsettop || (typeof(_slidetop_ptop) != 'undefined' && _slidetop_ptop < sc.top)){ if(typeof(_slidetoptime) != 'undefined') clearTimeout(_slidetoptime); _slidetop_ptop = undefined; } else{ _slidetop_ptop = sc.top; window.scroll(0 , sc.top - sc.top * 0.2); _slidetoptime = setTimeout("slidetop(getid('" + p.id + "'))" , 50); } }catch(e){} } function slideobj(o , p , plus_w , plus_h){ try{ plus_w = typeof(plus_w) != 'undefined' && is_int(plus_w) ? plus_w : 0; plus_h = typeof(plus_h) != 'undefined' && is_int(plus_h) ? plus_h : 0; p = typeof(p) == 'undefined' ? getid('container_all') : p; var poffset = getnowoffset(p); var ooffset = getnowoffset(o); var sc = getscrollsize(); var timer = 50; var flag = 1; if(o.style.top == '' || o.style.top == null) o.style.top = poffset.top + 'px'; if(parseInt(o.style.top) >= sc.top){ flag = -1; } var add = ((parseInt(o.style.top) + Math.ceil(Math.abs(sc.top - parseInt(o.style.top)) / 3) * flag)); if(sc.top != parseInt(o.style.top)){ o.style.left = (poffset.left + plus_w) + 'px'; o.style.top = ((poffset.top > add ? poffset.top : add) + plus_h) + 'px'; } else{ timer = 500; } var pnodes = p.id != '' ? "getid('" + p.id + "')" : "getid('" + o.id + "').parentNode"; setTimeout("slideobj(getid('" + o.id + "') , " + pnodes + " , " + plus_w + " , " + plus_h + ")" , timer); }catch(e){}; } function _fileupload(frm , loadfile , setupload_predir , filetype , callpage , execfunc , buttonid , processid , accesstype , postnm , q_func , succ_func , comp_func , upload_url , sid){ swfconf = _swfuploadconfig; swfconf.upload_url = typeof(upload_url) != 'undefined' ? upload_url : (typeof(accesstype) == 'undefined' ? bcommon + "loadajax.php" : fcommon + "floadajax.php") + "?upload=y&targetfrm=" + frm + "&swfupload=1&_callpage=" + callpage + "&resultexecutefunc=" + execfunc; swfconf.file_post_name = typeof(postnm) != 'undefined' ? postnm : 'largeupfilenm[]'; swfconf.file_types = typeof(filetype) != 'undefined' ? filetype : "*.zip"; swfconf.file_types_description = "select file"; swfconf.post_params = {'loadfile' : loadfile , 'setupload_predir' : setupload_predir , '_sess_sidnm' : typeof(sid) == 'object' && typeof(sid.sidnm) != 'undefined' ? sid.sidnm : '' , '_sess_sidvls' : typeof(sid) == 'object' && typeof(sid.sidvls) != 'undefined' ? sid.sidvls : ''}; swfconf.file_upload_limit = "0"; swfconf.file_queue_limit = "0"; swfconf.button_placeholder_id = typeof(buttonid) != 'undefined' ? buttonid : 'imageupbutton'; swfconf.file_dialog_complete_handler = function(){ this.startUpload();}; swfconf.upload_success_handler = function(file , sdata){ var progress = new FileProgress(file, this.customSettings.progress_target); progress.setComplete(); progress.setStatus("complete...!!"); progress.toggleCancel(false); if (sdata === " ") this.customSettings.upload_successful = false; else{ this.customSettings.upload_successful = true; eval(sdata); } } if(typeof(q_func) == 'function') swfconf.file_queued_handler = q_func; if(typeof(succ_func) == 'function') swfconf.upload_success_handler = succ_func; if(typeof(comp_func) == 'function') swfconf.upload_complete_handler = comp_func; swfconf.custom_settings = { progress_target : typeof(processid) != 'undefined' ? processid : "fsUploadProgress", upload_successful : false } return new SWFUpload(swfconf); } var _fupload = function(){ } _fupload = { params : function(){ var n = arguments; } } function json_decode(str){ return eval("(" + str + ")"); } function preserve_toggleimgwithdiv(btnid , layerid , is_cookie , init , clickevtfunc , execute){ return _jq(function($){ var ck = getcookie('preserve_tid_' + layerid); if(typeof(init) != 'undefined'){ $('#' + btnid).click(function(e){ var src = $(this).attr('src'); if(src.search(/off\.gif$/) != -1){ src = src.replace(/off\.gif$/ , 'on.gif'); var dck = 0; $('#' + layerid).hide(); } else { src = src.replace(/on\.gif$/ , 'off.gif'); var dck = 1; $('#' + layerid).show(); } $(this).attr('src' , src); setcookie('preserve_tid_' + layerid , dck); if(typeof(clickevtfunc) == 'function') clickevtfunc($); }); } if((ck == 1 || typeof(execute) != 'undefined')) $('#' + btnid).click(); return $('#' + btnid); }); } function toggleimgwithdiv(btnid , layerid , clickevtfunc){ _jq(function($){ var btn = $('#' + btnid); var src = btn.attr('src'); if(typeof src == 'undefined'){ return; } if(src.search(/off\.gif$/) != -1){ src = src.replace(/off\.gif$/ , 'on.gif'); var display = 'none'; var dck = 0; } else { src = src.replace(/on\.gif$/ , 'off.gif'); var display = 'inline-table'; var dck = 1; } btn.attr('src' , src); $('#' + layerid).css('display' , display); if(typeof(clickevtfunc) == 'function') clickevtfunc($); }); } function _popupadmin(url , width , height , contentonly , add , id , popuptitle){ var defparams = {};//2017-09-25 김관노 옵션 세팅 if(typeof(getovlparams) == "function") var defparams = getovlparams(popuptitle); ovl = new ovlmsg(defparams); if(typeof(width) == 'undefined') width = $(window).width()-50; if(typeof(height) == 'undefined') height = $(window).height()-100; var flag = url.indexOf("?") != -1 ? '&' : '?'; if((url).search(/pinid=\d+/) == -1 && (document.location.href).search(/\/backoffice\//) != -1){ url += flag + 'pinid=' + (_getparams().pinid||''); if(flag == '?') flag = '&'; } if(typeof(add) == 'undefined'){ ovl.screeniframe(url + (typeof(contentonly) != 'undefined' ? flag + 'contentonly=1' : '') + (url.indexOf("?") != -1 ? '&' : '?') + 'isoverlay=1' , width , height); } else{ var x = window.open(url + (typeof(contentonly) != 'undefined' ? flag + 'contentonly=1' : '') , (id != undefined ? id : 'popupadmin') , (typeof(width) != 'undefined' ? 'width=' + width : '1') + (typeof(height) != 'undefined' ? ',height=' + height : '') + (typeof(add) != 'undefined' ? ',' + add : '')); try{ x.focus(); }catch(e){alert(e.message);}; return x; } } function getovlparams(titlenm){ var titles = typeof(titlenm) != "undefined" ? titlenm : ''; if( titles ){ var o = new ovlmsg(); return { "topclosehtml" : '
'+titles+'
' , } } } _popup = _popupadmin; function _blankimg(id){ if(typeof(_bimg) == 'undefined') _bimg = []; var img = typeof(id) == 'undefined' ? $('img').get() : getids(id); for(var i = 0; i < img.length ; ++i){ if(img[i].readyState != 'complete' && img[i].complete == false){ img[i].onerror = function(){ this.src='data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='; } } } } igearajax = function(bsfile){ this.basedir = typeof(bsfile) != 'undefined' ? bsfile : bcommon + 'loadajax.php'; }; igearajax.prototype = { 'reload' : function(url , divnm , hist , func){ if(getid('loadingbuff') == null) buffimg(); var params = (typeof(frm) != 'undefined' ? form2urlquerystring(frm) : '') + '&' + url + '&_historypass=1'; var ajaxresult = new Ajax.Updater(divnm , this.basedir , {parameters : params , method : 'post' , evalJS : 'force' , evalScripts : true , onComplete : function(rt){ if(typeof(func) == 'function') func(rt); _reform(); }}); var _xthis = this; if(typeof hist == "undefined") pagehistory( ajaxresult , function(params){ _xthis.reload(params , divnm , true , func); } , 'end'); }, 'send' : function(url , uploaded , sfrm , exec , basedir , skipparam){ if(typeof(basedir) != 'undefined') this.basedir = basedir; if(typeof(sfrm) == 'string') sfrm = getid(sfrm); var frm = typeof(sfrm) != 'undefined' ? sfrm : getid('writefrm'); var isfile = is_readyupload(); if(getid('loadingbuff') == null) buffimg(); var skipssl = sslencrypt_skipparams(url); if(isfile == true && uploaded != true){ frm.action = this.basedir + "?upload=y&targetfrm=" + (frm.getAttribute('id')) + "&resultexecutefunc=new parent.igearajax.send('" + url + "' , true , " + sfrm + " , " + exec + ")"; frm.submit(); }else{ var params = (typeof(frm) != 'undefined' ? form2urlquerystring(frm , typeof(aSSL) == 'undefined' || aSSL.connections[aSSL._current].length == 0 ? false : true , skipparam , skipssl) : '') + '&' + url; new Ajax.Request(this.basedir , { parameters : params , method : 'post' , evalJS : 'force' , evalScripts : true , onComplete : function(rt){ try{ if(typeof(exec) == 'function') exec(rt); _reform(); }catch(e){ dyn_alert(e.message); } }}); } } } function autofill(is_checked , id , checkedfunc , notcheckedfunc){ for(var i = 0; i < getids(id).length; ++i){ if(is_checked && typeof(checkedfunc) == 'function') checkedfunc(getids(id)[i] , i); else if(typeof(notcheckedfunc) == 'function') notcheckedfunc(getids(id)[i] , i); } } function _dyn_alert(msg , exec){ window.onload = function(){ dyn_alert(msg); if(typeof(exec) == 'function') exec(); } } function _reform(exclass){ try{ $("INPUT[type='text'],INPUT[type='password'],INPUT[type='file']").addClass('input_onblur').blur(function(e){ var _t = this; var bk = false; $(exclass).each(function(){ if($(_t).hasClass(this)) bk = true; }); if(bk) return; $(this).removeClass('input_onfocus').addClass('input_onblur'); }).focus(function(e){ var _t = this; var bk = false; $(exclass).each(function(){ if($(_t).hasClass(this)) bk = true; }); if(bk) return; $(this).removeClass('input_onblur').addClass('input_onfocus'); }); }catch(e){} } function array_filter(arr, func) { var retObj = {}, k; func = func || function(v) { return v; }; if (Object.prototype.toString.call(arr) === '[object Array]') { retObj = []; } for (k in arr) { if (func(arr[k])) { retObj[k] = arr[k]; } } return retObj; } function array_unique(arr){ var key = '', tmp_arr2 = {}, val = ''; var __array_search = function (needle, haystack) { var fkey = ''; for (fkey in haystack) { if (haystack.hasOwnProperty(fkey)) { if ((haystack[fkey] + '') === (needle + '')) { return fkey; } } } return false; }; for (key in arr) { if (arr.hasOwnProperty(key)) { val = arr[key]; if (false === __array_search(val, tmp_arr2)) { tmp_arr2[key] = val; } } } return tmp_arr2; } function rollover2click(objnm , k , base){ var obj = getids(objnm); var self = obj[k]; var stat = self.src.search(/_r.gif/gi); var y = 0; for(var x = 0 ; x < obj.length ; ++x){ if(k == x && stat == '-1'){ pat = /off.gif$/; rep = 'on.gif'; } else { pat = /on.gif$/; rep = 'off.gif'; y++; } obj[x].src = obj[x].src.replace(pat , rep); } if(y == obj.length && typeof(base) != 'undefined' && base != ''){ obj[base].src = obj[base].src.replace(/off.gif$/ , 'on.gif'); } } function formrefdisabled(obj){ var x = arguments; var r = ''; for(var i = 1; i < x.length ; ++i){ x[i].disabled = obj.disabled == true || obj.checked == false || obj.selected == -1 ? true : false; } } function autobgcoloring(nm , mover , mout){ var bgtarget = getids(nm); for(var i = 0 , mx = bgtarget.length ; i < mx ; ++i){ bgtarget[i].onmouseover = function(){ this.style.background = mover; } bgtarget[i].onmouseout = function(){ this.style.background = mout; } } } function price2apply(obj , perc , price){ perc = isNaN(perc) ? 0 : perc; obj.value = round(parseInt(price) * perc / 100 , 0.1); } function menu(m){ try{ if(m == 'undefined') m = 'on'; var menuid = getid('lo_left_td'); var spot_menuon = getid('spot_menuon'); var spot_menuoff = getid('spot_menuoff'); var topmenudiv = getid('topmenudiv'); var ifrm_topmenubg = getid('ifrm_topmenubg'); setcookie('_menustat' , m); if(m == 'on'){ menuid.style.display = ''; spot_menuon.style.display = 'none'; spot_menuoff.style.display = ''; } else { menuid.style.display = 'none'; spot_menuon.style.display = ''; spot_menuoff.style.display = 'none'; } ifrm_topmenubg.style.width = topmenudiv.offsetWidth + 'px'; ifrm_topmenubg.style.height = topmenudiv.offsetHeight + 'px'; }catch(e){} } function round(vls , x){ return Math.round(vls * x) / x; } function nextfd(obj , cnt , nextnm){ if(obj.length >= cnt && typeof(nextnm.select) != 'undefined') nextnm.select(); else if(obj.length >= cnt) nextnm.focus(); } function getsortfd(depth){ var depth = parseInt(depth) + 96; var keycodemap = { '97' : 'a' , '98' : 'b' , '99' : 'c' , '100' : 'd' , '101' : 'e' , '102' : 'f' , '103' : 'g' , '104' : 'h' , '105' : 'i' } return keycodemap[depth]; } function getkeymatchdata(vls , rst){ var retdata = {}; for(k in rst){ if(typeof(rst[k]) == 'function') continue; if(vls == k){ retdata = rst[k]; break; } else retdata = getkeymatchdata(vls , rst[k]); } return retdata; } function adminlogout(){ if(getid('loadingbuff') == null) buffimg(); var params = "loadfile=admin_logout&setupload_predir=admin"; new Ajax.Request(bcommon + 'loadajax.php' , {parameters : params , method : 'post' , onComplete : function(rt){ var getdata = rt.responseXML; var resultcode_block = getdata.getElementsByTagName("resultcode"); var resultcode = resultcode_block[0].childNodes[0].nodeValue; location.replace(rootpath + 'backoffice/'); }}); } function sleep(time){ time = time * 1000; var sl = true; var now = new Date(); var nowstamp = now.getTime(); var sltime; while(sl){ sltime = new Date(); slstamp = sltime.getTime(); sl = slstamp - nowstamp > time ? false : true; } } function wheellistner(event , exec){ var obj = typeof(event.target) != 'undefined' ? event.target : event.srcElement; var event = (event || window.event); var wsize = event.wheelDelta ? (window.opera ? -delta : event.wheelDelta/120) : -event.detail/3; if(typeof(exec) == 'function') return exec(event , wsize , obj); else return wsize; } function wheel(exec , obj){ var wobj = typeof(obj) != 'undefined' ? obj : window; var dobj = typeof(obj) != 'undefined' ? obj : document; addevent(wobj , 'DOMMouseScroll' , function(e){ wheellistner(e , exec); } , false); addevent(wobj , 'mousewheel' , function(e){ wheellistner(e , exec); } , true); if(wobj !== dobj) addevent(dobj , 'mousewheel' , function(e){ wheellistner(e , exec); } , true); } function unwheel(obj){ wobj = typeof(obj) != 'undefined' ? obj : window; dobj = typeof(obj) != 'undefined' ? obj : document; addeventclear.reset(wheellistner , wobj , 'mousewheel'); addeventclear.reset(wheellistner , dobj , 'mousewheel'); addeventclear.reset(wheellistner , wobj , 'DOMMouseScroll'); } function wheelstop(){ $(window).on("mousewheel.disableScroll DOMMouseScroll.disableScroll touchmove.disableScroll", function(e) { e.preventDefault(); return; }); $(window).on("keydown.disableScroll", function(e) { var eventKeyArray = [32, 33, 34, 35, 36, 37, 38, 39, 40]; for (var i = 0; i < eventKeyArray.length; i++) { if (e.keyCode === eventKeyArray [i]) { e.preventDefault(); return; } } }); } function wheelrelease(){ $(window).off(".disableScroll"); } function togglecmd(cmd , id , key){ key = typeof(key) == 'undefined' ? 0 : key; var obj = getids(id); switch(cmd){ case "up": if(obj[key].style.display == "") $(obj[key]).slideUp('fast'); break; case "down": if(obj[key].style.display == "none") $(obj[key]).slideDown('fast'); break; default : if(obj.style.display == "none") $(obj).slideDown('fast'); else $(obj).slideUp('fast'); break; } } function grpoption(grp){ data = typeof(grp) == 'undefined' || grp == '' ? getusergroup : getadmingroup; var x = arguments; for(var i = 1; i < x.length ; ++i){ optioninsert(data , x[i] , '#match2 (#match0 / #match1)' , '^!!^' , 1); } }; function calselectbox(){ this.nowDate=new Date(); this.year_gap = 3; this.year_mxgap = 3; this.setfrmdata(); }; calselectbox.prototype.setfrmdata = function(y , m , d){ this.year = typeof(y) != 'undefined' ? y : this.nowDate.getFullYear(); this.month = typeof(m) != 'undefined' ? m : this.nowDate.getMonth() + 1; this.date = typeof(d) != 'undefined' ? d : this.nowDate.getDate(); }; calselectbox.prototype.setyear = function(yobj , mobj , dobj , sel , msel , dsel){ var nyear = parseInt(this.year) + parseInt(this.year_mxgap); var pyear = this.year - this.year_gap; var ii = 0; var tsel = ""; if(typeof(yobj) == "undefined") return false; if(typeof(sel) == "undefined" || sel == "" ) sel = this.year; for(var i = pyear ; i <= nyear ; ++i){ tsel = i == sel ? true : false; yobj.options[ii] = new Option( i , i , tsel , tsel); if(tsel == true) yobj.options.selectedIndex = ii; ++ii; } try{ this.setmon(yobj , mobj , dobj , msel , dsel); }catch(e){} return true; }; calselectbox.prototype.setmon = function(yobj , mobj , dobj , sel , dsel){ var ii = 0; var tsel = ""; if(typeof(yobj) == "undefined" || typeof(mobj) == "undefined") return false; if(typeof(sel) == "undefined" || sel == "" ) sel = this.month; for(i = 1 ; i <= 12 ; ++i){ tsel = i == sel ? true : false; mobj.options[ii] = new Option( i , i , tsel , tsel); if(tsel == true) mobj.options.selectedIndex = ii; ++ii; } try{ this.setday(yobj , mobj , dobj , dsel); }catch(e){} return true; }; calselectbox.prototype.setday = function(yobj , mobj , dobj , sel){ var mxday = 31; var yvalue = yobj.options[yobj.options.selectedIndex].value var mvalue = mobj.options[mobj.options.selectedIndex].value; if(typeof(yobj) == "undefined" || typeof(mobj) == "undefined") return false; if(typeof(sel) == "undefined" || sel == "" ) sel = this.date; for(var i = 0 ; i < 31; ++i) dobj.options[0] = null; var nyear = yvalue; if((mvalue % 2 == 0 && mvalue < 8 ) || (mvalue > 7 && mvalue % 2 == 1)){ if(mvalue == 2){ if(yvalue % 4 == 0 && yvalue % 100 !=0 || yvalue % 400 == 0) mxday = 29; else mxday =28; } else mxday = 30; } var ii = 0; for(var i = 1 ; i <= mxday ; ++i){ tsel = i == sel ? true : false; dobj.options[ii] = new Option( i , i , tsel , tsel); ++ii; } return true; }; categorybox = function(){}; categorybox.prototype = { boxinput : 'category_name' , boxnm : 'category_box', frm : 'frmwrite', init : function(){ this.boxnm = getid(this.boxnm); this.boxinput = getid(this.boxinput); this.frm = document[this.frm]; }, insert : function(){ try{ var catenm = this.boxinput.value; if(catenm == ''){ dyn_alert(blang_javascript[11002]); this.boxinput.select(); return; } var pindex = this.boxnm.options.selectedIndex; var pmxindex = this.boxnm.options.length; this.boxnm.options[pmxindex] = new Option(catenm , catenm , true , true); this.boxnm.options[pmxindex].title = blang_javascript[11001]; this.boxinput.value = ''; this.boxinput.select(); }catch(e){} }, del : function(key){ try{ this.boxnm.options[key] = null; this.boxinput.select(); }catch(e){ dyn_alert(blang_javascript[11004]); } }, move : function(updown){ try{ switch(updown){ case "up": var nindex = this.boxnm.options.selectedIndex; if(nindex < 1){ return; } var pindexobj = this.boxnm.options[nindex - 1]; this.boxnm.insertBefore(this.boxnm.options[nindex] , pindexobj); break; case "down" : var nindex = this.boxnm.options.selectedIndex; if(nindex > this.boxnm.options.length - 2){ return; } var pindexobj = this.boxnm.options[nindex + 1]; this.boxnm.insertBefore(pindexobj , this.boxnm.options[nindex]); break; default : return false; break; } }catch(e){ dyn_alert(blang_javascript[11003]); } } }; function autoselectedmatch(obj , vls , delim){ if(obj == undefined) return; delim = typeof(delim) == 'undefined' ? '^' : delim; var strvls = vls.split(delim); if(typeof(obj.length) != 'undefined'){ for(var i = 0 ; i < obj.length ; ++i){ for(var j = 0 ; j < strvls.length ; ++j){ obj.options[i].selected = obj.options[i].value == strvls[j] ? true : false; } } } } function autocheckedmath(obj , vls){ for(var i = 0 ; i < obj.length ; ++i){ if(typeof(vls) == 'object' && typeof(vls.length) != 'undefined'){ obj[i].checked = in_array(obj[i].value , vls) ? true : false; } else{ obj[i].checked = obj[i].value == vls ? true : false; } } } function copycb_loadflashclipboard(){ var x = arguments; clip = new ZeroClipboard.Client(); clip.setHandCursor( true ); clip.addEventListener('load', function(){}); clip.addEventListener('mouseOver', function(){ clip.setText(vls); }); clip.addEventListener('complete', function(){ if(typeof(comment) == 'undefined') dyn_alert(blang_javascript[10111]); else dyn_alert(comment); }); for(var i = 0; i < x.length ; ++i){ clip.glue(x[i]); } } function copycb(vls , comment){ if(typeof window.clipboardData == 'object'){ if(typeof(clip) != 'undefined') clip.setText(vls); else { window.clipboardData.setData('Text' , vls); if(typeof(comment) == 'undefined' || comment == '') dyn_alert(blang_javascript[10111]); else dyn_alert(comment); } }else{ if(comment){ temp = prompt(comment, vls); }else{ temp = prompt("복사하실 내용입니다. Ctrl+C를 눌러 클립보드로 복사하세요", vls); } } } function optioninsert(datax , obj , patten , delim , start){ if(typeof getusergroup == 'undefined') return false; if(typeof delim == 'undefined') delim = '^!!^'; if(typeof start == 'undefined') start = 0; var data = ''; var tpatten = ''; var tmppatten = ''; for(var i = obj.options.length ; i >= 0 ; --i){ if(i >= start) obj.options[i] = null; } for(var i = 0; i < datax.length ; ++i){ data = datax[i].split(delim); tpatten = patten; for(var j = 0 ; j < data.length ; ++j){ tmppatten = new RegExp('#match' + j , 'gi'); if(data[j]) tpatten = tpatten.replace(tmppatten , data[j]); } if(tpatten && data[0]) obj.options[start + i] = new Option(tpatten , data[0]); } return true; } function optinsert(obj , vls , delim , start , selected){ if(typeof delim == 'undefined') delim = '^!^'; if(typeof start == 'undefined') start = 0; for(var i = 0 ; i < obj.options.length; ++i){ obj.options[start + i] = null; } var datax = vls.split(delim); for(var i = 0; i < datax.length ; ++i){ data = datax[i]; if(data){ sel = selected == data ? true : false; obj.options[parseInt(start) + i] = new Option(data , data , sel , sel); } } } function checkactive(obj){ obj = typeof(obj) == "object" ? obj : getid(obj); obj.checked = obj.checked == true ? false : true; } function activetoggle(tdiv , callback , viewctrl){ tdiv = typeof(tdiv) == "object" ? tdiv : getid(tdiv); stat = tdiv.style.display; if(typeof(callback) == "function") callback(); if(stat != 'none' && viewctrl == false || stat == 'none' && viewctrl == true || typeof(viewctrl) == 'undefined'){ $(tdiv).toggle('fast'); } return stat; } function num2lang(val){ var retdata=new Array(); var price_unit0= new String(blang_javascript[21100]).split(','); var price_unit1= new String(blang_javascript[21101]).split(','); var price_unit2= new String(blang_javascript[21102]).split(','); var re=/^[1-9][0-9]*getid/; var num=new String(val).toString().split(",").join(""); for( i = num.length-1; i >= 0; i-- ){ retdata[i] = price_unit0[num.substr(num.length-1-i,1)]; if( i > 0 && retdata[i] != "" ) { retdata[i]+= price_unit1[i%4]; }; if( i % 4 == 0 ) { retdata[i]+= price_unit2[(i/4)]; }; }; for( i = num.length - 1; i >= 0; i-- ){ if( retdata[i].length == 2) { retdata[i-i%4]+="-"; }; if( retdata[i].length == 1 && i>0) { retdata[i]=""; }; if( i%4 != 0 ) { retdata[i] = retdata[i].replace(blang_javascript[21103],""); }; }; retdata = retdata.reverse().join("").replace(/-+/g," "); return retdata; }; function igear_objstart(url , size , id){ this.init(url , size , id); } igear_objstart.prototype.init = function( url , size , id , exec){ this.param = new Array(); this.tags = new Array(); this.url = url; if(typeof(size) != "undefined"){ this.size = size.split(","); this.setparam('width',this.size[0]); this.setparam('height',this.size[1]); }else{ this.size = new Array('',''); } this.codebase = 'http:/' + '/download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0'; this.classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"; this.paramsplit = "!@#$!@#$"; this.setparam('allowScriptAccess','sameDomain'); this.setparam('quality','high'); this.setparam('bgcolor','#ffffff'); this.setparam('autostart','true'); this.setparam('wmode','transparent'); this.setparam('movie',this.url); this.setparam('src',this.url); if(typeof(exec) == 'function') exec(this); this.id = id ? id : ''; } igear_objstart.prototype.setparam = function(nm , vls , key){ if(typeof(key) == "undefined") key = this.param.length; this.param[key] = nm + this.paramsplit + vls; } igear_objstart.prototype.write = function(obj){ var embedoption = new Array(); var id = this.id; this.tags[this.tags.length] = ""; for(var i = 0; i < this.param.length ; ++i){ this.params = this.param[i].split(this.paramsplit); if(this.params[0] != "src") this.tags[this.tags.length] = ""; if(this.params[0] != "movie") embedoption[embedoption.length] = this.params[0] + "='" + this.params[1] + "'"; } this.tags[this.tags.length] = ""; this.tags[this.tags.length] = ""; if(typeof(obj) != "undefined" && typeof(obj) == "object") { obj.innerHTML = this.tags.join("\n"); } else document.write(this.tags.join("\n")); } function _getparams(vls , is_duplicate){ if(typeof(vls) != "undefined" && decodeURIComponent(vls) != vls && (vls.indexOf('=') < 0 && vls.indexOf("%3D") > 0)){ vls = decodeURIComponent(vls); } var urlquery = typeof(vls) == 'undefined' ? new String(window.location.href).split("?") : new Array('' , vls); var vls = new String(urlquery[1]).split("&"); var retdata = {}; var tmp = s = ""; for(var i = 0 ; i < vls.length ; ++i){ tmp = new String(vls[i]).split("="); if(!tmp[1] && !tmp[0]) continue; if(tmp[1] && (tmp[1]).search(/#/) != -1) tmp[1] = (tmp[1].split('#')).shift(); tmp[0] = tmp[0]; tmp[0] = unescape(tmp[0]) tmp[1] = tmp[1]; tmp[1] = decodeURIComponent(tmp[1]); if(typeof(is_duplicate) != 'undefined' && tmp[0].search(/\[(.*)\]/) != -1){ if(typeof(retdata[tmp[0]]) == 'undefined') retdata[tmp[0]] = []; retdata[tmp[0]][retdata[tmp[0]].length] = tmp[1]; } else retdata[tmp[0]] = tmp[1]; } return retdata; } function is_readyupload(){ var frm = getnames("INPUT"); var retdata = false; for(var i = 0 ; i < frm.length ; ++i){ if(frm[i].getAttribute('type') == "file" && frm[i].value != "") retdata = true; } return retdata; } function viewcrtl(id , num , toggle){ var str = new String(num).split(","); var pitem = getids(id); for(var i = 0 ; i < pitem.length; ++i){ if(typeof(toggle) != 'undefined') pitem[i].style.display = in_array(i , str) == true && pitem[i].style.display == 'none' ? '' : 'none'; else pitem[i].style.display = in_array(i , str) == true ? '' : 'none'; if(pitem[i].style.display == ''){ $(pitem).eq(i).removeClass('displaynone').addClass('displayblock'); }else{ $(pitem).eq(i).removeClass('displayblock').addClass('displaynone'); } } } ovlmsg = function(p){ if(typeof(p) == "undefined") var p = {}; this.init(p) }; ovlmsg.prototype = { overlaynm : "igear_ovloverlayer" , whitespacenm : "igear_ovlwhitespace", hiddenfrmnm : "igear_ovlhiddenfrm" , whiteboxwidth : 750 , whiteboxheight : 590 , zoomnm : 'igear_zoombox', init : function(p){ this.defparams = { topclosehtml : typeof(p.topclosehtml) != "undefined" ? p.topclosehtml : '
' , contentpadding : typeof(p.contentpadding) != "undefined" ? p.contentpadding : '0px' } }, overlay : function(){ if(getid(this.overlaynm) == null){ var ovldiv = document.createElement("DIV"); var scrsize = getscrollsize(); var brwsize = getbrwsize(); var getoffsetsz = getoffsetsize('container_all'); ovldiv.style.width = brwsize.width + "px"; ovldiv.style.height = new String(getoffsetsz.height ? getoffsetsz.height : getoffsetsize().height) + "px"; ovldiv.name = ovldiv.id = this.overlaynm; ovldiv.onclick = function(){ new ovlmsg().action(true); } document.body.appendChild(ovldiv); } } , whitespace : function(){ var scrsize = getscrollsize(); var brwsize = getbrwsize(); var getoffsetsz = getoffsetsize('container_all'); if(getid(this.whitespacenm) == null){ var whitebox = document.createElement("DIV"); var hiddenfrm = document.createElement("IFRAME"); whitebox.name = whitebox.id = this.whitespacenm; hiddenfrm.name = hiddenfrm.id = this.hiddenfrmnm; hiddenfrm.style.top = whitebox.style.top = new String(scrsize.top + brwsize.height / 2 - (this.whiteboxheight / 2)) + "px"; hiddenfrm.style.left = whitebox.style.left = new String(brwsize.width / 2 - (this.whiteboxwidth / 2)) + "px"; hiddenfrm.style.position = "absolute"; hiddenfrm.style.width = whitebox.style.width = this.whiteboxwidth + "px"; hiddenfrm.style.height = whitebox.style.height = this.whiteboxheight + "px"; hiddenfrm.frameBorder = 0; document.body.appendChild(whitebox); document.body.appendChild(hiddenfrm); if(typeof(getoffsetsz_whitespace) == 'undefined') getoffsetsz_whitespace = getoffsetsz; } else{ getoffsetsz = getoffsetsz_whitespace; getid(this.overlaynm).style.width = brwsize.width + "px"; getid(this.overlaynm).style.height = new String(getoffsetsz.height ? getoffsetsz.height : getoffsetsize().height) + "px"; getid(this.whitespacenm).style.width = getid(this.hiddenfrmnm).style.width = this.whiteboxwidth + "px"; getid(this.whitespacenm).style.height = getid(this.hiddenfrmnm).style.height = this.whiteboxheight + "px"; getid(this.whitespacenm).innerHTML = ""; getid(this.hiddenfrmnm).style.top = getid(this.whitespacenm).style.top = new String(scrsize.top + brwsize.height / 2 - (this.whiteboxheight / 2)) + "px"; getid(this.hiddenfrmnm).style.left = getid(this.whitespacenm).style.left = new String(brwsize.width / 2 - (this.whiteboxwidth / 2)) + "px"; } } , action : function(flag , callback , plusheight){ if(typeof(flag) == "undefined" || flag == ""){ this.overlay(); this.whitespace(); getid(this.whitespacenm).style.height = getid(this.hiddenfrmnm).style.height = (parseInt(getid(this.whitespacenm).style.height) + (typeof(plusheight) != 'undefined' ? plusheight : 0)) + 'px'; var brwsize = getbrwsize(); var getoffsetsz = getoffsetsize('container_all'); var h = (brwsize.height > getoffsetsz.height ? brwsize.height : getoffsetsz.height) + 45; getid(this.overlaynm).style.height = new String(h) + "px"; getid(this.hiddenfrmnm).style.display = 'block'; getid(this.whitespacenm).style.display = 'block'; getid(this.overlaynm).style.display = 'block'; }else { if(getid(this.hiddenfrmnm) == null) return false; getid(this.hiddenfrmnm).style.display = 'none'; getid(this.whitespacenm).style.display = 'none'; getid(this.overlaynm).style.display = 'none'; } if(typeof callback == "function") callback(); } , screen : function(params , flag , callback , lastcallback , target , width , height){ if(typeof params == "undefined" || params == ""){ dyn_alert(blang_javascript[10105]); return; } if(params.indexOf('loadfile') < 0){ dyn_alert(blang_javascript[10104]); return; } if(typeof(width) != 'undefined') this.whiteboxwidth = width ; if(typeof(height) != 'undefined') this.whiteboxheight = height; this.action(flag , callback); target = typeof(target) == 'undefined' ? bcommon + 'loadajax.php' : target; params += '&contentonly=1'; params += '&_historypass=1'; getid(this.whitespacenm).innerHTML = this.defparams.topclosehtml; new Ajax.Updater( this.whitespacenm + '_div' , target , {parameters : params, method : 'post' , onComplete : function(rt){ if(typeof(lastcallback) == 'function') lastcallback(rt);}}); } , screeniframe : function(src , width , height , scrolling , func){ var ifrm = document.createElement("IFRAME"); width = parseInt(typeof(width) != 'undefined' ? width : this.whiteboxwidth); height = parseInt(typeof(height) != 'undefined' ? height : this.whiteboxheight); if(typeof(func) == 'undefined' && navigator.userAgent.indexOf('MSIE 6') != -1){ function func(){ ifrm.src = src; } } else ifrm.src = src; ifrm.style.overflow = typeof(scrolling) == 'undefined' ? 'hidden' : 'auto'; ifrm.frameBorder = '0'; ifrm.width = width + 'px'; ifrm.height = height + 'px'; ifrm.name = ifrm.id = "_lightbox_ifrm"; this.directscreen(ifrm , width , height , func); } , directscreen : function(data , width , height , func){ if(typeof(width) != "undefined" && is_int(width)){ this.whiteboxwidth =width; } if(typeof(height) != "undefined" && is_int(height)){ this.whiteboxheight = height; } this.action(); var tb = document.createElement('table'); var tr = document.createElement('tr'); var td = document.createElement('td'); tb.width = this.whiteboxwidth; tb.height = this.whiteboxheight; td.align = 'center'; td.valign = 'top'; td.appendChild(data); tr.appendChild(td); tb.appendChild(tr); td.style.padding = this.defparams.contentpadding; getid(this.whitespacenm).innerHTML = this.defparams.topclosehtml + getouterHTML(tb);// 2017-09-25 김관노 옵션연동 typeof(func) == 'function' ? func() : ''; var wbox = getid(this.whitespacenm); var _this = this; if(getid('_lightbox_ifrm') != null) addevent(getid('_lightbox_ifrm') , 'load' , function(e){ var obj = typeof(e.target) != 'undefined' ? e.target : e.srcElement; objdoc = typeof(obj.contentDocument) != 'undefined' ? obj.contentDocument : obj.contentWindow.document; if( $(objdoc.body).find("#container_all").css("min-width").replace('px', '') > obj.width.replace('px', '')){ $(objdoc.body).find("#container_all").css("min-width", obj.width.replace('px', '') + "px"); } objdoc.body.style.backgroundColor = "#FFF"; var h = objdoc.body.scrollHeight; var w = objdoc.body.scrollWidth; if(wbox.offsetHeight > h) h = wbox.offsetHeight; if(typeof ($(this)[0].contentWindow) != "undefined") $(this)[0].contentWindow.focus(); if(height == undefined){ obj.style.height = ($(window).height() < h ? $(window).height() - 200 : h) + 'px'; _this.whiteboxheight = obj.style.height; } obj.style.width = w + 'px'; obj.parentNode.parentNode.parentNode.parentNode.parentNode.style.height = (obj.parentNode.parentNode.parentNode.parentNode.parentNode.scrollHeight + 20) + 'px'; obj.parentNode.parentNode.parentNode.parentNode.parentNode.style.width = (obj.parentNode.parentNode.parentNode.parentNode.parentNode.scrollWidth + 3) + 'px'; _this.whitespace_reisze(); }); } , whitespace_reisze : function(){ var scrsize = getscrollsize(); var brwsize = getbrwsize(); var wbox = getid(this.whitespacenm); wbox.style.top = new String(scrsize.top + brwsize.height / 2 - (this.whiteboxheight / 2)) + "px"; wbox.style.left = new String(brwsize.width / 2 - ($(wbox).width() / 2)) + "px"; }, ovlimage : function(id , msg){ var pimg = typeof(id) != 'string' ? id : getids(id); var inc = 0; for(var i = 0 ; i < pimg.length ; ++i){ pimg[i].onload = function(){ } pimg[i].onclick = function(){ var img = new Image(); img.src = this.src; img.id = img.name = 'ovlimagespot'; img.align = 'absmiddle'; if( img.src && (img.width == 0 || img.height == 0 ) ){ img.width = this.width; img.height = this.height; } if(img.width == 0 || img.height == 0) dyn_alert(blang_javascript[10110]); else{ var brwsize = getbrwsize(); img.width = img.width > brwsize.width ? parseInt(img.width) / 3 : img.width; img.height = img.height > brwsize.width ? parseInt(img.height) / 3 : img.height; if(img.width < 150 || img.height < 150) ovl.directscreen(img , parseInt(img.width) + 50 , parseInt(img.height) + 50, ''); else ovl.directscreen(img , img.width , img.height, ''); } }; pimg[i].onmouseover = function(){ this.style.border = "1px solid #FF7070"; }; pimg[i].onmouseout = function(){ this.style.border = "1px solid #f7f7f7"; }; pimg[i].style.border = "1px solid #f7f7f7"; if(typeof(msg) != "undefined") pimg[i].title = msg; pimg[i].style.cursor = "pointer"; } }, popupclose : function(id){ var popupid = "popup_" + id; if(typeof(parent.getid) != 'undefined' && parent.getid(popupid) != null) document.body.removeChild(parent.getid(popupid)); else if(getid(popupid) != null) document.body.removeChild(getid(popupid)); else dyn_alert(flang_javascript['37007']); }, popupmouselayermove : function(obj , id){ if(typeof(obj) != 'object') return false; var popupid = "popup_" + id; var mdown_client = {x:0,y:0}; var tick = false; addevent(obj , 'mousedown' , function(e){ var ob = getid(popupid); mdown_client = {'x' : e.clientX - parseInt(ob.style.left) , 'y' : e.clientY - parseInt(ob.style.top)}; ob.style.filter = "alpha(opacity=50)"; ob.style.MozOpacity = 50 / 100; ob.style.opacity = 50 / 100; ob.style.border = '3px dashed #000000'; tick = true; }); addevent(obj , 'mouseup' , function(e){ var ob = getid(popupid); ob.style.filter = "alpha(opacity=100)"; ob.style.MozOpacity = 100 / 100; ob.style.opacity = 100 / 100; ob.style.border = '0px dashed #000000'; tick = false; }); addevent(obj , 'mousemove' , function(e){ if(!tick) return false; if( e.stopProgagation ) e.stopPropagation(); else e.cancelBubble = true; if(e.preventDefault){ e.preventDefault(); } else e.returnValue = false; var ob = getid(popupid); ob.style.left = (e.clientX - mdown_client.x) + 'px'; ob.style.top = (e.clientY - mdown_client.y) + 'px'; }); }, popupmouseiframemove : function(obj , id){ if(typeof(obj) != 'object') return false; var popupid = "popup_" + id; var mdown_client = mdown_now = {}; var tick = false; addevent(obj , 'mousedown' , function(e){ ob = getid(popupid); mdown_now = {'x' : parseInt(ob.style.left) , 'y' : parseInt(ob.style.top)}; mdown_client = {'x' : e.clientX , 'y' : e.clientY}; tick = true; }); addevent(obj , 'mouseup' , function(e){ tick = false; }); addevent(obj , 'mousemove' , function(e){ if(!tick) return false; ob = getid(popupid); if( e.stopProgagation ) e.stopPropagation(); else e.cancelBubble = true; if(e.preventDefault){ e.preventDefault(); } else e.returnValue = false; ob.style.left = (parseInt(mdown_now.x) + e.clientX - mdown_client.x) + 'px'; ob.style.top = (parseInt(mdown_now.y) + e.clientY - mdown_client.y) + 'px'; mdown_now = {'x' : parseInt(ob.style.left) , 'y' : parseInt(ob.style.top)}; }); }, popuplayer : function(id , html , width , height , positiont , positionl , is_move , is_tp){ var scrsize = getscrollsize(); var brwsize = getbrwsize(); var popupid = "popup_" + id; if(typeof(positiont) == 'undefined') positiont = -1; if(typeof(positionl) == 'undefined') positionl = -1; if(getid(popupid) != null) this.popupclose(id); var addheight = navigator.userAgent.indexOf("MSIE") != '-1' ? 0 : 120; var frm = document.createElement("FORM"); var popup = document.createElement("DIV"); popup.style.overflowY = "auto"; popup.style.overflowX = "hidden"; popup.style.position = "absolute"; popup.style.zIndex = "9999"; popup.style.width = width + 'px'; if(height > 0) popup.style.height = height + 'px'; popup.style.top = (positiont < 0 ? new String(scrsize.top + brwsize.height / 2 - (height / 2)) : positiont) + "px"; popup.style.left = (positionl < 0 ? new String(brwsize.width / 2 - (width / 2)) : positionl) + "px"; popup.name = popup.id = popupid; popup.innerHTML = html.replace(/'; frm.appendChild(popup); document.body.appendChild(frm); addevent(getid('_popuplayerload_' + id) , 'load' , function(e){ var obj = typeof(e.target) != 'undefined' ? e.target : e.srcElement; if(is_move){ (new parent.ovlmsg()).popupmouselayermove(popup , id); popup.style.cursor ='move'; } }); }, popupifrm : function(id , src , width , height , positiont , positionl , is_move , is_tp){ var popupid = "popup_" + id; var ifrmid = "popup_ifrm_" + id; var scrsize = getscrollsize(); var brwsize = getbrwsize(); var getoffsetsz = getoffsetsize('container_all'); if(typeof(width) == 'undefined') width = 700; if(typeof(height) == 'undefined') height = 550; if(typeof(positiont) == 'undefined') positiont = -1; if(typeof(positionl) == 'undefined') positionl = -1; is_move = typeof(is_move) == 'undefined' || is_move == false ? false : true; var is_ie = navigator.userAgent.indexOf("MSIE") != '-1' ? true : false; var addwidth = is_ie ? 0 : 35; var addheight = is_ie ? 0 : 50; if(getid(popupid) != null) this.popupclose(id); var popup = document.createElement("DIV"); popup.style.overflowY = "hidden"; popup.style.overflowX = "hidden"; popup.style.position = "absolute"; popup.style.zIndex = "9999"; popup.style.border = "5px solid #000000"; popup.style.width = width + 'px'; popup.style.height = height + 'px'; popup.style.top = (positiont < 0 ? new String(scrsize.top + (brwsize.height / 2) - (height / 2)) : positiont) + "px" ; popup.style.left = (positionl < 0 ? new String((brwsize.width / 2) - (width / 2)) : positionl) + "px"; popup.name = popup.id = popupid; var ifrm = document.createElement("IFRAME"); ifrm.style.overflow = typeof(scrolling) == 'undefined' && is_ie ? 'hidden' : 'auto'; if(typeof(is_tp) != 'undefined') ifrm.setAttribute('allowTransparency' , true); ifrm.frameBorder = '0'; ifrm.scrolling = "no"; ifrm.width = width + 'px'; ifrm.height = height + 'px'; ifrm.style.backgroundColor = '#ffffff'; ifrm.name = ifrm.id = ifrmid; popup.appendChild(ifrm); document.body.appendChild(popup); addevent(ifrm , 'load' , function(e){ var obj = typeof(e.target) != 'undefined' ? e.target : e.srcElement; var ifrm = typeof(obj.contentDocument) != 'undefined' ? obj.contentDocument.body : obj.contentWindow.document.body; var height = ifrm.scrollHeight + (ifrm.offsetHeight - ifrm.clientHeight) + addheight; var width = ifrm.scrollWidth + (ifrm.offsetWidth - ifrm.clientWidth) + addwidth; if(height>0 && width>0 && typeof(obj) != 'undefined' && getid(popupid) != null){ getid(popupid).style.height = obj.style.height = height + 'px'; getid(popupid).style.width = obj.style.width = width + 'px'; getid(popupid).style.top = (positiont < 0 ? new String(scrsize.top + (brwsize.height / 2) - (height / 2)) : positiont) + "px" ; getid(popupid).style.left = (positionl < 0 ? new String((brwsize.width / 2) - (width / 2)) : positionl) + "px"; } if(is_move) { try{ (new parent.ovlmsg()).popupmouseiframemove(ifrm.contentWindow != undefined ? ifrm.contentWindow.document : ifrm.document, id); obj.contentWindow.document.body.style.cursor ='move'; }catch(e){alert(e.message);} } }); ifrm.src = src; }, chasetext : function(spotid){ var xid = 'spot_chasetext'; if(typeof(spotid) == "undefined"){ var spotid = 'ctext'; } if(getid(xid) == null){ var fdiv = document.createElement("DIV"); fdiv.src = this.followimg; fdiv.style.filter = "alpha(opacity=90)"; fdiv.style.MozOpacity = 90 / 100; fdiv.style.opacity = 90 / 100; fdiv.style.display = 'none'; fdiv.style.backgroundColor = '#ffffff'; fdiv.style.position = 'absolute'; fdiv.style.lineHeight = '150%'; fdiv.style.padding = '5px'; fdiv.style.border = '1px solid #000000'; fdiv.id = fdiv.name = xid; document.body.appendChild(fdiv); var fowlay = getid(xid); var spotobj = getids(spotid); var is_ms = navigator.userAgent.indexOf("MSIE") != '-1' ? true : false; for(var i = 0 ; i < spotobj.length ;++i){ addevent(spotobj[i] , 'mousemove' , function(e){ var t = !is_ms ? e.currentTarget : e.srcElement; var scrsize = getscrollsize(); fowlay.innerHTML = t.getAttribute('ctitle'); fowlay.style.left = ((is_ms ? (window.event.clientX + scrsize.left) : e.pageX) + 20) + 'px'; fowlay.style.top = ((is_ms ? (window.event.clientY + scrsize.top) : e.pageY) + 20) + 'px'; fowlay.style.display = ''; }); addevent(spotobj[i] , 'mouseout' , function(e){ var t = !is_ms ? e.currentTarget : e.fromElement; fowlay.style.display = 'none'; }); } } } } function setPng24(obj){ obj.width=obj.height=1; obj.className=obj.className.replace(/\bpng24\b/i,''); obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"; obj.src=''; return ''; } function imagesize(src){ var img = new Image(); img.src = src; return {width : img.width , height : img.height}; } function is_int(n) { var s = n.toString(), l = s.length; if (l > 11) return false; for (var i = (s.charAt(0) == '-') ? 1 : 0; i < l; i++) { switch (s.charAt(i)) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default : return false; } } return !(n < -2147483648 || n > 2147483647); } function frmswitch(){ var obj = ""; for(var i = 0; i < arguments.length ; ++i){ try{ obj = typeof(arguments[i]) == "object" ? arguments[i] : getids(arguments[i]); if(obj.length > 1){ for(var j = 0; j < obj.length ; ++j){ obj[j].disabled = obj[j].disabled == true ? false : true; obj[j].style.backgroundColor = obj[j].disabled == true ? "#cccccc" : "#ffffff"; } } else { try{ obj[0].disabled = obj[0].disabled == true ? false : true; obj[0].style.backgroundColor = obj[0].disabled == true ? "#cccccc" : "#ffffff"; }catch(e){ obj.disabled = obj.disabled == true ? false : true; obj.style.backgroundColor = obj.disabled == true ? "#cccccc" : "#ffffff"; } } }catch(e){} } } function getpagedata(npage, url , hist , sfrm , target , func){ var frm = typeof(sfrm) != 'undefined' ? sfrm : (typeof(frm) != 'undefined' ? frm : window.frm); if(typeof(frm) == 'undefined'){ dyn_alert(flang_javascript[10110]); return false; } var loadurl = _getparams(url)['loadurl']; target = typeof(target) != 'undefined' && target ? '#' + target : '#paging_datalist'; if(typeof(frm.loadfile) != 'undefined') frm.loadfile.value = _getparams(url)['loadfile']; var hash = window.location.href.split('#')[1]||''; var ppage = hash && _getparams(hash).page != 'undefined' ? _getparams(hash).page : npage; npage = is_diffpage() ? ppage : npage; var skip = { 'tree_info[]' : 1, 'per_product_seq[]' : 1, 'per_sellprice[]' : 1, 'per_bs_imgnm[]' : 1, 'per_productnm[]' : 1, 'per_orderstatus[]' : 1, 'torderstatus' : 1 }; var params = url + "&" + form2urlquerystring(frm , undefined , skip) + (npage ? "&page=" + npage : ''); console.log(params); if(getid('loadingbuff') == null) buffimg(); var ajaxresult = new Ajax.Updater(target , (typeof(loadurl) != 'undefined' ? loadurl : bcommon + 'loadajax.php') , {parameters : params , method : 'post' , evalJS : 'force' , evalScripts : true , onComplete : function(rt){if(typeof(func) == 'function'){ func(rt); } }}); } function updownbutton(obj , imgpath , title1 , title2){ title1 = typeof(title1) != 'undefined' ? title1 : updownbutton_title1; title2 = typeof(title2) != 'undefined' ? title2 : updownbutton_title2; var flag = new String(obj.src).search(/put/gi) != -1 ? true : false; obj.src = imgpath + (flag == true ? "application_get.gif" : "application_put.gif"); obj.title = flag == true ? title2 : title1; } function basename(src){ var idx = src.lastIndexOf('/'); var src = new String(src); return src.substring(idx + 1,src.length); } function optionreset(obj , key) { if(typeof key == "undefined") key = 0; for(var i = 0 ; i <= eval(obj).options.length ; ++i){ eval(obj).options[key] = null; } } function cfmchecked_rowdelete(objnm){ objnm = typeof(objnm) != 'undefined' ? objnm : 'selector[]'; var selector = getids(objnm); var del = []; for(var i = 1 , mx = selector.length; i < mx ; ++i){ if(selector[i].checked == true) del[del.length] = selector[i].value; } for(var i = 0 , mx = del.length; i < mx ; ++i){ selector = getids(objnm); for(var xi = 1 , xmx = selector.length; xi < xmx ; ++xi){ if(typeof(selector[xi]) == 'undefined') continue; if( selector[xi].value == del[i]){ selector[xi].parentNode.parentNode.parentNode.removeChild(selector[xi].parentNode.parentNode); } } } } function dyn_button(id){ getid(id).onmouseup = function(){ this.style.marginTop = "0px"; this.style.marginBottom = "0px"; } getid(id).onmousedown = function(){ this.style.marginTop = "1px"; this.style.marginBottom = "-1px"; } } function tag2querystring(objnm){ var getobj = getids(objnm.replace(/\getid\getidinc/g, '')); var nm = ""; var retdata = new Array(); var ta = ""; for(var i = 0; i < getobj.length; ++i){ nm = objnm.replace(/\getid\getidinc/g , i); switch(getobj[i].type){ case "checkbox": case "radio": ta = getobj[i].checked == true ? getobj[i].value : ""; break; case "hidden": case "text": case "textarea": case "password": ta = getobj[i].value != "" ? getobj[i].value : ""; break; default : ta = getobj[i].tagName.toLowerCase() == "select" ? getobj[i].options[getobj[i].options.selectedIndex].value : ""; break; } retdata[retdata.length] = encodeURIComponent(nm) + "=" + encodeURIComponent(ta); } return retdata.join("&"); } function convert_encodeURI(str){ var retdata = str.split("&"); var y = ''; for(var i = 0 ; i < retdata.length ; ++i){ y = retdata[i].split("="); y[1] = encodeURIComponent(y[1]); retdata[i] = y.join("="); } return retdata.join("&"); } function sslencryptsubmit(frm , addurl , skip_form){ if(getid('_h_frm') != undefined){ var f = getids('_h_frm'); var l = f.length-1; for(var x = l ; x >= 0 ; x--) f[x].parentNode.removeChild(f[x]); } frm.onsubmit = function(){ return false; } var fm = document.createElement("FORM"); var skipssl = sslencrypt_skipparams(addurl); var fmdata = (form2urlquerystring(frm , navigator.userAgent.indexOf("MSIE 6") != -1 ? undefined : 1 , skip_form , skipssl) + (typeof(addurl) != 'undefined' ? '&' + addurl : '')).split("&"); var fmindata; for( var i = 0 ; i < fmdata.length ; ++i){ var ip = document.createElement("INPUT"); fmindata = fmdata[i].split('='); ip.setAttribute('name' , fmindata[0]); ip.setAttribute('id' , fmindata[0]); ip.setAttribute('value' , decodeURIComponent(fmindata[1])); ip.type = 'hidden'; fm.appendChild(ip); } fm.setAttribute('name' , '_h_frm'); fm.setAttribute('id' , '_h_frm'); fm.setAttribute('method' , 'post'); fm.setAttribute('action' , frm.getAttribute('action')); document.body.appendChild(fm); getid('_h_frm').submit(); } function sslencrypt(vls , is_encode , ea){ if(navigator.userAgent.indexOf("MSIE 6") != -1 || typeof(_is_sslencrypt) == 'undefined' || _is_sslencrypt == false) return vls; else if(ea != null){ return aSSL.encrypt(typeof(is_encode) != 'undefined' && is_encode == false ? vls : convert_encodeURI(vls)); } else{ return '_IGEARSSLMODE=decrypt&_IGEARSSLDATA=' + aSSL.encrypt(typeof(is_encode) != 'undefined' && is_encode == false ? vls : convert_encodeURI(vls)); } } function ssldecrypt(vls){ return aSSL.decrypt(vls); } function sslencrypt_skipparams(u){ u = _getparams(u); var skipssl = []; for(var x in u){ skipssl.push(x); } return skipssl; } function sslencrypt_param(v , is_ssl , skipssl , is_enckey){ if(is_ssl == null) is_ssl = true; if(typeof(is_ssl) != 'undefined' && is_ssl == true && typeof(aSSL) != 'undefined'){ var retdata = v; var encd = []; if(skipssl != null){ skipssl.push('loadfile'); skipssl.push('_IGEARSSLMODE'); skipssl.push('setupload_predir'); } var skipssl = skipssl != null ? skipssl : ['loadfile' , '_IGEARSSLMODE' , 'setupload_predir']; for(var k = 0 ; k < retdata.length ; ++k){ var x = retdata[k].split('='); if(in_array(x[0] , skipssl)) continue; x[1] = sslencrypt(x[1] , false , true); encd.push(x[0]); x = x.join('='); retdata[k] = x; } if(is_enckey != null) return encd; else{ retdata.push('_IGEARSSLMODE=decrypt&_IGEARSSLDATANM=' + encodeURIComponent(json_encode(encd)) + '&'); return retdata; } } else return v; } function form2urlquerystring(objnm , is_ssl , skip_param , skipssl){ if(typeof(_AJAX_SERIALIZE_USE) != "undefined"){ var retdata = $(objnm).find(":not(:hidden[value=''], :checkbox[value=''] , :radio[value=''] , select[value=''])").serialize(); if(typeof(is_ssl) != "undefined"){ retdata = retdata.split("&"); retdata = sslencrypt_param(retdata , is_ssl , skipssl); retdata = retdata.join("&"); } return retdata; }else{ var getobj = typeof(objnm) == "object" ? objnm : getid(objnm); if(getobj == null) return; var skip_param = typeof(skip_param) == "undefined" ? {} : skip_param; var retdata = new Array(); var ta = ""; var nm = ""; var skip = false; var is_multiple = false; var length = getobj.length; skipssl = skipssl != null ? skipssl : []; for(var i = 0; i < length; ++i){ if(getobj[i].type != 'text' && getobj[i].type != 'tel' && getobj[i].type != 'number' && getobj[i].type != 'email' && getobj[i].type != 'url' && getobj[i].type != 'textarea' && !getobj[i].value) continue; switch(getobj[i].type){ case "checkbox": case "radio": ta = getobj[i].checked == true ? getobj[i].value : ''; if(((getobj[i].name).search(/\[(.*)\]/) >= -1 && getobj[i].type == 'radio') || getobj[i].type == 'checkbox') skip = !ta ? true : false; break; case "textarea": ta = getobj[i].value; break; case "hidden": case "text": case "tel": case "number": case "email": case "url": case "password": ta = getobj[i].value; break; default : if(getobj[i].tagName.toLowerCase() == "select" && getobj[i].options.selectedIndex > -1 && !getobj[i].getAttribute("multiple")) ta = getobj[i].options[getobj[i].options.selectedIndex].value; else if(getobj[i].tagName.toLowerCase() == "select" && getobj[i].getAttribute("multiple")){ is_multiple = true; var arselected = []; for (var k = 0; k < getobj[i].options.length; k++) if (getobj[i].options[k].selected) arselected.push(getobj[i].options[k].value); } else ta=""; break; } if(skip == false && !skip_param[getobj[i].name]){ if(!is_multiple) retdata[retdata.length] = ((getobj[i].name).search(/\[(.*)\]/) != -1 ? getobj[i].name : encodeURIComponent(getobj[i].name)) + "=" + encodeURIComponent(ta); else{ for(key in arselected){ retdata[retdata.length] = ((getobj[i].name).search(/\[(.*)\]/) != -1 ? getobj[i].name : encodeURIComponent(getobj[i].name)) + "=" + encodeURIComponent(arselected[key]); } arselected = []; is_multiple = false; } } if(skip_param[getobj[i].name]) skipssl.push(getobj[i].name); skip = false; } retdata = sslencrypt_param(retdata , is_ssl , skipssl); return retdata.join("&"); } } function toajaxcr_conv(str){ var c = ''; var r = ''; var retdata = ''; for(var i = 0 ; i < str.length ; ++i){ var c = str.charAt(i) var r = str.charCodeAt(i); if(r == 13) c = '%0D'; if(r == 10) c = '%0A'; retdata += c; } return retdata; } function literalmatchvalue(frminputnm , nm , blankskip , nmskip){ var nm = typeof(nm) != 'undefined' ? nm : new String(frminputnm).replace(/\[\]/gi,''); var frminputbox = getids(frminputnm); var retdata = new Array(); var ta; for(var i = 0; i < frminputbox.length ; ++i){ ta = ''; switch(frminputbox[i].type){ case "checkbox": case "radio": ta = frminputbox[i].checked == true ? frminputbox[i].value : ''; break; case "hidden": case "text": case "textarea": case "password": ta = frminputbox[i].value; break; default : ta = frminputbox[i].tagName.toLowerCase() == "select" ? frminputbox[i].options[frminputbox[i].options.selectedIndex].value : ''; break; } if(blankskip == true && !ta) continue; retdata[i] = typeof(nmskip) == 'undefined' ? encodeURIComponent(nm + '[' + i + ']') + '=' + encodeURIComponent(ta) : encodeURIComponent(ta); } return retdata.join('&'); } function checkboxkey(obj){ var a = typeof(obj) == 'object' ? obj : getids(obj); var ty , rt ; for(var i = 0 ; i < a.length ; ++i){ ty = a[i].getAttribute('type'); if(ty == 'checkbox' || ty =='radio') if(a[i].checked == true) return i; } } function checkboxvls(obj){ var a = typeof(obj) == 'object' ? obj : getids(obj); var ty , rt ; for(var i = 0 ; i < a.length ; ++i){ ty = a[i].getAttribute('type'); if(ty == 'checkbox' || ty =='radio') if(a[i].checked == true) rt = a[i].value; } return rt; } function searcher(obj , searchtext){ if(typeof(obj) != "object") return false; var sel = ""; var retdata = new Array(); if(typeof(obj.length) == "undefined"){ var rs = new RegExp('' + searchtext + '' , 'ig'); sel = rs.exec(obj.value); if(sel != null){ retdata[0] = true; } } else { for(var i = 0 ; i < obj.length ; ++i){ var rs = new RegExp('' + searchtext + '' , 'ig'); sel = rs.exec(obj[i].value); if(sel != null){ retdata[retdata.length] = i; } } } return retdata; } function in_array( str , arr){ if(typeof(arr) != "object") return false; var retdata = false; var length = arr.length; if(arr instanceof Object){ for(var i in arr){ retdata = str == arr[i] ? true : false; if(retdata == true) break; } } else if(arr instanceof Array){ for(var i = 0; i < length; ++i){ retdata = str == arr[i] ? true : false; if(retdata == true) break; } } return retdata; } function cfmchecked(frmobj , cfmvls , base){ if(typeof(frmobj) == 'undefined') return; var basecnt = 0; var pinput = new String(cfmvls).split(","); if(typeof(frmobj) == 'object' && frmobj.length == undefined){ frmobj.checked = frmobj.value == cfmvls ? true : false; } else { for(var i = 0 ; i < frmobj.length; ++i){ for(var j = 0; j < pinput.length; ++j){ if(frmobj[i].value == pinput[j]){ frmobj[i].checked = true; ++basecnt; } } } } if(basecnt == 0 && typeof(base) != 'undefined') base.checked = true; } function is_checked(obj){ var selector = typeof(obj) == 'object' || typeof(obj) == 'function' ? obj : getids('selector[]'); var t = 0; for(var i = 0 ; i < selector.length ; ++i){ if(selector[i].value != '' && selector[i].checked == true) ++t; } return t >0 ? t : false; } function is_empty(vls){ return typeof(vls) == 'undefined' ? true : false; } function igeardomcontrol(){ this.nodearray = ""; } igeardomcontrol.prototype = { get_nodedata_array : function(nodeobj){ var retdata = new Array(); for(var i = 0 ; i < nodeobj.length ; ++i){ if(nodeobj[i].nodeName != "#text" && nodeobj[i].nodeName != "undefined"){ retdata[nodeobj[i].nodeName] = nodeobj[i].childNodes[0].nodeValue; } else if(typeof(nodeobj[i].nodeValue) != 'undefined'){ retdata[nodeobj[i].nodeName] = nodeobj[i].nodeValue; } } return retdata; }, get_attribute_array : function(nodeobj){ var nodenm = ""; var nodevls = ""; var retdata = new Array(); nodenm = nodeobj.attributes; for(var j = 0 ; j < nodenm.length ; ++j){ if(nodenm.item(j).nodeName) retdata[nodenm.item(j).nodeName] = nodenm.item(j).nodeValue; } return retdata; } } function entersubmit(frm , func){ var getinput = typeof(frm) == 'object' ? frm : document[frm].elements; var brw = typeof(document.all) != 'undefined' ? 'ie' : 'etc'; for(var i =0 ; i < getinput.length ; ++i){ if(getinput[i].type == "text" || getinput[i].type == "password"){ if(getinput[i].getAttribute('skip_entersubmit') != 'undefined' && getinput[i].getAttribute('skip_entersubmit') != null) continue; addevent(getinput[i] , 'keydown' , function(e){ var t = ""; if(brw == "ie") t = event.keyCode == 13 ? true : ""; else t = e.keyCode == 13 ? true : ""; if(t == true && typeof(func) == 'function'){ try{ if(e.srcElement.getAttribute('skip_entersubmit') == null){ func(e); return false; } }catch(i){ if(e.target.getAttribute('skip_entersubmit') == null){ func(e); return false; } } } }); } } } function enterpartsubmit(s , func){ if(typeof(s) != 'object' || typeof(func) != 'function') return false; addevent(s , 'keydown' , function(e){ var obj = typeof(e.target) != 'undefined' ? e.target : e.srcElement; obj.setAttribute('skip_entersubmit' , true); if(typeof(e) != 'undefined' && e.keyCode == 13){ document.body.focus(); func(obj); evt_cancel(e); } else if(typeof(e) != 'undefined' && e.keyCode == 13){ document.body.focus(); func(obj); evt_cancel(e); } }); } function keymatch(event , reg){ var ev = event || window.event; var evcode = ev.keyCode != null ? ev.keyCode : ev.which; var str = String.fromCharCode(evcode); var n = new RegExp(reg); if(n.exec(str) == null && evcode != 8 && evcode != 9 ){ if(typeof(document.all) == 'undefined'){ ev.preventDefault(); } else{ ev.returnValue = false; } } } function popzipcode(resultfunction){ if($("#__zipcode_result").length == 0){ $("body").prepend("
"); } $("#__zipcode_result").html(''); var ntime = new Date().getTime(); $( "#__zipcode_result" ).load( plugin + 'zipcode/zipcode_new.php?time=' + ntime + '&openerfunc='+resultfunction, function() { __zipcode_pageinit(); }); } function popmemdetail(memid){ window.open('../member/member_detail.php?memid=' + memid , 'pop_memdetail' , 'width=650,height=1,scrollbars=yes'); } function divdisplay(divnm , key , command){ key = typeof key == "undefined" ? 0 : key; var tdiv = getids(divnm); tdiv[key].style.display = command; } function editorctrl(plugin_path , divnum){ igeared[divnum] = new igeareditor(document.getElementById("igeareditor_put" + divnum), plugin_path + "igeareditor/"); igeared[divnum].conf.width = "530"; igeared[divnum].init(); } function buffimg(){} function print_rr(obj , line , is_hidden){ getid("submitframe").width = "800px"; getid("submitframe").height = "500px"; getid("submitframe").style.display = ''; var msg = []; if(typeof(line) == 'undefined') msg[msg.length] = "-------------------------
"; if(typeof obj == "object"){ for(var i in obj){ msg[msg.length]= "*" + i + " => " + obj[i] + "(" + typeof(obj[i]) + ")
"; } } else { msg[msg.length] = obj + "
"; } if(typeof(line) == 'undefined') msg[msg.length] = "-------------------------
"; if(typeof(is_hidden) == 'undefined'){ var prtviewer = eval("submitframe"); prtviewer.document.body.innerHTML += msg.join(''); prtviewer.scrollBy(0,prtviewer.document.body.scrollHeight); } return msg.join(''); } function fixalert(msg , is_html){ if(typeof(_logwin) == 'undefined' || typeof(_logwin.document) == 'undefined'){ _logwin = window.open('about:blank' , '_logalert' , 'width=800,height=450,scrollbars=yes,resizable=yes'); _logwin.document.write(''); } addevent(window , 'unload' , function(){ try{ document.readyState == 'complete' && typeof(_logwin) != 'undefined' ? _logwin.close() : ''; }catch(e){} }); _logwin.document.write("==========
"); _logwin.document.write(typeof(is_html) != undefined ? msg : htmlspecialchars(msg)); _logwin.document.write("
==========

"); _logwin.scrollTo(0 , _logwin.document.body.scrollHeight); } function htmlspecialchars(st) { var st = new String(st); st = st.replace(/&/g,"&") ; st = st.replace(/\"/g,""") ; st = st.replace(/\'/g,"'") ; st = st.replace(//g,">") ; st = st.replace(/\n/g,"
") ;  return st; } function cancel_confirm(){ if(parent.$('.dyn_alert_item').length > 0){ parent.$('.dyn_alert_item').hide(); } if(getid('dyn_alert_div') != null){ getid('dyn_alert_div').style.display = "none"; getid('dyn_alert_div_ifrm').style.display = "none"; getid('dyn_alert_overlay').style.display = "none"; } } function dyn_confirm(msg , yesfunction , nofunction , displaytime , topmsgnum , width , height){ if(typeof nofunction == "undefined" || nofunction == "") nofunction = 'cancel_confirm();return false;'; else nofunction += ');return false;'; yesfunction += ');return false;'; var btn = "  "; dyn_alert_confirm(msg , displaytime , topmsgnum , width , height , true , undefined , btn); } function dyn_confirm2(msg , yesfunction , nofunction , displaytime , topmsgnum , width , height){ nofunction = nofunction + ';cancel_confirm();'; var btn = "  "; dyn_alert_confirm(msg , displaytime , topmsgnum , width , height , true , undefined , btn); } function dyn_alert_confirm(msg , displaytime , topmsgnum , width , height , is_html , focus , btn){ var ifrmnm = "dyn_alert_div_ifrm"; var divnm = "dyn_alert_div"; var tdnm = "dyn_alert_msgspot"; var overlay = "dyn_alert_overlay"; width = typeof width != "undefined" ? width : 370; height = typeof height != "undefined" ? height : 200; is_html = typeof is_html != "undefined" ? is_html : false; topmsgnum = typeof topmsgnum == "undefined" ? 10000 : topmsgnum; var tb = "
\

" + blang_javascript[45000] + "

\
" + msg + "
\
" + btn + "
\
"; if(getid(divnm) == null){ var div = document.createElement("DIV"); div.id = divnm; div.name = divnm; var getbrwsz = getbrwsize(); var getscrollsz = getscrollsize(); var getoffsetsz = getoffsetsize('container_all'); div.overflow = "visible"; div.margin = "0px"; div.style.top = new String(getscrollsz.top + getbrwsz.height / 2 - (height / 2)) + "px"; div.style.left = new String(getbrwsz.width / 2 - (width / 2)) + "px"; div.style.position = "absolute"; div.style.zIndex = "9999999"; div.style.width = width + "px"; div.style.height = height + "px"; div.style.backgroundColor = "#ffffff"; div.style.textAlign = 'center'; div.innerHTML = tb; var ifrm = document.createElement("IFRAME"); ifrm.width = width + "px"; ifrm.height = parseInt(height) + 32 + "px"; ifrm.style.position = "absolute"; ifrm.style.zIndex = 1; ifrm.style.top = div.style.top; ifrm.style.left = div.style.left; ifrm.frameBorder = 0; ifrm.id = ifrm.name = ifrmnm; document.body.appendChild(ifrm); document.body.appendChild(div); var ovldiv = document.createElement("DIV"); var scrsize = getscrollsize(); var brwsize = getbrwsize(); var getoffsetsz = getoffsetsize('container_all'); ovldiv.style.width = brwsize.width + "px"; ovldiv.style.height = new String(getoffsetsz.height) + "px"; ovldiv.name = ovldiv.id = overlay; ovldiv.style.top = "0px"; ovldiv.style.left = "0px"; ovldiv.style.filter = "alpha(opacity=60)"; ovldiv.style.MozOpacity = 60 / 100; ovldiv.style.opacity = 60 / 100; ovldiv.style.position = "absolute"; ovldiv.style.zIndex = "99"; document.body.appendChild(ovldiv); getid(overlay).style.backgroundColor = "#ffffff"; } else{ getid(divnm).innerHTML = tb; getid(tdnm).innerHTML = msg; getid('dyn_alert_div').style.display = ''; getid('dyn_alert_div_ifrm').style.display = ''; getid('dyn_alert_overlay').style.display = ''; var getbrwsz = getbrwsize(); var getscrollsz = getscrollsize(); var getoffsetsz = getoffsetsize('container_all'); getid(divnm).style.top = new String(getscrollsz.top + getbrwsz.height / 2 - (height / 2)) + "px"; getid(divnm).style.left = new String(getbrwsz.width / 2 - (width / 2)) + "px"; getid(ifrmnm).style.top = getid(divnm).style.top; getid(ifrmnm).style.left = getid(divnm).style.left; } displaytime = typeof displaytime == "undefined" ? 99999999 : displaytime; if(displaytime != true){ setTimeout("getid('" + divnm + "').style.display = 'none';" , displaytime); setTimeout("getid('" + ifrmnm + "').style.display = 'none';" , displaytime); setTimeout("getid('" + overlay + "').style.display = 'none';" , displaytime); } if(getid('btn_close') != null) getid('btn_close').focus(); } function dyn_alert(msg , displaytime , topmsgnum , width , height , is_html , focus){ if( $('.dyn_alert_item').length > 0 ){ $('.dyn_alert_item').remove(); } cancel_confirm(); _jq(function($){ width = typeof width != "undefined" ? width : 400; height = typeof height != "undefined" ? height : 80; is_html = typeof is_html != "undefined" ? is_html : false; var spot_o = top.$('.spot_dyn_alert'); if(spot_o.length == 0){ var spot = ''; top.$('#container_all').append(spot); spot_o = top.$('.spot_dyn_alert'); } var tmpfunc = function(){ var dyn_alert_pos = get_object_position(spot_o.find(".dyn_alert_item:eq(0)") , "center_middle" , undefined , undefined , true); spot_o.css('top' , dyn_alert_pos.top).css('left' , dyn_alert_pos.left).css('display' , 'block'); }; $(window).on("resize.dynalertmethod" , function(){ tmpfunc(); }).on("scroll.dynalertmethod" , function(){ tmpfunc(); }); $(window).trigger("resize.dynalertmethod"); var addstyle =''; if( $(".dyn_alert_item").length > 0){ var item_len = $(".dyn_alert_item").length; addstyle = "style=\"position:absolute;top:" + (item_len*10) + "px;left:" + (item_len*10) + "px\""; } spot_o.append("
\

" + blang_javascript[45001] + "

\
" + msg + "
\ "); top.$('.dyn_alert').css('width' , width); top.$('.dyn_alert_item').css('width' , width).oneTime(typeof(displaytime) != 'undefined' ? displaytime : 5000 , function(){ $(this).fadeOut('slow' , function(){ top.$(this).remove(); top.$(window).off("resize.dynalertmethod"); top.$(window).off("scroll.dynalertmethod");}); }); dyn_alert_pos = get_object_position(spot_o.find(".dyn_alert_item:eq(0)") , "center_middle");//2020-02-25 김관노 추가 실사이즈 받을때 다시 체크 spot_o.css('top' , dyn_alert_pos.top).css('left' , dyn_alert_pos.left).css('display' , 'block'); }); } function getbrwsize(){ return {"width" : (self.width ? self.width : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth)) , "height" : (self.height ? self.height : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)) } } function getscrollsize(){ return {"top" : (self.pageYOffset ? self.pageYOffset : (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)) , "left" : (self.pageXOffset ? self.pageXOffset : (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft)) } } function getoffsetsize(id){ var obj = typeof(id) == 'object' ? id : getid(id); return typeof id != "undefined" ? { width : obj.offsetWidth , height : obj.offsetHeight} : ( document.body.scrollHeight > document.body.offsetHeight ? { width : document.body.scrollWidth , height : document.body.scrollHeight} : {width : document.body.offsetWidth , height : document.body.offsetHeight}); } function getnowoffset(tid){ if(tid == null) return {left: 0 , top : 0}; else if(tid.style.position == 'fixed'){ var scr = getscrollsize(); return {'left' : tid.offsetLeft , 'top' : scr.top == 0 ? tid.offsetTop : tid.offsetTop + scr.top} } else return {'left' : tid.offsetLeft + parseInt(tid.offsetParent != document.body ? getnowoffset(tid.offsetParent).left : 0) , 'top' : tid.offsetTop + parseInt(tid.offsetParent != document.body ? getnowoffset(tid.offsetParent).top : 0)}; } function selbox(obj , cmd , skip , func){ if(typeof(skip) != "undefined"){ var getskip = skip.split(","); var theskip = false; } if(typeof(obj) == "object"){ for(var i=0; i < $(obj).length; ++i){ var newobj = typeof obj[i] == 'undefined' && $(obj).length == 1 ? obj : obj[i]; if(typeof(skip) != "undefined" && skip != ''){ for(var jj = 0; jj < getskip.length ; ++jj){ theskip = getskip[jj] == newobj.value ? true : false; if(theskip == true) break ; } if(theskip == true) continue; } if(newobj.disabled == true) newobj.checked = false; else { switch(cmd){ case "enable": newobj.checked = true; break; case "reflect": if(newobj.checked == true) newobj.checked = false; else if(newobj.checked == false) newobj.checked = true; break; case "disable": newobj.checked = false; break; } } } } if(typeof(func) == 'function') func(); } function sp(code){ if(typeof(code) != 'function') return false; if(typeof(print_rr) == 'undefined'){ function print_rr(a){ alert(a);}}; var _start = new Date().getTime(); code(); var _end = new Date().getTime(); print_rr("Elapse time : "+(_end-_start)/1000+"ms"); return true; } function setcookie(name, value , savetime , domain) { var plustime = typeof savetime == "undefined" ? 86400 : savetime; var today = new Date(); var expire_date = new Date(); expire_date.setTime(today.getTime() + ((3600 * 9) + parseInt(plustime)) * 727); document.cookie = name + "=" + escape(value) + "; path=/; expires=" + expire_date.toUTCString() + (typeof(domain) != 'undefined' ? "; domain=" + location.host : ''); } function addevent(obj , event , func){ if(typeof(addDOMLoadEvent) != 'undefined' && addDOMLoadEvent != null && obj === window && event == 'load'){ addDOMLoadEvent(func); } else{ if(typeof(func) != "function") return false;//2018-01-05 김관노 패치 var xx =obj.attachEvent ? obj.attachEvent('on' + event , func) : (obj.addEventListener ? obj.addEventListener(event , func , true) : ''); if(!xx){ var old = obj[event]; obj[event] = typeof obj[event] != 'function' ? func : obj[event] = function(e){ try{ old(e); } catch(e){}; func(e); } } addeventclear.add(obj , event , func , true); } } var addeventclear = function(){ var item = []; return { add : function(){ item.unshift(arguments); }, get : function(obj){ var length = item.length; var vls = ''; for(var i = 0; i < length ; ++i){ vls = item[i]; if(typeof(obj) != 'undefined' && vls[0] == obj) return vls[0]; } }, reset : function(e , obj , evn){ var length = item.length; var vls = ''; for(var i = 0; i < length ; ++i){ vls = item[i]; if(typeof(obj) != 'undefined' && vls[0] != obj) continue; if(typeof(obj) != 'undefined' && vls[0] == obj && vls[1] != evn) continue; vls[1] = vls[1].substring(0, 2) != 'on' ? 'on' + vls[1] : vls[1]; vls[0].removeEventListener ? vls[0].removeEventListener(vls[1] , vls[2] , vls[3]) : (vls[0].detachEvent ? vls[0].detachEvent(vls[1] , vls[2]) : ''); vls[0][vls[1]] = null; } } }; }(); function evt_cancel(e){ e = e ? e : window.event; if(e.stopPropagation) e.stopPropagation(); if(e.preventDefault) e.preventDefault(); e.cancelBubble = true; e.cancel = true; e.returnValue = false; return false; } function getcookie(name) { var from_idx = document.cookie.indexOf(name+'='); if (from_idx != -1) { from_idx += name.length + 1; to_idx = document.cookie.indexOf(';', from_idx); if (to_idx == -1) { to_idx = document.cookie.length; }; return unescape(document.cookie.substring(from_idx, to_idx)); }; } function clearcookie(name) { var today = new Date(); var expire_date = new Date(today.getTime() - 60*60*24*1000); document.cookie = name + "= " + ";path=/; expires=" + expire_date.toGMTString(); } function getouterHTML(obj){ temp= obj.cloneNode(true); var tmpdiv = document.createElement("DIV"); tmpdiv.appendChild(temp); outer = tmpdiv.innerHTML; return outer; } function getchildnodelength(obj){ var is_ms10 = navigator.userAgent.indexOf("MSIE 10") != '-1' ? true : false; var retdata = 0; return $(obj).children().length;//2015-05-11 김관노 추가 IE9 에서 갯수가 제대로 안잡힘 이하 주석 } function prtnum(num , decpointspot){ var tnum = new String(num); decpointspot = typeof(decpointspot) != "undefined" && decpointspot != 0 ? parseInt(decpointspot) + 1 : 0; return tnum.substr(0 , parseInt(tnum.indexOf(".") > 0 ? tnum.indexOf(".") : tnum.length) + decpointspot); } function number_format(price , unit){ var addpriceflag = ""; var extprice = ""; unit = typeof(unit) == 'undefined' ? 1 : unit; price = price / unit; price=new String(price); price = price.replace(/,/gi,''); if(price.indexOf(".") != -1){ var tmpprice = price.split("."); price = tmpprice[0]; extprice = "." + tmpprice[1]; }; if(price.indexOf("-") == 0){ price = price.replace(/-/gi,''); addpriceflag = "-"; }; var tstrLen=price.length; var okstr=new String(); var ii=2; var comma=3; for(var i=tstrLen;i>=0;--i){ if(ii%comma==0&&i!=tstrLen){ okstr=","+okstr; ii=0; }; okstr=price.charAt(i)+okstr; ++ii; }; okstr=okstr.substring(0,parseInt(okstr.length)-1); okstr = addpriceflag + okstr + extprice; return okstr; } function mSelected(obj){ var objEntity=multiSelected(obj); var entity=new Array(); var retdata=new String(); var a=new String(); for(var i = 0 ; i < objEntity.length-1 ; ++i){ a = objEntity[i]; if(obj[a].value) entity[i] = obj[a].value; }; retdata = entity.join('^'); return retdata; }; function multiSelected(fmObj){ var lengths=fmObj.length; var saveIndex=new String(); for(var i=0;i 0 ){ var len; s = obj.value; len = s.length; for (var i = 0; i < len; i++) { if (s.charCodeAt(i) < 128 ){ dyn_alert(blang_javascript[10103]); obj.value = ""; return; }; }; }; }; function ctrl_optionspot(cnum , sdivspot , tdivspot , idx , renm){ var tdiv = typeof(tdivspot) != 'string' ? tdivspot : getids(tdivspot); var sdiv = typeof(sdivspot) != 'string' ? sdivspot : getids(sdivspot); var j = idx||0; if(cnum > sdiv.length){ for(var i = sdiv.length; i < cnum; ++i){ var cl = sdiv[0].childNodes[0].parentNode.cloneNode(true); if(renm != null){ var fi = ['radio' , 'checkbox']; $.each(fi , function(){ var nm = $(cl).find(':' + this).attr('name'); if((nm).search(/\[.*?\]/) != -1){ $(cl).find(':' + this).attr('name' , (nm).replace(/\[.*?\]/ , "[" + i + "]")); } }); } tdiv[j].appendChild(cl); } } else if(cnum < sdiv.length){ for(var i = sdiv.length; i > cnum ; --i){ tdiv[j].removeChild(sdiv[i - 1]); } } } function get_thumbnail_check(){ if(typeof(getid('is_thumbnail[]')) != "undefiend"){ var obj = getids('is_thumbnail[]'); for(var j = 0 ; j < obj.length ; j++){ if(obj[j].checked == true) thumbnail_chknum = j; } } } function get_thumbnail_keep(){ if(typeof(getid('is_thumbnail[]')) != "undefiend" && typeof(thumbnail_chknum) != 'undefined'){ var obj = getids('is_thumbnail[]'); for(var j = 0 ; j < obj.length ; j++){ if(thumbnail_chknum == j) obj[j].checked = true; else obj[j].checked = false; } } } function ctrl_optionchildspot(cmd , sdivspot , tdivspot , langnum , delskip , maxlen , minlen){ langnum = typeof(langnum) == 'undefined' ? 30014 : langnum; delskip = typeof(delskip) == 'undefined' ? false : true; maxlen = typeof(maxlen) == 'undefined' ? 999 : maxlen; minlen = typeof(minlen) == 'undefined' ? 1 : minlen; if(cmd == "add"){ var fnm = $(sdivspot).attr("name"); if($("[name=" + fnm+ "]").length >= maxlen){ dyn_alert('더이상 추가 할수 없습니다'); return false; } get_thumbnail_check(); $(tdivspot).append(getouterHTML(sdivspot)); get_thumbnail_keep(); }else if(cmd == "del"){ if(getchildnodelength(tdivspot) <= minlen && delskip == false){ var cmt = ""; if(minlen > 1){ cmt = "필드구성은 최소 "+minlen+"개이상 이어야 합니다."; }else{ cmt = typeof(blang_part_javascript) != 'undefined' ? blang_part_javascript[langnum] : flang_part_javascript[langnum]; } dyn_alert(cmt); return; } tdivspot.removeChild(sdivspot); } } function ctrl_tablechild(cmd , strobj , tbodyobj , min , max , func){ var j = 0; for(var i = 0 ; i < tbodyobj.children.length; ++i){ if(tbodyobj.children[i].getAttribute('id') != strobj.id) ++j; else break; } frmnum = tbodyobj.children.length - j; min = typeof(min) == 'undefined' ? 1 : min; max = typeof(max) == 'undefined' ? 99999 : max; if(cmd == 'add'){ if(frmnum > max){ dyn_alert((blang_javascript[30043]).replace(/\$\$max/ , max)); return false; } var strcpobj = strobj.cloneNode(true); tbodyobj.appendChild(strcpobj); } else if(cmd == 'del'){ if(frmnum <= min) { dyn_alert((blang_javascript[30044]).replace(/\$\$min/ , min)); return false; } tbodyobj.removeChild(strobj); } if(typeof(func) == 'function'){ func(frmnum); } } function getkey(obj , compareobj){ obj = typeof(obj) == "object" ? obj : getids(obj); var retdata = null; for(var i = 0 ; i < obj.length ; ++i){ if(obj[i] === compareobj) retdata = i; } return retdata; } function getbottom(obj){ obj = typeof(obj) == "object" ? obj : getid(obj); return obj.scrollHeight - obj.clientHeight; } function getid(objnm , tdoc){ var x = typeof(tdoc) != "undefined" && tdoc != "" ? eval(tdoc).document.getElementById(objnm) : document.getElementById(objnm); return x != null ? x : getids(objnm)[0]; } function getids(objnm , tdoc){ return typeof(tdoc) != "undefined" && tdoc != "" ? eval(tdoc).document.getElementsByName(objnm) : document.getElementsByName(objnm); } function getnames(objnm , tdoc){ return typeof(tdoc) != "undefined" && tdoc != "" ? eval(tdoc).document.getElementsByTagName(objnm) : document.getElementsByTagName(objnm); } function coloring(compareobj , basecolor , changecolor){ var reset = false; var nm = ''; basecolor = is_empty(basecolor) ? 'ffffff' : basecolor; if(typeof(compareobj) != 'object'){ reset = true nm = compareobj; } else { nm = is_empty(compareobj.id) == false ? compareobj.id : compareobj.name; } var targets = getids(nm); for(var i = 0 ; i < targets.length ; ++i){ if(compareobj == targets[i] && reset == false){ targets[i].style.color = '#' + changecolor; targets[i].style.fontWeight = 'bold'; } else{ targets[i].style.color = '#' + basecolor; targets[i].style.fontWeight = 'normal'; } } } function categoryview(cmd , key){ var subcatdiv = getids('subcategoryitem'); if(typeof(subcatdiv[key]) == 'undefined') return false; subcatdiv[key].style.display = cmd; } function product_selectoption(addparam , callback , lastcallback , width , height , is_move){ if(typeof(ovl) == 'undefined') ovl = new ovlmsg(); var params = '&setupload_predir=product&loadfile=product_selectoption&' + addparam; ovl.popupifrm('selectoption' , front + 'product/product_selectoption.php?' + params , width , height , undefined , undefined , is_move); } function blightbox(params){ var target = bcommon + 'loadajax.php'; var flag = ''; var callback = function(){} var lastcallback = function(rt){} ovl.screen(params , flag , callback , lastcallback , target); } function flightbox(params){ var target = fcommon + 'floadajax.php'; var flag = ''; var callback = function(){} var lastcallback = function(rt){} ovl.screen(params , flag , callback , lastcallback , target); } var suggest_result = {}; function suggest_searchwords(o , size , pos , buff){ var url = front + 'product/product_searchword.php?str='; var p = '_swordsdiv'; if(typeof(size) == 'undefined') size = '0;0'; var swh = size.split(';'); swh[0] = typeof(swh[0]) != 'undefined' ? parseInt(swh[0]) : 0; swh[1] = typeof(swh[1]) != 'undefined' ? parseInt(swh[1]) : 0; if(typeof(plus) == 'undefined') plus = '0;0'; var wh = pos.split(';'); wh[0] = typeof(wh[0]) != 'undefined' ? parseInt(wh[0]) : 0; wh[1] = typeof(wh[1]) != 'undefined' ? parseInt(wh[1]) : 0; if(getid(p) == null){ var ddv = document.createElement("DIV"); ddv.id = ddv.name = p; ddv.style.overflow = 'auto'; ddv.style.display = 'none'; ddv.style.backgroundColor = '#ffffff'; ddv.style.zIndex = '999999'; ddv.style.textAlign = 'left'; o.parentNode.appendChild(ddv); } _jq(function($){ $(o).attr('sel' , '').attr('autocomplete' , 'off').keyup(function(e){ var is_ie = navigator.userAgent.indexOf("MSIE") != '-1' ? true : false; var e = is_ie ? event : e; if(typeof(e) == 'undefined'){ return; } var kcode = e.keyCode; if(kcode == 9 || e.shiftKey || kcode == 38 || kcode == 16 || kcode == 40) return; var oo = this; if($('#' + p).css('display') == 'none'){ var tipos = getnowoffset(oo); $('#' + p).show().css({ 'height' : 300 + swh[1], 'width' : $(o).width() + swh[0] , 'border' : '1px solid #d0d0d0' , 'padding' : '3px' , 'position' : 'absolute' , 'zIndex' : '999' , 'left' : tipos.left + wh[0] , 'top' : tipos.top + oo.offsetHeight + wh[1] }); } var searchword = $(this).attr('value'); var psearchword = RegExp.escape($(this).attr('value')); var ds = {}; var pp = suggest_result[$(this).attr('name')]; var is_buff = typeof(buff) != 'undefined'; if(typeof(pp) == 'undefined') pp = suggest_result[$(this).attr('name')] = is_buff ? buff : {}; if(is_buff || typeof pp[searchword] == 'object'){ ds = is_buff ? pp : pp[searchword]; var h = ''; $(ds).each(function(i){ if(is_buff && this.sword.search(psearchword) == -1) return; h += '
' + this.sword.replace(searchword , '' + searchword + '') + '
'; }); $('#' + p).html(h); $('.suggestitem').mousedown(function(){$(o).val(trim($(this).text())); $('#searchfrm').submit();}).mouseenter(function(){ $(this).css('backgroundColor' , '#F4F4F4'); }).mouseout(function(){ $(this).css('backgroundColor' , '#ffffff'); }).css('cursor' , 'pointer'); $('.suggestitem_word').mouseenter(function(){ $('.suggestitem').css('backgroundColor' , '#F4F4F4'); }).mouseout(function(){ $('.suggestitem').css('backgroundColor' , '#ffffff'); }); } else if(typeof(buff) == 'undefined'){ $.getJSON(url + encodeURIComponent(searchword) , function(dt){ ds = pp[searchword] = dt; var h = ''; $(ds).each(function(i){ h += '
' + this.sword.replace(searchword , '' + searchword + '') + '
'; }); $('#' + p).html(h); $('.suggestitem').mousedown(function(){$(o).val($(this).text()); $('#searchfrm').submit();}).mouseenter(function(){ $(this).css('backgroundColor' , '#F4F4F4'); }).mouseout(function(){ $(this).css('backgroundColor' , '#ffffff'); }).css('cursor' , 'pointer'); $('.suggestitem_word').mouseenter(function(){ $('.suggestitem').css('backgroundColor' , '#F4F4F4'); }).mouseout(function(){ $('.suggestitem').css('backgroundColor' , '#ffffff'); }); }); } }).keydown(function(){ var is_ie = navigator.userAgent.indexOf("MSIE") != '-1' ? true : false; var e = is_ie ? event : e; if(typeof(e) == 'undefined'){ return; } var kcode = e.keyCode; var mx = $('.suggestitem').length; var minuskey = ((kcode == 9 && e.shiftKey) || kcode == 38); var pluskey = kcode == 9 || kcode == 40; if((minuskey || pluskey) && mx > 0){ var m = 0; var n = $(o).attr('sel'); n = n === '' ? 0 : (minuskey ? n-1 : n+1); $('.suggestitem').each(function(i){ if(i == n){ var xo = i; xo = xo < 0 ? 0 : xo; xo = xo > mx ? mx : xo; $(o).attr('sel' , xo); $(o).val(trim($(this).text())); $(this).mouseenter(); } else{ $(this).mouseout(); m++; } }); if(m == $('.suggestitem').length){ $(o).attr('sel' , ''); $(o).blur();} return false; } }).blur(function(){ $('#' + p).html(''); $('#' + p).hide(); }); }); } function _jq(func){ return jQuery(document).ready(function($){ return $(func); }); } function dropfloor(vls , seed , is_up){ var mod = Math.pow(10 , seed); return (is_up != null ? Math.ceil : Math.floor)(vls * mod) / mod; } function scalefloor(vls , seed){ seed = seed||0; var mod = Math.pow(10 , seed); return Math.floor(Math.round(vls) * mod) / mod; } function getapplyexchangerate(vls){ if(typeof(_exchangerate) != 'undefined' && vls != null) vls /= _exchangerate; return vls; } function money_format(vls , unit){ var payunit = ''; if(typeof(_typeofpay) != 'undefined'){ switch(_typeofpay){ case 'en_US.utf8': payunit = 'USD'; break; } } if(payunit) vls = getapplyexchangerate(vls); return payunit + ' ' + number_format(vls , unit); } function is_params(nm){ var urlquery = new String(window.location.href).split("?"); var vls = new String(urlquery[1]).split("&"); for(var i = 0 ; i < vls.length ; ++i){ if((vls[i]).search(new RegExp("^" + nm + "+" , "ig")) != -1){ return true; } } return false; } flashobj = new igear_objstart(); addevent(window , 'unload' , addeventclear.reset); addevent(window , 'load' , function(){ if(is_params('_bug')){ $('form').attr('target' , ''); } var _windowopen = window.open; try{ window.open = function(p , q , r){ if(is_params('_bug')){ p += ((p).search(/\?/) != -1 ? '&' : '?') + '_bug=1'; } return _windowopen(p , q || '' , r || ''); } }catch(e){alert(e.message);} }); function mem_certain_set(obj){ $(obj).each(function(k){ var vls = op = new Array() , dt , itype; dt = json_decode($(this).attr("info")); vls = dt["mem_optvls"].split("\n"); if(dt["mem_opttype"] == '1'){ op.push(""); } for(var i = 0 ; i < vls.length; i++){ switch(dt["mem_opttype"]){ case "1": var b = ""; op.push(b); break; case "2": case "3": case "4": case "5": if(dt["mem_opttype"] == 2){ if(typeof _mobile != 'undefined'){ b = ""; }else{ b = "" + vls[i]; } }else if(dt["mem_opttype"] == 3){ if(typeof _mobile != 'undefined'){ b = ""; }else{ b = "" + vls[i]; } }else if(dt["mem_opttype"] == 4){ b = ""; }else{ b = vls[i]; } op.push(b); break; } }//end for if(dt["mem_opttype"] == 1){ var select = document.createElement('select'); $(select).attr("name" , "mem_optvls["+k+"][]").attr("opt_nm" , dt["mem_optnm"]).addClass("mem_optvls"); $(select).append(op.join(" ")); $(this).append($(select)); }else $(this).html(op.join(" ")); $(this).append(""); }); } function autocomplete_data(jsond , target){ try{ var jsond = $.parseJSON(jsond); var obj , caseo , skipobj = new Array; if(jsond == null || typeof jsond != "object" || $(target).length != 1) return false; for(var key in jsond){ obj = $(target).find("[name='" + key + "']").length > 0 ? $(target).find("[name='" + key + "']") : $(target).find("[name='" + key + "[]']"); if($(obj).length == 0){ skipobj.push(key); continue; } caseo = typeof obj.attr("type") == "undefined" ? obj[0].tagName.toLowerCase() : obj.attr("type"); switch(caseo){ case "hidden": case "text": case "textarea": obj[0].value = jsond[key]; break; case "checkbox": if($.isArray(jsond[key])){ for(var i = 0 ; i < jsond[key].length ; i++){ $(obj).filter("[value=" + jsond[key][i] + "]").attr("checked" , "checked"); } }else obj.filter("[value='" + jsond[key] + "']").attr("checked" , "checked"); break; case "radio": obj.filter("[value='" + jsond[key] + "']").attr("checked" , "checked"); break; case "select": obj.find("option[value='" + jsond[key] + "']").attr("selected" , "selected"); break; } } return skipobj; } catch(e){ alert("error"); } } function setzipcode(f , nm , v){ if(f['zipdoro[' + nm + ']'] == null){ var o = document.createElement('input'); o.setAttribute('type' , 'hidden'); o.setAttribute('value' , v); o.setAttribute('name' , 'zipdoro[' + nm + ']'); f.appendChild(o); } else if(f['zipdoro[' + nm + ']'] != null){ f['zipdoro[' + nm + ']'].value = v; } } function getformvar(f , fv , div){ var d = div != null ? div : '#frm_forms'; var f = $(d + "[value=" + f + "]"); var v = $(f).find(':input[name*=' + fv + ']'); return {'form' : f , 'o' : v}; } function calc_rowspan_table(tobj){ var tobj = typeof(tobj) == "object" ? tobj : $("#datalist_table > tbody > tr"); var _start = new Date().getTime(); var roofkey = new Array , countkey = new Array , ik , crowkey , td; tobj.each(function(){ td = $(this).children("td"); $(this).children("td[rowkey]").each(function(i){ ik = td.index($(this)); crowkey = $(this)[0].getAttribute("rowkey") + "#" + ik; if(!countkey[crowkey]){ countkey[crowkey] = 0; $(this)[0].setAttribute("s-rowspan" , true); } $(this)[0].setAttribute("rowkey" , crowkey); countkey[crowkey]++; roofkey.push($(this)); }) }); var ob ; for (var i = -1; ++i < roofkey.length;) { ob = roofkey[i]; if($(ob).attr("s-rowspan")){ ob[0].setAttribute("rowspan" , countkey[ob.attr("rowkey")]); } else{ ob[0].style.display = "none"; } } } function _v(f){ if(typeof(console) != 'undefined'){ console.log(f); console.trace(); } } function is_diffpage(){ var p = window.location.href.split('?')[0]; try{ var r = document.cc.split('?')[0] || ''; var r = typeof(r) != 'undefined' ? r : ''; document.cc = ''; }catch(e){} return p != r && r != '' ? true : false; } addevent(window , 'load' , function(){ try{ document.cc = getcookie('prevhref')||''; }catch(e){ } setcookie('prevhref' , window.location.href || ''); }); String.prototype.price2han = function(){ var h = ["" , "일" , "이" , "삼" , "사" , "오" , "육" , "칠" , "팔" , "구" , "십"]; var p = ["만" , "억" , "조" , "경" , "해"]; var d = ["" , "십" , "백" , "천"]; var t = new String(this); var x = []; var j = 0; for (i = t.length ; i > 0 ; --i){ if(j == 4){ j = 0; x.push(p.shift()); } else if(h[t[i-1]]) x.push(d[j]); x.push(h[t[i-1]]); ++j; } var rt = [] ; for(i = x.length-1 ; i > 0 ; --i){ rt.push(x[i]); } return rt.join(""); } function getxml(o , s){ return $(o).find(s).text(); } function _post(f , p , func){ switch(f){ case 'backoffice': f = bcommon + 'loadajax.php'; break; case 'bmodule': f = bcommon + 'bmodule'; break; case 'fmodule': f = fcommon + 'fmodule'; break; case 'front': f = fcommon + 'floadajax.php'; break; case 'self': case '': f = location.pathname + '&contentonly=2&__exec=1'; break; } if((f).search(/\.do/) && (f).search(/contentonly\=2/) != -1) p += '&__exec=1'; return new Ajax.Request(f , {parameters : p , method : 'post' , onComplete : func}); } function _postresult(dx , f , m){ var d = json_decode(dx.responseText).result; if(d.exec && d.error == false){ if(typeof(f) == 'function') f(d , dx); if(m != null && d.message != null) parent.dyn_alert(d.message); } else{ if(d.error){ parent.dyn_alert(d.message||'통신상의 오류가 있습니다. 잠시뒤 이용해 주십시요.'); } } } _module = function( type ){ this.type = type == 'b' ? 'bmodule' : 'fmodule'; return this; } _module.prototype = { 'type' : '', 'data' : {}, 'add' : function(p , q){ if(p == null) return; this.data[p] = q; return this; }, 'get' : function(func){ if(typeof(func) != 'function') return false; _post(this.type , this.data , func); return this; } } function _postmodule(t , f , n){ if(typeof(f) == 'function') n = '_resource'; else{ var nn = f; f = n; n = nn; } new _module().add('tpl' , t).add('name' , n).get(f); } function _autoformxml(f , d , func){ $.each(f , function(f){ $.each(this , function(k){ var knm = (k).replace(new RegExp(f + "_" , "gi") , '').replace("[" , "\\[").replace("]" , "\\]"); var dnm = (k).replace(new RegExp(f + "_" , "gi") , '').replace(/\[.*\]/ , ""); try{ if($('.' + knm).length == 0) return; }catch(e){ return;} switch((getids(k)[0].tagName).toLowerCase()){ case 'select': autoselectedmatch($('.' + knm)[0] , d[dnm]); break; case 'textarea': $($('.' + knm)).val(d[dnm]); break; default: var type = $('.' + knm)[0].getAttribute('type'); switch(type){ case 'checkbox': case 'radio': cfmchecked($('.' + knm) , d[dnm]); break; case 'text': case 'hidden': $('.' + knm).val(d[dnm]); break; default: if(typeof(func) == 'function') func(f , k); break; } break; } }); }); } function _autoform(fx , func){ $.each(fx , function(i){ var d = this; var dx = $('.' + i); var ob = $.makeArray(dx); var f = dx[0]||''; if(f && d != null){ switch((f.tagName).toLowerCase()){ case 'select': autoselectedmatch(f , d); break; case 'textarea': $(dx).val(d); break; default: var type = f.getAttribute('type'); switch(type){ case 'checkbox': case 'radio': cfmchecked(ob , d); dx.each(function(){ if(this.checked) $(this).trigger('init' , []); }); break; case 'text': case 'hidden': $(dx).val(d); break; default: if(typeof(func) == 'function') func(f , k); break; } break; } } }); } function toggleinput(nm , vls){ $(nm).bind('init' , function(e){ if(this.checked && this.value === vls) $('.' + $(this).attr('group')).removeClass('displaynone'); else $('.' + $(this).attr('group')).addClass('displaynone'); }).click(function(){ $(this).trigger('init' , []); }); } timesc = function(endtime , act){ this.act = act; return this.init(endtime).interval(1); } timesc.prototype = { end : false, stm : 0, gap : 1000, act : function(){ } , time : {}, init : function(endtime){ this.stm = parseInt(new Date().getTime()/this.gap) + parseInt(endtime); this.setdate(this.stm); return this; }, setend : function(y,m,d,h,i,s , func){ clearTimeout(this.atime); var n = new Date(); n.setMonth(new Date().getMonth()+1); var ntime = (new Date(y,m,d,h,i,s).getTime() - n.getTime()) / this.gap; if(ntime > 0 && typeof(func) == 'function'){ func(); } this.end = false; this.init(ntime).interval(1); }, setdate : function(endstamp){ var now = new Date()/this.gap; endstamp = endstamp || this.stm; var end = endstamp - now; this.stm = endstamp; if(end > -1){ this.time = { 'day' : Math.floor(end / 86400), 'hour' : Math.floor(end % 86400 / 3600), 'minute' : Math.floor(end % 86400 % 3600 / 60), 'second' : Math.floor(end % 86400 % 3600 % 60) }; } else{ this.end = true; this.time = { 'day' : 0, 'hour' : 0, 'minute' : 0, 'second' : 0 }; } return this; }, interval : function(f){ var _t = this; if(!this.end){ setTimeout(function(){ _t.act(_t.time).setdate().interval(); } , this.gap); } else if(f != null && this.end){ this.act(this.time); } } } function relative_toggledivact(k , p , c , on , off , func){ if(k < 0 || $('.' + c).length-1 <= k) k = 0; else k++; var e = ''; if(typeof(func) == 'function') e = func(k , p , c); if(!e){ $('.' + c).addClass('displaynone').eq(k).removeClass('displaynone'); $('.' + p).find('ul.reltab > li').removeClass(on).addClass(off).eq(k).removeClass(off).addClass(on); } } function relative_togglediv(p , c , init , on , off , func , time){ var k = $('.' + c).index($('.' + c + ':not(".displaynone")')); relative_toggledivact(k , p , c , on , off , func); if(init == true){ var st = function(){ return setInterval(function(){ relative_togglediv(p , c , init , on , off , func , time); } , time||'3000'); }; $('.' + p).find('ul.reltab > li').mouseover(function(){ var t = $('.' + p).find('ul.reltab > li').index(this); relative_toggledivact(t-1 , p , c , on , off , func); }); $('.' + p).mouseover(function(){ clearInterval($(this).find(".reltab").attr('intval')); }).mouseleave(function(){ var tab = $(this).find(".reltab"); if(tab.attr('intval')) clearInterval(tab.attr('intval')); tab.attr('intval' , st()); }).mouseleave(); } } function geturl(input , func){ var param = []; var nm = ''; var rt = []; var mk = function(o , mt){ try{ if(mt != null){ nm = mt[1] + '[]' + mt[2]; } else nm = ($(o).attr('name')) + '[]'; vls = $(o).val(); d = [nm , vls]; }catch(e){} return d; } var d = ''; $(input).each(function(){ var mt = ($(this).attr('name')).match(/(.*?)(\[.*?)$/ , ''); if(typeof func == 'function'){ d = func(this , mt); } else { d = mk(this , mt); } rt.push(d[0]); param.push(d); }); var url = []; $.each(param , function(){ url.push(encodeURIComponent(this[0]) + '=' + encodeURIComponent(this[1])); }); return url.join('&') + '&geturlnm=' + encodeURIComponent(json_encode(rt)); } function sync_form_mirror(btn , iframe , src , func){ var f = $(btn).parent().children('.options'); $(iframe).load(function(){ $(btn).parent().children('.options').removeClass('displaynone'); var doc = $(iframe).contents()[0]; var childf = $(doc.writefrm); $(f.find(':input')).unbind('change').change(function(){ var pthis = this; var parent = f.find(":input[name='" + $(this).attr('name') + "']"); var child =childf.find(":input[name='" + $(this).attr('name') + "']"); var k = parent.index(this); if(child.length){ var cf = $.makeArray(child); var val = $(this).val(); switch((this.tagName).toLowerCase()){ case 'input': case 'textarea': switch(($(this).attr('type')).toLowerCase()){ case 'checkbox': case 'radio': cfmchecked(cf , val); break; default: $(cf[k]).val(val); break; } break; default: $(cf[k]).val(val); break; } } if(f.find(':input:last')[0] === this){ $(childf).find('button.btn_reloadopt').click(); } if(typeof(func) == 'function') func(pthis , val , f , childf , parent , child , k); }); }).attr('src' , src); } function lastdayselect(o){ $(o).each(function(xx){ switch(xx){ case 0: case 1: $(this).change(function(){ if($(o).eq(0).val() && $(o).eq(1).val()){ var l = (new Date($(o).eq(0).val() , $(o).eq(1).val() , 0)).getDate(); var day = $(o).last(); $(day).children(":gt(0)").remove(); for(var i = 1; i <= parseInt(l) ; ++i){ day.append(""); } } }); break; } }); } function target_scroll_event(o , func , notonce){ if($(o).length == 0 || typeof(func) != "function") return false; var notonce = notonce == true ? true : false; var toffset = $(o).offset().top; $(window).on("scroll.target_scroll_event" , function(){ toffset = $(o).offset().top; var comparentoffset = $(window).scrollTop()+$(window).height(); if(comparentoffset > toffset){ if(!notonce){ $(window).off("scroll.target_scroll_event"); func(); }else if(notonce == true) func(); } }); } element_listener = function(frm , rtinputnm){ this.o = frm; this.hinputnm = rtinputnm; this.init(); }; element_listener.prototype = { 'init' : function(){ if(typeof(this.o) != "object") return false; var _this = this; var nel = $(document.createElement('textarea')).attr({"name" : this.hinputnm , "class" : this.hinputnm , "id" : this.hinputnm}); $(nel).css({"width" : "700px" , "height" : "300px", "display" : "none"}); var edit_name= { "mainedit_html_0" : '교환/반품안내' , "mainedit_html_1" : '배송안내' , "mainedit_html_2" : '결제안내' , "mainedit_html_3" : '상세설명' , "mainedit_html_4" : '모바일상세설명' , }; $(this.o).find("input , select , textarea , iframe , .itextarea ").each(function(i , e){ if( $(e)[0].localName == 'iframe' ){ this.type = 'iframe'; var f_name = $(e).attr('name'); } switch(this.type){ case "hidden": break; case "textarea": case "text": $(this).unbind("focus").bind("focus" , function(){ _this.setdefValue(this); }).bind("focusout" , function(){ _this.setReturnValue(this); }); break; case "checkbox": case "radio": case "select": case "select-one": _this.setdefValue(this); $(this).unbind("change").change(function(){ _this.setdefValue(this); _this.setReturnValue(this); }); break; case "iframe": if( typeof edit_name[f_name] != "undefined" ){ $(window[f_name].document.getElementsByTagName("body")[0]).unbind("focus").bind("focus" , function(e){ edit_title =edit_name[f_name]; parent.$(e)[0].type = 'iframe'; _this.setdefValue(parent.$(e)[0]); }).bind("blur" , function(e){ edit_title =edit_name[f_name]; parent.$(e)[0].type = 'iframe'; parent.$(e)[0].name = f_name; _this.setReturnValue(parent.$(e)[0]); }); } break; } }); $(this.o).append(nel); this.hinput = $("." + this.hinputnm); } , 'setdefValue' : function(el){ var val ; var editor_log = false; orgdata = ''; switch(el.type){ case "checkbox": case "radio": if(typeof($(el).data("_orgchked")) == "undefined") $(el).data("_orgchked" , $(el).attr("checked") == "checked" ? "true" : "false"); var elnm = $(el).attr("name"); var len = $(this.o).find("input[name='" + elnm +"']").length; var orgval = []; $(this.o).find("input[name='" + elnm +"']").each(function(i){ if( $(this).attr("checked") == 'checked' ){ orgval.push($(this).val()); } }); elnm = elnm.replace("[", "").replace("]", ""); if(!$(this.o).find("[logtitle='" + elnm +"']").attr('_orgvalue')){ $(this.o).find("[logtitle='" + elnm +"']").attr('_orgvalue', orgval); } val = $(this.o).find("[logtitle='" + elnm +"']").attr('_orgvalue'); break; case "text": var elnm = $(el).attr("name"); var len = $(this.o).find("input[name='" + elnm +"']").length if(len > 1 ){ var orgval = []; $(this.o).find("input[name='" + elnm +"']").each(function(i){ orgval.push($(this).val()); }); elnm = elnm.replace("[", "").replace("]", ""); if(!$(this.o).find("[logtitle='" + elnm +"']").attr('_orgvalue')){ $(this.o).find("[logtitle='" + elnm +"']").attr('_orgvalue', orgval); } val = $(this.o).find("[logtitle='" + elnm +"']").attr('_orgvalue'); }else{ val = $(el).val(); } break; case "select": case "select-one": case "textarea": val = $(el).val(); break; case "iframe" : val = $(el)[0].target.innerHTML.replace(/