', { class: 'popupalert', id: ids })
.html(msg)
.appendTo(document.body);
Ivy.center_popup_div(ids);
$('#' + ids).fadeIn('slow', function () {
window.setTimeout(function () {
$('#' + ids).fadeOut('slow', function () {
$(this).remove();
});
}, sec);
});
},
/**
* 알림용 POPUP Slide ( 창이 닫힐 시간을 지정하지 않으면 자동 닫힘 X ), 우측하단에서 나타남.
* @param msg 알림 메세지
* @param sec 창이 닫힐 시간(초)
*/
divpopupslide: function (msg, sec) {
if (sec == undefined) sec = 60000;
sec = sec * 1000;
var ids = 'popupslider';
if ($('#' + ids).attr('id')) {
hei = $('#' + ids).height() + 50;
$('#' + ids).animate({ bottom: '-=' + hei }, 300, function () {
$(this).remove();
Ivy.divpopupslideAction(ids, msg, sec);
});
} else {
Ivy.divpopupslideAction(ids, msg, sec);
}
},
divpopupslideAction: function (ids, msg, sec) {
$('
', { class: 'popupslider', id: ids })
.html(msg)
.appendTo(document.body);
hei = $('#' + ids).height() + 50;
$('#' + ids)
.css({ bottom: '-' + hei + 'px', visibility: 'visible' })
.animate(
{
bottom: '+=' + hei,
},
700
)
.bind('click', function () {
$(this).animate({ bottom: '-=' + hei }, 700, function () {
$(this).remove();
});
});
if (sec < 60000) {
window.setTimeout(function () {
$('#' + ids).animate({ bottom: '-=' + hei }, 700, function () {
$(this).remove();
});
}, sec);
}
},
/**
* 달력 선택용 DIV
* @param obj 선택한 날짜를 삽입할 Object
*/
calendar: function (obj) {
$.datepicker.regional['ko'] = {
closeText: '닫기',
prevText: '이전달',
nextText: '다음달',
currentText: '오늘',
monthNames: [
'1월(JAN)',
'2월(FEB)',
'3월(MAR)',
'4월(APR)',
'5월(MAY)',
'6월(JUM)',
'7월(JUL)',
'8월(AUG)',
'9월(SEP)',
'10월(OCT)',
'11월(NOV)',
'12월(DEC)',
],
monthNamesShort: [
'1월',
'2월',
'3월',
'4월',
'5월',
'6월',
'7월',
'8월',
'9월',
'10월',
'11월',
'12월',
],
dayNames: ['일', '월', '화', '수', '목', '금', '토'],
dayNamesShort: ['일', '월', '화', '수', '목', '금', '토'],
dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
weekHeader: 'Wk',
dateFormat: 'yy-mm-dd',
firstDay: 0,
isRTL: false,
showMonthAfterYear: true,
yearSuffix: '',
yearRange: 'c-100:c+10',
};
$.datepicker.setDefaults($.datepicker.regional['ko']);
$(obj).datepicker({
changeMonth: true,
changeYear: true,
showMonthAfterYear: true,
dateFormat: 'yy-mm-dd',
yearRange: 'c-100:c+10',
});
if (arguments.length >= 2) {
if (arguments[1] == false) {
return false;
}
}
$(obj).datepicker('show');
},
nsobj: null,
nscobj: null,
nsinter: null,
nscobjh: 0,
nstime: 500,
nsque: 0,
nsquemax: 0,
slideUpActionInit: function (obj) {
if (arguments.length >= 2) this.nstime = arguments[1];
this.nsobj = $('#' + obj);
this.nscobj = this.nsobj.children();
this.nsquemax = this.nscobj.length;
this.nscobjh = this.nscobj.height();
this.nscobj.css({ overflow: 'hidden' });
this.nscobj.children().css({
position: 'relative',
top: this.nscobjh + 'px',
visibility: 'hidden',
});
this.nsinter = window.setInterval(
'Ivy.slideUpActionProcess()',
this.nstime
);
},
slideUpActionProcess: function () {
$(this.nscobj[this.nsque]).children().css({ visibility: 'visible' });
$(this.nscobj[this.nsque])
.children()
.animate(
{
top: '-=' + this.nscobjh,
},
this.nstime
);
this.nsque++;
if (this.nsque >= this.nsquemax) {
window.clearInterval(this.nsinter);
this.nsque = 0;
}
},
/**
* 우편번호 검색
* @param obj a Tag
* @param fnc Function Name
* @param what "juso" : juso.go.kr과 연계할 경우
*/
zipcodeSearch: function (obj, fnc, what) {
if (what == undefined) what = 'local';
url = $(obj).attr('href') + '?fn=' + fnc;
var wpx = (window.screen.width - 790) / 2;
var wpy = (window.screen.height - 650) / 2 - 30;
Ivy.popup(url, 'zc', wpy, wpx, 790, 650, 0, 0, 0, 0);
},
/**
* 좌표 검색
* @param obj a Tag
* @param gdefaultAddress 기본 주소
* @param func 좌표 지정후 처리될 Function / Return type ( posX, posY )
*/
mapPoint: function (obj, gdefaultAddress, func) {
//pat = /.*(로)([0-9]+길)?[0-9 -]*/;
pat = /(.*)(로[0-9]+길|[0-9]+길|[0-9]+번길|길|로)([0-9 -]*)/;
if (!pat.test(gdefaultAddress)) {
try {
if ($('#address2').attr('id') != undefined) {
if ($('#address2').val().trim().length < 1) {
alert(
'지번주소 형식의 주소는 조금더 정확한 지점을 찾기위해 번지를 입력하셔야 합니다.'
);
return false;
} else {
// dongpat = /((.*)?(읍|면|동|리) )|(.*)?(읍|면|동|리)$/;
// gdefaultAddressre = gdefaultAddress.match(dongpat);
// if ( gdefaultAddressre.length > 0 ) gdefaultAddress = gdefaultAddressre[gdefaultAddressre["index"]];
gdefaultAddress = gdefaultAddress.trim();
gdefaultAddress += ' ' + $('#address2').val();
}
}
} catch (e) {}
}
url =
$(obj).attr('href') +
'?func=' +
func +
'&gdefaultAddress=' +
encodeURIComponent(gdefaultAddress) +
'&mapMode=Point';
Ivy.centerpopup(url, 'mp', 1000, 600, 1, 0);
},
/**
* 우편번호 검색
* @param obj a Tag
* @param fnc Function Name
* @param what "juso" : juso.go.kr과 연계할 경우
*/
mzipcodeSearch: function (obj, fnc, what) {
if (what == undefined) what = 'local';
url = $(obj).attr('href') + '?fn=' + fnc;
openWindow(url, 'zc');
},
/**
* URL의 파라메터 Hash Type으로 Return
*/
getParams: function (curl) {
if (curl == undefined)
try {
var url = location.href.split('#')[0];
} catch (e) {
var url = location.href;
}
else var url = curl;
url = decodeURIComponent(url);
var regex = /([^=&?]+)=([^]*)/g,
params = {},
parts,
key,
value;
while ((parts = regex.exec(url)) != null) {
(key = parts[1]), (value = parts[2]);
var isArray = /\[\]$/.test(key);
if (isArray) {
params[key] = params[key] || [];
params[key].push(value);
} else {
params[key] = value;
}
}
return params;
},
/**
* URL의 파라메터를 Array로 리턴
*/
getParamsAr: function (curl) {
if (curl == undefined)
try {
var url = location.href.split('#')[0];
} catch (e) {
var url = location.href;
}
else var url = curl;
url = decodeURIComponent(url);
a = url.match(/[^&?=]*=[^&?=]*/g);
if (a != undefined) alen = a.length;
else alen = 0;
r = new Array();
for (i = 0; i < alen; i++) {
r[i] = new Array(
a[i].match(/[^&?=]*/)[0],
a[i].match(/=([^&?]*)/)[0].replace('=', '')
);
}
return r;
},
/**
* 로그인 체크
*/
login: function (obj) {
var f = $(obj).attr('id');
$('.submit_bt').css('visibility', 'hidden');
Ivy.mask_start('로그인 처리중 입니다.');
if (!Ivy.alert('uid', '아이디', 2, 'none')) return false;
if (!Ivy.alert('upass', '비밀번호', 2, 'none')) return false;
return true;
},
/**
* 객체의 높이값 측정 리턴
*/
objSize: function (obj) {
var oh = parseInt(obj.height(), 10);
if ($.isNumeric(obj.css('margin-top')))
oh += parseInt(obj.css('margin-top').replaceAll('px', ''), 10);
if ($.isNumeric(obj.css('margin-bottom')))
oh += parseInt(obj.css('margin-bottom').replaceAll('px', ''), 10);
if ($.isNumeric(obj.css('padding-top')))
oh += parseInt(obj.css('padding-top').replaceAll('px', ''), 10);
if ($.isNumeric(obj.css('padding-bottom')))
oh += parseInt(obj.css('padding-bottom').replaceAll('px', ''), 10);
if ($.isNumeric(obj.css('borderTopWidth')))
oh += parseInt(obj.css('borderTopWidth').replaceAll('px', ''), 10);
if ($.isNumeric(obj.css('borderBottomWidth')))
oh += parseInt(obj.css('borderBottomWidth').replaceAll('px', ''), 10);
return oh;
},
/**
* 미니맵
* @param obj 삽입 객체 ID
* @param option
* - gdefaultPoint : 좌표값 ( lat/lng )
* - gdefaultAddress : 주소
* - zoom : Zoom
*/
minimapLoad: function (obj, option) {
var pam = Ivy.getParams();
if (pam['ivyscreenprint'] == undefined) {
var minimapUrl = '/Ivyservice/gmap/?mapMode=Minimap®ion=KR';
if (option != undefined) {
if (option.gdefaultPoint != undefined)
minimapUrl += '&gdefaultPoint=' + option.gdefaultPoint;
else if (option.gdefaultAddress != undefined)
minimapUrl += '&gdefaultAddress=' + option.gdefaultAddress;
if (option.zoom != undefined) minimapUrl += '&zoom=' + option.zoom;
else minimapUrl += '&zoom=14';
if (option.id == undefined) option.id = 'minimapframe';
if (option.scrollwheel != undefined)
minimapUrl += '&scrollwheel=' + option.scrollwheel;
else minimapUrl += '&scrollwheel=true';
}
if ($('#' + option.id).attr('id') == undefined) {
$('