/*2010/02/18 KKato

/*ブラウザ判別(onload前の処理)
------------------------------------------------------------------------------------*/
window.onBeforeUnload = onLoadSet();

function onLoadSet()
{
	if(flg_browser == 'ie')	window.attachEvent('onload',sideMenuSet);
	else	window.addEventListener('load',sideMenuSet,false);
}


/*サイドメニューのカレント表示処理
------------------------------------------------------------------------------------*/
function sideMenuSet()
{
	var url = urlSearch();
	var html = htmlSet();
	var cutF;
	var cutE;
		
	while(html.indexOf(url) != -1)
	{
		cutF = html.substring(0 , html.indexOf(url) - 5);
		cutE = html.substring(html.indexOf(url) + url.length);
		html = cutF + 'class="sideCurrent" href=""' + cutE;
	}
	
	document.getElementById('sideBOX').innerHTML = html;
}


/*URL取得
------------------------------------------------------------------------------------*/
function urlSearch()
{
	var pass;
	pass = '"' + location.href.substring(location.href.lastIndexOf('/') + 1) + '"';
	
	if(pass == '""')
	{
		pass = location.href.substring(0 , location.href.length - 1);
		pass = '"/' + pass.substring(pass.lastIndexOf('/') + 1) + '/"';
	}
	
	return pass;
}


/*サイドメニューのhtml取得
------------------------------------------------------------------------------------*/
function htmlSet()
{
	return document.getElementById('sideBOX').innerHTML;
}