function chgLinkStyle(style1,style2){
	var nowPage = location.pathname;
	if(nowPage.indexOf("/",0) == 0){ 
		nowPage = nowPage.substr(1,nowPage.length);
	}
	if(nowPage.indexOf("/",nowPage.length-1) == nowPage.length-1){ 
		nowPage = nowPage.slice(0,-1);
	}
	var aryNowPage = nowPage.split("/");
	
	if(aryNowPage[aryNowPage.length-1] == directoryIndex){
		aryNowPage.pop();
	}
	nowPage = aryNowPage.join("/");
		
	for ( i = 0; i < linkIdList.length; i++ ) {
		var target = document.getElementById(linkIdList[i]);
		var targetFile = target.pathname;
		if(targetFile.indexOf("/",0) == 0){ 
			targetFile = targetFile.substr(1,targetFile.length);
		}
		if(targetFile.indexOf("/",targetFile.length-1) == targetFile.length-1){ 
			targetFile = targetFile.slice(0,-1);
		}
		var aryFilepath = targetFile.split("/");
		if(aryFilepath[aryFilepath.length-1] == directoryIndex){
			aryFilepath.pop();
		}

		targetFile = aryFilepath.join("/");
		
		if(nowPage == targetFile){
			target.className = style1;
		} else {
			target.className = style2;
		}
	}
}

function debug_write(){
	document.write( '<br />');
	var nowPage = location.pathname;
	if(nowPage.indexOf("/",0) == 0){ 
		nowPage = nowPage.substr(1,nowPage.length);
	}
	if(nowPage.indexOf("/",nowPage.length-1) == nowPage.length-1){ 
		nowPage = nowPage.slice(0,-1);
	}
	var aryNowPage = nowPage.split("/");
	
	if(aryNowPage[aryNowPage.length-1] == directoryIndex){
		aryNowPage.pop();
	}
	nowPage = aryNowPage.join("/");
	document.write('nowPage = '+nowPage);
	document.write( '<br />');
	
	for ( i = 0; i < linkIdList.length; i++ ) {
		var target = document.getElementById(linkIdList[i]);
		var targetFile = target.pathname;
		if(targetFile.indexOf("/",0) == 0){ 
			targetFile = targetFile.substr(1,target.pathname.length);
		}
		if(targetFile.indexOf("/",target.pathname.length-1) == targetFile.length-1){ 
			targetFile = targetFile.slice(0,-1);
		}
		var aryFilepath = targetFile.split("/");
		for ( j = 0; j < aryFilepath.length; j++ ) {
			document.write(j + " = " +aryFilepath[j] + "<br>")
		}
		if(aryFilepath[aryFilepath.length-1] == directoryIndex){
			aryFilepath.pop();
		}
		for ( j = 0; j < aryFilepath.length; j++ ) {
			document.write(j + " = " +aryFilepath[j] + "<br>")
		}
		targetFile = aryFilepath.join("/");
		
		document.write('targetFile = '+targetFile);
		document.write( '<br />');
	}

}

