

function go_bc() {
	var countdown = 0;
	var toyearsold = 0;
	arr_birthday = bc_config_birthday.split("-")
	var birthday = new Date(
		arr_birthday[0],
		arr_birthday[1]-1,
		arr_birthday[2],
		0,0,0,0);
	var today = new Date();
	today.setHours(0);
	today.setMinutes(0);
	today.setSeconds(0);
	today.setMilliseconds(0);
	var thisyear = today.getFullYear()
	toyearsold = thisyear - birthday.getFullYear();
/*
	document.write(birthday);
	document.write("<br />");
	document.write(today);
*/
	//今年生日(target_day)是否已經過了。若生日已經過了， 下一個年紀等於『今年』- 『生日年』＋ 1。
	var target_day = new Date(
		thisyear,
		arr_birthday[1]-1,
		arr_birthday[2],
		0,0,0,0);
	var delta = target_day.getTime() - today.getTime();
	if (delta < 0) { //生日已過
		target_day.setYear(thisyear+1);
		delta = target_day.getTime() - today.getTime();
		toyearsold = toyearsold + 1
	} //eles  //生日當天

	countdown = delta / 86400000;
	write_data(toyearsold, countdown);
/*
	document.write("<br />");
	document.write(toyearsold);
	document.write("<br />");
	document.write(delta);
	document.write("<br />");
	document.write(countdown);
*/
}


function write_data(toyearsold, countdown) {
	if (countdown) {
		try{
		document.getElementById('bc_toyearsold').innerHTML = toyearsold;
		} catch(err) {}
		document.getElementById('bc_countdown').innerHTML = countdown;

	} else {
		document.getElementById('bc_otherday').style.display = 'none';
		document.getElementById('bc_today').style.display = 'block';
	}

}
