var t_preventDefault = function (evt) { evt.preventDefault(); }; var IvyBri = new Array(); var mcsServer = ''; var ebookServer = ''; /** * 브라우져 종류 및 상태를 IvyBri 배열 UPDATE */ jQuery(function () { Ivy.briUpdate(); //alert( Ivy.briCompare("ie7") ); try { csshost = location.protocol + '//'; csshost += location.host; try { if (contentBrowserType != 'm') Ivy.cssload(csshost + '/Ivylib/css/common/_csshack.css'); } catch (e) { Ivy.cssload(csshost + '/Ivylib/css/common/_csshack.css'); } try { if (contentBrowserType != 'm') Ivy.cssload( csshost + '/Ivylib/css/site/' + IvyHostKey + '/common/_csshack.css' ); } catch (e) { Ivy.cssload( csshost + '/Ivylib/css/site/' + IvyHostKey + '/common/_csshack.css' ); } } catch (e) {} qs = location.search; //if ( qs.match(/(mode=read)/i) && location.host != "www.delightzhotel.kr" ) { //if ( location.host != "www.delightzhotel.kr" ) { Ivy.articleMover();} }); /** * 콘텐츠의 이미지를 lightview에 연동처리 하는 스크립트 */ $(window).on('load', function() { window.setTimeout(function () { try { $('#contentBody img.lightview').easycaptions({ classmodifier: 'cont' }); } catch (e) {} }, 0); window.setTimeout(function () { try { $('#moduleBody img.lightview').easycaptions({ classmodifier: 'cont' }); } catch (e) {} }, 0); }); $(document).ready(function () { jQuery(function () { $('textarea.resizeable50').resizable({ handles: 's', minHeight: '50', create: function (event, ui) { $(this).children('.ui-resizable-handle').addClass('TextareaResize'); }, }); }); try { css_browser_selector(navigator.userAgent); } catch (e) {} try { mcsServer = Ivy.decode64Prc(IvyMcaHost); } catch (e) {} try { ebookServer = Ivy.decode64Prc(IvyEbookHost); } catch (e) {} $('a').bind('focus', function () { try { if (IvyTopMenuStyle == 'single') { if ($(this).parents('ul.IvyTopMenu').attr('class') == undefined) Ivy.topMenuSubViewClose(); } else { if ( $(this).parents('ul.IvyTopMenu').attr('class') == undefined && $(this).parents('div.subAllDisplay').attr('class') == undefined ) Ivy.topMenuSubViewClose(); } } catch (e) {} }); try { if (IvySmartBrowser == 'true') { try { kmentitle = $('meta[name=subject]').attr('content'); } catch (e) { kmentitle = document.title; } try { ksurl = $('link[rel=shortlink]').attr('href'); } catch (e) { ksurl = document.location.href; } try { if ($('link[rel=image_src]').attr('href') != undefined) { kmimage = $('link[rel=image_src]').attr('href'); kmimage = encodeURI(kmimage); } else { kmimage = 'http://www.pohang.ac.kr/Ivyimages/site/open_content/main/logo.gif'; } } catch (e) { kmimage = 'http://www.pohang.ac.kr/Ivyimages/site/open_content/main/logo.gif'; } try { kmendesc = $('meta[name=description]').attr('content'); } catch (e) { kmendesc = ''; } Kakao.init('6e8ce4078bc17969b9c522be29eb1d02'); Kakao.Link.createTalkLinkButton({ container: '#kakao-link-btn', label: '[' + kmentitle + '] ' + kmendesc, image: { src: kmimage, width: '300', height: '150' }, webButton: { text: '포항대학교 홈페이지로 이동', url: ksurl, // 앱 설정의 웹 플랫폼에 등록한 도메인의 URL이어야 합니다. }, }); } } catch (e) {} }); /** * Class Extend Creator */ (function () { var initializing = false, fnTest = /xyz/.test(function () { xyz; }) ? /\b_super\b/ : /.*/; this.Class = function () {}; Class.extend = function (prop) { var _super = this.prototype; initializing = true; var prototype = new this(); initializing = false; for (var name in prop) { prototype[name] = typeof prop[name] == 'function' && typeof _super[name] == 'function' && fnTest.test(prop[name]) ? (function (name, fn) { return function () { var tmp = this._super; this._super = _super[name]; var ret = fn.apply(this, arguments); this._super = tmp; return ret; }; })(name, prop[name]) : prop[name]; } function Class() { if (!initializing && this.init) this.init.apply(this, arguments); } Class.prototype = prototype; Class.constructor = Class; Class.extend = arguments.callee; return Class; }; })(); /** * JSON Type을 String로 Return */ function JsonToString(object) { var results = []; for (var property in object) { var value = object[property]; if (value) results.push(property.toString() + ': ' + value); } return results.join(', '); } /** * IE 6 & 7 Dynamic Create Select Error */ jQuery(function () { if ( $.browser.msie && ($.browser.version == '6.0' || $.browser.version == '7.0') ) { $(':radio').live('click', function () { if (!jQuery('#' + jQuery(this).attr('id')).is(':checked')) { var this_name = jQuery(this).attr('name'); jQuery('input:radio[name=' + this_name + ']').each(function () { jQuery(this).attr('checked', false); }); jQuery('#' + jQuery(this).attr('id')).attr('checked', 'checked'); } }); } }); /** * 탑메뉴 이벤트 활성화 */ var IvyTopMenuActive = false; var IvyTopMenuStyle = 'single'; jQuery(function () { if (!IvyTopMenuActive) { IvyTopMenuActive = true; if ($('.subAllDisplay').attr('class') !== undefined) IvyTopMenuStyle = 'all'; try { if (IvySmartBrowser == 'false') { $('ul.IvyTopMenu > li > a').bind('mouseover', function () { Ivy.topMenuSubView(this); }); $('ul.IvyTopMenu > li > a').bind('focus', function () { Ivy.topMenuSubView(this); }); $('ul.IvyTopMenu2s > li > ul > li.top_sub > a').bind( 'mouseover', function () { Ivy.topMenuSub2View(this); } ); $('ul.IvyTopMenu2s > li > ul > li.top_sub > a').bind( 'focus', function () { Ivy.topMenuSub2View(this); } ); } else { $('ul.IvyTopMenu > li > a').bind('click', function () { if (IvyTopMenuStyle == 'single') { pli = $(this).parent('li'); if (pli.children('ul').length > 0) { Ivy.topMenuSubView(this); event.preventDefault(); } } else { pcls = $(this).parent('li').index(); if ( $('.IvyTop' + pcls + 'SubMenu li:nth-child(1)').attr('class') != 'empty' ) { Ivy.topMenuSubView(this); event.preventDefault(); } } }); } } catch (e) {} } }); /** * 서브메뉴 활성화 */ var IvySubMenuActive = false; jQuery(function () { if (!IvySubMenuActive) { IvySubMenuActive = true; try { if (IvySmartBrowser == 'false') { $('ul.IvySubMenu > li > a').bind('mouseover', function () { pli = $(this).parent('li'); if (pli.children('ul').length > 0) Ivy.subMenuSubView(this); }); $('ul.IvySubMenu > li > a').bind('focus', function () { pli = $(this).parent('li'); if (pli.children('ul').length > 0) Ivy.subMenuSubView(this); }); } else { $('ul.IvySubMenu > li > a').bind('click', function () { pli = $(this).parent('li'); if (pli.children('ul').length > 0) { Ivy.subMenuSubView(this); event.preventDefault(); } }); } } catch (e) {} } }); /* 페이지내 pre tag에 라인넘버 */ $(function () { $('pre').html(function (index, html) { var htmls = html.replace(/^(.*)$/gm, '$1'); /*if ( IvySmartBrowser != "true" ) { htmls = "Clipboard"+htmls; $(".copyclip").bind("click",function(){ Ivy.clipCopys(this, 'pre'); event.preventDefault(); }); }*/ return htmls; }); }); $.fn.preload = function () { this.each(function () { $('')[0].src = this; }); }; $(['/Ivylib/css/common/images/loading.gif']).preload(); var Ivy = { mask_start_closeBt: false, base64_keyStr: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', keyStr: this.base64_keyStr, scr_size: 1, errMsg: { argument: '함수 인자 지정이 올바르지 않습니다.', option: '옵션항목 지정이 올바르지 않습니다.', 403: '접근거부.', 404: '페이지를 찾을 수 없습니다.', 500: '서버 오류 발생.', object: '지정한 객체를 찾을 수 없습니다.', }, researchpopup: null, moduleConfigDiv: null, /** * 브라우져 정보 Array 업데이트 */ briUpdate: function () { IvyBri.clear(); if ($('html').attr('class')) { bri = $('html').attr('class').split(' '); $.each(bri, function (k, v) { if (v != '') IvyBri.push(v); }); } }, /** * 브라우져 정보에서 param과 같은 정보 존재 여부 검사 * @param iv 비교할 문자열 * @return true/false */ briCompare: function (iv) { if (iv == '') return false; var rval = false; $.each(IvyBri, function (k, v) { if (v == iv) { rval = true; return false; } }); return rval; }, /** * ClipBoard Copy * @param obj 클릭한 Object * @param parentTag 복사할 내용을 감싸고 있는 부모 tag */ clipCopys: function (obj, parentTag) { $(obj).zclip({ beforeCopy: function () { alert('before'); }, //afterCopy : function(){} path: '/Ivylib/js/zeroclip/ZeroClipboard.swf', copy: $(obj).closest(parentTag).text(), }); }, /** * 지정한 n millis 동안 sleep * @param numberMillis Sleep할 시간 * @return "" */ pause: function (numberMillis) { var now = new Date(); var exitTime = now.getTime() + numberMillis; while (true) { now = new Date(); if (now.getTime() > exitTime) return; } }, /** * 즐겨찾기에 추가 * @param bookmarkTitle 북마크에 추가될 이름 * @param bookmarkURL 북마크될 URL * * Ex] 즐겨찾기에 추가 */ bookmarksite: function (bookmarkTitle, bookmarkURL) { if (bookmarkURL.substring(0, 7) != 'http://') bookmarkURL = 'http://' + bookmarkURL; if (window.sidebar) { window.sidebar.addPanel(bookmarkTitle, bookmarkURL, ''); } else if (window.opera && window.print) { var elem = document.createElement('a'); elem.attr('href', bookmarkURL); elem.attr('title', bookmarkTitle); elem.attr('rel', 'sidebar'); elem.click(); } else if ($.browser.msie) { window.external.AddFavorite(bookmarkURL, bookmarkTitle); } else { alert('즐겨찾기에 추가하실려면 Ctrl+D를 누르세요.'); } }, /** * 시작페이지 설정 * @param Obj * @param urlStr * * Ex] 시작페이지로 */ startPage: function (Obj, urlStr) { if (document.all && window.external) { Obj.style.behavior = 'url(#default#homepage)'; Obj.setHomePage(urlStr); } else { alert('시작페이지 설정은 IE만 가능합니다.'); } }, /** * Flash Display Script * @param file_path 파일위치 * @param width 가로 * @param height 세로 * @param title 타이틀 태그 * @param targetPositionId [optional] target ID * @return none */ flashInsert: function (file_path, width, height, title, targetPositionId) { sTag = Ivy.loadingFlashFile(file_path, width, height, title); if (targetPositionId == '' || targetPositionId == undefined) document.write(sTag); else $(document).ready(function () { $('#' + targetPositionId).html(sTag); }); }, /** * Flash File Loading * @param file_path 파일위치 * @param width 가로 * @param height 세로 * @param title 타이틀 태그 * @return Flash Object Tag */ loadingFlashFile: function (file_path, width, height, title) { if (title == '' || title == undefined) var title = 'FLASH'; if ($.browser.msie) { var sTag = '' + '' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ''; } else { var sTag = ' '; } return sTag; }, loadingMca: function (tid, width, height, mcscode) { var sTag = '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + ''; $('#' + tid).html(sTag); }, loadingMcavod: function (tid, width, height, mcscode) { var sTag = ''; if ($.browser.msie) sTag = ''; else sTag = ''; sTag += '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + ''; $('#' + tid).html(sTag); }, loadingEtc: function (tid, width, height, vods, trade) { var sTag = '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + ''; $('#' + tid).html(sTag); }, /** * 파일의 byte 크기를 인식이 용이한 크기로 바꾸기 * @param siz Bytes * @param argument[optional] ,및 소수점이하 표현 true/false * @return 인식이 용이한 문자열 */ fileSizeReturn: function (siz) { var human = false; var flo = 2; if (arguments.length >= 2) human = arguments[1]; if (arguments.length >= 3) flo = arguments[2]; org_size = parseFloat(siz, 10); var rret = ''; ret = Math.floor(org_size / 1024); if (ret > 0) { ret1 = Math.floor(ret / 1024); if (ret1 > 0) { if (human) rret = Ivy.number_format(org_size / 1024 / 1024, flo) + ' MBytes'; else rret = ret1 + ' MBytes'; } else { if (human) rret = Ivy.number_format(org_size / 1024, flo) + ' KBytes'; else rret = ret + ' KBytes'; } } else { if (human) rret = Ivy.number_format(org_size, 0) + ' Bytes'; else rret = org_size + ' Bytes'; } return rret; }, /** * PHP NUMBER FORMAT * @param number 수치 * @param decimals 소수점 자리수 * @param dec_point 소수점 자리 표현 Char * @param thousands_sep 1000단위 표현 Char */ number_format: function (number, decimals, dec_point, thousands_sep) { var n = number, c = isNaN((decimals = Math.abs(decimals))) ? 2 : decimals; var d = dec_point == undefined ? '.' : dec_point; var t = thousands_sep == undefined ? ',' : thousands_sep, s = n < 0 ? '-' : ''; var i = parseInt((n = Math.abs(+n || 0).toFixed(c))) + '', j = (j = i.length) > 3 ? j % 3 : 0; return ( s + (j ? i.substr(0, j) + t : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + t) + (c ? d + Math.abs(n - i) .toFixed(c) .slice(2) : '') ); }, /** * 로딩마스크 시작 ( 닫기 버튼 존재 ) * @param msg 메세지 * @return NONE */ mask_start_close: function (msg) { Ivy.mask_start_closeBt = true; Ivy.mask_start(msg); }, /** * 로딩마스크 시작 * @param msg 메세지 * @return NONE */ mask_start: function (msg) { if (msg == undefined) msg = ''; try { $('#loading').remove(); } catch (e) {} try { if ($('#nekr_mask').attr('id') == undefined) var mask_div = $('
', { id: 'nekr_mask', class: 'nekr_mask', }).appendTo(document.body); else var mask_div = $('#nekr_mask'); var maskheight = Ivy.docheight(); var maskwidth = Ivy.docwidth(); mask_div.css('height', maskheight + 'px'); mask_div.css('width', maskwidth + 'px'); mask_div.fadeTo('normal', 0.3); mask_div.css({ position: 'absolute', left: '0px', top: '0px' }); Ivy.nekr_hide_controller(); if (msg != '') { var indicate = $('
', { id: 'loading', class: 'loading-indicator', }).appendTo(document.body); if (msg != '') { var indiv = $('
').appendTo(indicate); var indiv_1 = $('
', { class: 'imgIn' }).appendTo(indiv); var img = $('', { src: '/Ivylib/css/common/images/loading.gif', class: 'processImg', alt: '로딩이미지', }).appendTo(indiv_1); if (Ivy.mask_start_closeBt) { var ldivCloseBt = $('
', { class: 'closeBtDiv' }).appendTo( indiv_1 ); var ldivCloseBtA = $('', { href: 'javascript:Ivy.mask_stop()', }).appendTo(ldivCloseBt); $('', { src: '/Ivyimages/common/closeLoadingDiv.png', alt: '닫기', title: '닫기', }).appendTo(ldivCloseBtA); } var msginn3 = $('
', { id: 'loading-msg', class: 'loading-msg' }) .appendTo(indiv_1) .html(msg); } } $(window).bind('resize', Ivy.maskWindowResize); $(window).bind('scroll', Ivy.maskWindowsScroll); } catch (e) {} try { Ivy.center_popup_div('loading'); } catch (e) {} try { Ivy.mask_start_closeBt = false; } catch (e) {} }, maskWindowResize: function () { var maskheight = Ivy.docheight(); var maskwidth = Ivy.docwidth(); $('#nekr_mask').css('height', maskheight + 'px'); $('#nekr_mask').css('width', maskwidth + 'px'); try { Ivy.center_popup_div('loading'); } catch (e) {} }, maskWindowsScroll: function () { try { Ivy.center_popup_div('loading'); } catch (e) {} }, /** * 마스크 시작 ( 메세지 없음 ) * @return NONE */ mask_start_nomsg: function () { Ivy.mask_start(' '); try { $('#loading').remove(); } catch (e) {} }, /** * 로딩마스크 종료 * @return NONE */ mask_stop: function () { try { $('#loading').remove(); } catch (e) {} try { $('#nekr_mask').remove(); } catch (e) {} try { Ivy.mask_start_closeBt = false; } catch (e) {} $(window).unbind('resize', Ivy.maskWindowResize); $(window).unbind('scroll', Ivy.maskWindowsScroll); try { $('#' + tid).unbind('resize'); } catch (e) {} Ivy.nekr_show_controller(); }, /** * 마스크시 SELECT/OBJECT/EMBED TAG를 hidden 시킴. [ className에 exclude_hidden_obj CLASS를 추가 시키면 강제 SHOW/HIDE 시키지 않음 ] * @return NONE */ nekr_hide_controller: function () { /* if ( !$("select").hasClass("exclude_hidden_obj") ){ if ( $("select").css("display") == "" || $("select").css("display") == "block" || $("select").css("display") == "inline" ||$("select").css("visibility") == "visible" ) { $("select").css("visibility","hidden"); $("select").addClass("nekr_obj_show"); } } if ( !$("object").hasClass("exclude_hidden_obj") ){ if ( $("object").css("display") == "" || $("object").css("display") == "block" || $("object").css("display") == "inline" ||$("object").css("visibility") == "visible" ) { $("object").css("visibility","hidden"); $("object").addClass("nekr_obj_show"); } } if ( !$("embed").hasClass("exclude_hidden_obj") ){ if ( $("embed").css("display") == "" || $("embed").css("display") == "block" || $("embed").css("display") == "inline" ||$("embed").css("visibility") == "visible" ) { $("embed").css("visibility","hidden"); $("embed").addClass("nekr_obj_show"); } }*/ }, /** * 마스크시 hidden시킨 TAG를 SHOW 시킴 [ className에 exclude_hidden_obj CLASS를 추가 시키면 강제 SHOW/HIDE 시키지 않음 ] * @return NONE */ nekr_show_controller: function () { /*$(".nekr_obj_show").css("visibility","visible"); $(".nekr_obj_show").removeClass("nekr_obj_show");*/ }, /** * Div를 화면의 중앙에 출력 * @param objname DIV ID * @return NONE */ center_popup_div: function (objname) { my = ($(window).height() - $('#' + objname).height()) / 2 + $(window).scrollTop(); mx = ($(window).width() - $('#' + objname).width()) / 2 + $(window).scrollLeft(); $('#' + objname).css({ top: my + 'px', left: mx + 'px' }); }, /** * 지정한 Object에 마스크 씌우기 * @param tid Tag ID * @param msg 메세지 * @return NONE */ mask_start_obj: function (tid, msg) { try { $('#' + tid + 'Mask').remove(); } catch (e) {} try { $('#' + tid + 'Loading').remove(); } catch (e) {} var vpos = $('#' + tid).position(); if ($('#' + tid).css('position') == 'absolute') vpos.top = 0; mask_div = $('
', { id: tid + 'Mask', class: 'inMask' }) .appendTo($('#' + tid)) .css({ position: 'absolute', top: vpos.top, left: vpos.left, width: $('#' + tid).width() + 'px', height: $('#' + tid).height() + 'px', }); mask_div.fadeTo('fast', 0.1); var indicate = $('
', { id: tid + 'Loading', class: 'loadingInMask loading-indicator', }) .css({ padding: '10px', 'min-width': '70px' }) .appendTo($('#' + tid)); var indiv = $('
') .appendTo(indicate) .css({ 'min-width': '70px', 'max-width': '120px' }); var indiv_1 = $('
', { class: 'imgIn' }).appendTo(indiv); var img = $('', { src: '/Ivyimages/common/large-loading.gif', class: 'processImg', alt: '로딩이미지', }).appendTo(indiv_1); if (msg != '') { var indiv_2 = $('
', { class: 'msgIn' }) .appendTo(indiv) .css({ 'max-width': '60px' }); var msginn1 = $('
', { class: 'processMsg' }) .html('처리중...') .appendTo(indiv_2); var msginn2 = $('
', { class: 'block' }).appendTo(indiv_2); var msginn3 = $('
', { id: 'loading-msg', class: 'loading-msg' }) .appendTo(indiv_2) .html(msg); } else { indicate.css({ padding: '0px', border: '0px', 'background-color': 'transparent', 'min-width': '32px', 'max-width': '32px', }); indiv.css({ 'max-width': '32px' }); } my = Math.max( ($('#' + tid).height() - $('#' + tid + 'Loading').height()) / 2 ) + vpos.top; mx = Math.max(($('#' + tid).width() - $('#' + tid + 'Loading').width()) / 2) + vpos.left; $('#' + tid + 'Loading').css({ top: my + 'px', left: mx + 'px' }); $('#' + tid).bind('resize', function (e) { var vpos = $('#' + tid).position(); if ($('#' + tid).css('position') == 'absolute') vpos.top = 0; $('#' + $(this).attr('id') + 'Mask').css({ width: $(this).width() + 'px', height: $(this).height() + 'px', }); my = Math.max( ($(this).height() - $('#' + $(this).attr('id') + 'Loading').height()) / 2 ) + vpos.top; mx = Math.max( ($(this).width() - $('#' + $(this).attr('id') + 'Loading').width()) / 2 ) + vpos.left; $('#' + $(this).attr('id') + 'Loading').css({ top: my + 'px', left: mx + 'px', }); }); }, /** * 지정한 Object에 마스크 벗기기 * @param tid Tag ID * @return NONE */ mask_stop_obj: function (tid) { try { $('#' + tid + 'Mask').remove(); } catch (e) {} try { $('#' + tid + 'Loading').remove(); } catch (e) {} try { $('#' + tid).unbind('resize'); } catch (e) {} }, /** * mask_start_obj로 마스크된 모든 Object에서 마스크 벗기기 * @return NONE */ mask_stop_obj_all: function () { try { $('.inMask').remove(); } catch (e) {} try { $('.loadingInMask').remove(); } catch (e) {} }, /** * Document Height ( Scroll Height Calculate ) * @return height */ docheight: function () { var D = document; return Math.max( Math.max(D.body.scrollHeight, D.documentElement.scrollHeight), Math.max(D.body.offsetHeight, D.documentElement.offsetHeight), Math.max(D.body.clientHeight, D.documentElement.clientHeight) ); }, /** * Document Width * @return width */ docwidth: function () { var D = $(window); return Math.max(D.width()); }, /** * 폼전송 공용 상단부 * @return */ formSubmitTop: function () { Ivy.mask_start(''); try { $('#submit_bt').css('visibility', 'hidden'); } catch (e) {} try { $('.submit_bt').css('visibility', 'hidden'); } catch (e) {} }, /** * 폼전송 공용 하단부 * @param objID 전송될 폼Tag의 ID * @return */ formSubmitBottom: function (objID) { if ($('#user_file').attr('id') == undefined) { Ivy.mask_start('등록 처리중...'); return true; } else { Ivy.mask_start(''); upResult = custom_upload_start(objID); return upResult; } }, /** * 폼의 필수항목 입력 오류 * @param essentialId 필수항목 Focus ID * @param essentialName 필수항목 명칭 * @param essentialMinimalInputSize 최소 입력 문자수 * @param essentialInputType 입력항목 유효성 ( none OR empty : 검사하지 않음, number : 정수형 숫자만 입력가능, float : 소수점형 숫자만 입력가능(.), eng : 영문자만 가능, han : 한글만 입력가능, tel : 전화번호, email : 이메일 ) * @param itype 체크방식 ( checkbox/radio ) * @return boolean */ alert: function ( essentialId, essentialName, essentialMinimalInputSize, essentialInputType, itype ) { var its = itype == undefined ? '' : itype; var alertMsg = '필수항목이 입력(선택) 되어 있지 않습니다.'; alertMsg += '\n\n - 필수 입력(선택) 항목 명 : ' + essentialName + ''; if (essentialMinimalInputSize > 1 && its == '') { alertMsg += '\n - 최소 입력 문자 수 : ' + essentialMinimalInputSize + ' 문자'; } else if (essentialMinimalInputSize > 0 && its != '') { if (its == 'checkbox') alertMsg += '\n - 최소 선택 수 : ' + essentialMinimalInputSize + ' 개'; else if (its == 'radio') alertMsg += ''; } if (its == '') { if ( $('#' + essentialId) .val() .trim().length < essentialMinimalInputSize ) { alert(alertMsg); Ivy.mask_stop(); try { $('#' + essentialId).focus(); } catch (e) {} try { $('#submit_bt').css({ visibility: 'visible' }); } catch (e) {} try { $('.submit_bt').css({ visibility: 'visible' }); } catch (e) {} return false; } else if (essentialInputType != '' && essentialInputType != 'none') { var pat; if (essentialInputType == 'number') { pat = /(^[0-9]+$)/; reMsg = '숫자만 입력이 가능합니다.'; } else if (essentialInputType == 'float') { pat = /(^[0-9.]+$)/; reMsg = '숫자(소수점 가능)만 입력이 가능합니다.'; } else if (essentialInputType == 'eng') { pat = /(^[a-zA-Z ]+$)/; reMsg = '영문자만 입력이 가능합니다.'; } else if (essentialInputType == 'han') { pat = /(^[ㄱ-ㅎ|ㅏ-ㅣ|가-힝| ]+$)/; reMsg = '한글만 입력이 가능합니다.'; } else if (essentialInputType == 'numeng') { pat = /(^[0-9a-zA-Z ]+$)/; reMsg = '영문자/숫자만 입력이 가능합니다.'; } else if (essentialInputType == 'alias') { pat = /(^[0-9a-zA-Z-_]+$)/; reMsg = '영문자/숫자 및 -_ 만 입력이 가능합니다.'; } else if (essentialInputType == 'id') { pat = /(^[0-9a-zA-Z]+$)/; reMsg = '영문자/숫자만 입력이 가능합니다.'; } else if (essentialInputType == 'tablename') { pat = /(^[0-9a-zA-Z_ ]+$)/; reMsg = '영문자/숫자/_ 만 입력이 가능합니다.'; } else if (essentialInputType == 'tel') { pat = /(^[0-9]{2,3}-[0-9]{3,4}-[0-9]{4})$/; reMsg = '[010-0000-1111] 형식으로만 입력하세요.'; } else if (essentialInputType == 'email') { pat = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/; reMsg = '[abc@bcd.com] 형식으로만 입력하세요.'; } else if ( essentialInputType == 'link' || essentialInputType == 'homepage' || essentialInputType == 'url' ) { pat = /^(http)(s)?(:\/\/).*/; reMsg = '[http://www.domain.com] 형식으로만 입력하세요.'; } else if (essentialInputType == 'domain') { pat = /\w+([-.]\w+)*\.\w+([-.]\w+)*/; reMsg = '[bcd.com] 형식으로만 입력하세요.'; } else if (essentialInputType == 'time') { pat = /[0-9]{2}[:][0-9]{2}/; reMsg = '[10:00] 형식으로만 입력하세요.'; } else if (essentialInputType == 'passwd') { pat = /(^[0-9a-zA-Z-_=+\|()*&^%$#@!~`?><\/;,.:' ]+$)/; reMsg = '영문자/숫자/특수문자 만 입력이 가능합니다.'; } else if (essentialInputType == 'date') { pat = /(^[0-9]{4}-{1}[0-9]{2}-{1}[0-9]{2})$/; reMsg = '[2015-01-01] 형식으로만 입력하세요.'; } if ( !pat.test( $('#' + essentialId) .attr('value') .trim() ) ) { alertMsg = reMsg + '\n\n'; alertMsg += '- 오류 입력 항목 명 : ' + essentialName + ''; alert(alertMsg); Ivy.mask_stop(); try { $('#' + essentialId).focus(); } catch (e) {} try { $('#submit_bt').css({ visibility: 'visible' }); } catch (e) {} try { $('.submit_bt').css({ visibility: 'visible' }); } catch (e) {} return false; } else return true; } else return true; } else if (its == 'checkbox' || its == 'radio') { var cnt = $("input[name='" + essentialId + "']:" + its + ':checked') .length; if (cnt < essentialMinimalInputSize) { alert(alertMsg); Ivy.mask_stop(); try { $('#' + essentialId).focus(); } catch (e) {} try { $('#submit_bt').css({ visibility: 'visible' }); } catch (e) {} try { $('.submit_bt').css('visibility', 'visible'); } catch (e) {} return false; } else return true; } else return true; }, /** * POPUP창으로 POST * @param actUrl 전송될 URL * @param postElements 전송될 Element 아이디 ( 구분자 '#' ) * @param sslType SSL로 연결 여부 ( ssl일 경우 true ELSE false ) * @param width_size Window Width Size * @param height_size Window Height Size */ popupPost: function (actUrl, postElements, sslType, width_size, height_size) { if (sslType == '' || sslType == undefined) sslType = false; if ($('#popupSubmitForm')) $('#popupSubmitForm').remove(); actUrl = actUrl.trim(); if ( actUrl.substring(0, 7) != 'http://' && actUrl.substring(0, 8) != 'https://' ) { if (sslType) actUrl = 'https://' + document.domain + actUrl; else actUrl = 'http://' + document.domain + actUrl; } var fm = $('
', { id: 'popupSubmitForm', name: 'popupSubmitForm', method: 'post', action: actUrl, target: 'PTAWin', }).appendTo(document.body); var postElementsSet = new Array(); postElementsSet = postElements.split('#'); postElementsSetLen = postElementsSet.length; for (var i = 0; i < postElementsSetLen; i++) { if (postElementsSet[i] != '') { var nEm = $('', { type: 'hidden', name: postElementsSet[i], value: $('#' + postElementsSet[i]).attr('value'), }).appendTo(fm); } } var PTAWin = window.open( '', 'PTAWin', 'width=' + width_size + ', height=' + height_size + ', resizable=yes, scrollbars=yes, status=1, titlebar=0, toolbar=0, location=0, left=300, top=200' ); if (PTAWin == null) { var ua = window.navigator.userAgent; var msie = ua.indexOf('MSIE'); var msxp = ua.indexOf('Windows NT 5.1'); var msxpsp2 = ua.indexOf(' SV1'); if (msie > 0 && msxp > 0 && msxpsp2 > 0) { alert( '※ MSN,야후,구글 팝업 차단 툴바가 설치된 경우 팝업허용을 해주셔야만 진행이 가능합니다. \n\n※ 윈도우 XP SP2 이상의 사용자일 경우에는 화면 상단(또는 하단)에 있는 팝업 차단 알림줄을 클릭하여 팝업을 \n 허용해 주시기 바랍니다.' ); } else { alert( '※ MSN,야후,구글 팝업 차단 툴바가 설치된 경우 팝업허용을 해주셔야만 진행이 가능합니다.' ); } } else { try { fm.submit(); PTAWin.focus(); try { PTAWin.moveTo( screen.availWidth / 2 - width_size / 2, screen.availHeight / 2 - height_size / 2 ); } catch (e) {} } catch (e) { alert('전송중 오류 발생'); } finally { $('#popupSubmitForm').remove(); } } }, /** * POPUP창으로 POST * @param actUrl 전송될 URL * @param formname 폼의 name * @param postElements 전송될 Element 아이디 ( 구분자 '#' ) * @param sslType SSL로 연결 여부 ( ssl일 경우 ssl 아닐경우 빈값 ) * @param width_size Window Width Size * @param height_size Window Height Size * @param addGet [Optional] 전송될 retUrl에 GET방식으로 추가파라메터를 보낼지 여부, 기본 ok */ popupPostSiren: function ( actUrl, formname, postElements, sslType, width_size, height_size ) { if ($('#reqCBAForm')) $('#reqCBAForm').remove(); addGet = arguments.length > 6 ? arguments[5] : 'ok'; hostName = document.domain; actUrl = actUrl.trim(); if ( actUrl.substring(0, 7) != 'http://' && actUrl.substring(0, 8) != 'https://' ) { if (sslType == 'ssl') actUrl = 'https://' + hostName + actUrl; else actUrl = 'http://' + hostName + actUrl; } var fm = $('', { id: 'reqCBAForm', name: 'reqCBAForm', method: 'post', action: actUrl, target: 'CbaWindow', }).appendTo(document.body); var postElementsSet = new Array(); postElementsSet = postElements.split('#'); postElementsSetLen = postElementsSet.length; for (var i = 0; i < postElementsSetLen; i++) { if (postElementsSet[i] != '') { tval = $("form[name='" + formname + "'] #" + postElementsSet[i]).val(); if ( $('#ip_name').attr('id') != undefined && postElementsSet[i] == 'retUrl' ) { $('', { type: 'hidden', name: 'iname', value: encodeURI($('#ip_name').val()), }).appendTo(fm); if (addGet == 'ok') tval += '&iname=' + encodeURI($('#ip_name').val()); } if ( $('#ip_id').attr('id') != undefined && postElementsSet[i] == 'retUrl' ) { $('', { type: 'hidden', name: 'iid', value: encodeURI($('#ip_id').val()), }).appendTo(fm); if (addGet == 'ok') tval += '&iid=' + encodeURI($('#ip_id').val()); } if ( $('input[name=certGb]').attr('name') != undefined && postElementsSet[i] == 'retUrl' ) { $('', { type: 'hidden', name: 'iwhat', value: encodeURI($('input[name=certGb]:radio:checked').val()), }).appendTo(fm); if (addGet == 'ok') tval += '&iwhat=' + encodeURI($('input[name=certGb]:radio:checked').val()); } if ( $('#iwhat').attr('name') != undefined && postElementsSet[i] == 'retUrl' ) { $('', { type: 'hidden', name: 'iwhat', value: encodeURI($('#iwhat').val()), }).appendTo(fm); if (addGet == 'ok') tval += '&iwhat=' + encodeURI($('#iwhat').val()); } if ( $('#sid').attr('name') != undefined && postElementsSet[i] == 'retUrl' ) { $('', { type: 'hidden', name: 'sid', value: encodeURI($('#sid').val()), }).appendTo(fm); if (addGet == 'ok') tval += '&sid=' + encodeURI($('#sid').val()); } $('', { type: 'hidden', name: postElementsSet[i], value: tval, }).appendTo(fm); } } var PTAWinS = window.open( '', 'CbaWindow', 'width=' + width_size + ', height=' + height_size + ', resizable=0, scrollbars=no, status=1, titlebar=0, toolbar=0, location=0, left=300, top=200' ); if (PTAWinS == null) { var ua = window.navigator.userAgent; var msie = ua.indexOf('MSIE'); var msxp = ua.indexOf('Windows NT 5.1'); var msxpsp2 = ua.indexOf(' SV1'); if (msie > 0 && msxp > 0 && msxpsp2 > 0) { alert( '※ MSN,야후,구글 팝업 차단 툴바가 설치된 경우 팝업허용을 해주셔야만 진행이 가능합니다. \n\n※ 윈도우 XP SP2 사용자일 경우에는 화면 상단에 있는 팝업 차단 알림줄을 클릭하여 팝업을 \n 허용해 주시기 바랍니다.' ); } else { alert( '※ MSN,야후,구글 팝업 차단 툴바가 설치된 경우 팝업허용을 해주셔야만 진행이 가능합니다.' ); } } else { try { fm.submit(); PTAWinS.focus(); try { PTAWinS.moveTo( screen.availWidth / 2 - width_size / 2, screen.availHeight / 2 - height_size / 2 ); } catch (e) {} } catch (e) { alert('전송중 오류 발생'); } finally { $('#reqCBAForm').remove(); } } }, /** * 공공IPIN */ ipinAuth: function (rtnurl, obj) { var wWidth = 360; var wHight = 120; var wX = (window.screen.width - wWidth) / 2; var wY = (window.screen.height - wHight) / 2; var rqurl = $(obj).attr('href'); var url = rqurl + '?rtnurl=' + rtnurl; // Request Page Call var w = window.open( url, 'gPinLoginWin', 'directories=no,toolbar=no,left=' + wX + ',top=' + wY + ',width=' + wWidth + ',height=' + wHight ); }, /** * 공공IPIN */ ipinAuthPw: function (url) { var wWidth = 360; var wHight = 120; var wX = (window.screen.width - wWidth) / 2; var wY = (window.screen.height - wHight) / 2; var w = window.open( url, 'gPinLoginWin', 'directories=no,toolbar=no,left=' + wX + ',top=' + wY + ',width=' + wWidth + ',height=' + wHight ); }, /** * 팝업창 * @param url URL * @param name 새창이름 * @param argument TOP POSITION * @param argument LEFT POSITION * @param argument Width * @param argument Height * @param [optional] Resizeable * @param [optional] Scrollbars */ popup: function (url, name) { if (arguments.length < 6) { Ivy.simpleAlert(argument); return; } var property = ''; property += 'top=' + arguments[2]; property += ',left=' + arguments[3]; property += ',width=' + arguments[4]; property += ',height=' + arguments[5]; property += arguments.length > 6 ? ',resizable=' + arguments[6] : ',resizable=0'; property += arguments.length > 7 ? ',scrollbars=' + arguments[7] : ',scrollbars=0'; var winfr = window.open(url, name, property); try { winfr.focus(); } catch (e) {} return winfr; }, /** * 팝업창 화면의 가운데 열기 * @param url URL * @param name 새창이름 * @param argument Width * @param argument Height * @param [optional] Resizeable * @param [optional] Scrollbars */ centerpopup: function (url, name) { if (arguments.length < 2) { Ivy.simpleAlert(argument); return; } tWi = Math.round((screen.availWidth - parseInt(arguments[2], 10)) / 2); tHe = Math.round((screen.availHeight - parseInt(arguments[3], 10)) / 2); if ($.browser.msie) tHe -= 30; var property = ''; property += 'top=' + tHe; property += ',left=' + tWi; property += ',width=' + arguments[2]; property += ',height=' + arguments[3]; property += arguments.length > 3 ? ',resizable=' + arguments[4] : ',resizable=0'; property += arguments.length > 4 ? ',scrollbars=' + arguments[5] : ',scrollbars=0'; var winfr = window.open(url, name, property); try { winfr.focus(); } catch (e) {} return winfr; }, /** * 새창 열기 */ windowOpen: function () { var url = ''; if (arguments.length == 0) return; if ( $('#' + arguments[0]).attr('value') != undefined && $('#' + arguments[0]).length != 0 ) url = $('#' + arguments[0]).attr('value'); else url = arguments[0]; if (arguments.length == 2) { window.open(url, arguments[1]); } else { window.open(url); } }, /** * 새창 열기 */ openWindow: function () { if (arguments.length == 0) return; if (arguments.length == 2) { window.open(arguments[0], arguments[1]); } else { window.open(arguments[0]); } }, /** * 탐색기 창을 지정한 크기로 변경합니다. * @param w 가로 * @param h 세로 * @return NONE */ resizeWin: function (w, h) { scx = parseInt(w, 10); scy = parseInt(h, 10); tWi = Math.round((screen.availWidth - scx) / 2); tHe = Math.round((screen.availHeight - scy) / 2); if ($.browser.msie) tHe -= 30; window.moveTo(tWi, tHe); window.resizeTo(scx, scy); }, /** * 경고창 */ simpleAlert: function () { var errno = arguments[0]; var msg = ''; switch (arguments.length) { case 2: msg = '[' + arguments[1] + ']\n'; break; case 1: msg += this.errMsg[errno]; break; default: msg = this.errMsg.toString(); } window.alert(msg); }, /** * 쿠키제어 * @param Name 쿠키명 * @param Value 쿠키 내용 * @param [optional] expire * @param [optional] Cookie Path * @param [optional] Cookie domain * @param [optional] Secure */ setCookie: function (Name, Value) { var argv = arguments; var argc = arguments.length; var expires = 2 < argc ? argv[2] : null; var path = 3 < argc ? argv[3] : '/'; var domain = 4 < argc ? argv[4] : null; var secure = 5 < argc ? argv[5] : false; document.cookie = Name + '=' + escape(Value) + (expires ? '; expires=' + expires.toGMTString() : '') + (path ? '; path=' + path : '') + (domain ? '; domain=' + domain : '') + (secure == true ? '; secure' : ''); }, /** * 쿠키 가져오기 * @param name 쿠키명 */ getCookie: function (name) { var cookies = document.cookie.split('; '); for (i = 0, j = cookies.length; i < j; i++) { cookieArray = cookies[i].split('='); if (name == cookieArray[0]) return unescape(cookieArray[1]); } return false; }, /** * 쿠키삭제 */ delCookie: function (name) { var expireDate = new Date(); if (arguments.length > 1) domain = '; domain=' + arguments[1]; else domain = ''; expireDate.setDate(expireDate.getDate() - 1); document.cookie = name + '= ' + '; expires=' + expireDate.toGMTString() + '; path=/' + domain; }, /** * URL 이동 * @param argument URL * @param [optional] target */ gourl: function () { var target = arguments.length == 2 ? arguments[1] : document; target.location.href = arguments[0]; }, /** * 이미지 크기 제어 * @param obj 대상이미지객체 * @param r 비율 */ imResizeRatio: function (obj, r) { var ratio = r.split(':'); var cw = obj.width(); var ch = obj.height(); obj.attr('width', Math.round(cw * (ratio[1] / ratio[0]))); obj.attr('height', Math.round(ch * (ratio[1] / ratio[0]))); }, /** * 이미지 사이즈 고정화 * @param obj 대상이미지객체 * @param w 가로사이즈 */ imResizeFixing: function (obj, w) { var cw = obj.width(); var ch = obj.height(); if (cw > w) { obj.attr('width', w); obj.attr('height', Math.round((ch * w) / cw)); } }, /** * 화면폰트크기제어 * @param s S : 작게, L : 크게, R : 원본 */ setFont: function (s, c) { if (s == 'L') Ivy.scr_size = Ivy.scr_size + 0.1; else if (s == 'S') Ivy.scr_size = Ivy.scr_size - 0.1; else if (s == 'R') Ivy.scr_size = 1; if (Ivy.scr_size >= 1.4) { Ivy.scr_size = 1.4; } else if (Ivy.scr_size <= 0.7) { Ivy.scr_size = 0.7; } $('#contentBody').css({ zoom: Ivy.scr_size }); }, /** * UTF-8 => CP949 * @param utf8 문자열 * @return 변환된 문자열 */ utf8ToCp949: function (utf8) { var i = 0; var output = ''; var state = 0; while (i < utf8.length) { var c = utf8.charAt(i++); if (state == 1) { if (c < 'C') { output += '%' + c + utf8.charAt(i++); } else { var length = c < 'E' ? 6 : 9; var c3 = utf8.substring(i - 2, i - 2 + length); var key = c3.replace(/%/g, ''); var converted = eval('codeTable.' + key); output += converted; i += length - 2; } state = 0; } else { if (c == '%') { state = 1; } else { output += c; } } } return output; }, /** * BASE64 ENCODE * @param input 문자열 * @return 엔코딩된 문자열 */ encode64Prc: function (input) { var output = ''; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; do { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + this.base64_keyStr.charAt(enc1) + this.base64_keyStr.charAt(enc2) + this.base64_keyStr.charAt(enc3) + this.base64_keyStr.charAt(enc4); } while (i < input.length); return output; }, /** * BASE64 DECODE * @param input 문자열 * @return 디코딩된 문자열 */ decode64Prc: function (input) { var output = ''; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); do { enc1 = this.base64_keyStr.indexOf(input.charAt(i++)); enc2 = this.base64_keyStr.indexOf(input.charAt(i++)); enc3 = this.base64_keyStr.indexOf(input.charAt(i++)); enc4 = this.base64_keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } while (i < input.length); return output; }, /** * BASE64 ENCODE ( HANGUL ) * @param str 문자열 * @return 엔코딩된 문자열 */ encode64: function (str) { return this.encode64Prc(escape(str)); }, /** * BASE64 DECODE ( HANGUL ) * @param str 문자열 * @return 디코딩된 문자열 */ decode64: function (str) { return unescape(this.decode64Prc(str)); }, /** * DIV POPUP * @param type 처리방법 * - html : HTML코드 * - page : Page 불러오기 * @param acContent 내용 * @param title 타이틀 * @param argument[optional] Width * @param argument[optional] Height * @param argument[optional] Top Position [ 숫자 혹은 left, center, right, top, bottom ] * @param argument[optional] Left Position [ 숫자 혹은 left, center, right, top, bottom ] * @param argument[optional] Resize [ true/false ] * @param argument[optional] Dragable [ true/false ] * @param argument[optional] modal [ true/false ] */ divpoopup: function (type, acContent, title) { try { $('#jqContextMenu').css({ 'z-index': 1001 }); } catch (e) {} try { $('#dialog-modal').remove(); } catch (e) {} $('#dialog:ui-dialog').dialog('destroy'); var pdiv = $('
', { id: 'dialog-modal', title: title }).appendTo( document.body ); if (arguments.length > 3) dwidth = arguments[3]; else dwidth = 'auto'; if (arguments.length > 4) dheight = arguments[4]; else dheight = 'auto'; if (arguments.length > 5) dtop = arguments[5]; else dtop = 'center'; if (arguments.length > 6) dleft = arguments[6]; else dleft = 'center'; if (arguments.length > 7) dresizable = arguments[7]; else dresizable = false; if (arguments.length > 8) ddraggable = arguments[8]; else ddraggable = false; if (arguments.length > 9) dmodal = arguments[9]; else dmodal = false; if (dmodal) Ivy.nekr_hide_controller(); if (type == 'page') { $.get(acContent, function (data) { $('#dialog-modal').dialog({ width: dwidth, height: dheight, position: [dtop, dleft], resizable: dresizable, draggable: ddraggable, modal: dmodal, close: function (event, ui) { if (dmodal) Ivy.nekr_show_controller(); $('#dialog-modal').remove(); }, }); $('#dialog-modal').css({ overflow: 'auto' }); $('#dialog-modal').html(data); }); } else if (type == 'html') { $('#dialog-modal').dialog({ width: dwidth, height: dheight, position: [dtop, dleft], resizable: dresizable, draggable: ddraggable, modal: dmodal, close: function (event, ui) { if (dmodal) Ivy.nekr_show_controller(); $('#dialog-modal').remove(); }, }); $('#dialog-modal').css({ overflow: 'auto' }); $('#dialog-modal').html(acContent); } return $('#dialog-modal'); }, /** * 경고용 POPUP ALERT ( 1초 노출후 자동 닫힘 ) * @param msg 알림 메세지 * @param sec 창이 닫힐 시간(초) */ divpopupalert: function (msg, sec) { if (sec == undefined) sec = 1; sec = sec * 1000; var ids = ('popupalert' + Math.random()).replaceAll('.', ''); $('
', { 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) { $('