var eventList = new Array("20100701","20090702","20090520","20090407","20090223","20081015","20080613");

var dirName = "";
var locationArray = location.toString();
locationArray = locationArray.split('/');
for(var locationArrayCnt = 0; locationArrayCnt < locationArray.length; locationArrayCnt++)
{
	if(locationArray[locationArrayCnt].substr(locationArray[locationArrayCnt].length - 5, 5) == ".html")
	{
		dirName = locationArray[locationArrayCnt - 1];
	}
}

document.write(getEventListString());

function getEventListString()
{
	var const_slash = "/";
	var rtnValue = "";

	rtnValue = rtnValue + "<ul>";
	for(var eventCnt = 0; eventCnt < eventList.length; eventCnt++)
	{
		var strCurrent = "";
		var incSlashStr = eventList[eventCnt].substr(0, 4) + const_slash + eventList[eventCnt].substr(4, 2) + const_slash + eventList[eventCnt].substr(6, 2);
		var strParam = location.search.substring(1).split('&')[0].split('=')[1];

		if(dirName == eventList[eventCnt])
		{
			strCurrent = "class='current'";
		}

		rtnValue = rtnValue + "<li><a href='../" + eventList[eventCnt] + "/index.html' title='" + incSlashStr + "' " + strCurrent + ">" + incSlashStr + "</a></li>";
	}
	rtnValue = rtnValue + "</ul>";

	return rtnValue;
}
