/**********************************************************************
JBIS : [ menu.js ]

09.03.10
***********************************************************************
a variable : gMn_xxx
a function : menu_xxx
**********************************************************************/

/*---------------------------------------------
 Path
---------------------------------------------*/
var gMn_strImgPath = gCm_strRootPath + 'service/img/';       // common.js
var gMn_strLinkPath = gCm_strRootPath + 'service/';
var gImg_strEnd = '_on';


/*=============================================
 current
=============================================*/

var gdirName = {
	'index'				: 'mn_01',
	'cosulting'			: 'mn_02',
	'itmanegement'		: 'mn_03',
	'bpo'				: 'mn_04',
	'knowledge'			: 'mn_05'	
}

var gfileName = {
	'sigma21'			: 'mn_03_01',
	'e_sigma_m_sigmal'	: 'mn_03_02',
	'bps'				: 'mn_03_03',
	'riskout'			: 'mn_03_04',
	'jcubic'			: 'mn_03_05',
	'bits_sigma'		: 'mn_03_06',
	'plan'				: 'mn_04_01',
	'suport'			: 'mn_04_02',
	'concentration'		: 'mn_04_03',
	'send'				: 'mn_04_04',
	'succession'		: 'mn_04_05',
	'training'			: 'mn_05_01'
}

function get_filename() {
	var strUrl  = location.href;
	var strFile = strUrl.substring(strUrl.lastIndexOf('/') + 1, strUrl.length);
	var strName = strFile.split('.')[0];

	return strName;
}

function get_dirname() {
	var strRoot = gCm_strRootPath;
	var strUrl  = location.href;
	var strPath = strUrl.substring(strUrl.indexOf(strRoot) + strRoot.length + 1 , strUrl.length);
	var strDir  = strPath.split('/')[1];

	if(strDir == '' || strDir == 'index.html'){
		strDir = 'index';
	}
	return strDir;
}

function get_current(){
	var strDir = gMn_strImgPath;
	var strdirName = get_dirname();
	var strfileName = get_filename();
	
	if(gdirName[strdirName]){
		document.images[gdirName[strdirName]].src = strDir + gdirName[strdirName] +'_on.gif';
	}
	if(gfileName[strfileName]){
		document.images[gdirName[strdirName]].src = strDir + gdirName[strdirName] +'.gif';
		document.images[gfileName[strfileName]].src = strDir + gfileName[strfileName] +'_on.gif';
	}
	
	if(gdirName[strdirName] == "mn_03"){
		document.getElementById("Sub01").style.display = 'block';
		document.getElementById("Sub02").style.display = 'none';
		document.getElementById("Sub03").style.display = 'none';
	}else if(gdirName[strdirName] == "mn_04"){
		document.getElementById("Sub01").style.display = 'none';
		document.getElementById("Sub02").style.display = 'block';
		document.getElementById("Sub03").style.display = 'none';
	}else if(gdirName[strdirName] == "mn_05"){
		document.getElementById("Sub01").style.display = 'none';
		document.getElementById("Sub02").style.display = 'none';
		document.getElementById("Sub03").style.display = 'block';
	}
	
}

/*---------------------------------------------
 Loading
---------------------------------------------*/
image_load(
	'/mn_01.gif','/mn_01_on.gif',
	'/mn_02.gif','/mn_02_on.gif',
	'/mn_03.gif','/mn_03_on.gif',
	'/mn_04.gif','/mn_04_on.gif',
	'/mn_05.gif','/mn_05_on.gif',
	
	'/mn_03_01.gif','/mn_03_01_on.gif',
	'/mn_03_02.gif','/mn_03_02_on.gif',
	'/mn_03_03.gif','/mn_03_03_on.gif',
	'/mn_03_04.gif','/mn_03_04_on.gif',
	'/mn_03_05.gif','/mn_03_05_on.gif',
	'/mn_03_06.gif','/mn_03_06_on.gif',
	
	'/mn_04_01.gif','/mn_04_01_on.gif',
	'/mn_04_02.gif','/mn_04_02_on.gif',
	'/mn_04_03.gif','/mn_04_03_on.gif',
	'/mn_04_04.gif','/mn_04_04_on.gif',
	'/mn_04_05.gif','/mn_04_05_on.gif',
	
	'/mn_05_01.gif','/mn_05_01_on.gif',
	
	'/btn_detail.gif','/btn_detail_on.gif'
);

/*=============================================
 image_load()
=============================================*/
function image_load() {
	var strDir  = gMn_strImgPath;
	var aobjImg = new Array();
	var i;
	for (i = 0; i < image_load.arguments.length; i ++) {
		aobjImg[i] = new Image();
		aobjImg[i].src = strDir + image_load.arguments[i];
		document.write('<img src="' + aobjImg[i].src + '" style="display:none;">');
	}
}

