jQuery.fn.extend({
fastSerialize:function(option){
var a=(option=="json")?{}:[];
$(this).find("*").each(function(){
var n=this.name;
var t=this.type;
if(!n||this.disabled||t=='reset'||(t=='checkbox'||t=='radio')&&!this.checked||(t=='submit'||t=='image'||t=='button')&&this.form.clicked!=this||this.tagName.toLowerCase()=='select'&&this.selectedIndex==-1){
return;
}
option=="json"?a[n]=this.value:a.push({name:n,value:this.value});
});
return option=="json"?a:$.param(a);
}
});
var domainName="wooriwm.com";
jQuery.cookie=function(name,value,options){
if(typeof value!='undefined'){options=options||{};
if(value==null){
value='';
options.expires=-1;
}
var expires='';
if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){
var date;
if(typeof options.expires=='number'){
date=new Date();
date.setTime(date.getTime()+(options.expires*24*60*60*1000));
}else{
date=options.expires;
}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+options.path:'';
var domain=options.domain?'; domain='+options.domain:'';
var secure=options.secure?'; secure':'';
document.cookie=[name,'=',value,expires,path,domain,secure].join('');
}else{var cookieValue=null;
if(document.cookie&&document.cookie!=''){
var cookies=document.cookie.split(';');
for(var i=0;i<cookies.length;i++){
var cookie=jQuery.trim(cookies[i]);
if(cookie.substring(0,name.length+1)==(name+'=')){
try{
cookieValue=decodeURIComponent(cookie.substring(name.length+1));
}catch(e){
cookieValue=cookie.substring(name.length+1);
}
}
}
}
return cookieValue;
}
};
var khd=0;
function AjaxRequest(url,pars,success,error,async,type){
pars="q="+escape_url(XecureAjax(pars));
$.ajax({
type:"POST",
url:url,
data:pars,
dataType: type != null ? "text" : "json",
async: (async == null || async == true) ? true : false,
error:error!=null?error:function(req,s,e){isOverlap=0;},success:success,
//error: error!=null?error:function(req, s, e) {isOverlap=0;alert(req.responseText);},
success:success,
beforeSend:function(){
makeBlockLayer();
$("#blockLayer").show();
},
complete:function(){
$("#blockLayer").hide();
}
});
}
function AjaxRequest2(url,pars,success,error){
$.ajax({
type:"POST",
url:url,
data:pars,
dataType:"json",
async:arguments[4]?false:true,
error:error!=null?error:function(req,s,e){isOverlap=0;},success:success,
beforeSend:function(){
makeBlockLayer();
$("#blockLayer").show();
},
complete:function(){
$("#blockLayer").hide();
}
});
}
function AjaxRequest3(url,pars,success,error){
pars="q="+escape_url(XecureAjax(pars));
$.ajax({
type:"POST",
url:url,
data:pars,
dataType:"text",
async:arguments[4]?false:true,
error:error!=null?error:function(req,s,e){isOverlap=0;},success:success,
beforeSend:function(){
makeBlockLayer();
$("#blockLayer").show();
},
complete:function(){
$("#blockLayer").hide();
}
});
}
function AjaxRequestNoX(options){	
options.beforeSend=function(){
makeBlockLayer();
$("#blockLayer").show();
};
options.complete=function(){
$("#blockLayer").hide();
};
$.ajax(options);
}
function makeBlockLayer(){
if(typeof($("#blockLayer")[0])=="undefined"){
var clientWidth=document.body.clientHeight;
var clientHeight=document.body.clientWidth;
var arrayPageSize=getPageSize();
var html_doc=document.getElementsByTagName('body').item(0);
var div=document.createElement('div');
div.setAttribute("id","blockLayer");
div.style.position='absolute';
div.style.display='none';
div.style.top='0';
div.style.left='0';
div.style.zIndex='5000';
div.style.width='100%';
div.style.height=(arrayPageSize[1]+'px');
div.style.background='url(/image/common/bullet/blank.gif)';html_doc.insertBefore(div,html_doc.firstChild);
}
}
function getPageSize(){
var xScroll,yScroll;
if(window.innerHeight&&window.scrollMaxY){
xScroll=document.body.scrollWidth;
yScroll=window.innerHeight+window.scrollMaxY;
}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;
yScroll=document.body.scrollHeight;
}else{xScroll=document.body.offsetWidth;
yScroll=document.body.offsetHeight;
}
var windowWidth,windowHeight;
if(self.innerHeight){windowWidth=self.innerWidth;
windowHeight=self.innerHeight;
}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;
windowHeight=document.documentElement.clientHeight;
}else if(document.body){windowWidth=document.body.clientWidth;
windowHeight=document.body.clientHeight;
}
if(yScroll<windowHeight){
pageHeight=windowHeight;
}else{
pageHeight=yScroll;
}
if(xScroll<windowWidth){
pageWidth=windowWidth;
}else{
pageWidth=xScroll;
}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;
}
function flashRequest(url,pars,id){
pars="creator=multicg";
$.ajax(
{
type:"POST",
url:url,
data:pars,
dataType:"json",
error:function(req){},
success:function(req){document.getElementById(id).responseJS(req)}
}
);
}
function getClientSize(){
var obj={"clientWidth":document.body.clientWidth,"clientHeight":document.body.clientHeight};
return obj;
}
function setSelectOption(selectId,value,text,option){
if(option=="del"){
selectId.empty();
}
selectId.append("<option value='"+value+"'>"+text+"</option>").attr("selectedIndex",0);
}
function autoTabFocus(thisObj,id){
if(id==null){
return;
}
var maxLen=thisObj.getAttribute("maxlength");
if(thisObj.value.length>=maxLen){
document.getElementById(id).select();
}
}
function retJSonObj(str){
var obj=eval("("+str+")");
return obj;
}
function layerFade(arrLayerId,showId){
for(var i=0;i<arrLayerId.length;i++){
if(arrLayerId[i]==showId){
$(showId).fadeIn();
}else{
$(arrLayerId[i]).hide();
}
}
}
function autoRadioCheck(obj,value){
if(value==""){
return;
}
obj=typeof(obj)=="object"?obj:document.getElementsByName(obj);
var radioObj="";
for(var i=0;i<obj.length;i++){
radioObj=obj[i];
if(radioObj.value==value){
radioObj.checked=true;
try{
radioObj.onclick();
}catch(e){}
}else{
radioObj.checked=false;
}
}
}
function delimiterString(type,str,delimiter){
if(str==""){
return str;
}
delimiter=delimiter||"-";
var idx=0;
var strLength=str.length;
var resultArr=new Array();
var resultValue="";
switch(type){
case "date":
resultArr[idx++]=str.substring(0,4);
resultArr[idx++]=str.substring(4,(strLength-2));
resultArr[idx++]=str.substring(strLength-2);
break;
case "tel":
if(strLength==8){
return str.substring(0,4)+delimiter+str.substring(4);
}else if(strLength<9){
return str;
}
var tempTel01=str.substring(0,2);
var tempTel02=str.substring(0,3);
var tel01Length=3;
if(tempTel01=="02"){
tel01Length=2;
}else if(tempTel02=="050"){
tel01Length=4;
}
resultArr[idx++]=str.substring(0,tel01Length);
resultArr[idx++]=str.substring(tel01Length,(strLength-4));
resultArr[idx++]=str.substring(strLength-4);
break;
}
for(var i=0;i<resultArr.length;i++){
resultValue+=resultArr[i];
if(i!=resultArr.length-1){
resultValue+=delimiter;
}
}
return resultValue;
}

