var domainName="rexy.co.kr";
var topmenuTry = 0;
var leftmenuTry = 0;
var maxTry = 5;

var blockLayer = null;

var myWidth = 0, myHeight = 0;	// body ³ôÀÌ, ³ÐÀÌ
var scrOfX  = 0 , scrOfY = 0;   // body ½ºÅ©·Ñ x, y

var NS4;
var IE4;
if (document.all)
{
    IE4 = true;
    NS4 = false;
}
else
{
    IE4 = false;
    NS4 = true;
}
if (NS4)  {
    document.captureEvents(Event.KEYDOWN)
    document.onkeydown = trapRefreshNS;
} else if (IE4)  {
    document.onkeydown = trapRefreshIE;
}
function trapRefresh(event) {
    if (event.keyCode == 116) {
    	event.cancelBubble = true; 
    	event.returnValue = false;
        document.location.reload();
    }
}
function trapRefreshNS(e) {
	trapRefresh(e);
}
function trapRefreshIE() {
	trapRefresh(event);
}

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);
	}
});
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;
	}
};
function AjaxReq(url,pars,success,error){
	$.ajax({
		type:"POST",
		url:url,
		data:pars,
		dataType:"json",
		async:false,
		error:error!=null?error:function(req, s, e){alert(e.message);},
		success:success
	});
}
function AjaxRequestNoX(options){
	options.beforeSend=function(){
		makeBlockLayer();
		$("#blockLayer").show();
	};
	options.complete=function(){
		$("#blockLayer").hide();
	};
	$.ajax(options);
}
function resetDocumentSize()
{
	if( typeof( window.innerWidth ) == 'number' )
	{
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	}
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
    	scrOfY = document.documentElement.scrollTop;
	    scrOfX = document.documentElement.scrollLeft;
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	    scrOfY = document.body.scrollTop;
    	scrOfX = document.body.scrollLeft;
	}
	else
	{
    	scrOfY = document.documentElement.scrollTop;
	    scrOfX = document.documentElement.scrollLeft;
	}
	if (isNaN(scrOfY)) {
		scrOfY = 0;
	}
}
function makeBlockLayer(){
	resetDocumentSize();
	if (blockLayer == null) {
		var clientWidth=document.body.clientHeight;
		var clientHeight=document.body.clientWidth;
		var arrayPageSize=getPageSize();
		var html_doc=document.getElementsByTagName('body').item(0);
		blockLayer = document.createElement('div');
		var chddiv = document.createElement('div');
		blockLayer.setAttribute("id","blockLayer");
		blockLayer.setAttribute("class","blockLayer");
		blockLayer.style.position='absolute';
		blockLayer.style.display='none';
		blockLayer.style.top='0';
		blockLayer.style.left='0';
		blockLayer.style.zIndex='100';
		blockLayer.style.width='100%';
		blockLayer.style.height='100%';
		blockLayer.style.textAlign='center';
		blockLayer.style.background='white';
		chddiv.setAttribute("id","progressLayer");
		chddiv.style.position='absolute';
		chddiv.style.width='200';
		chddiv.style.top = (myHeight / 2) - (chddiv.style.height / 2);
		chddiv.style.left = (parseInt(myWidth) / 2) - (parseInt(chddiv.style.width) / 2);
		chddiv.style.zIndex='101';
		chddiv.style.background='white';
		chddiv.style.textAlign='left';
		blockLayer.insertBefore(chddiv, blockLayer.firstChild);
		html_doc.insertBefore(blockLayer, html_doc.firstChild);
	}
}
function resetBlockLayer(){
	resetDocumentSize();
	document.getElementById("blockLayer").style.top = scrOfY;
	document.getElementById("blockLayer").style.left = scrOfX;
}
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 flashNavigate(url, target) {
	location.href = url;
}
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 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;">X</a></div>'+
	'<div id="'+(this.alertTxtName+this.no)+'" class="txt"></div>'+
	'<div id="'+(this.alertBtncName+this.no)+'" class="m_btnc">'+
	'</div><img src="/images/base/alert/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%";
		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='';
	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="/images/base/alert/btn_confirm.gif" border="0" alt="È®ÀÎ" /></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="/images/base/alert/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="/images/base/alert/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="/images/base/alert/btn_close.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:960/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.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;
	}
	(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);
}
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 Comm={
	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);
	},
	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 "";
	},
	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 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)?10000:time;
	
	var alert_msg = $("#progressLayer");
	alert_msg.html(message + '<div class="ac"><a href="javascript:close_title_alert()">´Ý±â</a></div>');
	$("#blockLayer").show();
	this.timer = setTimeout("close_title_alert()", time);
}
function close_title_alert()
{
	$("#blockLayer").hide();
	blockLayer = null;
}
function isNull(cObj){
	if(cObj==null||cObj=="undefined")return true;
	if(typeof(cObj)=="string"&&cObj=="")return true;
	return false;
}
function chgState(oID,oState){
	if(isNull(oID))return;
	var tObj=document.getElementById(oID);
	if(isNull(tObj))return;
	if(isNull(oState)){
		tObj.style.display=(tObj.style.display=="none")?"":"none";
	}else{
		tObj.style.display=oState;
	}
}
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 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;
	}
}
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;
}
function link(url, option){
	top.document.getElementById("topFrame").rows="*,0";
	if(option=="index"){
		top.main.location.href = "/main/main.php";
	}else{
		top.main.location.href = url;
	}
}
function showBanner(classNum) {
	var leftXmlObject = null;
	try {
		leftXmlObject = leftXml.getInstance();
	} catch(e) { leftXmlObject = null; }
	if(leftXmlObject == null) {
		return;
	}
	var oneDepth = classNum.substring(0, 2);
	var ban = $("#ban");
	ban.empty().append($("left[@seq="+oneDepth+"] contents", leftXmlObject).text());
	if(classNum.length >= 4) {
		var twoDepth = classNum.substring(2, 4);
		ban.append($("left[@seq="+oneDepth+twoDepth+"] contents", leftXmlObject).text());
		if(classNum.length >= 6) {
			var threeDepth = classNum.substring(4, 6);
			ban.append($("left[@seq="+oneDepth+twoDepth+threeDepth+"] contents", leftXmlObject).text())
			if(classNum.length == 8) {
				ban.append($("left[@seq="+classNum+"] contents", leftXmlObject).text())
			}
		}
	}
	//resetDiv();
}