/*=============================================
 image_over()
=============================================*/
function image_over(vstrName) {
	var strDir = gMn_strImgPath;
	var strEnd = gImg_strEnd;
	if (document.images[vstrName]) {
		var strdirName = get_dirname();
		var strfileName = get_filename();
		
		if( gdirName[strdirName] == vstrName && gfileName[strfileName] == undefined){return;}
		if( gfileName[strfileName] == vstrName){return;}
		
		var objImg = document.images[vstrName];	
		var strExt = objImg.src.substring(objImg.src.lastIndexOf('.'), objImg.src.length);
		objImg.src = strDir + vstrName + strEnd + strExt;
	}
}

/*=============================================
 image_out()
=============================================*/
function image_out(vstrName) {
	var strDir = gMn_strImgPath;
	if (document.images[vstrName]) {
		var strdirName = get_dirname();
		var strfileName = get_filename();
		
		if( gdirName[strdirName] == vstrName && gfileName[strfileName] == undefined){return;}
		if( gfileName[strfileName] == vstrName){return;}
		
		var objImg = document.images[vstrName];
		var strExt = objImg.src.substring(objImg.src.lastIndexOf('.'), objImg.src.length);
		objImg.src = strDir + vstrName + strExt;
	}
}

/*=============================================
 detail_over()
=============================================*/
function detail_over(vstrName) {
	var strDir = gMn_strImgPath;
	var strEnd = gImg_strEnd;
	if (document.images[vstrName]) {		
		var objImg = document.images[vstrName];	
		var strExt = objImg.src.substring(objImg.src.lastIndexOf('.'), objImg.src.length);
		objImg.src = strDir + 'btn_detail' + strEnd + strExt;
	}
}

/*=============================================
 image_out()
=============================================*/
function detail_out(vstrName) {
	var strDir = gMn_strImgPath;
	if (document.images[vstrName]) {		
		var objImg = document.images[vstrName];
		var strExt = objImg.src.substring(objImg.src.lastIndexOf('.'), objImg.src.length);
		objImg.src = strDir + 'btn_detail' + strExt;
	}
}

//---------------------------------------------
// Document Write
//---------------------------------------------