var BTN_OK=1;
var BTN_CANCEL=2;
var BTN_BACK=4;
var BTN_CLOSE=8;
var BTN_YES=16;
var BTN_NO=32;
var panel=new Array();
var panel_seq=0;
var Panel=function(text,config){
this.alertLayerName="alert";
this.alertTxtName="alert_txt";
this.alertBtncName="alert_btnc";
this.alertMaskLayer="alert_mask";
this.no=this.sequence();
config=typeof(config)=='undefined'?{}:config;
this.config=config;
var p=document.createElement("div");
p.id=this.alertLayerName+this.no;
p.className="laybox02";p.style.position="absolute";p.style.display="none";p.style.zIndex=999999-this.no;
inner=''+
'<div class="layheader"><a href="#" onclick="panel['+this.no+'].hide(); return false;"><img src="/image/common/pop/pop_btn_close01.gif" border="0" alt="´Ý±â" align="absmiddle" /></a></div>'+
'<div id="'+(this.alertTxtName+this.no)+'" class="txt"></div>'+
'<div id="'+(this.alertBtncName+this.no)+'" class="m_btnc">'+
'</div><img src="/image/common/pop/pop_box_bottom02.gif" border="0" alt="" align="absmiddle" />';
p.innerHTML=inner;
this.defaultConfiguration(this.no,p);
(this.config.target).body.appendChild(p);
if(typeof(this.config.target.body.firstChild)!='undefined'){
this.config.target.body.insertBefore(p,this.config.target.body.firstChild);
}else{
this.config.target.body.appendChild(p);
}
var maskLayer=(this.config.target).getElementById(this.alertMaskLayer);
if(typeof(maskLayer)=='undefined'){
var mask=document.createElement("div");
mask.id=this.alertMaskLayer;
mask.style.position="absolute";
mask.style.display="none";
mask.style.width="100%";
//mask.style.height="100%";
if(typeof(this.config.target.body.firstChild)!='undefined'){
this.config.target.body.insertBefore(mask,this.config.target.body.firstChild);
}else{
this.config.target.body.appendChild(mask);
}
}
if(typeof(text)!='undefined'){
this.show(text);
}else{
this.show("undefined");
}
}
Panel.prototype.sequence=function(){
panel_seq+=1;
return panel_seq;
}
Panel.prototype.show=function(text){
var layer=(this.config.target).getElementById(this.alertLayerName+this.no);
var txt=(this.config.target).getElementById(this.alertTxtName+this.no);
var btnc=(this.config.target).getElementById(this.alertBtncName+this.no);
if(!this.config||this.config.modal!=false){
this.disableEvents();
}
var btn='';
var btnLang=location.href.indexOf("wooriwm.com/eng/")!=-1?"/eng":"";
this.config.button=typeof(this.config.button)=='undefined'?BTN_OK:this.config.button;
if((this.config.button&BTN_OK)==BTN_OK){
btn+='	<a href="#" id="alert_btnc_ok_'+this.no+'" onclick="panel['+this.no+'].hide('+BTN_OK+'); return false;" class="panel_btn"><img src="'+btnLang+'/image/common/button/btn_confirm.gif" border="0" alt="'+(location.href.indexOf("wooriwm.com/eng/")!=-1?"Confirm":"È®ÀÎ")+'" /></a>';
}
if((this.config.button&BTN_CANCEL)==BTN_CANCEL){
btn+='	<a href="#" onclick="panel['+this.no+'].hide('+BTN_CANCEL+'); return false;" class="panel_btn"><img src="'+btnLang+'/image/common/button/btn_cancel.gif" border="0" alt="Ãë¼Ò" /></a>';
}
if((this.config.button&BTN_BACK)==BTN_BACK){
btn+='	<a href="#" onclick="panel['+this.no+'].hide('+BTN_BACK+'); return false;" class="panel_btn"><img src="'+btnLang+'/image/common/button/btn_back.gif" border="0" alt="µÚ·Î" /></a>';
}
if((this.config.button&BTN_CLOSE)==BTN_CLOSE){
btn+='	<a href="#" onclick="panel['+this.no+'].hide('+BTN_CLOSE+'); return false;" class="panel_btn"><img src="'+btnLang+'/image/common/button/btn_close.gif" border="0" alt="´Ý±â" /></a>';
}
if((this.config.button&BTN_YES)==BTN_YES){
btn+='	<a href="#" onclick="panel['+this.no+'].hide('+BTN_YES+'); return false;" class="panel_btn"><img src="'+btnLang+'/image/common/button/btn_yes_0621.gif" border="0" alt="¿¹" /></a>';
}
if((this.config.button&BTN_NO)==BTN_NO){
btn+='	<a href="#" onclick="panel['+this.no+'].hide('+BTN_NO+'); return false;" class="panel_btn"><img src="'+btnLang+'/image/common/button/btn_no_0621.gif" border="0" alt="¾Æ´Ï¿À" /></a>';
}
btnc.innerHTML=btn;
layer.style.display="block";
layer.style.left=this.config.left;
layer.style.top=this.config.top;
txt.innerHTML=text;
if(typeof(this.config.mask)=='undefined'||this.config.mask==true){
var maskLayer=(this.config.target).getElementById(this.alertMaskLayer);
}
var focus=document.getElementById("alert_btnc_ok_"+this.no);
if(typeof(focus)!='undefined'){
focus.focus();
}
}
Panel.prototype.defaultConfiguration=function(no,layer){
if(this.config.target==null){
panel[this.no]=this;
this.config.target=document;
}else{
this.config.target.panel[this.no]=this;
this.config.target=this.config.target.document;
}
this.config.width=this.config.width!=null?this.config.width+"px":"330px";
this.config.height=this.config.height!=null?this.config.height+"px":"80px";
layer.style.width=this.config.width;layer.style.height=this.config.height;
this.config.left=this.config.left!=null?this.config.left:686/2-parseInt(layer.style.width)/2;
this.config.top=this.config.top!=null?this.config.top:(((document.body.clientHeight-parseInt(layer.style.height))/2)+document.body.scrollTop);
this.config.modal=this.config.modal==null?true:this.config.modal;
this.config.button=this.config.button==null?BTN_OK:this.config.button;
this.config.onok=this.config.onok==null?function(){}:this.config.onok;
this.config.oncancel=this.config.oncancel==null?function(){}:this.config.oncancel;
this.config.onback=this.config.onback==null?function(){}:this.config.onback;
this.config.onclose=this.config.onclose==null?function(){}:this.config.onclose;
this.config.onyes=this.config.onyes==null?function(){}:this.config.onyes;
this.config.onno=this.config.onno==null?function(){}:this.config.onno;
this.config.visibility=true;
}
Panel.prototype.disableEvents=function(){
return;
}
Panel.prototype.enableEvents=function(){
return;
}
Panel.prototype.hide=function(button){
var layer=(this.config.target).getElementById(this.alertLayerName+this.no);
layer.style.display="none";
this.enableEvents();
switch(button){
case BTN_OK:
if(this.config.onok)
this.config.onok();
this.analysis(this.config.ok);
break;
case BTN_CANCEL:
if(this.config.oncancel)
this.config.oncancel();
this.analysis(this.config.cancel);
break;
case BTN_BACK:
if(this.config.onback)
this.config.onback();
this.analysis(this.config.back);
break;
case BTN_CLOSE:
if(this.config.close)
this.config.onclose();
this.analysis(this.config.close);
break;
case BTN_YES:
if(this.config.onyes)
this.config.onyes();
this.analysis(this.config.yes);
break;
case BTN_NO:
if(this.config.onno)
this.config.onno();
this.analysis(this.config.no);
break;
}
(this.config.target).body.removeChild(layer);
}
Panel.prototype.analysis=function(key){
if(typeof(key)=='undefined')return;
if(key.charAt(0)=="@"){
var temp=key.split(" ");
key=temp[0];
no=typeof(temp[1])!='undefined'?temp[1]:-1;
if(key=="@focus"||key=="@f")this._focus(key,no);
else if(key=="@move"||key=="@m")this._move(key,no);
else if(key=="@back")this._back(key,no);
else if(key=="@go")this._go(key,no);
else if(key=="@close")this._close(key,no);
return;
}else{
location.href=key;
}
}
Panel.prototype._focus=function(key,no){
if(no!=-1&&typeof(this.config.focus[no])!='undefined')this.config.focus[no].focus();
else if(typeof(this.config.focus)!='undefined')this.config.focus.focus();
}
Panel.prototype._move=function(key,no){
if(no!=-1&&typeof(this.config.move[no])!='undefined')location.href=this.config.move[no];
else if(typeof(this.config.move)!='undefined')location.href=this.config.move;
}
Panel.prototype._back=function(key,no){
history.back();
}
Panel.prototype._go=function(key,no){
if(no!=-1&&typeof(this.config.move[go])!='undefined')history.go(this.config.go[no]);
else if(typeof(this.config.go)!='undefined')history.go(this.config.go);
}
Panel.prototype._close=function(key,no){
if(typeof(this.config.close)!='undefined')eval(this.config.close+".close()");
else self.close();
}
var panel;
function alert(text,config){
config=config==null?{}:config;
if(config.button==null){
config.button=BTN_OK;
}
var p=new Panel(text,config);
}
function confirm(text,config){
config=config==null?{}:config;
if(config.button==null){
config.button=BTN_OK|BTN_CANCEL;
}
var p=new Panel(text,config);
}

