var recentExName, futureExName, pastExName;
var nowExPoint;

var now = new Date();
var today = now.getFullYear() +'-'+ chech2keta(now.getMonth()+1) +'-'+ chech2keta(now.getDate());


for(var i=0; i<exDate.length; i++){
	if(exDate[i].date < today){
		nowExPoint = i;
		break;
	}
}


pastExName = exDate[nowExPoint].id;
if(nowExPoint-1 >= 0) recentExName = exDate[nowExPoint-1].id;
if(nowExPoint-2 >= 0) futureExName = exDate[nowExPoint-2].id;

//1桁を、0を追加して2桁にする
function chech2keta(no){
	if(no <= 9){
		no = '0' + no;
	}
	return no;
}

/////////////////////////////////////HTMLからコール
function getPastLink(no){		//0:index.htmlから、1:other.htmlから
	if(no == 1){
		location.href = "index.html#" + pastExName;
	}else {
		location.hash = pastExName;
	}
}

function getRecentLink(no){
	if(no == 1){
		location.href = "index.html#" + recentExName;
	}else {
		location.hash = recentExName;
	}
}

function getFutureLink(no){
	if(no == 1){
		location.href = "index.html#" + futureExName;
	}else {
		location.hash = futureExName;
	}
}

