rhymix/common/js/xe.min.js

73 lines
28 KiB
JavaScript

/**
* @file common/js/xe.min.js
* @author NHN (developers@xpressengine.com)
* @brief XE Common JavaScript
**/
(function(a){function b(){return function(){var e=this;if(a.isArray(this._plugins))this._plugins=[];this._messages?this._messages={}:this._binded_fn={};a.each(this,function(c,b){if(!a.isFunction(b))return!0;if(!/^API_([A-Z0-9_]+)$/.test(c))return!0;var d=RegExp.$1,f=function(a,b){return e[c](a,b)};e._messages?e._messages[d]=[f]:e._binded_fn[d]=f});a.isFunction(this.init)&&this.init.apply(this,arguments)}}var d,c,f=[];d={_plugins:[],_messages:{},getPlugin:function(e){e=e.toLowerCase();return a.isArray(this._plugins[e])?
this._plugins[e]:[]},registerPlugin:function(e){var c=this,b=e.getName().toLowerCase();if(a.inArray(e,this._plugins)>=0)return!1;this._plugins.push(e);a.isArray(this._plugins[b])||(this._plugins[b]=[]);this._plugins[b].push(e);a.each(e._binded_fn,function(a,e){c.registerHandler(a,e)});e.oApp=this;a.isFunction(e.activate)&&e.activate();return!0},registerHandler:function(e,c){var b=this._messages,e=e.toUpperCase();a.isArray(b[e])||(b[e]=[]);b[e].push(c)},cast:function(a,c){return this._cast(this,a,
c||[])},broadcast:function(a,c,b){this.parent&&this.parent._broadcast&&this.parent._broadcast(a,c,b)},_cast:function(c,b,d){var f,l=this._messages,b=b.toUpperCase();if(!l["BEFORE_"+b]&&!this["API_BEFORE_"+b]||this._cast(c,"BEFORE_"+b,d)){var g=[];if(a.isArray(l[b]))for(f=0;f<l[b].length;f++)g.push(l[b][f](c,d));g.length<2&&(g=g[0]);(l["AFTER_"+b]||this["API_AFTER_"+b])&&this._cast(c,"AFTER_"+b,d);return/^(?:AFTER|BEFORE)_/.test(b)?a.isArray(g)?a.inArray(!1,g)<0:typeof g=="undefined"?!0:!!g:g}}};c=
{oApp:null,cast:function(a,c){if(this.oApp&&this.oApp._cast)return this.oApp._cast(this,a,c||[])},broadcast:function(a,c){this.oApp&&this.oApp.broadcast&&this.oApp.broadcast(this,mag,c||[])}};window.xe=a.extend(d,{getName:function(){return"Core"},createApp:function(c,f){var h=b();a.extend(h.prototype,d,f);h.prototype.getName=function(){return c};return h},createPlugin:function(e,d){var f=b();a.extend(f.prototype,c,d);f.prototype.getName=function(){return e};return f},getApps:function(){return a.makeArray(f)},
getApp:function(a){a=(a||"").toLowerCase();return typeof f[a]!="undefined"?f[a]:null},registerApp:function(c){var b=c.getName().toLowerCase();f.push(c);a.isArray(f[b])||(f[b]=[]);f[b].push(c);c.parent=this;a.isFunction(c.activate)&&c.activate()},unregisterApp:function(c){var b=oPlugin.getName().toLowerCase(),d=a.inArray(c,f);d>=0&&f.splice(d,1);a.isArray(f[b])&&(d=a.inArray(c,f[b]),d>=0&&f[b].splice(d,1));a.isFunction(c.deactivate)&&c.deactivate()},broadcast:function(a,c){this._broadcast(this,a,c)},
_broadcast:function(a,c,b){for(var d=0;d<f.length;d++)f[d]._cast(a,c,b);this._cast(a,c,b)}});window.xe.lang={};a(function(){xe.broadcast("ONREADY")});a(window).load(function(){xe.broadcast("ONLOAD")})})(jQuery);jQuery&&jQuery.noConflict();
(function(a){var b=navigator.userAgent.toLowerCase();a.os={Linux:/linux/.test(b),Unix:/x11/.test(b),Mac:/mac/.test(b),Windows:/win/.test(b)};a.os.name=a.os.Windows?"Windows":a.os.Linux?"Linux":a.os.Unix?"Unix":a.os.Mac?"Mac":"";window.XE={loaded_popup_menus:[],addedDocument:[],checkboxToggleAll:function(){var b="cart",c={wrap:null,checked:"toggle",doClick:!1};switch(arguments.length){case 1:typeof arguments[0]=="string"?b=arguments[0]:a.extend(c,arguments[0]||{});break;case 2:b=arguments[0],a.extend(c,
arguments[1]||{})}if(c.doClick==!0)c.checked=null;if(typeof c.wrap=="string")c.wrap="#"+c.wrap;b=c.wrap?a(c.wrap).find("input[name="+b+"]:checkbox"):a("input[name="+b+"]:checkbox");c.checked=="toggle"?b.each(function(){a(this).attr("checked",a(this).attr("checked")?!1:!0)}):c.doClick==!0?b.click():b.attr("checked",c.checked)},displayPopupMenu:function(b,c,f){var c=f.menu_id,e=b.menus,b="";if(this.loaded_popup_menus[c])b=this.loaded_popup_menus[c];else{if(e){e=e.item;if(typeof e.length=="undefined"||
e.length<1)e=Array(e);if(e.length)for(var j=0;j<e.length;j++){var h=e[j].url,k=e[j].str,l=e[j].icon,g=e[j].target,m="",o="";l&&(m=" style=\"background-image:url('"+l+"')\" ");switch(g){case "popup":o=" onclick=\"popopen(this.href,'"+g+"'); return false;\"";break;case "self":break;case "javascript":o=' onclick="'+h+'; return false; "';h="#";break;default:o=' onclick="window.open(this.href); return false;"'}b+="<li "+m+'><a href="'+h+'"'+o+">"+k+"</a></li> "}}this.loaded_popup_menus[c]=b}if(b){c=a("#popup_menu_area").html("<ul>"+
b+"</ul>");f={top:f.page_y,left:f.page_x};if(c.outerHeight()+f.top>a(window).height()+a(window).scrollTop())f.top=a(window).height()-c.outerHeight()+a(window).scrollTop();if(c.outerWidth()+f.left>a(window).width()+a(window).scrollLeft())f.left=a(window).width()-c.outerWidth()+a(window).scrollLeft();c.css({top:f.top,left:f.left}).show()}}}})(jQuery);
jQuery(function(a){a.browser.msie&&a("select").each(function(a,b){for(var e=!1,d=[],h=0;h<b.options.length;h++)b.options[h].disabled?(b.options[h].style.color="#CCCCCC",e=!0):d[a]=d[a]>-1?d[a]:h;if(e&&(b.oldonchange=b.onchange,b.onchange=function(){this.options[this.selectedIndex].disabled?this.selectedIndex=d[a]:this.oldonchange&&this.oldonchange()},b.selectedIndex>=0&&b.options[b.selectedIndex].disabled))b.onchange()});var b=a(".xe_content .fold_button");if(b.size()){var d=a("div.fold_container",
b);a("button.more",b).click(function(){a(this).hide().next("button").show().parent().next(d).show()});a("button.less",b).click(function(){a(this).hide().prev("button").show().parent().next(d).hide()})}});String.prototype.getQuery=function(a){var b=this.indexOf("?");if(b==-1)return null;var d={};this.substr(b+1,this.length).replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,e){d[b]=e});a=d[a];typeof a=="undefined"&&(a="");return a};
String.prototype.setQuery=function(a,b){var d=this.indexOf("?"),c=this.replace(/#$/,"");if(d!=-1){var f=c.substr(d+1,this.length),e={},j=[],c=this.substr(0,d);f.replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){e[b]=c});e[a]=b;jQuery.each(e,function(a,b){jQuery.trim(b)&&j.push(a+"="+decodeURI(b))});f=j.join("&");c+=f?"?"+f:""}else b.toString().trim()&&(c=c+"?"+a+"="+b);d=/https:\/\/([^:\/]+)(:\d+|)/i;if(f=d.exec(c))f="http://"+f[1],typeof http_port!="undefined"&&http_port!=80&&(f+=":"+http_port),c=
c.replace(d,f);d=!1;if(typeof enforce_ssl!="undefined"&&enforce_ssl)d=!0;else if(typeof ssl_actions!="undefined"&&typeof ssl_actions.length!="undefined"&&c.getQuery("act")){f=c.getQuery("act");for(i=0;i<ssl_actions.length;i++)if(ssl_actions[i]==f){d=!0;break}}if(d&&(d=/http:\/\/([^:\/]+)(:\d+|)/i,f=d.exec(c)))f="https://"+f[1],typeof https_port!="undefined"&&https_port!=443&&(f+=":"+https_port),c=c.replace(d,f);return encodeURI(c)};
String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};function xSleep(a){a/=1E3;for(var b=new Date,d=new Date;d.getTime()-b.getTime()<a;)d=new Date}function isDef(){for(var a=0;a<arguments.length;++a)if(typeof arguments[a]=="undefined")return!1;return!0}var winopen_list=[];
function winopen(a,b,d){typeof xeVid!="undefined"&&a.indexOf(request_uri)>-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid));try{b!="_blank"&&winopen_list[b]&&(winopen_list[b].close(),winopen_list[b]=null)}catch(c){}typeof b=="undefined"&&(b="_blank");typeof d=="undefined"&&(d="");a=window.open(a,b,d);a.focus();b!="_blank"&&(winopen_list[b]=a)}
function popopen(a,b){typeof b=="undefined"&&(b="_blank");typeof xeVid!="undefined"&&a.indexOf(request_uri)>-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid));winopen(a,b,"left=10,top=10,width=10,height=10,scrollbars=no,resizable=yes,toolbars=no")}function sendMailTo(a){location.href="mailto:"+a}function move_url(a,b){if(!a)return!1;typeof b=="undefined"&&(b="N");b=b=="N"?!1:!0;/^\./.test(a)&&(a=request_uri+a);b?winopen(a):location.href=a;return!1}
function displayMultimedia(a,b,d,c){(a=_displayMultimedia(a,b,d,c))&&document.writeln(a)}
function _displayMultimedia(a,b,d,c){a.indexOf("files")==0&&(a=request_uri+a);var c=jQuery.extend({wmode:"transparent",allowScriptAccess:"sameDomain",quality:"high",flashvars:"",autostart:!1},c||{}),f=c.autostart&&c.autostart!="false"?"true":"false";delete c.autostart;var e="",e=e="";if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(a))e='<img src="'+a+'" width="'+b+'" height="'+d+'" />';else if(/\.flv$/i.test(a)||/\.mov$/i.test(a)||/\.moov$/i.test(a)||/\.m4v$/i.test(a))e='<embed src="'+request_uri+'common/tpl/images/flvplayer.swf" allowfullscreen="true" autostart="'+
f+'" width="'+b+'" height="'+d+'" flashvars="&file='+a+"&width="+b+"&height="+d+"&autostart="+f+'" wmode="'+c.wmode+'" />';else if(/\.swf/i.test(a)){e='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+(typeof enforce_ssl!="undefined"&&enforce_ssl?"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0":"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0")+'" width="'+b+'" height="'+d+'" flashvars="'+c.flashvars+
'">';e+='<param name="movie" value="'+a+'" />';for(var j in c)c[j]!="undefined"&&c[j]!=""&&(e+='<param name="'+j+'" value="'+c[j]+'" />');e+='<embed src="'+a+'" autostart="'+f+'" width="'+b+'" height="'+d+'" flashvars="'+c.flashvars+'" wmode="'+c.wmode+'"></embed></object>'}else{if(jQuery.browser.mozilla||jQuery.browser.opera)f=c.autostart&&c.autostart!="false"?"1":"0";e='<embed src="'+a+'" autostart="'+f+'" width="'+b+'" height="'+d+'"';c.wmode=="transparent"&&(e+=' windowlessvideo="1"');e+="></embed>"}return e}
function zbxe_folder_open(a){jQuery("#folder_open_"+a).hide();jQuery("#folder_close_"+a).show();jQuery("#folder_"+a).show()}function zbxe_folder_close(a){jQuery("#folder_open_"+a).show();jQuery("#folder_close_"+a).hide();jQuery("#folder_"+a).hide()}
function setFixedPopupSize(){var a=jQuery;a("#popHeader");var b=a("#popBody");b.length&&b.height()>400&&b.css({overflow:"auto",overflowX:"hidden",height:"400px"});var d=a(window),b=a("#popup_content"),a=Math.max(b[0].offsetWidth,600),b=b[0].offsetHeight,c=d.width(),d=d.height(),f=0,e=0;a!=c&&(f=a-c);b!=d&&(e=b-d);(f||e)&&window.resizeBy(f,e);if(!arguments.callee.executed)setTimeout(setFixedPopupSize,300),arguments.callee.executed=!0}
function doCallModuleAction(a,b,d){var c=[];c.target_srl=d;c.cur_mid=current_mid;exec_xml(a,b,c,completeCallModuleAction)}function completeCallModuleAction(a){a.message!="success"&&alert(a.message);location.reload()}function completeMessage(a){alert(a.message);location.reload()}function doChangeLangType(a){typeof a=="string"?setLangType(a):setLangType(a.options[a.selectedIndex].value);location.href=location.href.setQuery("l","")}
function setLangType(a){var b=new Date;b.setTime(b.getTime()+6048E8);setCookie("lang_type",a,b,"/")}
function doDocumentPreview(a){for(;a.nodeName!="FORM";)a=a.parentNode;if(a.nodeName=="FORM"){a=a.getAttribute("editor_sequence");a=editorGetContent(a);window.open("","previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes");var b=jQuery("#previewDocument");b.length||(jQuery('<form id="previewDocument" target="previewDocument" method="post" action="'+request_uri+'"><input type="hidden" name="module" value="document" /><input type="hidden" name="act" value="dispDocumentPreview" /><input type="hidden" name="content" /></form>').appendTo(document.body),b=
jQuery("#previewDocument")[0]);if(b)b.content.value=a,b.submit()}}
function doDocumentSave(a){var b=a.form.getAttribute("editor_sequence"),d=editorRelKeys[b].content.value;if(typeof b!="undefined"&&b&&typeof editorRelKeys!="undefined"&&typeof editorGetContent=="function"){var c=editorGetContent(b);editorRelKeys[b].content.value=c}var f={},c=jQuery(a.form).serializeArray();jQuery.each(c,function(a,b){var c=jQuery.trim(b.value);if(!c)return!0;if(/\[\]$/.test(b.name))b.name=b.name.replace(/\[\]$/,"");f[b.name]?f[b.name]+="|@|"+c:f[b.name]=b.value});exec_xml("document",
"procDocumentTempSave",f,completeDocumentSave,["error","message","document_srl"],f,a.form);editorRelKeys[b].content.value=d;return!1}function completeDocumentSave(a){jQuery("input[name=document_srl]").eq(0).val(a.document_srl);alert(a.message)}var objForSavedDoc=null;function doDocumentLoad(a){objForSavedDoc=a.form;popopen(request_uri.setQuery("module","document").setQuery("act","dispTempSavedList"))}
function doDocumentSelect(a){if(opener&&opener.objForSavedDoc)opener.location.href=opener.current_url.setQuery("document_srl",a).setQuery("act","dispBoardWrite");window.close()}function viewSkinInfo(a,b){popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+a+"&skin="+b,"SkinInfo")}var addedDocument=[];function doAddDocumentCart(a){addedDocument[addedDocument.length]=a.value;setTimeout(function(){callAddDocumentCart(addedDocument.length)},100)}
function callAddDocumentCart(a){if(!(addedDocument.length<1||a!=addedDocument.length))a=[],a.srls=addedDocument.join(","),exec_xml("document","procDocumentAddCart",a,null),addedDocument=[]}
function transRGB2Hex(a){if(!a)return a;if(a.indexOf("#")>-1)return a.replace(/^#/,"");if(a.toLowerCase().indexOf("rgb")<0)return a;a=a.replace(/^rgb\(/i,"").replace(/\)$/,"");value_list=a.split(",");for(var a="",b=0;b<value_list.length;b++){var d=parseInt(value_list[b],10).toString(16);d.length==1&&(d="0"+d);a+=d}return a}function toggleSecuritySignIn(){var a=location.href;location.href=/https:\/\//i.test(a)?a.replace(/^https/i,"http"):a.replace(/^http/i,"https")}
function reloadDocument(){location.reload()}
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){for(var b="",d,c,f,e,j,h,k=0,a=Base64._utf8_encode(a);k<a.length;)d=a.charCodeAt(k++),c=a.charCodeAt(k++),f=a.charCodeAt(k++),e=d>>2,d=(d&3)<<4|c>>4,j=(c&15)<<2|f>>6,h=f&63,isNaN(c)?j=h=64:isNaN(f)&&(h=64),b=b+this._keyStr.charAt(e)+this._keyStr.charAt(d)+this._keyStr.charAt(j)+this._keyStr.charAt(h);return b},decode:function(a){for(var b="",d,c,f,e,j,h=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<
a.length;)d=this._keyStr.indexOf(a.charAt(h++)),c=this._keyStr.indexOf(a.charAt(h++)),e=this._keyStr.indexOf(a.charAt(h++)),j=this._keyStr.indexOf(a.charAt(h++)),d=d<<2|c>>4,c=(c&15)<<4|e>>2,f=(e&3)<<6|j,b+=String.fromCharCode(d),e!=64&&(b+=String.fromCharCode(c)),j!=64&&(b+=String.fromCharCode(f));return b=Base64._utf8_decode(b)},_utf8_encode:function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",d=0;d<a.length;d++){var c=a.charCodeAt(d);c<128?b+=String.fromCharCode(c):(c>127&&c<2048?b+=String.fromCharCode(c>>
6|192):(b+=String.fromCharCode(c>>12|224),b+=String.fromCharCode(c>>6&63|128)),b+=String.fromCharCode(c&63|128))}return b},_utf8_decode:function(a){for(var b="",d=0,c=c1=c2=0;d<a.length;)c=a.charCodeAt(d),c<128?(b+=String.fromCharCode(c),d++):c>191&&c<224?(c2=a.charCodeAt(d+1),b+=String.fromCharCode((c&31)<<6|c2&63),d+=2):(c2=a.charCodeAt(d+1),c3=a.charCodeAt(d+2),b+=String.fromCharCode((c&15)<<12|(c2&63)<<6|c3&63),d+=3);return b}};
if(typeof resizeImageContents=="undefined")var resizeImageContents=function(){};if(typeof activateOptionDisabled=="undefined")var activateOptionDisabled=function(){};objectExtend=jQuery.extend;function toggleDisplay(a){jQuery("#"+a).toggle()}function checkboxSelectAll(a,b,d){var c={};if(typeof a!="undefined")c.wrap=a;if(typeof d!="undefined")c.checked=d;XE.checkboxToggleAll(b,c)}function clickCheckBoxAll(a,b){var d={doClick:!0};if(typeof a!="undefined")d.wrap=a;XE.checkboxToggleAll(b,d)}
function svc_folder_open(a){jQuery("#_folder_open_"+a).hide();jQuery("#_folder_close_"+a).show();jQuery("#_folder_"+a).show()}function svc_folder_close(a){jQuery("#_folder_open_"+a).show();jQuery("#_folder_close_"+a).hide();jQuery("#_folder_"+a).hide()}function open_calendar(a,b,d){typeof b=="undefined"&&(b="");var c="./common/tpl/calendar.php?";a&&(c+="fo_id="+a);b&&(c+="&day_str="+b);d&&(c+="&callback_func="+d);popopen(c,"Calendar")}var loaded_popup_menus=XE.loaded_popup_menus;
function createPopupMenu(){}function chkPopupMenu(){}function displayPopupMenu(a,b,d){XE.displayPopupMenu(a,b,d)}function GetObjLeft(a){return jQuery(a).offset().left}function GetObjTop(a){return jQuery(a).offset().top}function replaceOuterHTML(a,b){jQuery(a).replaceWith(b)}function getOuterHTML(a){return jQuery(a).html().trim()}function setCookie(a,b,d,c){a=a+"="+escape(b)+(!d?"":"; expires="+d.toGMTString())+"; path="+(!c?"/":c);document.cookie=a}
function is_def(a){return typeof a!="undefined"}function ucfirst(a){return a.charAt(0).toUpperCase()+a.slice(1)}
jQuery(function(a){a(".lang_code").each(function(){var b=a(this),d=b.attr("id");typeof d=="undefined"&&(d=b.attr("name"));typeof d!="undefined"&&b.after("<a href='"+request_uri.setQuery("module","module").setQuery("act","dispModuleAdminLangcode").setQuery("target",d)+"' class='buttonSet buttonSetting' onclick='popopen(this.href);return false;'><span>find_langcode</span></a>")});a(document).click(function(b){var d=a("#popup_menu_area");d.length||(d=a('<div id="popup_menu_area" style="display:none;z-index:9999" />').appendTo(document.body));
d.hide();d=a(b.target).filter("a,div,span");d.length||(d=d.parents("a,div,span").eq(0));if(d.length){var d=d.attr("class"),c;d&&(c=d.match(/(?:^| )((document|comment|member)_([1-9]\d*))(?: |$)/));if(c){d="get"+ucfirst(c[2])+"Menu";b={mid:current_mid,cur_mid:current_mid,menu_id:c[1],target_srl:c[3],cur_act:current_url.getQuery("act"),page_x:b.pageX,page_y:b.pageY};c="error message menus".split(" ");if(is_def(window.xeVid))b.vid=xeVid;if(is_def(XE.loaded_popup_menus[b.menu_id]))return XE.displayPopupMenu(b,
c,b)&&!1;show_waiting_message=!1;exec_xml("member",d,b,XE.displayPopupMenu,c,b);show_waiting_message=!0;return!1}}})});var show_waiting_message=!0;
function xml2json(a,b,d){var c={toObj:function(a){var b={};if(a.nodeType==1){if(d&&a.attributes.length)for(var f=0;f<a.attributes.length;f++)b["@"+a.attributes[f].nodeName]=(a.attributes[f].nodeValue||"").toString();if(a.firstChild){for(var k=f=0,l=!1,g=a.firstChild;g;g=g.nextSibling)g.nodeType==1?l=!0:g.nodeType==3&&g.nodeValue.match(/[^ \f\n\r\t\v]/)?f++:g.nodeType==4&&k++;if(l)if(f<2&&k<2){c.removeWhite(a);for(g=a.firstChild;g;g=g.nextSibling)g.nodeType==3?b=c.escape(g.nodeValue):g.nodeType==4?
b=c.escape(g.nodeValue):b[g.nodeName]?b[g.nodeName]instanceof Array?b[g.nodeName][b[g.nodeName].length]=c.toObj(g):b[g.nodeName]=[b[g.nodeName],c.toObj(g)]:b[g.nodeName]=c.toObj(g)}else a.attributes.length?b["#text"]=c.escape(c.innerXml(a)):b=c.escape(c.innerXml(a));else if(f)a.attributes.length?b["#text"]=c.escape(c.innerXml(a)):b=c.escape(c.innerXml(a));else if(k)if(k>1)b=c.escape(c.innerXml(a));else for(g=a.firstChild;g;g=g.nextSibling)b=c.escape(g.nodeValue)}!a.attributes.length&&!a.firstChild&&
(b=null)}else a.nodeType==9?b=c.toObj(a.documentElement):alert("unhandled node type: "+a.nodeType);return b},toJson:function(a,b,d){var f=b?'"'+b+'"':"";if(a instanceof Array){for(var l=0,g=a.length;l<g;l++)a[l]=c.toJson(a[l],"",d+"\t");f+=(b?":[":"[")+(a.length>1?"\n"+d+"\t"+a.join(",\n"+d+"\t")+"\n"+d:a.join(""))+"]"}else if(a==null)f+=(b&&":")+"null";else if(typeof a=="object"){l=[];for(g in a)l[l.length]=c.toJson(a[g],g,d+"\t");f+=(b?":{":"{")+(l.length>1?"\n"+d+"\t"+l.join(",\n"+d+"\t")+"\n"+
d:l.join(""))+"}"}else f+=typeof a=="string"?(b&&":")+'"'+a.toString()+'"':(b&&":")+a.toString();return f},innerXml:function(a){var b="";if("innerHTML"in a)b=a.innerHTML;else for(var c=function(a){var b="";if(a.nodeType==1){b+="<"+a.nodeName;for(var d=0;d<a.attributes.length;d++)b+=" "+a.attributes[d].nodeName+'="'+(a.attributes[d].nodeValue||"").toString()+'"';if(a.firstChild){b+=">";for(d=a.firstChild;d;d=d.nextSibling)b+=c(d);b+="</"+a.nodeName+">"}else b+="/>"}else a.nodeType==3?b+=a.nodeValue:
a.nodeType==4&&(b+="<![CDATA["+a.nodeValue+"]]\>");return b},a=a.firstChild;a;a=a.nextSibling)b+=c(a);return b},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();for(var b=a.firstChild;b;)if(b.nodeType==3)if(b.nodeValue.match(/[^ \f\n\r\t\v]/))b=b.nextSibling;else{var d=b.nextSibling;a.removeChild(b);b=d}else b.nodeType==1&&c.removeWhite(b),b=b.nextSibling;return a}};if(a.nodeType==9)a=a.documentElement;
var f=c.toObj(c.removeWhite(a));typeof JSON=="object"&&jQuery.isFunction(JSON.stringify);a=c.toJson(f,a.nodeName,"");return"{"+(b?a.replace(/\t/g,b):a.replace(/\t|\n/g,""))+"}"}
(function(a){function b(b,d){a("#xeTmpIframe").length||a('<iframe name="%id%" id="%id%" style="position:absolute;left:-1px;top:1px;width:1px;height:1px"></iframe>'.replace(/%id%/g,"xeTmpIframe")).appendTo(document.body);a("#xeVirtualForm").remove();var e=a('<form id="%id%"></form>'.replace(/%id%/g,"xeVirtualForm")).attr({id:"xeVirtualForm",method:"post",action:b,target:"xeTmpIframe"});d.xeVirtualRequestMethod="xml";d.xeRequestURI=location.href.replace(/#(.*)$/i,"");d.xeVirtualRequestUrl=request_uri;
a.each(d,function(b,c){a('<input type="hidden">').attr("name",b).attr("value",c).appendTo(e)});e.appendTo(document.body).submit()}function d(a){var b={},d;for(d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);return b}a.exec_xml=window.exec_xml=function(c,f,e,j,h,k,l){function g(b){var b=a(b).find("response")[0],d,e="",g=[],m={};d="";t.css("visibility","hidden");if(!b)return alert(s.responseText),null;d=xml2json(b,!1,!1);d=typeof JSON=="object"&&a.isFunction(JSON.parse)?JSON.parse(d):eval("("+d+")");d=d.response;
if(typeof d=="undefined"){g.error=-1;g.message="Unexpected error occured.";try{if(typeof(e=b.childNodes[0].firstChild.data)!="undefined")g.message+="\r\n"+e}catch(o){}return g}a.each(h,function(a,b){m[b]=!0});m.redirect_url=!0;m.act=!0;a.each(d,function(a,b){m[a]&&(g[a]=b)});if(g.error!=0){if(a.isFunction(a.exec_xml.onerror))return a.exec_xml.onerror(c,f,g,j,h,k,l);alert(g.message||"error!");return null}if(g.redirect_url)return location.href=g.redirect_url.replace(/&amp;/g,"&"),null;a.isFunction(j)&&
j(g,h,k,l)}var m=request_uri+"index.php";e||(e={});a.isArray(e)&&(e=d(e));e.module=c;e.act=f;typeof xeVid!="undefined"&&(e.vid=xeVid);typeof h=="undefined"||h.length<1?h=["error","message"]:h.push("error","message");if(a.isArray(ssl_actions)&&e.act&&a.inArray(e.act,ssl_actions)>=0){var m=window.https_port||443,o=a("<a>").attr("href",default_url||request_uri)[0],r="https://"+o.hostname.replace(/:\d+$/,"");m!=443&&(r+=":"+m);o.pathname[0]!="/"&&(r+="/");r+=o.pathname;m=r.replace(/\/$/,"")+"/index.php"}o=
a("<a>").attr("href",location.href)[0];r=a("<a>").attr("href",m)[0];if(o.protocol!=r.protocol||o.port!=r.port)return b(m,e);var n=[],p=0;n[p++]='<?xml version="1.0" encoding="utf-8" ?>';n[p++]="<methodCall>";n[p++]="<params>";a.each(e,function(a,b){n[p++]="<"+a+"><![CDATA["+b+"]]\></"+a+">"});n[p++]="</params>";n[p++]="</methodCall>";var s=null;s&&s.readyState!=0&&s.abort();try{a.ajax({url:m,type:"POST",dataType:"xml",data:n.join("\n"),contentType:"text/plain",beforeSend:function(a){s=a},success:g,
error:function(a,b){t.css("visibility","hidden");var c="";if(b=="parsererror"){c="The result is not valid XML :\n-------------------------------------\n";if(a.responseText=="")return;c+=a.responseText.replace(/<[^>]+>/g,"")}else c=b;alert(c)}})}catch(q){alert(q);return}var t=a("#waitingforserverresponse");show_waiting_message&&t.length&&(e=a(document),t.html(waiting_message).css({top:e.scrollTop()+20+"px",left:e.scrollLeft()+20+"px",visibility:"visible"}))};a.exec_json=function(b,d,e){typeof d=="undefined"&&
(d={});b=b.split(".");b.length==2&&(show_waiting_message&&a("#waitingforserverresponse").html(waiting_message).css("top",a(document).scrollTop()+20).css("left",a(document).scrollLeft()+20).css("visibility","visible"),a.extend(d,{module:b[0],act:b[1]}),typeof xeVid!="undefined"&&a.extend(d,{vid:xeVid}),a.ajax({type:"POST",dataType:"json",url:request_uri,contentType:"application/json",data:a.param(d),success:function(b){a("#waitingforserverresponse").css("visibility","hidden");b.error>0&&alert(b.message);
a.isFunction(e)&&e(b)}}))};a.fn.exec_html=function(b,d,e,j,h){typeof d=="undefined"&&(d={});a.inArray(e,["html","append","prepend"])||(e="html");var k=a(this),b=b.split(".");b.length==2&&(show_waiting_message&&a("#waitingforserverresponse").html(waiting_message).css("top",a(document).scrollTop()+20).css("left",a(document).scrollLeft()+20).css("visibility","visible"),a.extend(d,{module:b[0],act:b[1]}),a.ajax({type:"POST",dataType:"html",url:request_uri,data:a.param(d),success:function(b){a("#waitingforserverresponse").css("visibility",
"hidden");k[e](b);a.isFunction(j)&&j(h)}}))}})(jQuery);
(function(a){function b(a){var b=[];return a.is(":radio")?a.filter(":checked").val():a.is(":checkbox")?(a.filter(":checked").each(function(){b.push(this.value)}),b.join("|@|")):a.val()}var d=[],c=[],f=[],e=[],j={},h=new (xe.createApp("Validator",{init:function(){var a=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;this.cast("ADD_RULE",["email",a]);this.cast("ADD_RULE",["email_address",a]);a=/^[a-z]+[\w-]*[a-z0-9_]+$/i;this.cast("ADD_RULE",["userid",a]);this.cast("ADD_RULE",["user_id",a]);a=/^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/;
this.cast("ADD_RULE",["url",a]);this.cast("ADD_RULE",["homepage",a]);this.cast("ADD_RULE",["korean",/^[\uac00-\ud7a3]*$/]);this.cast("ADD_RULE",["korean_number",/^[\uac00-\ud7a30-9]*$/]);this.cast("ADD_RULE",["alpha",/^[a-z]*$/i]);this.cast("ADD_RULE",["alpha_number",/^[a-z][a-z0-9_]*$/i]);this.cast("ADD_RULE",["number",/^[0-9]*$/])},run:function(a){var b="";if(a._filter)b=a._filter.value;a=this.cast("VALIDATE",[a,b]);typeof a=="undefined"&&(a=!1);return a},API_ONREADY:function(){var b=this;a("form").each(function(){if(this.onsubmit)this["xe:onsubmit"]=
this.onsubmit,this.onsubmit=null}).submit(function(){var c=this["xe:onsubmit"];return a.isFunction(c)?c.apply(this):b.run(this)})},API_VALIDATE:function(c,d){var m=this,h=!0,k=d[0],n=null,p=null;if(k.elements._filter)n=k.elements._filter.value;if(!n)return!0;a.isFunction(e[n])&&(p=e[n]);n=a.extend({},f[n.toLowerCase()]||{},j);a.each(n,function(c){var d=k.elements[c];if(!d)return!0;var d=a(d),e=a.trim(b(d)),d=parseInt(this.minlength)||0,g=parseInt(this.maxlength)||0,f=(this.rule||"").split(",");if(this.required&&
!e)return h=!!m.cast("ALERT",[k,c,"isnull"])&&!1;if(!this.required&&!e)return h=!0;if(d&&e.length<d||g&&e.length>g)return h=!!m.cast("ALERT",[k,c,"outofrange",d,g])&&!1;if(this.equalto&&b(a(k.elements[this.equalto]))!=e)return h=!!m.cast("ALERT",[k,c,"equalto"])&&!1;f&&a.each(f,function(a,b){if(!b)return!0;if(!m.cast("APPLY_RULE",[b,e]))return m.cast("ALERT",[k,c,"invalid_"+this]),h=!1});if(!h)return!1});if(!h)return!1;if(a.isFunction(p))return p(k);return!0},API_ADD_RULE:function(a,b){var d=b[0].toLowerCase();
c[d]=b[1]},API_DEL_RULE:function(a,b){var d=b[0].toLowerCase();delete c[d]},API_GET_RULE:function(a,b){var d=b[0].toLowerCase();return c[d]?c[d]:null},API_ADD_FILTER:function(a,b){var c=b[0].toLowerCase();f[c]=b[1]},API_DEL_FILTER:function(a,b){var c=b[0].toLowerCase();delete f[c]},API_GET_FILTER:function(a,b){var c=b[0].toLowerCase();return f[c]?f[c]:null},API_ADD_EXTRA_FIELD:function(a,b){var c=b[0].toLowerCase();j[c]=b[1]},API_GET_EXTRA_FIELD:function(a,b){var c=b[0].toLowerCase();return j[c]},
API_DEL_EXTRA_FIELD:function(a,b){var c=b[0].toLowerCase();delete j[c]},API_APPLY_RULE:function(b,d){var e=d[0],f=d[1];if(typeof c[e]=="undefined")return!0;if(a.isFunction(c[e]))return c[e](f);if(c[e]instanceof RegExp)return c[e].test(f);return!0},API_ALERT:function(b,c){var d=c[0],e=c[1],f=c[2],h=c[3],j=c[4],k=this.cast("GET_MESSAGE",[e]),q=this.cast("GET_MESSAGE",[f]);q!=f&&(q=q.indexOf("%s")<0?k+q:q.replace("%s",k));if(h||j)q+="("+(h||"")+"~"+(j||"")+")";this.cast("SHOW_ALERT",[q]);a(d.elements[e]).focus()},
API_SHOW_ALERT:function(a,b){alert(b[0])},API_ADD_MESSAGE:function(a,b){d[b[0]]=b[1]},API_GET_MESSAGE:function(a,b){var c=b[0];return d[c]||c},API_ADD_CALLBACK:function(a,b){e[b[0]]=b[1]},API_REMOVE_CALLBACK:function(a,b){delete e[b[0]]}}));xe.registerApp(h);var k=xe.createPlugin("editor_stub",{API_BEFORE_VALIDATE:function(a,b){var c=b[0].getAttribute("editor_sequence");if(c&&typeof c=="object")c=c.value;if(c)try{editorRelKeys[c].content.value=editorRelKeys[c].func(c)||""}catch(d){}}});h.registerPlugin(new k)})(jQuery);
function filterAlertMessage(a){var b=a.message,d=a.act,a=a.redirect_url,c=location.href;typeof b!="undefined"&&b&&b!="success"&&alert(b);typeof d!="undefined"&&d?c=current_url.setQuery("act",d):typeof a!="undefined"&&a&&(c=a);c==location.href&&(c=c.replace(/#(.*)$/,""));location.href=c}function procFilter(a,b){b(a);return!1}
function legacy_filter(a,b,d,c,f,e,j,h){var k=xe.getApp("Validator")[0],l=jQuery,g=[];if(!k)return!1;b.elements._filter||l(b).prepend('<input type="hidden" name="_filter" />');b.elements._filter.value=a;g[0]=a;g[1]=function(a){var g={},a=l(a).serializeArray();l.each(a,function(a,b){var c=l.trim(b.value),d=b.name;if(!c||!d)return!0;h[d]&&(d=h[d]);/\[\]$/.test(d)&&(d=d.replace(/\[\]$/,""));g[d]?g[d]+="|@|"+c:g[d]=b.value});if(j&&!confirm(j))return!1;exec_xml(d,c,g,f,e,g,b)};k.cast("ADD_CALLBACK",g);
k.cast("VALIDATE",[b,a]);return!1};