function menuWrite(){
	with( document ){
		write('<div id="MenuArea">');
		write('<div><img src="' + gCm_strImgPath + '/mn_title.gif" width="140" height="11" alt="MENU" /></div>');
		write('<ul>');
		write('<li><a href="' + gMn_strLinkPath + 'index.html" onmouseover="image_over(\'mn_01\');" onmouseout="image_out(\'mn_01\');"><img name="mn_01" src="' + gMn_strImgPath + 'mn_01.gif" width="140" height="40" alt="サービス" /></a></li>');
		
		write('<li>');
		write('<p><a href="' + gMn_strLinkPath + 'itmanegement/index.html" onmouseover="image_over(\'mn_03\');" onmouseout="image_out(\'mn_03\');"><img name="mn_03" src="' + gMn_strImgPath + 'mn_03.gif" width="140" height="55" alt="ITマネジネントサービス" /></a></p>');
		write('<ul class="sub" id="Sub01">');
		write('<li><a href="' + gMn_strLinkPath + 'itmanegement/sigma21.html" onmouseover="image_over(\'mn_03_01\');" onmouseout="image_out(\'mn_03_01\');"><img name="mn_03_01" src="' + gMn_strImgPath + 'mn_03_01.gif" width="140" height="29" alt="・SIGMA21-X 証券総合システム" /></a></li>');
		write('<li><a href="' + gMn_strLinkPath + 'itmanegement/e_sigma_m_sigmal.html" onmouseover="image_over(\'mn_03_02\');" onmouseout="image_out(\'mn_03_02\');"><img name="mn_03_02" src="' + gMn_strImgPath + 'mn_03_02.gif" width="140" height="53" alt="・e-SIGMA21/m-SIGMA21 インターネット・モバイル取引システム" /></a></li>');
		write('<li><a href="' + gMn_strLinkPath + 'itmanegement/bits_sigma.html" onmouseover="image_over(\'mn_03_06\');" onmouseout="image_out(\'mn_03_06\');"><img name="mn_03_06" src="' + gMn_strImgPath + 'mn_03_06.gif" width="140" height="35" alt="・投信窓販取引システム Bits SIGMA" /></a></li>');
		write('<li><a href="' + gMn_strLinkPath + 'itmanegement/riskout.html" onmouseover="image_over(\'mn_03_04\');" onmouseout="image_out(\'mn_03_04\');"><img name="mn_03_04" src="' + gMn_strImgPath + 'mn_03_04.gif" width="140" height="41" alt="・RiskOut 不公正取引監視システム" /></a></li>');
		write('<li><a href="' + gMn_strLinkPath + 'itmanegement/jcubic.html" onmouseover="image_over(\'mn_03_05\');" onmouseout="image_out(\'mn_03_05\');"><img name="mn_03_05" src="' + gMn_strImgPath + 'mn_03_05.gif" width="140" height="41" alt="・営業員支援システム/Jcubic（ジェイキュービック）" /></a></li>');
		write('<li class="list-end><a href="' + gMn_strLinkPath + 'itmanegement/bps.html" onmouseover="image_over(\'mn_03_03\');" onmouseout="image_out(\'mn_03_03\');"><img name="mn_03_03" src="' + gMn_strImgPath + 'mn_03_03.gif" width="140" height="29" alt="・BPSビジネスサービス" /></a></li>');
		write('</ul>');
		write('</li>');
		
		write('<li>');
		write('<p><a href="' + gMn_strLinkPath + 'bpo/index.html" onmouseover="image_over(\'mn_04\');" onmouseout="image_out(\'mn_04\');"><img name="mn_04" src="' + gMn_strImgPath + 'mn_04.gif" width="140" height="40" alt="BPOサービス" /></a></p>');
		write('<ul class="sub" id="Sub02">');
		write('<li><a href="' + gMn_strLinkPath + 'bpo/plan.html" onmouseover="image_over(\'mn_04_01\');" onmouseout="image_out(\'mn_04_01\');"><img name="mn_04_01" src="' + gMn_strImgPath + 'mn_04_01.gif" width="140" height="29" alt="・企画管理" /></a></li>');
		write('<li><a href="' + gMn_strLinkPath + 'bpo/suport.html" onmouseover="image_over(\'mn_04_02\');" onmouseout="image_out(\'mn_04_02\');"><img name="mn_04_02" src="' + gMn_strImgPath + 'mn_04_02.gif" width="140" height="29" alt="・事務サポート" /></a></li>');
		write('<li><a href="' + gMn_strLinkPath + 'bpo/concentration.html" onmouseover="image_over(\'mn_04_03\');" onmouseout="image_out(\'mn_04_03\');"><img name="mn_04_03" src="' + gMn_strImgPath + 'mn_04_03.gif" width="140" height="29" alt="・事務集中" /></a></li>');
		write('<li><a href="' + gMn_strLinkPath + 'bpo/send.html" onmouseover="image_over(\'mn_04_04\');" onmouseout="image_out(\'mn_04_04\');"><img name="mn_04_04" src="' + gMn_strImgPath + 'mn_04_04.gif" width="140" height="29" alt="・発送" /></a></li>');
		write('<li><a href="' + gMn_strLinkPath + 'bpo/succession.html" onmouseover="image_over(\'mn_04_05\');" onmouseout="image_out(\'mn_04_05\');"><img name="mn_04_05" src="' + gMn_strImgPath + 'mn_04_05.gif" width="140" height="29" alt="・相続事務サービス" /></a></li>');
		//write('<li><a href="' + gMn_strLinkPath + 'itmanegement/silver.html" onmouseover="image_over(\'mn_04_05\');" onmouseout="image_out(\'mn_04_05\');"><img name="mn_04_05" src="' + gMn_strImgPath + 'mn_04_05.gif" width="140" height="41" alt="銀証連携ソリューション" /></a></li>');
		write('</ul>');
		write('</li>');
		
		write('<li><a href="' + gMn_strLinkPath + 'cosulting/index.html" onmouseover="image_over(\'mn_02\');" onmouseout="image_out(\'mn_02\');"><img name="mn_02" src="' + gMn_strImgPath + 'mn_02.gif" width="140" height="55" alt="コンサルティングサービス" /></a></li>');		
				
		write('<li class="list-end">');
		write('<p><a href="' + gMn_strLinkPath + 'knowledge/index.html" onmouseover="image_over(\'mn_05\');" onmouseout="image_out(\'mn_05\');"><img name="mn_05" src="' + gMn_strImgPath + 'mn_05.gif" width="140" height="39" alt="ナレッジサービス" /></a></p>');

		write('<ul class="sub" id="Sub03">');
		write('<li><a href="' + gMn_strLinkPath + 'knowledge/training.html" onmouseover="image_over(\'mn_05_01\');" onmouseout="image_out(\'mn_05_01\');"><img name="mn_05_01" src="' + gMn_strImgPath + 'mn_05_01.gif" width="140" height="39" alt="・新人社員向け 証券業務研修サービス " /></a></li>');
		write('</ul>');

		write('</li>');
		
		write('</ul>');
		write('</div>');
	}
	get_current();
}

/*********************************************************************/