function confirm_yn(text,config){
config=config==null?{}:config;
if(config.button==null){
config.button=BTN_YES|BTN_NO;
}
var p=new Panel(text,config);
}


hanNumber=new Array('¿µ','ÀÏ','ÀÌ','»ï','»ç','¿À','À°','Ä¥','ÆÈ','±¸');
fourFour=new Array('ÀÏ','¸¸','¾ï','Á¶');
fourDigit=new Array('ÀÏ','½Ê','¹é','Ãµ');
function getEmoney(param){
if(param=="total")
{
$("#emoney").val("999,999,999");
$("#emoney_han").val("Àü¾×");
}
else if(param=="cancle"){
$("#emoney").val("");
$("#emoney_han").val("");
}
else if(param=="100"){
$("#emoney").val("1,000,000");
$("#emoney_han").val("( ÀÏ¹é¸¸ ¿ø )");
}
else if(param=="50"){
$("#emoney").val("500,000");
$("#emoney_han").val("( ¿À½Ê¸¸ ¿ø )");
}
else if(param=="10"){
$("#emoney").val("100,000");
$("#emoney_han").val("( ÀÏ½Ê¸¸ ¿ø )");
}
else if(param=="5"){
$("#emoney").val("50,000");
$("#emoney_han").val("( ¿À¸¸ ¿ø )");
}
else if(param=="1"){
$("#emoney").val("10,000");
$("#emoney_han").val("( ÀÏ¸¸ ¿ø )");
}
}
function numchk(num){
num=Number(num);
num=new String(num);
num=num.replace(/,/gi,"");
return numchk1(num);
}
function numchk1(num){
var sign="";
if(isNaN(num)){
alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
return 0;
}
if(num==0){
return num;
}
if(num<0){
num=num*(-1);
sign="-";
}
else{
num=num*1;
}
num=new String(num)
var temp="";
var pos=3;
num_len=num.length;
while(num_len>0){
num_len=num_len-pos;
if(num_len<0){
pos=num_len+pos;
num_len=0;
}
temp=","+num.substr(num_len,pos)+temp;
}
return sign+temp.substr(1);
}
function num_han(num)
{
if(num=="1")return "ÀÏ";
else if(num=="2")return "ÀÌ";
else if(num=="3")return "»ï";
else if(num=="4")return "»ç";
else if(num=="5")return "¿À";
else if(num=="6")return "À°";
else if(num=="7")return "Ä¥";
else if(num=="8")return "ÆÈ";
else if(num=="9")return "±¸";
else if(num=="½Ê")return "½Ê";
else if(num=="¹é")return "¹é";
else if(num=="Ãµ")return "Ãµ";
else if(num=="¸¸")return "¸¸ ";
else if(num=="¾ï")return "¾ï ";
else if(num=="Á¶")return "Á¶ ";
else if(num=="0")return "";
}
function NUM_HAN(num,mode,return_input)
{
if(num==""||num=="0"){
if(mode=="3"){
return_input.value="";
}
return;
}
num=new String(num);
num=num.replace(/,/gi,"");
var len=num.length;
var temp1="";
var temp2="";
if(len/4>3&&len/4<=4){
if(len%4==0){
temp1=ciphers_han(num.substring(0,4))+"Á¶"+ciphers_han(num.substring(4,8))+"¾ï"+ciphers_han(num.substring(8,12))+"¸¸"+ciphers_han(num.substring(12,16));
}
else{
temp1=ciphers_han(num.substring(0,len%4))+"Á¶"+ciphers_han(num.substring(len%4,len%4+4))+"¾ï"+ciphers_han(num.substring(len%4+4,len%4+8))+"¸¸"+ciphers_han(num.substring(len%4+8,len%4+12));
}
}
else if(len/4>2&&len/4<=3){
if(len%4==0){
temp1=ciphers_han(num.substring(0,4))+"¾ï"+ciphers_han(num.substring(4,8))+"¸¸"+ciphers_han(num.substring(8,12));
}
else{
temp1=ciphers_han(num.substring(0,len%4))+"¾ï"+ciphers_han(num.substring(len%4,len%4+4))+"¸¸"+ciphers_han(num.substring(len%4+4,len%4+8));
}
}
else if(len/4>1&&len/4<=2){
if(len%4==0){
temp1=ciphers_han(num.substring(0,4))+"¸¸"+ciphers_han(num.substring(4,len));
}
else{
temp1=ciphers_han(num.substring(0,len%4))+"¸¸"+ciphers_han(num.substring(len%4,len));
}
}
else if(len/4<=1){
temp1=ciphers_han(num.substring(0,len));
}
for(var i=0;i<temp1.length;i++){
temp2=temp2+num_han(temp1.substring(i,i+1));
}
temp3=new String(temp2);
temp3=temp3.replace(/¾ï ¸¸/gi,"¾ï ");
temp3=temp3.replace(/Á¶ ¾ï/gi,"Á¶ ");
if(mode==1){
alert(temp3+" ¿ø");
}else if(mode==2){
return temp3;
}else if(mode==3){
return_input.value="( "+temp3+" ¿ø )";
}
}
function ciphers_han(num)
{
var len=num.length;
var temp="";
if(len==1){
temp=num;
}
else if(len==2){
temp=num.substring(0,1)+"½Ê"+num.substring(1,2);
}
else if(len==3){
temp=num.substring(0,1)+"¹é"+num.substring(1,2)+"½Ê"+num.substring(2,3);
}
else if(len==4){
temp=num.substring(0,1)+"Ãµ"+num.substring(1,2)+"¹é"+num.substring(2,3)+"½Ê"+num.substring(3,4);
}
num=new String(temp);
num=num.replace(/0½Ê/gi,"");
num=num.replace(/0¹é/gi,"");
num=num.replace(/0Ãµ/gi,"");
return num;
}
function moncom(mon){
var factor=mon.length%3;
var su=(mon.length-factor)/3;
var com=mon.substring(0,factor);
for(var i=0;i<su;i++){
if((factor==0)&&(i==0)){
com+=mon.substring(factor+(3*i),factor+3+(3*i));
}
else{
com+=",";
com+=mon.substring(factor+(3*i),factor+3+(3*i));
}
}
document.write(com);
}
var TransUtil=function(txtObj,lblObj,unit){
this.value=0;this.total=0;this.txt=document.getElementById(txtObj);this.lbl=document.getElementById(lblObj);if(unit!=null){
this.unit=unit;
}
}
TransUtil.prototype.add=function(money){
(money==0)?this.value=this.total:this.value+=money;
$(this.txt).val(this.get(this.value));
this.toString(this.value);
}
TransUtil.prototype.cancel=function(){
this.value=0;
$(this.txt).val("");
$(this.lbl).val("");
}
TransUtil.prototype.getTotal=function(){
return this.total;
}
TransUtil.prototype.setTotal=function(total){
this.total=total;
}
TransUtil.prototype.numchk=function(num){
num=new String(num);
num=num.replace(/,/gi,"");
return this.numchk1(num);
}
TransUtil.prototype.numchk1=function(num){
var sign="";
if(isNaN(num)){
alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
return 0;
}
if(num==0){
return num;
}
if(num<0){
num=num*(-1);
sign="-";
}
else{
num=num*1;
}
this.value=num;
num=new String(num)
var temp="";
var pos=3;
num_len=num.length;
while(num_len>0){
num_len=num_len-pos;
if(num_len<0){
pos=num_len+pos;
num_len=0;
}
temp=","+num.substr(num_len,pos)+temp;
}
return sign+temp.substr(1);
}
TransUtil.prototype.get=function(num){
if(!num||num==""){
this.value=0;
}
return this.numchk(num);
}
TransUtil.prototype.num2han=function(num){
return num2han(num);
}
function num2han(num){
if(num=="1")return "ÀÏ";
else if(num=="2")return "ÀÌ";
else if(num=="3")return "»ï";
else if(num=="4")return "»ç";
else if(num=="5")return "¿À";
else if(num=="6")return "À°";
else if(num=="7")return "Ä¥";
else if(num=="8")return "ÆÈ";
else if(num=="9")return "±¸";
else if(num=="½Ê")return "½Ê";
else if(num=="¹é")return "¹é";
else if(num=="Ãµ")return "Ãµ";
else if(num=="¸¸")return "¸¸ ";
else if(num=="¾ï")return "¾ï ";
else if(num=="Á¶")return "Á¶ ";
else if(num=="0")return "";
}
TransUtil.prototype.toString=function(num){
if(num==""||num=="0"){
$(this.lbl).val("");
return;
}
var temp3=numberToHangul(num);
if(this.unit==null){
$(this.lbl).val(temp3+" ¿ø");
}else{
$(this.lbl).val(temp3+" "+this.unit);
}
}
function numberToHangul(num){
if(num==""||num=="0"){
return "";
}
num=new String(num);
num=num.replace(/,/gi,"");
var len=num.length;
var temp1="";
var temp2="";
if(len/4>3&&len/4<=4){
if(len%4==0){
temp1=ciphers_han(num.substring(0,4))+"Á¶"+ciphers_han(num.substring(4,8))+"¾ï"+ciphers_han(num.substring(8,12))+"¸¸"+ciphers_han(num.substring(12,16));
}
else{
temp1=ciphers_han(num.substring(0,len%4))+"Á¶"+ciphers_han(num.substring(len%4,len%4+4))+"¾ï"+ciphers_han(num.substring(len%4+4,len%4+8))+"¸¸"+ciphers_han(num.substring(len%4+8,len%4+12));
}
}
else if(len/4>2&&len/4<=3){
if(len%4==0){
temp1=ciphers_han(num.substring(0,4))+"¾ï"+ciphers_han(num.substring(4,8))+"¸¸"+ciphers_han(num.substring(8,12));
}
else{
temp1=ciphers_han(num.substring(0,len%4))+"¾ï"+ciphers_han(num.substring(len%4,len%4+4))+"¸¸"+ciphers_han(num.substring(len%4+4,len%4+8));
}
}
else if(len/4>1&&len/4<=2){
if(len%4==0){
temp1=ciphers_han(num.substring(0,4))+"¸¸"+ciphers_han(num.substring(4,len));
}
else{
temp1=ciphers_han(num.substring(0,len%4))+"¸¸"+ciphers_han(num.substring(len%4,len));
}
}
else if(len/4<=1){
temp1=ciphers_han(num.substring(0,len));
}
for(var i=0;i<temp1.length;i++){
temp2=temp2+num2han(temp1.substring(i,i+1));
}
temp3=new String(temp2);
temp3=temp3.replace(/¾ï ¸¸/gi,"¾ï ");
temp3=temp3.replace(/Á¶ ¾ï/gi,"Á¶ ");
return temp3;
}
function ciphers_han(num){
var len=num.length;
var temp="";
if(len==1){
temp=num;
}
else if(len==2){
temp=num.substring(0,1)+"½Ê"+num.substring(1,2);
}
else if(len==3){
temp=num.substring(0,1)+"¹é"+num.substring(1,2)+"½Ê"+num.substring(2,3);
}
else if(len==4){
temp=num.substring(0,1)+"Ãµ"+num.substring(1,2)+"¹é"+num.substring(2,3)+"½Ê"+num.substring(3,4);
}
num=new String(temp);
num=num.replace(/0½Ê/gi,"");
num=num.replace(/0¹é/gi,"");
num=num.replace(/0Ãµ/gi,"");
return num;
}
var CommonUtil={
alert:function(message,time){title_alert(message,time);}
,closeAlert:function(message){close_title_alert();}
,validJSON:function(json){
if(!json.valid_session)
{
alert("¼¼¼ÇÀÌ À¯È¿ÇÏÁö ¾Ê¾Æ ·Î±×ÀÎÆäÀÌÁö·Î ÀÌµ¿ÇÕ´Ï´Ù.",{ok:"/login/login.jsp"});
return false;
}
if(json.result.error)
{
alert(json.result.message);
return false;
}
return true;
}
,validJSON2:function(json,flag,callback){if(!json.valid_session){
alert("¼¼¼ÇÀÌ À¯È¿ÇÏÁö ¾Ê¾Æ ·Î±×ÀÎÆäÀÌÁö·Î ÀÌµ¿ÇÕ´Ï´Ù.",{ok:"/login/login.jsp"});
return false;
}
if(json.result.error){
if(flag){
return callback();
}else{
alert(json.result.message);
return false;
}
}
return true;
}
,formatPostNo:function(code){return code.substring(0,3)+"-"+code.substring(3,6);}
,remakeNumber:function(no,away,small_cipher){return remake_Number(no,away,small_cipher)}
,numberFormat:function(no,small_cipher){return number_format(no,small_cipher);}
,unnumberFormat:function(no){return unnumber_format(no);}
,rfill:function(str,len,c){return rfill(str,len,c);}
,lfill:function(str,len,c){return lfill(str,len,c);}
,checkCAPwd:function(form,juminno,ca_pwd,callback){return check_ca(form,juminno,ca_pwd,callback);}
,formatDate:function(date){return format_date(date);}
,formatTime:function(time){return format_time(time);}
}
var AccountUtil={

	formatAccountNo:function(accnt_no){return format_account_no(accnt_no);}
	,formatCreateNo:function(CreditNo){return format_create_no(CreditNo);}
	,unformatAccountNo:function(accnt_no){return unformat_account_no(accnt_no);}
	,unformatFundNo:function(fund_no){return unformat_fund_no(fund_no);}
	, formatFundNo: function(fund_no, fund_seq) {
	if (fund_no==null || fund_no.length<6) return "";
	if ((fund_seq != null) && (fund_seq.length >= 3)) {
	return fund_no.substring(0, 6) + "-" + fund_seq.substring(0, 3);
	}
	if (fund_no.length >= 9) {
	return fund_no.substring(0, 6) + "-" + fund_no.substring(6, 9);
	}
	return fund_no;
	}
	,changeGoodsNumber:function(accnt_no,goods){return change_goods_number(accnt_no,goods);}
	,getGoodsNumber:function(accounts, account){
	if ((accounts == null) || (account == null)) return "";
	for (var i=0; i<accounts.account.length; i++)
	{
	if (accounts.account[i].accnt_no == account) {
	return accounts.account[i].act_pdt_cd;
	}
	}
	return "";
	}
	,getAmnNumber:function(accounts, account){
	if ((accounts == null) || (account == null)) return "";
	for (var i=0; i<accounts.account.length; i++)
	{
	if (accounts.account[i].accnt_no == account) {
	return accounts.account[i].amn_tab_cd;
	}
	}
	return "";
	}
	, isOcto:function(accounts, account){
	if ((accounts == null) || (account == null)) return "";
	for (var i=0; i<accounts.account.length; i++)
	{
	if (accounts.account[i].accnt_no == account) {
	return accounts.account[i].octo;
	}
	}
	return "";
	}
	// java method ¿Í µ¿ÀÏÇÏ°Ô Ã³¸®ÇÏµµ·Ï
	,get:function(accounts, account){
		var ret = false;
		if ((accounts == null) || (account == null)) return ret;
		for (var i=0; i<accounts.account.length; i++)
		{
			if (accounts.account[i].accnt_no == account) {
				ret = true;
				break;
			}
		}
		return ret;
	}
}
function check_ca(form,juminno,ca_pwd,callback){
	var dn=getCookieUserInfo("dn");
	var json={rtcode:"1",message:""};
	if(CertManX.object==null){
		alert("°øÀÎÀÎÁõ °ü¸® ÇÁ·Î±×·¥ÀÌ Á¤»óÀûÀ¸·Î ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.");
		return false;
	}
	if(dn.length>0){

		CertManX.SetKeySaferMode(5);	//¼ÒÇÁÆ®Ä·ÇÁ Å°º¸µå º¸¾È
		if(!CertManX.SetPasswordEncMode(17))
		{
		           alert("["+CertManX.GetLastErrorCode() +"]"+CertManX.GetLastErrorMsg());
		           return false;
		}
	
		var gubunDN=CertManX.SetMatchedContextExt(dn,"",ca_pwd,256+0+1);
		if(dn!=gubunDN){
			var err=CertManX.GetLastErrorMsg();
			var code=CertManX.GetLastErrorCode();
			if(code=='2500'){
				CertManX.UnsetMatchedContext();
				alert(err);
				return false;
			}
			CertManX.UnsetMatchedContext();
			alert("°øÀÎÀÎÁõºñ¹Ð¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
			return false;
		}
		CertManX.UnsetMatchedContext();
	}else{
		alert("°øÀÎÀÎÁõ¼­ Á¤º¸¸¦ ¾Ë ¼ö ¾ø½À´Ï´Ù.");
		return false;
	}
	callback(json);
	return true;
}
function check_ca_focus(form,juminno,ca_pwd_obj,callback){
var dn=getCookieUserInfo("dn");
var ca_pwd = ca_pwd_obj.val();
var json={rtcode:"1",message:""};
if(CertManX.object==null){
alert("°øÀÎÀÎÁõ °ü¸® ÇÁ·Î±×·¥ÀÌ Á¤»óÀûÀ¸·Î ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.");
return false;
}
if(dn.length>0){
var gubunDN=CertManX.SetMatchedContextExt(dn,"",ca_pwd,256+0+1);
if(dn!=gubunDN){
var err=CertManX.GetLastErrorMsg();
var code=CertManX.GetLastErrorCode();
if(code=='2500'){
CertManX.UnsetMatchedContext();
alert(err);
return false;
}
CertManX.UnsetMatchedContext();
alert("°øÀÎÀÎÁõºñ¹Ð¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.",
{onok: function(){
ca_pwd_obj.val("");
ca_pwd_obj.focus();
}
});
return false;
}
CertManX.UnsetMatchedContext();
}else{
alert("°øÀÎÀÎÁõ¼­ Á¤º¸¸¦ ¾Ë ¼ö ¾ø½À´Ï´Ù.");
return false;
}
callback(json);
return true;
}
function format_date(date)
{
var result="";
if(date=="00000000") date = "";
date=date==null?"":date+"";
for(var i=0;i<date.length;i++)
{
result+=date.charAt(i);
if(i==3||i==5)
{
result+="/";
}
}
return result;
}
function format_time(time)
{
var result="";
time=time==null?"":time+"";
for(var i=0;i<time.length;i++)
{
result+=time.charAt(i);
if(i==1||i==3)
{
result+=":";
}
}
return result;
}
function title_alert(message,time)
{
close_title_alert();
if(this.timer!=null)
clearTimeout(this.timer);
time=time==null?4000:time;
var layer=$("div[@class=tit_btn] #message");
var alert_msg=$("#alert_message");
if(layer.length==1)
{
alert_msg.html(message);
layer.show();
this.timer=setTimeout("close_title_alert()",time);
}
}
function close_title_alert()
{
var layer=$("div[@class=tit_btn] #message");
var alert_msg=$("#alert_message");
if(layer.length==1)
{
layer.hide();
}
}
function remake_Number(no,away,small_cipher)
{
var minus=no.charAt(0)=='-';
var num=minus?no.substr(1):no;
if(num==null||num=="0")
{
num=0;
}
else
{
small_cipher=small_cipher==null?0:parseInt(small_cipher);
away=away==null?0:parseInt(away);
var sp=num.substring(0,num.length-away);
if(small_cipher > sp.length){
sp=lfill(sp,small_cipher+1,'0');
}else if(small_cipher == sp.length){
sp="0"+sp;
}
num=sp.substring(0,sp.length-small_cipher)+"."+sp.substring(sp.length-small_cipher,sp.length);	
}
num=minus?"-"+num:num;
return number_format(num,small_cipher);
}
function number_format(no,small_cipher)
{
if(no==null)
{
no=0;
}
small_cipher=small_cipher==null?0:parseInt(small_cipher);
var sp=new String(no).split(".");
var number="";
var small_number="";
var formatted="";
number=sp.length>0?sp[0]:"0";
small_number=sp.length==2?sp[1]:"";
var minus=number.charAt(0)=='-';
number=minus?number.substr(1):number;
var cnt=0;
for(var i=number.length-1;i>=0;i--)
{
var c=number.charAt(i);
if(cnt!=0&&cnt%3==0)
{
formatted=','+formatted;
}
formatted=c+formatted;
cnt++;
}
if(small_cipher>0)
{
small_number=small_number.substr(0,small_cipher);
if(small_number!=null){
for(var i=small_number.length;i<small_cipher;i++)
{
small_number=small_number+'0';
}
formatted=formatted+"."+small_number;
}
}
formatted=minus?"-"+formatted:formatted;
return formatted;
}
function unnumber_format(no)
{
if(no==null||no=="")
{
return "0";
}
no=new String(no);
return no.replace(/,/gi,"");
}
function format_account_no(accnt_no)
{
accnt_no=new String(accnt_no);
var result="";
var count=accnt_no.length;
for(var i=0;i<count;i++)
{
result=result+accnt_no.charAt(i);
if(i==2||i==4)
{
result+="-";
}
}
return result;
}
function format_create_no(accnt_no)
{
accnt_no=new String(accnt_no);
var result="";
var count=accnt_no.length;
for(var i=0;i<count;i++)
{
result=result+accnt_no.charAt(i);
if(i==3||i==7||i==11)
{
result+="-";
}
}
return result;
}


function unformat_account_no(accnt_no)
{
if(accnt_no==null||accnt_no=="")
{
return "0";
}
accnt_no=new String(accnt_no);
return accnt_no.replace(/-/gi,"");
}
function unformat_fund_no(fund_no)
{
if(fund_no==null||fund_no=="")
{
return "";
}
fund_no=new String(fund_no);
return fund_no.replace(/-/gi,"");
}
function change_goods_number(accnt_no,goods,format)
{
if(accnt_no==null)
{
return "";
}
if(goods==null)
{
return accnt_no;
}
var accntNo="";
if(accnt_no.length!=11)
{
accnt_no=CommonUtil.unformatAccountNo(accntNo);
}
accntNo=accnt_no.substring(0,3)+"-"+goods+"-"+accnt_no.substring(5,11);
if(format)
{
return CommonUtil.formatAccountNo(accntNo);
}
return accntNo;
}
function rfill(str,len,c){
str=str==null?"":str;
len=len==null?0:len;
c=c==null?" ":c;
var rs=str;
for(var i=str.length;i<len;i++)
{
rs+=c;
}
return rs;
}
function lfill(str,len,c){
str=str==null?"":str;
len=len==null?0:len;
c=c==null?" ":c;
var rs="";
for(var i=str.length;i<len;i++)
{
rs+=c;
}
rs+=str;
return rs;
}
function accountFormat(str){
return str.substring(0,3)+"-"+str.substring(3,5)+"-"+str.substring(5,11);
}
function accountFormat2(str){
return str.substring(0,3)+"-"+"00"+"-"+str.substring(5,11);
}
function fundFormat(str){
try{
if(str.length <= 6) {
return str.substring(0,6);
} else {
return str.substring(0,6)+"-"+str.substring(6);
}
}catch(e){
return str;
}
}
function last_accnt_no(it){
$.cookie('last_accnt_no',it.value,{expires:0,path:'/',domain:domainName,secure:false});
it.blur();
}
function numberChk(){if(event.keyCode<45||event.keyCode>57)event.returnValue=false;}
function delStr(str,c){
return str.split(c).join("");
}
function SetNum(obj){
val=obj.value;
re=/[^0-9-,]/gi;
obj.value=val.replace(re,"");
}
function addCommas(obj){
val=delStr(obj.value,",");
var objRegExp=new RegExp('(-?[0-9]+)([0-9]{3})');
while(objRegExp.test(val)){
val=val.replace(objRegExp,'$1,$2');
}
obj.value=val;
}
function number2Hangeul(obj,obj2){
var labelObj=typeof(obj2)=="object"?obj2:document.getElementById(obj2);
SetNum(obj);
addCommas(obj);
var strNumber=obj.value;
strNumber=strNumber.replace(new RegExp(",","g"),"");
var arrayAmt=new Array("ÀÏ","ÀÌ","»ï","»ç","¿À","À°","Ä¥","ÆÈ","±¸","½Ê");
var arraypos=new Array("","½Ê","¹é","Ãµ");
var arrayUnit=new Array("","¸¸","¾ï","Á¶","°æ","ÇØ","ÀÚ","¾ç","±¸","°£","Á¤","Àç","±Ø","Ç×ÇÏ»ç","¾Æ½Â±â","³ªÀ¯Å¸","ºÒ°¡»çÀÇ","¹«·®´ë¼ö");
var pos=strNumber.length%4;var len=(strNumber.length/4).toString();
if(len.indexOf(".")>0)
var unit=len.substring(0,len.indexOf("."));else
var unit=strNumber.length/4-1;
var korNumber="";
var op=0;
for(i=0;i<strNumber.length;i++){
if(pos==0)pos=4;
var num=parseInt(strNumber.substring(i,i+1));
if(num!=0){
korNumber+=arrayAmt[num-1];
korNumber+=arraypos[pos-1];
op=1;
}
if(pos==1){
if(op==1)korNumber+=arrayUnit[unit];
unit--;
op=0;
}
pos--;
}
if(korNumber.length==0||korNumber.length==null)
labelObj.value="";
else
labelObj.value=korNumber+" ¿ø";
}
function getCookieUserInfo(val){
var userInfoObj=$.cookie("userInfo")==null?{}:retJSonObj($.cookie("userInfo"));
return eval("userInfoObj."+val);
}
function enter(callback){
if(window.event.keyCode=="13"){
callback();
}
}
function openBtFortune(){
var toolbar=document.getElementById("MyToolBar");
if(toolbar)
{
toolbar.openBtFortune();
}
}
function tableReSize(objS1,objS2,len,maxHeight,height){
var h=len*height;
if(h>maxHeight){
$("#"+objS1).css("height",maxHeight+"");
$("#"+objS2).css("height",(maxHeight+17)+"");
}else{
$("#"+objS1).css("height",h+"");
$("#"+objS2).css("height",(h+17)+"");
}
}

function quoteCheck(value){
	if( value.indexOf("\'") >= 0 ||value.indexOf("\"") >= 0 ){
		alert("ÀÛÀºµû¿ÈÇ¥³ª Å« µû¿ÈÇ¥´Â ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
		return false;
	}else{
		return true;
	}
}
/** 2008-06-19 ±èº¸¿¬ Ãß°¡
 *   °¡°Ý¿¡ ,(½°Ç¥)¿Í .(¸¶Ä§Ç¥) Ãß°¡
 */
function addNumCommaDot(value) {
	var index = value.indexOf('.');		// ¸¶Ä§Ç¥ À§Ä¡
	var num1 = '';		// Á¤¼öºÎºÐ
	var num2 = '';		// ¼Ò¼öºÎºÐ
	var returnNum = '';		// °á°ú¼ýÀÚ
	var temp = '';			// ÀÓ½Ãº¯¼ö

	// ¸¶Ä§Ç¥°¡ ¾øÀ¸¸é
	if ( index < 0 ) {
		num1 = value;
	}
	// ¸¶Ä§Ç¥°¡ ÀÖÀ¸¸é
	else {
		num1 = value.split('.')[0];
		num2 = value.split('.')[1];
	}

	num1 = num1.replace(/,/gi,"");		// ½°Ç¥ Á¦°Å
	num1 = new String(Number(num1) == 0 ? '' : Number(num1));

	if ( isNaN(num1) ) {
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		return 0;
	}

	// ÃµÀÚ¸®¸¶´Ù ÄÞ¸¶¸¦ Âï´Â´Ù.
	for ( var i = num1.length-1, j = 1 ; i > -1 ; i--, j++ )	{
		if ( j > 3 && j % 3 == 1 )	{
			temp = num1.charAt(i) + ',' + temp;
		}
		else {
			temp = num1.charAt(i) + temp;
		}
	}

	// ¼Ò¼öºÎºÐÀÌ ÀÖÀ¸¸é
	if ( index > 0 ) {
		// ¼Ò¼öºÎºÐÀÌ µÎÀÚ¸® ÀÌ»óÀÌ¸é µÎÀÚ¸®±îÁö¸¸ ÀÔ·Â
		if ( num2.length > 2 ) {
			returnNum = temp + '.' + num2.substr(0, 2);
		}
		else {
			returnNum = temp + '.' + num2;
		}
	}
	// ¼Ò¼öºÎºÐÀÌ ¾øÀ¸¸é
	else {
		returnNum = temp;
	}

	return returnNum;
}
