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; try { if ( IvyHostKey != "hotel" && IvyHostKey != "ssengym" && IvyHostKey != "kmahn" && IvyHostKey != "shinchun" ) { Ivy.articleMover(); } } catch(e) {} }); /** * 콘텐츠의 이미지를 lightview에 연동처리 하는 스크립트 */ $(window).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){} }); }); /** * 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); }); } 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(/^(.*)$/mg, "$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(); $(document).ready(function(){ $("ol.attach li img").each(function(n){ $(this).error(function(){ $(this).attr("src","/Ivyimages/swfupload/fileicon/unknown.gif"); }); }); }); 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) { nvis = new vodplayer({ "objId":tid, "flexExternalObj":"nvis", "steelPath":"thumb", "videoSrc":mcscode, "width":width, "height":height }); /*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 = "영문자/숫자/특수문자 만 입력이 가능합니다."; } 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 = 0; if ( essentialId.substring(0,1) == "#" ) { essentialId = essentialId.replace(/ +/g," "); nessentialId = essentialId.split(" "); cnt = $("#"+nessentialId[0]+" input[name='"+nessentialId[1]+"']:"+its+":checked").length; } else { 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 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" }); $(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") .attr("id",option.id) .attr("name",option.id) .attr("src",minimapUrl) .attr("scrolling","no") .attr("frameborder",0) .attr("vspace",0) .attr("hspace",0) .attr("tabindex",-1) .attr("title",document.title) .css({"border":"0px","width":"100%","height":"100%","margin":"0px","padding":"0px","borderstyle":"none","frameborder":0}) .appendTo($("#"+obj)); } } }, /** * 미니맵의 줌 콘트롤 */ minimapZoom: function( mid, act ) { window.frames[mid].window.ngmap.zoomChange( act ); }, /** * minimap에 노출된 좌표를 중심으로 새창으로 큰 지도화면 띄우기 * @param mid : minimap ID */ minimapFull: function ( mid ) { var pma = Ivy.getParams( $("#"+mid).attr("src") ); var mapUrl = "/Ivyservice/gmap/?inmap=ok"; $.each(pma, function( k, v){ if ( k == "mapMode" ) v = "Full"; mapUrl += "&"+k+"="+v; }); window.open(mapUrl,"map"); }, /** * 최대 입력가능한 글자수를 제한하여 입력 받도록 함. * @param obj : Tag ID * @param maxCnt : 최대 입력 글자수 * @return (obj ID+"Cnt") Class로 선언된 태그의 안쪽에 현재 글자수 표현 */ maxInputControl: function ( obj, maxCnt ) { var txt = $(obj).val(); var rxtxt = txt.replace(/\r\n|\n\r|\r|\n/g,"[ENTER]"); var rxtxtCnt = rxtxt.match(/\[ENTER\]/g); var rtxt = txt.replace(/\r\n|\n\r|\r|\n/g,""); txtlen = rtxt.length; if ( txtlen > maxCnt ) { Ivy.divpopupalert(maxCnt+"자 까지만 입력이 가능합니다."); $(obj).blur(); if ( rxtxtCnt == null ) rxtxtCntRe = 0; else rxtxtCntRe = rxtxtCnt.length; rstrCnt = rxtxtCntRe + maxCnt; $(obj).val( txt.substring(0,rstrCnt).replace(/\s+$/,"") ); try { $("."+$(obj).attr("id")+"Cnt").html(maxCnt); } catch(e) {} } else { try { $("."+$(obj).attr("id")+"Cnt").html(txtlen); } catch(e) {} } }, /** * 최대 입력가능한 글자수를 제한하여 입력 받도록 함. * @param obj : Tag ID * @param maxCnt : 최대 입력 글자수 * @return (obj ID+"Cnt") Class로 선언된 태그의 안쪽에 현재 글자수 표현 */ maxInputControlByte: function ( obj, maxCnt ) { var txt = $(obj).val(); var rxtxt = txt.replace(/\r\n|\n\r|\r|\n/g,"[ENTER]"); var rxtxtCnt = rxtxt.match(/\[ENTER\]/g); var rtxt = txt.replace(/\r\n|\n\r|\r|\n/g,""); txtlen = rtxt.length; chkbyte = 0; subCnt = 0; for ( i = 0; i < txtlen; i++ ) { ncs = rtxt.charAt(i); if ( escape(ncs).length > 4 ) chkbyte += 2; else chkbyte += 1; if ( chkbyte <= maxCnt ) { subCnt=i+2;} } if ( chkbyte > maxCnt ) { Ivy.divpopupalert(maxCnt+"Byte 까지만 입력이 가능합니다."); if ( rxtxtCnt == null ) rxtxtCntRe = 0; else rxtxtCntRe = rxtxtCnt.length; rstrCnt = rxtxtCntRe + maxCnt; $(obj).val( txt.substring(0,subCnt) ); try { $("."+$(obj).attr("id")+"Cnt").html(maxCnt); } catch(e) {} } else { try { $("."+$(obj).attr("id")+"Cnt").html(chkbyte); } catch(e) {} } }, /** * 문자열 자르기 * @pram txts : 문자열 * @param maxCnt : 최대 입력 글자수 * @param dot : 글줄임 문구 표시여부 ( ... ) : true / false ( Default : false ) * @return String */ cutString: function ( txts, maxCnt, dot ) { var rval = ""; if ( dot == undefined ) dot = false; else dot = dot; var txt = txts; var rxtxt = txt.replace(/\r\n|\n\r|\r|\n/g,"[ENTER]"); var rxtxtCnt = rxtxt.match(/\[ENTER\]/g); var rtxt = txt.replace(/\r\n|\n\r|\r|\n/g,""); txtlen = rtxt.length; if ( txtlen > maxCnt ) { if ( rxtxtCnt == null ) rxtxtCntRe = 0; else rxtxtCntRe = rxtxtCnt.length; rstrCnt = rxtxtCntRe + maxCnt; rval = txt.substring(0,rstrCnt).replace(/\s+$/,""); if ( dot ) rval += "..."; } else { rval = txt; } return rval; }, /** * 만족도 조사 입력값 체크 */ researchCheck: function ( obj ) { $("#researchSubmitBt").css({"visibility":"hidden"}); if ( !Ivy.alert("research", "만족도 내용", 10, "none") ) { $("#researchSubmitBt").css({"visibility":"visible"}); return false; } var pdata = $(obj).serialize()+"&sti="+Math.random(); var actionurl = $(obj).attr("action"); if ( !Ivy.ajaxSubmit(pdata, actionurl, "만족도 내용 등록 처리중입니다.", "html", "researchSubmitBt", Ivy.researchCheckComplete) ) { $("#researchSubmitBt").css({"visibility":"visible"}); return false; } return false; }, /** * 만족도 조사 등록 처리 완료처리 * @param req : Ajax Request */ researchCheckComplete: function ( req ) { $("#research").val(""); $(".researchCnt").html("0"); alert("성공적으로 등록 되었습니다."); Ivy.researchResultList(researchOption); }, /** * 만족도 조사 결과 보기 * @param req : 인자값 ( menucode/tablename/tablecode ) */ researchResultView: function ( req ) { reqs = req.split("/"); var url = "/_Lib/modulesext/XNMResearchView.php?tfk="+reqs[1]+"&afk="+reqs[2]+"&mfk="+reqs[0]+"&sti="+Math.random();; researchpopup = Ivy.divpoopup('page', url, '만족도 조사 결과', 530, 210, 'center', 'center', false, true, true); }, /** * 만족도 조사 목록 보기 * @param req : 인자값 ( menucode/tablename/tablecode ) */ researchResultList: function ( req ) { reqs = req.split("/"); var url = "/_Lib/modulesext/XNMResearchList.php?tfk="+reqs[1]+"&afk="+reqs[2]+"&mfk="+reqs[0]+"&sti="+Math.random();; $("div#researchList").load(url); }, /** * Social 댓글 입력값 체크 */ socialCheck: function ( obj ) { $("#socialSubmitBt").css({"visibility":"hidden"}); if ( !Ivy.alert("social", "Social 댓글 내용", 10, "none") ) { $("#socialSubmitBt").css({"visibility":"visible"}); return false; } var pdata = $(obj).serialize()+"&sti="+Math.random(); var actionurl = $(obj).attr("action"); if ( !Ivy.ajaxSubmit(pdata, actionurl, "Social 댓글 등록 처리중입니다.", "html", "socialSubmitBt", Ivy.socialCheckComplete) ) { $("#socialSubmitBt").css({"visibility":"visible"}); return false; } return false; }, /** * 만족도 조사 등록 처리 완료처리 * @param req : Ajax Request */ socialCheckComplete: function ( req ) { alert("Complete") }, /** * Ajax로 폼내용을 전송 * @param pdata : 전송할 내용 serialize * @param actionurl : 전송될 URL * @param [Optional] submitMsg : Submit시 Mask에 나타낼 메세지 * @param [Optional] datatype : 송신 Protocol [ "html" / "json" ] [ Defalut : "html" ] * @param [Optional] submitbt : Submit Button ID * @param [Optional] func : 처리완료후 실행될 function @return request */ ajaxSubmit: function ( pdata, actionurl, submitMsg, datatype, submitbt, func ) { if ( pdata == undefined || pdata == "" ) { alert("전송할 내용이 없습니다."); return false; } if ( actionurl == undefined || actionurl == "" ) { alert("전송될 URL이 없습니다."); return false; } if ( submitMsg == undefined ) submitMsg = ""; if ( datatype == undefined ) datatype = "html"; if ( submitbt == undefined ) submitMsg = "submit_bt"; $.ajax({ url: actionurl, dataType: datatype, data: pdata, async: false, type: "POST", encoding: "UTF-8", success: function( request ) { if ( datatype == "html" && request.substring(0,6) == "ERROR/" ) { alert( request.substring(6, request.length) ); try { $("#"+submitbt).css({"visibility":"visible"}); } catch(e) {} } else if ( datatype == "html" && request.substring(0,14) == "Database Error" ) { alert( request.substring(14, request.length) ); try { $("#"+submitbt).css({"visibility":"visible"}); } catch(e) {} } else if ( datatype == "html" && request.substring(0,17) == "[ SQL MAP ERROR ]" ) { alert( request.substring(17, request.length) ); try { $("#"+submitbt).css({"visibility":"visible"}); } catch(e) {} } else if ( datatype == "html" && request.strip_tags().trim().substring(0,8) == "Warning:" ) { alert( "프로그램 오류 발생! 관리자에게 문의 바랍니다." ); try { $("#"+submitbt).css({"visibility":"visible"}); } catch(e) {} } else { if ( typeof func == "function" ) func(request); } }, error: function( request, status, err ) { try { $("#"+submitbt).css({"visibility":"visible"}); } catch(e) {} try { $("."+submitbt).css({"visibility":"visible"}); } catch(e) {} alert("서버와의 통신에 실패하였습니다.\n\n"+err.message); Ivy.mask_stop(); }, beforeSend: function() { try { $("#"+submitbt).css({"visibility":"hidden"}); } catch(e) {} try { $("."+submitbt).css({"visibility":"hidden"}); } catch(e) {} Ivy.mask_start(submitMsg); }, complete: function() { try { $("#"+submitbt).css({"visibility":"visible"}); } catch(e) {} try { $("."+submitbt).css({"visibility":"visible"}); } catch(e) {} Ivy.mask_stop(); } }); }, ajaxSubmitSlient: function ( pdata, actionurl, submitMsg, datatype, submitbt, func ) { if ( pdata == undefined || pdata == "" ) { alert("전송할 내용이 없습니다."); return false; } if ( actionurl == undefined || actionurl == "" ) { alert("전송될 URL이 없습니다."); return false; } $.ajax({ url: actionurl, dataType: datatype, data: pdata, async: true, type: "POST", encoding: "UTF-8", success: function( request ) { if ( typeof func == "function" ) func(request); } }); }, subImgView: function ( obj ) { $(obj).parents("ul").parent("li").children("ul").children("li").children("a").removeClass("select"); var isrc = ($(obj).children("img").attr("src")).split("/"); var ipath = ""; for ( var i = 0; i < (isrc.length - 1 ); i++ ) if ( isrc[i] != "" ) ipath += "/"+isrc[i]; ipath += "/"+isrc[(isrc.length-1)].replaceAll("tn99_",""); $("#tradeImgZone").css({"background-image":"url("+ipath+")"}); $(obj).addClass("select"); }, subImgTabChange: function( obj, act ) { aniAction = true; showTab = ($("#subImgZone ul.active").attr("id")).split("_")[1]; maxUl = $("#subImgZone ul").length; if ( act == "prev") { showTab--; if ( showTab < 0 ) { showTab = 0; Ivy.divpopupalert("첫 페이지 입니다."); aniAction = false; } } else if ( act == "next") { showTab++; if ( showTab >= maxUl ) { showTab = maxUl - 1; Ivy.divpopupalert("마지막 페이지 입니다."); aniAction = false; } } if ( aniAction ) { $("#subImgZone ul.active").animate({"opacity":0}, function() { $("#subImgZone ul.active").removeClass("active").css({"display":"none"}); $("#subImgZone ul#subImgUl_"+showTab).addClass("active").css({"display":"block"}).animate({"opacity":1}); }); } }, /** * 상단메뉴 닫기 */ topMenuSubViewClose: function() { var scrollDuration = "bottom"; if ( $("ul.IvyTopMenu").hasClass("ScrollLeft") ) scrollDuration = "left"; if ( scrollDuration == "left" ) { $("ul.IvyTopMenu").find("ul.active").removeClass("active").animate({width:'toggle'},{ step: function(){ $(this).children().hide(); }, complete: function(){ $("ul.IvyTopMenu").unbind("mouseleave"); $(this).hide(); } }); } else if ( IvyTopMenuStyle == "single" ) $("ul.IvyTopMenu").find("ul.active").removeClass("active").slideUp("fast",function(){ $("ul.IvyTopMenu").unbind("mouseleave"); }); else $("div.subAllDisplay").slideUp("fast",function(){ $("div.subAllDisplay").unbind("mouseleave"); }); }, /** * 상단 메뉴 Animation * @param tobj : Open Object */ topMenuSubView: function( tobj ) { var scrollDuration = "bottom"; if ( $("ul.IvyTopMenu").hasClass("ScrollLeft") ) scrollDuration = "left"; $("ul.IvyTopMenu li").removeClass("select"); var pliObj = $(tobj).parent(); pliObj.addClass("select"); var viewObj = pliObj.children("ul"); if ( viewObj == undefined ) { $("ul.IvyTopMenu").find("ul.active").removeClass("active").slideUp("fast",function(){ $("ul.IvyTopMenu").unbind("mouseleave"); }); } else { var viewObjLen = viewObj.children().length; var viewObjWidthPct = 100/viewObjLen; var ops = $("ul.IvyTopMenu").position(); if ( viewObjLen == 0 ) { if ( IvyTopMenuStyle == "single" ) $("ul.IvyTopMenu").find("ul.active").removeClass("active").slideUp("fast",function(){ $("ul.IvyTopMenu").unbind("mouseleave"); }); else { $("div.gnb").bind("mouseleave",function(){ $(".subAllDisplay").slideUp(); }); if ( $(".subAllDisplay").css("display") == "block" && IvySmartBrowser == "true" ) $(".subAllDisplay").slideUp(); else $(".subAllDisplay").slideDown(); } } else { if ( IvyTopMenuStyle == "single" ) { if ( viewObj.css("display") == "none" ) { viewObj.css({"left":ops.left+"px"}); flen = $("ul.IvyTopMenu").find("ul.active").length; $("ul.IvyTopMenu").find("ul.active").removeClass("active").fadeOut(); viewObj.addClass("active"); if ( flen > 0 ) { viewObj.fadeIn(function(){ var lish = 0; var lii = 0; viewObj.children("li").each(function(){ clish = $(this).height(); if ( clish > lish ) lish = clish; if ( (lii%5) == 0 && !$(this).parents("li").hasClass("top1stother") ) $(this).css({"clear":"none"}); lii++; }); //viewObj.children("li").css({"height":lish+"px"}); $("ul.IvyTopMenu").bind("mouseleave",function(){ Ivy.topMenuSubViewClose() }); }); } else { if ( scrollDuration == "left" ) { viewObj.animate({width:'toggle',queue:false},{ step: function(a){ if ( a == 1 ) viewObj.children().hide(); }, complete: function(){ viewObj.children().show(); var lish = 0; var lii = 0; viewObj.children("li").each(function(){ clish = $(this).height(); if ( clish > lish ) lish = clish; if ( (lii%5) == 0 && !$(this).parents("li").hasClass("top1stother") ) $(this).css({"clear":"none"}); lii++; }); //viewObj.children("li").css({"height":lish+"px"}); $("ul.IvyTopMenu").bind("mouseleave",function(){ Ivy.topMenuSubViewClose() }); } }); } else { viewObj.slideDown(function(){ var lish = 0; var lii = 0; viewObj.children("li").each(function(){ clish = $(this).height(); if ( clish > lish ) lish = clish; if ( (lii%5) == 0 && !$(this).parents("li").hasClass("top1stother") ) $(this).css({"clear":"none"}); lii++; }); //viewObj.children("li").css({"height":lish+"px"}); $("ul.IvyTopMenu").bind("mouseleave",function(){ Ivy.topMenuSubViewClose() }); }); } } } } } } }, /** * 서브 메뉴 3차 메뉴 열기 * @param tobj : Open Object */ subMenuSubView: function( tobj ) { if ( !$(tobj).parent().hasClass("IvySubMenuPlusOpen") ) { $(tobj).parent().children("ul").slideDown(function(){ $(tobj).parent().addClass("IvySubMenuPlusOpen"); }); } else { if ( IvySmartBrowser == "true" ) { $(tobj).parent().children("ul").slideUp(function(){ $(tobj).parent().removeClass("IvySubMenuPlusOpen"); }); } } }, /** * 서브 메뉴 3차 메뉴 모두 열기 */ subMenuSubAllView: function() { $("ul.IvySubMenu li ul.IvySubMenu1s").slideDown(function(){ $("ul.IvySubMenu li.IvySubMenuPlus").addClass("IvySubMenuPlusOpen"); }); }, /** * 서브 메뉴 3차 메뉴 모두 닫기 */ subMenuSubCloseView: function() { $("ul.IvySubMenu li ul.IvySubMenu1s").slideUp(function(){ $("ul.IvySubMenu li.IvySubMenuPlus").removeClass("IvySubMenuPlusOpen"); }); }, /** * MCA 제작 요청 * @param arguments[0] : 첨부파일 Table 고유 코드 * @param arguments[1] : Click Object */ mcaCreateOrder: function() { if ( arguments.length < 2 ) { alert("인자가 부족합니다."); return false; } var attachCode = arguments[0]; var tobj = $(arguments[1]); if ( confirm("동영상 제작을 요청하시겠습니까?") ) { var pathUrl = location.pathname; var pdata = "mode=mcaCreateOrder&table="+contentTableName+"&idx="+contentIdx+"&attachIdx="+attachCode; tobj.css("display","none"); if ( !Ivy.ajaxSubmit(pdata, pathUrl, "동영상 제작 요청 처리중입니다.", "html", "", Ivy.mcaCreateOrderComplete) ) { return false; } } return false; }, /** * MCA 제작 요청 완료 * @param req : 요청결과 REQUEST */ mcaCreateOrderComplete: function ( req ) { }, /** * 이북(digitomi) * @param arguments[0] : 제작상태 * @param arguments[1] : 전자책 코드 */ ebookOpen: function() { var bookstatus = arguments[0]; var bookcode = arguments[1]; if(bookstatus != 3){alert('전자책 제작완료후 열람이 가능합니다.');return false;} if(bookcode==''){alert('전자책 코드가 필요 합니다.');return false;} if(bookcode.length == 10) { // 2012-02-03 이전 ibook alert("지원되지 않은 전자책 코드입니다."); return false; } else if(bookcode.length == 12) { // 2012-02-03 이후 mbook try{ var screenwidth = window.screen.width; var screenheight = window.screen.height; }catch(e){ var screenwidth = screen.availWidth; var screenheight = screen.availHeight; } var pWidth = screenwidth - 10; var pHeight = screenheight - 80; var ebook = Ivy.popup("http://"+ebookServer+"/Viewer/"+bookcode,Math.round(Math.random() * 100),0,0,pWidth,pHeight,1,0); return false; } else { alert('지원형식이 맞지않는 전자책 코드 입니다.');return false; } return false; }, /** * 이북(digitomi) 제작 요청 * @param arguments[0] : 첨부파일 Table 고유 코드 * @param arguments[1] : Click Object */ ebookCreateOrder: function() { if ( arguments.length < 2 ) { alert("인자가 부족합니다."); return false; } var attachCode = arguments[0]; var tobj = $(arguments[1]); if ( confirm("전자책 제작을 요청하시겠습니까?") ) { var pathUrl = location.pathname; var pdata = "mode=ebookCreateOrder&table="+contentTableName+"&idx="+contentIdx+"&attachIdx="+attachCode; tobj.css("display","none"); if ( !Ivy.ajaxSubmit(pdata, pathUrl, "전자책 제작 요청 처리중입니다.", "html", "", Ivy.ebookCreateOrderComplete) ) { return false; } } return false; }, /** * 이북(digitomi) 제작 요청 완료 * @param req : 요청결과 REQUEST */ ebookCreateOrderComplete: function ( req ) { }, /** * MCA * @param arguments[0] : 제작상태 * @param arguments[1] : 영상 코드 * @param arguments[2] : 영상 Width * @param arguments[3] : 영상 Height * @param arguments[4] : 영상 서버 주소 */ mcaOpen: function() { var mcastatus = arguments[0]; var mcacode = arguments[1]; if ( arguments.length > 2 ) var mcacaption = arguments[2]; else var mcacaption = ""; if ( arguments.length > 3 ) var mcawidth = arguments[3]; else var mcawidth = 600; if ( arguments.length > 4 ) var mcaheight = arguments[4]; else var mcaheight = 400; if ( arguments.length > 5 ) var mcaserver = arguments[5]; else var mcaserver = "mca.phnet.kr"; if(mcastatus != 3){alert('동영상 제작완료후 열람이 가능합니다.');return;} if(mcacode==''){alert('동영상 코드가 필요 합니다.');return;} commentUrl = "http://"+mcaserver+"/content/"+mcacode+"&callback=?"; //$.getJSON(commentUrl, function( data ){ // console.log(data) comment = ""; Lightview.show({ url: "http://"+mcaserver+"/lib/flvPlayer.swf", type: 'flash', title: mcacaption, caption: comment, options: { width: mcawidth, height: mcaheight, flashvars: { movieCode: mcacode, width: mcawidth, height: mcaheight } } }); //}); }, mcaThumb: function() { var mcastatus = arguments[0]; var mcacode = arguments[1]; if(mcastatus != 3){alert('동영상 제작완료후 열람이 가능합니다.');return;} if(mcacode==''){alert('동영상 코드가 필요 합니다.');return;} url = '/_Lib/extlib/mca/thumbnail.php?movieCode='+mcacode+'&etval='+Math.random(); Ivy.centerpopup(url,"thumbnail",800,370, false, true); }, moduleConfig: function( obj, str ) { this.moduleConfigDiv = Ivy.divpoopup('page', $(obj).attr('href'), '모듈'+str, 1000, 610, 'center', 'center', false, true, true); $(window).scroll(function () { if ( $("div#dialog-modal").css("display") != undefined ) { Ivy.moduleConfigDiv.dialog('option', 'position', 'center'); } else $(window).unbind('scroll'); }); $(document).bind("resize", function () { if ( $("div#dialog-modal").css("display") != undefined ) { Ivy.moduleConfigDiv.dialog('option', 'position', 'center'); } else $(document).unbind('resize'); }); }, newMember: function( obj, str ) { this.moduleConfigDiv = Ivy.divpoopup('page', $(obj).attr('href'), '회원'+str, 500, 305, 'center', 'center', false, true, true); $(window).scroll(function () { if ( $("div#dialog-modal").css("display") != undefined ) { Ivy.moduleConfigDiv.dialog('option', 'position', 'center'); } else $(window).unbind('scroll'); }); $(document).bind("resize", function () { if ( $("div#dialog-modal").css("display") != undefined ) { Ivy.moduleConfigDiv.dialog('option', 'position', 'center'); } else $(document).unbind('resize'); }); }, solutionConfig: function( obj, str ) { this.moduleConfigDiv = Ivy.divpoopup('page', $(obj).attr('href'), '솔루션'+str, 1000, 610, 'center', 'center', false, true, true); $(window).scroll(function () { if ( $("div#dialog-modal").css("display") != undefined ) { Ivy.moduleConfigDiv.dialog('option', 'position', 'center'); } else $(window).unbind('scroll'); }); $(document).bind("resize", function () { if ( $("div#dialog-modal").css("display") != undefined ) { Ivy.moduleConfigDiv.dialog('option', 'position', 'center'); } else $(document).unbind('resize'); }); }, cclPopup: null, cclCommentView: function( ccl ) { lang = ""; if ( arguments.length >= 2 ) lang = arguments[1]; cclPopup = Ivy.divpoopup('page', '/_Lib/modulesext/XNMCcl.php?what='+ccl+'&lang='+lang, ''+ccl+'', 300, 150, 'center', 'center', false, true, true); cclPopup.bind("dialogclose",function(){ if ( $("a.cclfocusbta").attr("class") != undefined ) $("a.cclfocusbta").focus(); else $(".etc_ccl a").focus(); }); }, lightview: function ( url, alt, ty ) { if ( arguments[3] != undefined ) { ma = arguments[3].split("x"); wid = ma[0]; hei = ma[1]; } else { wid = "auto"; hei = "auto"; } Lightview.show({url:'/_Lib/modulesext/XNMDirectView.php?path='+url, caption:alt, title:$(document).attr('title'),type:ty, options:{width:wid, height:hei}}); }, /** * SNS 퍼가기 * @param what * - tw : 트위터 * - m2 : 미투데이 * - fb : 페이스북 * - yz : 요즘 * - kt : 카카오톡 * - ks : 카카오스토리 * - bd : 네이버 밴드 * - gp : Google Plus */ snsPost: function( what ){ popupWidth = 600; popupHeight = 400; fullWidth = screen.availWidth; fullHeight = screen.availHeight; if ( ( what != "kt" && what != "ks" && what != "bd" ) || ( IvySmartBrowser == "false" && what == "bd" ) ) { if ( what == "m2" ) { popupWidth = fullWidth; popupHeight = fullHeight; } snspop = Ivy.centerpopup("/_blank.html", 'SNS', popupWidth, popupHeight); } try { mtitle = encodeURI($("meta[name=subject]").attr("content")); } catch(e) { mtitle = encodeURI(document.title); } try { mentitle = $("meta[name=subject]").attr("content"); } catch(e) { mtitle = document.title; } try { surl = $("link[rel=shortlink]").attr("href"); } catch(e) { surl = document.location.href; } try { msummary = encodeURI($("meta[name=description]").attr("content")); } catch(e) { msummary = ""; } try { mimage = encodeURI($("link[rel=image_src]").attr("href")); } catch(e) { mimage = ""; } try { menimage = $("link[rel=image_src]").attr("href"); } catch(e) { menimage = ""; } try { mendesc = $("meta[name=description]").attr("content"); } catch(e) { mendesc = ""; } try { mtag = encodeURI($("meta[name=keywords]").attr("content")); } catch(e) { mtag = mtitle; } if ( what == "m2" ) url = "http://me2day.net/plugins/post/new?new_post[body]="+surl+" : "+mtitle+" : "+msummary+"&new_post[tags]="+mtag+"&new_post[attachment]="+mimage; else if ( what == "yz" ) url = "https://yozm.daum.net/api/popup/prePost?prefix="+mtitle+" : "+msummary+"&link="+surl; else if ( what == "tw" ) { sendTxt = Ivy.cutString("["+IvySiteName+"] "+mentitle+" : "+mendesc, 100, true); sendTxt = encodeURI(sendTxt); url = "http://twitter.com/intent/tweet/?url="+surl+"&text="+sendTxt+"&original_referer="+encodeURIComponent(document.location); } else if ( what == "fb" ) { if ( IvySmartBrowser != "true" ) url = "https://www.facebook.com/sharer.php?s=100&p[url]="+surl+"&p[title]="+mtitle+"&p[summary]="+msummary; else url = "https://m.facebook.com/sharer.php?u="+surl; if ( mimage != "" && mimage != undefined && mimage != "undefined") url += "&p[images][0]="+mimage; } else if ( what == "gp" ) { url = "https://plus.google.com/share?url="+surl; } else if ( what == "kt" || what == "ks" ) { if ( IvySmartBrowser != "true" ) { alert("모바일 기기에서만 지원이 가능합니다."); return false; } if ( what == "kt" ) { socialapppost.link("talk").send({ msg : mentitle, url : surl, appid : "IvyCMS2", appver : "2.0", appname : IvySiteName, type : "link" }); } else if ( what == "ks" ) { if ( menimage != "" && menimage != undefined ) { socialapppost.link("story").send({ post : surl, appid : "IvyCMS2", appver : "1.0", appname : IvySiteName, urlinfo : JSON.stringify({title : '"'+mentitle+'"', desc : '"'+mendesc+'"', imageurl:[menimage], type:"article"}) }); } else { socialapppost.link("story").send({ post : surl, appid : "IvyCMS2", appver : "1.0", appname : IvySiteName, urlinfo : JSON.stringify({title : '"'+mentitle+'"', desc : '"'+mendesc+'"', type:"article"}) }); } } } else if ( what == "bd" ) { if ( IvySmartBrowser != "true" ) { url = "http://www.band.us/plugin/share?body=%5B"+mtitle+"%5D "+msummary+"%0A"+surl; } else { socialapppost.link("band").send({ text : "["+IvySiteName+"]\n"+mentitle+"\n"+mendesc+"...\n"+surl }); } } if ( ( what != "kt" && what != "ks" && what != "bd" ) || ( IvySmartBrowser == "false" && what == "bd" ) ) snspop.location.href = url; pdata = "IvyMenuCode="+contentMenuCode+"&IvyTableName="+contentTableName+"&IvyContentCode="+contentIdx+"&what="+what+"&callback=?"; Ivy.ajaxSubmit(pdata, "/_Lib/modulesext/XNMSnsPost.php", "", "html", "", ""); try { $(".snsPost_"+what).html( parseInt($(".snsPost_"+what).html(), 10)+1 ); } catch(e) {} }, /** * 배열에 해당하는 원소가 있는지 판별 * @param needle : 요소 * @param haystack : 배열 * @param argStrict * @return true/false */ in_array: function (needle, haystack, argStrict) { var key = '', strict = !! argStrict; if (strict) { for (key in haystack) { if (haystack[key] === needle) { return true; } } } else { for (key in haystack) { if (haystack[key] == needle) { return true; } } } return false; }, mobileView: function( obj ) { var ddomain = (document.URL.replace(/http(s)?:\/\//ig,"").split("/"))[0]; var url = (($(obj).attr("href")).replace("index\.php","")).replace(/(\/)+/gi,"/"); var nowBrMode = Ivy.getCookie("IvyMobile"); if ( nowBrMode === false || nowBrMode == "" || nowBrMode != "m" || nowBrMode == undefined ) { Ivy.setCookie("IvyMobile", "m", 0, "/", ddomain); } else { Ivy.setCookie("IvyMobile", "pc", 0, "/", ddomain); } location.replace(url); }, siteOpenUrl: function( objid ) { var oidval = $("#"+objid).val(); if ( oidval != "japan" ) Ivy.openWindow(oidval); else { CSLI_SVC_WEB(location.host, 'kj', 's', 'new'); } return false; }, japansiteOpenUrl: function() { CSLI_SVC_WEB(location.host, 'kj', 's', 'new'); return false; }, chargerChange: function ( obj ) { Ivy.mask_start("부서원 목록을 불러오는 중입니다."); try { var MoreMenuNameS = (($(obj).parents("tr").children("td.taL").html()).strip_tags().trim()).split(">"); var MoreMenuName = MoreMenuNameS[(MoreMenuNameS.length - 1)]; } catch(e) { var MoreMenuName = ""; } Ivy.divpoopup('page', $(obj).attr("href"), '[담당자 지정] '+MoreMenuName, 400, 600, 'center', 'center', false, true, true); }, chargerApply: function ( obj ) { if ( confirm("[ "+$(obj).text()+" ]님을 담당자로 지정하시겠습니까?") ) { var actionurl = $(obj).attr("href").split("?")[0]; var pdata = $(obj).attr("href").split("?")[1]+"&sti="+Math.random(); if ( !Ivy.ajaxSubmit(pdata, actionurl, "담당자 등록 처리중입니다.", "html", "", Ivy.chargerApplyComplete) ) { return false; } } return false; }, chargerApplyComplete: function( req ) { alert("성공적으로 지정되었습니다."); location.reload(); }, chargerSelect: function( what ) { var url = "./?mode=chargerSearch&what="+what; contentAccessoriesPopup = Ivy.divpoopup('page', url, '담당자 검색', 700, 600, 'center', 'center', false, true, true); }, contentRefreshDaysOverAlert: function() { var ahtml = "

콘텐츠 갱신주기가 만료된 콘텐츠가 존재합니다.

" +"

콘텐츠 갱신주기를 확인하여 갱신하여 주십시요.

"; Ivy.divpoopup('html', ahtml, '콘텐츠 갱신주기 만료 안내', 320, 120, 'center', 'center', false, true, true); }, webwritealert: function() { IvyWriteAlertCookie = Ivy.getCookie("IvyWriteAlert"); if ( IvyWriteAlertCookie === false || IvyWriteAlertCookie == "" || IvyWriteAlertCookie != "OK" || IvyWriteAlertCookie == undefined ) { try { if ( IvySmartBrowser != "true" ) wid = 600; else wid = "95%"; } catch(e) { wid = 600; } contentAccessoriesPopup = Ivy.divpoopup('html', $("#IVYWEBERITEALERT").html(), '접근성 준수', wid, 440, 'center', 'center', false, true, true); } }, webwritealertclose: function() { var ddomain = (document.URL.replace(/http(s)?:\/\//ig,"").split("/"))[0]; var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + 1 ); Ivy.setCookie("IvyWriteAlert", "OK", todayDate, "/", ddomain); contentAccessoriesPopup.dialog("close"); }, sprintf : function() { var regex = /%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g; var a = arguments, i = 0, format = a[i++]; var pad = function (str, len, chr, leftJustify) { if (!chr) { chr = ' '; } var padding = (str.length >= len) ? '' : Array(1 + len - str.length >>> 0).join(chr); return leftJustify ? str + padding : padding + str; }; var justify = function (value, prefix, leftJustify, minWidth, zeroPad, customPadChar) { var diff = minWidth - value.length; if (diff > 0) { if (leftJustify || !zeroPad) { value = pad(value, minWidth, customPadChar, leftJustify); } else { value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length); } } return value; }; var formatBaseX = function (value, base, prefix, leftJustify, minWidth, precision, zeroPad) { var number = value >>> 0; prefix = prefix && number && { '2': '0b', '8': '0', '16': '0x' }[base] || ''; value = prefix + pad(number.toString(base), precision || 0, '0', false); return justify(value, prefix, leftJustify, minWidth, zeroPad); }; var formatString = function (value, leftJustify, minWidth, precision, zeroPad, customPadChar) { if (precision != null) { value = value.slice(0, precision); } return justify(value, '', leftJustify, minWidth, zeroPad, customPadChar); }; var doFormat = function (substring, valueIndex, flags, minWidth, _, precision, type) { var number; var prefix; var method; var textTransform; var value; if (substring == '%%') { return '%'; } var leftJustify = false, positivePrefix = '', zeroPad = false, prefixBaseX = false, customPadChar = ' '; var flagsl = flags.length; for (var j = 0; flags && j < flagsl; j++) { switch (flags.charAt(j)) { case ' ': positivePrefix = ' '; break; case '+': positivePrefix = '+'; break; case '-': leftJustify = true; break; case "'": customPadChar = flags.charAt(j + 1); break; case '0': zeroPad = true; break; case '#': prefixBaseX = true; break; } } if (!minWidth) { minWidth = 0; } else if (minWidth == '*') { minWidth = +a[i++]; } else if (minWidth.charAt(0) == '*') { minWidth = +a[minWidth.slice(1, -1)]; } else { minWidth = +minWidth; } if (minWidth < 0) { minWidth = -minWidth; leftJustify = true; } if (!isFinite(minWidth)) { throw new Error('sprintf: (minimum-)width must be finite'); } if (!precision) { precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type == 'd') ? 0 : undefined; } else if (precision == '*') { precision = +a[i++]; } else if (precision.charAt(0) == '*') { precision = +a[precision.slice(1, -1)]; } else { precision = +precision; } value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++]; switch (type) { case 's': return formatString(String(value), leftJustify, minWidth, precision, zeroPad, customPadChar); case 'c': return formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, zeroPad); case 'b': return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, precision, zeroPad); case 'o': return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, precision, zeroPad); case 'x': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad); case 'X': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad).toUpperCase(); case 'u': return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, precision, zeroPad); case 'i': case 'd': number = +value || 0; number = Math.round(number - number % 1); prefix = number < 0 ? '-' : positivePrefix; value = prefix + pad(String(Math.abs(number)), precision, '0', false); return justify(value, prefix, leftJustify, minWidth, zeroPad); case 'e': case 'E': case 'f': case 'F': case 'g': case 'G': number = +value; prefix = number < 0 ? '-' : positivePrefix; method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(type.toLowerCase())]; textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(type) % 2]; value = prefix + Math.abs(number)[method](precision); return justify(value, prefix, leftJustify, minWidth, zeroPad)[textTransform](); default: return substring; } }; return format.replace(regex, doFormat); }, sec2time: function (sec) { var sep = ( arguments.length >= 2 ) ? arguments[1] : ":"; if ( sec < 60 ) { return "00:"+Ivy.sprintf("%02d",sec); } else { rval = ""; rh = Math.floor( sec / 3600 ); rm = Math.floor( ( sec / 60 ) % 60 ); rs = sec % 60; if ( rh > 0 ) rval += Ivy.sprintf("%02d",rh)+sep; rval += Ivy.sprintf("%02d",rm)+sep; rval += Ivy.sprintf("%02d",rs); return rval; } }, autoComma: function( innum ) { var num = new String( innum ); num = num.trim(); if ( num == "" ) return ""; var regex = /[^0-9]/g; num = num.replace(regex, ''); var pattern = /(-?[0-9]+)([0-9]{3})/; while(pattern.test(num)) { num = num.replace(pattern,"$1,$2"); } if ( arguments.length >= 2 ) { $(arguments[1]).val(num); if ( arguments.length >= 3 ) { var danwee = ( arguments.length >= 4 ) ? arguments[3] : ""; $(arguments[2]).html( "( "+Ivy.num2han( num )+danwee+" )" ); } } else return num; }, stripComma: function (num) { return (num.replace(/\,/g,"")); }, num2han: function(num){ var regex = /[^0-9]/g; num = num.replace(regex, ''); var i, j=0, k=0; var han1 = new Array("","일","이","삼","사","오","육","칠","팔","구"); var han2 = new Array("","만","억","조","경","해","시","양","구","간"); var han3 = new Array("","십","백","천"); var result="", hangul = num + "", pm = ""; var str = new Array(), str2=""; var strTmp = new Array(); if(parseInt(num)==0) return "영"; if(hangul.substring(0,1) == "-"){ pm = "마이너스 "; hangul = hangul.substring(1, hangul.length); } if(hangul.length > han2.length*4) return "too much number"; for(i=hangul.length; i > 0; i=i-4){ str[j] = hangul.substring(i-4,i); for(k=str[j].length;k>0;k--){ strTmp[k] = (str[j].substring(k-1,k))?str[j].substring(k-1,k):""; strTmp[k] = han1[parseInt(strTmp[k])]; if(strTmp[k]) strTmp[k] += han3[str[j].length-k]; str2 = strTmp[k] + str2; } str[j] = str2; if(str[j]) result = str[j]+han2[j]+result; //result = (str[j])? " "+str[j]+han2[j]+result : " " + result; j++; str2 = ""; } return result; }, /** * Style 동적 로드 * @param url css 파일 주소 */ cssload: function( url ) { if ( url == "" ) return false; var icharset = "UTF-8"; var imedia = "screen"; if ( arguments.length >= 2 ) icharset = arguments[1]; if ( arguments.length >= 3 ) imedia = arguments[2]; $("",{"href":url, "rel":"stylesheet", "type":"text/css", "charset":icharset, "media":imedia}).appendTo( $("head") ); }, /** * NetMedia WebMail ( 신규메일수 조회 반영 ) * @param url 조회할 URL 및 인자 ( http://mail.phnet.kr/sso_newmail.php?domain=&user=&sso_key= ) */ netMediaMailCount: function ( url ) { $(window).load(function(){ Ivy.netMediaMailCountExecute(url); window.setInterval(function(){ Ivy.netMediaMailCountExecute(url); }, 120000); }); }, netMediaMailCountExecute: function( url ) { $.getJSON(url+"&callback=?", function(data) { ncnt = parseInt(data.cnt, 10); $("#netmediawebmail").html("("+ncnt+")"); if ( ncnt > 0 ) $("#netmediawebmail").addClass("oranges"); else $("#netmediawebmail").removeClass("oranges"); var IvyNetmediaWebmailPrevCnt = Ivy.getCookie("IvyNetmediaWebmailCnt"); if ( IvyNetmediaWebmailPrevCnt === false || IvyNetmediaWebmailPrevCnt == "" || IvyNetmediaWebmailPrevCnt == undefined ) IvyNetmediaWebmailPrevCnt = 0; else IvyNetmediaWebmailPrevCnt = parseInt(IvyNetmediaWebmailPrevCnt, 10); if ( IvyNetmediaWebmailPrevCnt < ncnt ) Ivy.divpopupslide("새로운 메일이 있습니다.", 20); var ddomain = (document.URL.replace(/http(s)?:\/\//ig,"").split("/"))[0]; Ivy.setCookie("IvyNetmediaWebmailCnt", ncnt, 0, "/", ddomain); } ); }, /** * 게시물 이동 RemoteControler */ articleMover: function(){ var widthRe = 50; var heightRe = 5; var ddomain = (document.URL.replace(/http(s)?:\/\//ig,"").split("/"))[0]; var nowAMMode = Ivy.getCookie("IvyArticleMoverSet"); if ( nowAMMode === false || nowAMMode == "" || nowAMMode != "small" || nowAMMode == undefined ) nowAMMode = "big"; if ( !$("html").hasClass("ie6") && !$("html").hasClass("ie7") && !$("html").hasClass("ie8") ) { pobject = $("div.bbslist ul"); whichIn = $(".contWrap"); if ( whichIn.attr("class") != undefined ) { articleMoverDiv = $("
",{"id":"articleMoverDiv"}).appendTo( whichIn ); artMain = $("
",{"class":"articleMover"}).appendTo( articleMoverDiv ); if ( $("div.bbslist").attr("class") != undefined ){ if ( pobject.children().length > 0 ) { cpos = pobject.children("li.current"); cpprev = cpos.prev().children("a").attr("href"); cpnext = cpos.next().children("a").attr("href"); if ( cpprev === undefined ) { $("",{"href":"","class":"prev no_active item", "title":"이전 게시물 없음"}).appendTo( artMain ).bind("click",function(){ return false; }).html("<"); } else { cpprevText = cpos.prev().children("a").text().strip_tags().replace(/["']/gi,""); $("",{"href":cpprev,"class":"prev item","title":"이전 ["+cpprevText+"]"}).appendTo( artMain ).html("<"); } if ( cpnext === undefined ) { $("",{"href":"","class":"next no_active item", "title":"다음 게시물 없음"}).appendTo( artMain ).bind("click",function(){ return false; }).html(">"); } else { cpnextText = cpos.next().children("a").text().strip_tags().replace(/["']/gi,""); $("",{"href":cpnext,"class":"next item","title":"다음 ["+cpnextText+"]"}).appendTo( artMain ).html(">"); } } } else { $("",{"href":"","class":"prev no_active item no_s", "title":""}).appendTo( artMain ).bind("click",function(){ return false; }).html("<"); $("",{"href":"","class":"next no_active item no_s", "title":""}).appendTo( artMain ).bind("click",function(){ return false; }).html(">"); } $("",{"href":"","class":"close","title":"최소화"}).appendTo( artMain ).html("X").bind("click",function(){ if ( artMain.children("a.item").css("display") != "none" ) { mwidth = parseInt(artMain.width(), 10) - widthRe; artMainLeft = parseInt(artMain.position().left, 10); mleft = artMainLeft - widthRe; artMain.css({"left":artMainLeft+"px"}); artMain.children("a.item").fadeOut("fast",function(){ artMain.animate({"height":"34px","left":mleft+"px","width":mwidth+"px"}); }); setTimeout(function(){ $(".topgo").animate({"width":"-="+widthRe,"height":"-="+heightRe,"font-size":"0.78em"}); Ivy.setCookie("IvyArticleMoverSet", "small", 0, "/", ddomain); }, 200); $(this).html("O").attr("title","최대화"); } else { mwidth = parseInt(artMain.width(), 10) + widthRe; mleft = parseInt(artMain.position().left, 10) + widthRe; artMain.animate({"height":"120px","left":mleft+"px","width":mwidth+"px"},function(){ artMain.children("a.item").fadeIn("fast"); }); setTimeout(function(){ $(".topgo").animate({"width":"+="+widthRe,"height":"+="+heightRe,"font-size":"1.0em"}); Ivy.setCookie("IvyArticleMoverSet", "big", 0, "/", ddomain); }, 200); $(this).html("X").attr("title","최소화"); } return false; }); topgo = $("",{"href":"#IvyWrap","class":"topgo"}).appendTo( artMain ).html("TOP"); topb = $("",{"href":"","class":"top item","title":"위로"}).appendTo( artMain ).html("▲").bind("click",function(){ $("body, html").animate({"scrollTop":"-=80px"},"fast"); return false; }); bottomb = $("",{"href":"","class":"bottom item","title":"아래로"}).appendTo( artMain ).html("▼").bind("click",function(){ $("body, html").animate({"scrollTop":"+=80px"},"fast"); return false; }); topbw = topb.width(); topb.css("margin-left","-"+topbw+"px"); bottomb.css("margin-left","-"+topbw+"px"); Ivy.articleMoverPosition(whichIn, articleMoverDiv); $(window).resize(function() { Ivy.articleMoverPosition(whichIn, articleMoverDiv); }); if ( nowAMMode == "small" ) $("div.articleMover").children("a.close").trigger("click"); } } }, articleMoverPosition: function(whichIn, articleMoverDiv) { artMain = articleMoverDiv.children(".articleMover"); mwidth = whichIn.outerWidth() + artMain.width() + 20; //console.log(whichIn.outerWidth()) mleft = parseInt(whichIn.position().left, 10); articleMoverDiv.css({"width":mwidth+"px","left":mleft+"px"}); } } /* 지역정보 */ var regionArea = function( obj, lat, lng ) { this.obj = obj; this.lat = lat; this.lng = lng; this.baseUrl = "/_Lib/modulesext/XNMRegionAreaList.php"; $(window).load(this.initial()); } regionArea.prototype = { initial: function() { var _this = this; _this.baseUrl += "?lat="+_this.lat+"&lng="+_this.lng; _this.obj.load(_this.baseUrl, function(responseTxt,statusTxt,xhr){ responseTxt = responseTxt.trim(); if ( responseTxt.substring(0,14) == "Database Error" || responseTxt.substring(0,5) == "ERROR" || responseTxt == "" ) { $(_this.obj).remove(); } }, { beforeSend: function() { if ( $(this.obj).attr("id") != undefined ) Ivy.mask_start_obj( $(this.obj).attr("id"), "주변 지역정보 호출중..."); } }); }, pageloading: function( which, item, page ) { var _this = this; $(which).load(_this.baseUrl+"&item="+item+"&page="+page, { beforeSend: function() { $(which).html("
  • 주변 지역정보 호출중...
  • "); Ivy.divpopupalert("주변 지역정보 호출중..."); } }); }, infoView: function( obj ) { if ( $(obj).children("span.moreinfo").css("display") == "none" ) $(obj).children("span.moreinfo").show(); else $(obj).children("span.moreinfo").hide(); }, openDivMiniMap: function(lat, lng, tit, obj){ tits = $(obj).parents("li.tour_list").attr("title"); tits = Ivy.cutString( tits, 400, true); homepageurl = $(obj).attr("href"); if ( homepageurl == undefined || homepageurl == "" ) homepageurl = ""; var datas = 'inmap=ok&mapMode=Minimap&applybt=false&gdefaultPoint='+lng+'/'+lat+'&zoom=16&scrollwheel=true&markertitle='+encodeURIComponent(tit)+'&markercontent='+encodeURIComponent(tits)+'&homepageurl='+encodeURIComponent(homepageurl); Lightview.show({url:'/Ivyservice/gmap/?'+datas, caption:tits, title:tit, options:{width:800, height:600}}); } } /* 통합검색 */ var searchManager = function() { this.obj = $("#tskeyword"); this.pushKeywordsSel = 0; this.pushKeywordsTotal = 0; this.searchProcess = "/_Lib/modules/_tag/process.php"; this.defaultSearchKey = ""; if ( $("#tskeyword").attr("id") != undefined ) this.initial(); } searchManager.prototype = { initial: function() { var _this = this; _this.obj.attr("autocomplete","off"); //if ( _this.obj.val() == "" ) _this.obj.css("background-image","url(/Ivyimages/searchTxt.png)"); else _this.obj.css("background-image","none"); _this.obj.keydown(function( event ) { if ( event.keyCode == "13" || event.keyCode == "188" ) { if ( _this.pushKeywordsSel > 0 ) { $(this).val( $("#searchDiv ul.item li:nth-child("+_this.pushKeywordsSel+")").text() ); } _this.pushKeywordsDivClear(); } }) .focus(function( event ) { _this.obj.css("background-image","none"); }) .blur(function( event ){ //if ( _this.obj.val() == "" ) _this.obj.css("background-image","url(/Ivyimages/searchTxt.png)"); else _this.obj.css("background-image","none"); _this.pushKeywordsDivClear(); }) .keyup(function( event ){ keyC = parseInt(event.keyCode, 10); if ( event.keyCode != "13" && event.keyCode != "188" && ( keyC < 37 || keyC > 40 ) ) { $("#searchDiv").css({"visibility":"visible"}); posy = parseInt($(this).offset().top, 10) + parseInt($(this).outerHeight(), 10); posx = parseInt($(this).offset().left, 10); wid = $("#tskeyword").outerWidth() - 4; $("#searchDiv").css({"top":posy+"px","left":posx+"px","z-index":99,"width":wid+"px"}); _this.pushKeyword( $(this).val() ); } else if ( keyC >= 37 && keyC <= 40 ) { if ( keyC == 37 || keyC == 38 ) act = "UP"; else act = "DOWN"; _this.pushKeywordsSelMove( act ); } }); ptd = $("
    ",{"id":"searchDiv"}).addClass("pushtagDiv").addClass("pushkeywordDiv").appendTo( document.body ); $("

    ").addClass("title").html("추천 키워드").appendTo(ptd); $("