﻿var	today =	new	Date();
var	iMonth = today.getMonth();
var iDay = today.getDate();
var iTemp = 0;

var str = '';
str = str+'<table cellspacing="1">\n';
str = str+'	<tr>\n';
str = str+'		<th>日</th>\n';
str = str+'		<th>一</th>\n';
str = str+'		<th>二</th>\n';
str = str+'		<th>三</th>\n';
str = str+'		<th>四</th>\n';
str = str+'		<th>五</th>\n';
str = str+'		<th>六</th>\n';
str = str+'	</tr>\n';

for (i=3; i<31; i++) {
	if (iTemp%7 == 0){	str = str+'	<tr>\n';}
	iTemp = iTemp + 1;
	
	str = str+'<td';
	
	if (iMonth==7 && i==iDay){str = str+' class="current"';}
	if (i>7 && i<25) {
		str = str+'><a href="http://forums.chinatimes.com/report/Olympic2008/schedule_daily.aspx#'+i+'" onClick="canlendarClick('+i+')">'+i+'</a></td>\n';
	} else {
		str = str+'>'+i+'</td>\n';
	}
		
	if (iTemp%7 == 0){	str = str+'	</tr>\n';}
}

str = str+'</table>\n';

if(document.getElementById("calendarjs")) document.getElementById('calendarjs').innerHTML = str;


var bThisFlag = false;
if (document.location.href.indexOf("/schedule_daily.") > -1) bThisFlag = true;

function canlendarClick(thisI) {

	window.location="http://forums.chinatimes.com/report/Olympic2008/schedule_daily.aspx#"+thisI+"";
	if (bThisFlag == true) {window.location.reload();}
}