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 = $("