function objmenuItem(code, url){
	this.code = code;
	this.url = url;
}
global_menu_name	= "CJMenu";
var CJMenu = new Array();
CJMenu[0] = new objmenuItem('ix_00_00_00_00', '/en/index.asp');

/*01 about*/
CJMenu[1] = new objmenuItem('co_00_00_00_00', '/en/about/view.asp');
	CJMenu[1][0] = new objmenuItem('co_01_00_00_00', '/en/about/view.asp'); // 01. Overview
	CJMenu[1][1] = new objmenuItem('co_02_00_00_00', '/en/about/ceo.asp'); // 02. CEO Massage
	CJMenu[1][2] = new objmenuItem('co_03_00_00_00', '/en/about/history.asp'); // 03. History
	CJMenu[1][3] = new objmenuItem('co_04_00_00_00', '/en/about/vision.asp'); // 04. Vision
	CJMenu[1][4] = new objmenuItem('co_05_00_00_00', '/en/about/cibi.asp'); // 05. CI & BI


/*02 Business Field*/
CJMenu[2] = new objmenuItem('ab_00_00_00_00', '/en/field/food.asp');
	CJMenu[2][0] = new objmenuItem('ab_01_00_00_00','/en/field/food.asp'); // 01. Food distribution
	CJMenu[2][1] = new objmenuItem('ab_02_00_00_00', '/en/field/service.asp'); // 02. Contract meal service
	CJMenu[2][2] = new objmenuItem('ab_03_00_00_00', '/en/field/foodcourt.asp'); // 03. Food court & Concession
	CJMenu[2][3] = new objmenuItem('ab_04_00_00_00', '/en/field/raw.asp'); // 04. Raw food material processing
	CJMenu[2][4] = new objmenuItem('ab_05_00_00_00', '/en/field/engineering.asp'); // 05.Engineering


/*03 Business Infra*/
CJMenu[3] = new objmenuItem('pr_00_00_00_00', '/en/infra/system.asp');
	CJMenu[3][0] = new objmenuItem('pr_01_00_00_00', '/en/infra/system.asp'); // 01.Sanitation & Safety System
	CJMenu[3][1] = new objmenuItem('pr_02_00_00_00', '/en/infra/infra.asp'); // 02.Distribution Infrastructure
	CJMenu[3][2] = new objmenuItem('pr_03_00_00_00', '/en/infra/info.asp'); // 03.Information system
	CJMenu[3][3] = new objmenuItem('pr_04_00_00_00', '/en/infra/facility.asp'); // 04.Facility system
	CJMenu[3][4] = new objmenuItem('pr_05_00_00_00', '/en/infra/service.asp'); // 05.Academy of Service
	CJMenu[3][5] = new objmenuItem('pr_06_00_00_00', '/en/infra/edu.asp'); // 06.Academy of Cuisine education

/*04(IR )_ir(invest)*/
CJMenu[4] = new objmenuItem('ir_00_00_00_00', '/en/investors/ir.asp');
	CJMenu[4][0] = new objmenuItem('ir_01_00_00_00', '/en/investors/ir.asp'); // 01.Company Overview for IR
	CJMenu[4][1] = new objmenuItem('ir_02_00_00_00', '/en/investors/ip.asp'); // 02.Investment Points
	CJMenu[4][2] = new objmenuItem('ir_03_00_00_00', '/en/investors/industry.asp'); // 03.Industry Trend
	CJMenu[4][3] = new objmenuItem('ir_04_00_00_00', '/en/investors/management.asp'); // 04.Management strategy


/*07(¸¶ÀÌÆäÀÌÁö)_my(Mypage)*/
CJMenu[7] = new objmenuItem('my_00_00_00_00', '/util/feedback.asp');
	CJMenu[7][0] = new objmenuItem('my_01_00_00_00', '/util/feedback.asp'); // 01.¸Þ¾Æ¸®
	CJMenu[7][1] = new objmenuItem('my_02_00_00_00', '/util/membermodify.asp'); // 02.È¸¿øÁ¤º¸¼öÁ¤
	CJMenu[7][2] = new objmenuItem('my_03_00_00_00', '/util/secession.asp'); // 03.È¸¿øÅ»Åð

