String.format=function(){var a=arguments;var c=a.length;if(c<2){return null}var d=a[0];for(var b=1;b<c;b++){d=d.replace("{"+(b-1)+"}",a[b])}return d};String.prototype.string=function(a){var c="",b=0;while(b++<a){c+=this}return c};String.prototype.trim=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")};Date.prototype.format=function(a){if(!this.valueOf()){return" "}var b=this;return a.replace(/(yyyy|yy|MM|dd|E|hh|mm|ss|a\/p)/gi,function(c){switch(c){case"yyyy":return b.getFullYear();case"yy":return(b.getFullYear()%1000).padLeft(2);case"MM":return(b.getMonth()+1).padLeft(2);case"dd":return b.getDate().padLeft(2);case"HH":return b.getHours().padLeft(2);case"hh":return((h=b.getHours()%12)?h:12).padLeft(2);case"mm":return b.getMinutes().padLeft(2);case"ss":return b.getSeconds().padLeft(2);case"a/p":return b.getHours()<12?"AM":"PM";default:return c}})};Array.prototype.contains=function(b){var a=this.length;while(a--){if(this[a]==b){return true}}return false};String.prototype.padLeft=function(a){return"0".string(a-this.length)+this};Number.prototype.padLeft=function(a){return this.toString().padLeft(a)};Array.prototype.indexOf=function(c){var a=-1;for(var b in this){if(this[b]==c){a=b;break}}return a};function get_label_text(a){return $('label[for="'+a+'"]').text()}function to_json_string(c){var b=new Array();for(var a in c){var d=c[a];if(typeof(d)=="object"){d=to_json_string(d)}else{if(typeof(d)=="string"){d='"'+d+'"'}else{if(typeof(d)=="function"){continue}}}b.push(a+":"+d)}return"{"+b.join()+"}"}function get_number_with_comma(c){var b=/(^[+-]?\d+)(\d{3})/;var a=""+c;while(b.test(a)){a=a.replace(b,"$1,$2")}return a}function qs_to_json(b){var a={};b.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function(d,c,f,e){a[c]=e});return a}function array_to_json(a){var b={};for(var c=0;c<a.length;c++){b[a[c].name]=a[c].value}return b}function has_checked_checkbox(a){return $("input[name='"+a+"']").is(":checked")}function check_bulk_checkbox(a,b){var c=a.prop("checked");$(":checkbox[name='"+b+"']:not(:disabled)").prop("checked",c)}function get_checked_value(b){var a=[];$("input[name='"+b+"']:checkbox:checked").each(function(){a.push($(this).val())});return a}function get_checked_radio_value(b){var a=$("input[name='"+b+"']:checked").val();return a}function load_head_file(b,a){if(a=="js"){$.ajaxSetup({async:false});$.getScript(b);$.ajaxSetup({async:true})}else{if(a=="css"){var c=document.createElement("link");c.setAttribute("rel","stylesheet");c.setAttribute("type","text/css");c.setAttribute("href",b);document.getElementsByTagName("head")[0].appendChild(c)}}}$.fn.formatKey=function(a){$(this).css({"ime-mode":"disabled"});this.each(function(){$(this).keyup(function(b){if(window.event){key=window.event.keyCode}else{if(b){key=b.which}else{return true}}keychar=String.fromCharCode(key);if(key==null){return true}switch(a){case"alpha-upper":return/[^A-Z]+$/.test(keychar)?false:true;break;case"alpha-upper-number":return/[^A-Z0-9]+$/.test(keychar)?false:true;break;case"alpha-lower":return/[^a-z]+$/.test(keychar)?false:true;break;case"alpha":return/[^a-zA-Z]+$/.test(keychar)?false:true;break;case"alpha-number":return/\W/.test(keychar)?false:true;break;case"number":return isNaN(keychar)||/[^\d]/.test(keychar)?false:true;break;case"alpha-number-spcharacters":return !/[a-zA-Z0-9_.]/.test(keychar)?false:true;break;case"no-hangul":return true;break;default:return true}}).keyup(function(b){key=b.which;keychar=String.fromCharCode(key);if($.browser.chrome||$.browser.safari||$.browser.opera){if(key!=37){if(!/[\ㄱ-ㅎ가-힣ㅏ-ㅗ]/g.test($(this).val())){return false}$(this).val($(this).val().replace(/[\ㄱ-ㅎ가-힣ㅏ-ㅗ]/g,""))}}})})};$(function(){$("#sortable").sortable();$("#sortable").disableSelection()});jQuery.Alert=function(c,b){if($("#alertBox").length==0){var a=$.parseHTML('<div id="alertBox"></div>');$("body").append(a);if($("#alertSmart").length>0){$("#alertSmart").dialog("close");$("#alertSmart").remove()}}$(a).dialog({open:function(){$(a).append(c);$("#alertBox").prev().children().next().css("display","none")},title:get_msg("dialog_alert"),resizable:false,autoOpen:true,modal:true,buttons:{OK:function(){$("#alertBox").dialog("close");$("#alertBox").remove();if(b!=undefined){b()}}}})};jQuery.SmartAlert=function(d,b,a){if($("#alertSmart").length==0){var c=$.parseHTML('<div id="alertSmart"></div>');$("body").append(c)}$(c).dialog({open:function(){$(c).append(d);$("#alertSmart").prev().children().next().css("display","none")},title:get_msg("dialog_alert"),resizable:false,autoOpen:true,modal:true,buttons:{Reboot:function(){$("#alertSmart").dialog("close");$("#alertSmart").remove();if(b!=undefined){b()}},"Main Menu":function(){$("#alertSmart").dialog("close");$("#alertSmart").remove();if(a!=undefined){a()}}}})};jQuery.Confirm=function(c,b){if($("#confirmBox").length==0){var a=$.parseHTML('<div id="confirmBox"></div>');$("body").append(a)}$(a).dialog({open:function(){$(a).append(c);$("#confirmBox").prev().children().next().css("display","none")},title:get_msg("dialog_confirm"),resizable:false,autoOpen:true,modal:true,buttons:{OK:function(){$("#confirmBox").dialog("close");$("#confirmBox").remove();if(b!=undefined){b()}return true},Cancel:function(){$("#confirmBox").dialog("close");$("#confirmBox").remove();return false}}})};var enc64List,dec64List;function initBase64(){enc64List=new Array();dec64List=new Array();var a;for(a=0;a<26;a++){enc64List[enc64List.length]=String.fromCharCode(65+a)}for(a=0;a<26;a++){enc64List[enc64List.length]=String.fromCharCode(97+a)}for(a=0;a<10;a++){enc64List[enc64List.length]=String.fromCharCode(48+a)}enc64List[enc64List.length]="+";enc64List[enc64List.length]="/";for(a=0;a<128;a++){dec64List[dec64List.length]=-1}for(a=0;a<64;a++){dec64List[enc64List[a].charCodeAt(0)]=a}}function base64Encode(m){var l,k,j,g=0;var r,q,p,o;var a=-1;var n=m.split("");var f="";while(g==0){l=(typeof n[++a]!="undefined")?n[a].charCodeAt(0):((g=1)?0:0);k=(typeof n[++a]!="undefined")?n[a].charCodeAt(0):((g+=1)?0:0);j=(typeof n[++a]!="undefined")?n[a].charCodeAt(0):((g+=1)?0:0);r=enc64List[l>>2];q=enc64List[(3&l)<<4|k>>4];p=enc64List[(15&k)<<2|j>>6];o=enc64List[j&63];if(g>=1){o="="}if(g==2){p="="}if(g<3){f+=r+q+p+o}}var i="";var b=76;while(f.length>b){i+=f.substring(0,b)+"\n";f=f.substring(b)}i+=f;return i}function base64Decode(p){var o=0,m=0,l=0,k=0,j=0,g=0;var q=p.split("");var b="";var a=0;do{k=q[a++].charCodeAt(0);j=dec64List[k];if(k>=0&&k<128&&j!=-1){if(g%4==0){o=j<<2}else{if(g%4==1){o=o|(j>>4);m=(j&15)<<4}else{if(g%4==2){m=m|(j>>2);l=(j&3)<<6}else{l=l|j}}}g++;if(g%4==0){b+=String.fromCharCode(o)+String.fromCharCode(m)+String.fromCharCode(l)}}}while(typeof q[a]!="undefined");b+=(g%4==3)?String.fromCharCode(o)+String.fromCharCode(m):((g%4==2)?String.fromCharCode(o):"");return b}initBase64();jQuery.fn.hasHorizontalScrollBar=function(){return this.get(0)?this.get(0).scrollWidth>this.innerWidth():false};jQuery.fn.hasVerticalScrollBar=function(){return this.get(0)?this.get(0).scrollHeight>this.innerHeight():false};var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(c){var a="";var l,j,f,k,g,e,d;var b=0;c=Base64._utf8_encode(c);while(b<c.length){l=c.charCodeAt(b++);j=c.charCodeAt(b++);f=c.charCodeAt(b++);k=l>>2;g=((l&3)<<4)|(j>>4);e=((j&15)<<2)|(f>>6);d=f&63;if(isNaN(j)){e=d=64}else{if(isNaN(f)){d=64}}a=a+this._keyStr.charAt(k)+this._keyStr.charAt(g)+this._keyStr.charAt(e)+this._keyStr.charAt(d)}return a},decode:function(c){var a="";var l,j,f;var k,g,e,d;var b=0;c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(b<c.length){k=this._keyStr.indexOf(c.charAt(b++));g=this._keyStr.indexOf(c.charAt(b++));e=this._keyStr.indexOf(c.charAt(b++));d=this._keyStr.indexOf(c.charAt(b++));l=(k<<2)|(g>>4);j=((g&15)<<4)|(e>>2);f=((e&3)<<6)|d;a=a+String.fromCharCode(l);if(e!=64){a=a+String.fromCharCode(j)}if(d!=64){a=a+String.fromCharCode(f)}}a=Base64._utf8_decode(a);return a},_utf8_encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e<b.length;e++){var d=b.charCodeAt(e);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},_utf8_decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d<a.length){e=a.charCodeAt(d);if(e<128){b+=String.fromCharCode(e);d++}else{if((e>191)&&(e<224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&31)<<6)|(c2&63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&15)<<12)|((c2&63)<<6)|(c3&63));d+=3}}}return b}};