\
\
\
");
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(/