/*08(»çÀÌÆ®¸Ê)_si(Sitemap)*/
CJMenu[8] = new objmenuItem('si_00_00_00_00', '/util/sitemap.asp');
	CJMenu[8][0] = new objmenuItem('si_01_00_00_00', '/util/sitemap.asp');

/*07(·Î±×ÀÎ/È¸¿ø)_lo(Login/join)*/
CJMenu[9] = new objmenuItem('lo_00_00_00_00', '/util/feedback.asp');
	CJMenu[9][0] = new objmenuItem('lo_01_00_00_00', '/util/login.asp'); // 01.·Î±×ÀÎ
	CJMenu[9][1] = new objmenuItem('lo_02_00_00_00', '/util/join.asp'); // 02.È¸¿ø°¡ÀÔ 
	CJMenu[9][2] = new objmenuItem('lo_03_00_00_00', '#'); // 03.ºñ¹Ð¹øÈ£ Ã£±â

	
function fnisnum(argvalue) {
	argvalue = argvalue.toString();
	if (argvalue.length == 0)
		return false;
	for (var n = 0; n < argvalue.length; n++)
		if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9")
		return false;
	return true;
}


function fnobjlength(obj) {
	var count = 0;
	for (var i in obj) {
		if (fnisnum(i)) {
			count += 1;
		}
	}
	return count;
}

function fnobjmenu(code){
	var returnarrname;
	var arrname = global_menu_name;
	var serchchk = false;
	
	function serchobj(code, arrname){
		for (var i = 0; i <  fnobjlength(eval(arrname)) ; i ++){
			if (serchchk == true) return;
			var rearrname = arrname + "[" + i + "]";
			if(eval(rearrname).code == code){
				returnarrname = rearrname;
				serchchk = true;
			}
			else if (eval(rearrname).code != code && fnobjlength(eval(rearrname)) != 0 && serchchk == false){
				serchobj(code, rearrname);
			}
		}
	}
	
	serchobj(code, arrname);
	return returnarrname;
}




function fngourl(code){
	//alert(code);
	document.location.href=eval(fnobjmenu(code)).url;
	//alert(eval(fnobjmenu(code)).url);
}



function Setupmenu(code){
	document.getElementById('currlocation').innerHTML = fn_currlocatin(code);
	menuactive(code);
}

function fncurrlocatin(code){
	var parcode = code.split("_");
	var objname = "CJMenu"
	var returntext = " <a href='/index.html' title=\"Home\"> Home </a> ";
	for (var i=0; i < 4 ; i++ ){
		for (var j=0; j < fnobjlength(eval(objname)); j ++ )
		{
			var menucode	=	eval(objname + "[" + j + "]" + ".code").split("_")
			if ( menucode[i] == parcode[i] ){
				if (i < 4 ){ var nexti	= i + 1; }else{nexti = i;}
				if ( parcode[nexti] != "00" && nexti != 4 ){
					returntext = returntext + " > " + "<a href=" + eval(objname + "[" + j + "]" + ".url") +" title=\"" + eval(objname + "[" + j + "]" + ".comment") + "\" class=\"nav\">" + fnreplacebrtitle( eval(objname + "[" + j + "]" + ".title") , 2 ) + "</a>";
					break;
				}
				else{
					returntext = returntext + " > " + "<a href=" + eval(objname + "[" + j + "]" + ".url") +" title=\"" + eval(objname + "[" + j + "]" + ".comment") + "\" class=\"nav"+parcode[0]+"\"><b>" + fnreplacebrtitle( eval(objname + "[" + j + "]" + ".title") , 2 ) + "</b></a>";
					break;
				}
			}else if(eval(objname+".code") == code){
				break;				
			}
		}
		objname = objname + "[" + j + "]";
	}
	if (document.getElementById('currlocation'))
	{document.getElementById('currlocation').innerHTML = returntext;
	}
	
}