function topMenuActive(one, two, three){
	try{
		if (topmenuTry > maxTry) {
			return;
		}
		document.getElementById("TopMenu").resetDepths(one, two, three);
	}catch(e){
		//alert(e.message);
		topmenuTry++; 
		setTimeout(function(){topMenuActive(one,two, three);},1000);
	}
}
function leftMenuActive(one, two, three, four, five){
	//alert(one+""+two+""+three+""+four+""+five);
	try{
		if (leftmenuTry > maxTry) {
			return;
		}
		document.getElementById("LeftMenu").resetDepths(one, two, three, four, five);
		/*showBanner(one+""+two+""+three+""+four+""+five);
		if(document.direct_link.direct_detail.value == 'Y'){
			goDetail(document.direct_link.pd_cd.value);
		}*/
	}catch(e){
		//alert(e.message);
		leftmenuTry++; 
		setTimeout(function(){leftMenuActive(one, two, three, four, five);},10);
	}
}
function getMenuXml(){
	return menuXml.getInstance();
}
function getLocation()
{
	var xmlObject=null;
	var title = "ÇÁ·Î±×·¥Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.";
	try{xmlObject = getMenuXml();}catch(e){}
	if(xmlObject != null)
	{
		var pageUrl=window.location.pathname;
		var param = window.location.search;
		var parameter=window.location.search.substr(1);
		var parameterObj={};
		parameter.replace(/([^=]+)=([^&]*)(&|$)/g,function(){
			parameterObj[arguments[1]]=arguments[2];
			return arguments[0];
		});
		
		var urlNodeObject=null;
		var urlNodeObjecttmp=null;
		var pagePath="",tempUrlPath="";
		var urlsNodes = xmlObject.getElementsByTagName("urls");
		var subUrl="", urlsArr;
		var paramsArr2 = [];
		for(var i=0;i<urlsNodes.length;i++){
			tempUrlPath = urlsNodes[i].parentNode.getElementsByTagName("url")[0].firstChild.nodeValue;
			pagePath = tempUrlPath.substring(0,tempUrlPath.lastIndexOf("/"));
			pagePath = (pagePath != "")? pagePath + "/" : "";
			urlsArr = (urlsNodes[i].childNodes[0] == null || typeof urlsNodes[i].childNodes[0] == "undefined")?"":urlsNodes[i].childNodes[0].nodeValue.split('|');
			paramsArr2 = null;
			paramsArr2 = urlsNodes[i].getAttribute("params").split("|");
			for(var j=0;j<urlsArr.length;j++){
				if((pagePath+urlsArr[j])==pageUrl||urlsArr[j]==pageUrl){
					urlNodeObjecttmp = urlsNodes[i];
					for (k=0;k<paramsArr2.length;k++) {
						if (paramsArr2[k] != "" && param.indexOf(paramsArr2[k])>-1) {
							urlNodeObject=urlsNodes[i];
							break;
						}
					}
				}
			}
		}
		if(urlNodeObject == null){
			urlNodeObject = urlNodeObjecttmp;
		}
		if(urlNodeObject != null){
			var currNodeName = "";
			var depth = 0;
			var seq = [];
			seq[0] = 0;
			seq[1] = 0;
			seq[2] = 0;
			seq[3] = 0;
			seq[4] = 0;
			var nodesArray=new Array();
			var el=urlNodeObject;
			var index = 0;
			
			do
			{
				el = el.parentNode;
				if (el == null || el.nodeName.indexOf("depth") != 0) {
					break;
				}
				depth = el.nodeName.substring(5,6);
				nodesArray[depth - 1] = new Object();
				nodesArray[depth - 1].url = el.getElementsByTagName("url")[0].firstChild.nodeValue;
				nodesArray[depth - 1].param = el.getElementsByTagName("url")[0].getAttribute("param");
				nodesArray[depth - 1].name = el.getElementsByTagName("name")[0].firstChild.nodeValue;
				index = 0;
				while(el.previousSibling)
				{
					el = el.previousSibling;
					if (el.nodeName.indexOf("depth"+depth) == 0) {
						index++;
					}
				}
				seq[depth - 1] = index+1;
			} while(el);
			var one=seq[0];
			var two=seq[1];
			var three=seq[2];
			var four=seq[3];
			var five=seq[4];
			/* ÇÃ·¡½Ã¸Þ´º ¸®¼Â start */
			topMenuActive(one, two, three);
			leftMenuActive(one, two, three, four, five);
			if (document.getElementById('top_navi_bg') != null)
			{
				document.getElementById('top_navi_bg').style.cssText="background:url('/images/company/sub_"+one+".jpg') no-repeat right top";
			}
			/* ÇÃ·¡½Ã¸Þ´º ¸®¼Â end */

			var locationHtml="<a href=\"/main/main.php\">Home</a>";
			var nodesArrayLength=nodesArray.length;
			for(var i=0;i<nodesArrayLength;i++){
				var tempSeq=seq[0];
				if(i==0){
					var linkString = nodesArray[i].url;
					if (nodesArray[i].param != "") {
						linkString += "?"+nodesArray[i].param;
					}
					locationHtml+="&nbsp;&gt;&nbsp;<a href=\""+linkString+"\">"+nodesArray[i].name+"</a>";
				}else if(i==nodesArrayLength-1){
					locationHtml+="&nbsp;&gt;&nbsp;<span class=\"now\">"+nodesArray[i].name+"</span>";
				}else{
					locationHtml+="&nbsp;&gt;&nbsp;<a href=\""+nodesArray[i].url+"\">"+nodesArray[i].name+"</a>";
				}
				title = nodesArray[i].name;
			}
			title = title.replace(/&/g, "&amp;");

			//var titleText=locationHtml.replace(/<[^>]*>/gi,"").replace(/Home&nbsp;&gt;/,"");
			//document.title=titleText;
		}
	}

	var titleEl=document.getElementById("title");
	var locationEl=document.getElementById("location");
	if(titleEl){
		titleEl.innerHTML = title;
	}
	if(locationEl){
		locationEl.innerHTML = locationHtml;
	}
}
function ImgSizeConv(maxWidth,resizeWidth){
	var oIMG = document.getElementsByName('IMAGEVIEW_1_0');
	if(!maxWidth)maxWidth=500;
	if(!resizeWidth)resizeWidth=500;
	
	var max    = maxWidth;  // ÁöÁ¤ÇÒ Å©±â
	var resize = resizeWidth;	// ¸®»çÀÌÁîÇÒ Å©±â
	var resize2 = 0;
	for(i=0;i<oIMG.length;i++){
		if (oIMG[i].offsetWidth > max ) {
			resize2 = parseInt(resize * oIMG[i].offsetHeight / oIMG[i].offsetWidth);
			oIMG[i].style.width = resize;
			oIMG[i].style.height = resize2;
			oIMG[i].style.cursor = 'hand';
			tmp = oIMG[i];
			tmp.onclick = function ()
			{
				image_window(tmp);
			}
		}
	}
}