function fncurrmeta(code){
	var parcode = code.split("_");
	var objname = "CJMenu"
	var returntext = " Home ";
	for (var i=0; i < 4 ; i++ ){
		for (var j=0; j < fnobjlength(eval(objname)); j ++ )
		{
			var menucode	=	eval(objname + "[" + j + "]" + ".code").split("_")
			if ( menucode[i] == parcode[i] ){
				if (i < 4 ){ var nexti	= i + 1; }else{nexti = i;}
				if ( parcode[nexti] != "00" && nexti != 4 ){
					returntext = returntext + " > " + fnreplacebrtitle( eval(objname + "[" + j + "]" + ".title") , 2 ) + " ";
					break;
				}
				else{
					returntext = returntext + " > " + fnreplacebrtitle( eval(objname + "[" + j + "]" + ".title") , 2 ) + " ";
					break;
				}
			}else if(eval(objname+".code") == code){
				break;				
			}
		}
		objname = objname + "[" + j + "]";
	}
	if (document.getElementById('currlocation'))
	{document.getElementById('currlocation').innerHTML = returntext;
	}
	
}

function fnreplacebrtitle( title , chkbr ){  // chkbr = 1 AI¢¬e-> $br A¡í <br> ¡¤I, chkbr = 2 -> $br A¡í "" A¢¬¡¤I
	var retrunstr 
	if (chkbr == 1)
	{
		retrunstr = title.replace("$br", "<br>");
	}else{
		retrunstr = title.replace("$br", "");
	}
	return retrunstr;
}



/*-----------------------------------------------------------------------------------------
|                   ::::::::    Indicator Link Script     :::::::::                        |
----------------------------------------------------------------------------------------- */

function goHome()
{
		document.location = '/en/index.asp';
}


function go(chk)
{
// 1. about
		if (chk==11) {
			document.location = '/en/about/view.asp'; // Overview
		} else if (chk==12) {
			document.location = '/en/about/ceo.asp'; // CEO Massage
		} else if (chk==13) {
			document.location = '/en/about/history.asp'; // History
		} else if (chk==14) {
			document.location = '/en/about/vision.asp'; // Vision
		} else if (chk==15) {
			document.location = '/en/about/cibi.asp'; // CI & BI
		}


// 2. Business Field		
		if (chk==21) {
			document.location = '/en/field/food.asp'; // Food distribution
		} else if (chk==211) {
			document.location = '/en/field/food_01.asp'; // product information
		} else if (chk==22) {
			document.location = '/en/field/service.asp'; // Contract meal service
		} else if (chk==23) {
			document.location = '/en/field/foodcourt.asp'; // Food court & Concession
		} else if (chk==24) {
			document.location = '/en/field/raw.asp'; // Raw food material processing
		} else if (chk==25) {
			document.location = '/en/field/engineering.asp'; // Engineering
		}



// 3. Business Infra
		else if (chk==31){
			document.location = '/en/infra/system.asp'; // Sanitation & Safety System
		} else if (chk==32){
			document.location = '/en/infra/infra.asp'; // Distribution Infrastructure
		}  else if (chk==33){
			document.location = '/en/infra/info.asp'; // Information system
		}  else if (chk==34){
			document.location = '/en/infra/facility.asp';  // Facility system
		}  else if (chk==35){
			document.location = '/en/infra/service.asp'; // Academy of Service
		}  else if (chk==36){
			document.location = '/en/infra/edu.asp'; // Academy of Cuisine education
		}


// 4. Investors
		else if (chk==41) {
			document.location = '/en/investors/ir.asp'; // Company Overview for IR
		} else if (chk==42) {
			document.location = '/en/investors/ip.asp'; // Investment Points
		} else if (chk==43) {
			document.location = '/en/investors/industry.asp'; // Industry Trend
		} else if (chk==44) {
			document.location = '/en/investors/management.asp'; // Management strategy
		} 
}	


// »ó´Ü °øÅë¸Þ´º (sitemap ... )
function util(chk)
{
		if (chk==1) {
			document.location = '/en/sitemap/sitemap.asp'; // Sitemap
		} else if (chk==2) {
			document.location = '/index.asp'; // korean
		}
}





/*-----------------------------------------------------------------------------------------
|                   ::::::::    Indicator Link Script  END     :::::::::                   |
----------------------------------------------------------------------------------------- */
