function describe(x) {
	var firstCell = x.parentNode.parentNode.childNodes[0];
	var secondCell = x.parentNode.parentNode.childNodes[1];
	if (!x.parentNode.parentNode.childNodes[0].className) {
		firstCell = x.parentNode.parentNode.childNodes[1];
		secondCell = x.parentNode.parentNode.childNodes[3];
	}
	var description;
	for (i = 0; i < x.parentNode.childNodes.length; i++) {
		if (x.parentNode.childNodes[i].className == "sessiondescription") {
			description = x.parentNode.childNodes[i];
			break;
		}
	}
	if (description.style.display == 'block') {
		description.style.display = 'none';
		x.parentNode.parentNode.style.backgroundColor = "#fff";
		firstCell.className = 'start';
		secondCell.className = 'end';

	} else {
		description.style.display = 'block';
		x.parentNode.parentNode.style.backgroundColor = "#f9f9f9";
		categoryColor = description.childNodes[description.childNodes.length - 1].className;
		firstCell.className = categoryColor;
		firstCell.style.color = '#000';
		secondCell.className = categoryColor;
		secondCell.style.color = '#000';
	}
}

function highlightToday() {
	var re = /http:\/\/.*\.apple\.com/gi;
	myPath = location.href.replace(re,'');

	var today = new Date();
	var year = new String(today.getFullYear());
	var month = today.getMonth();
	if (++month < 10) {
		month = '0' + month.toString();
	}
	var day = today.getDate();
	if (day < 10) {
		day = '0' + day.toString();
	}
	var idName = new String('a' + year + month + day);
	
	var thisweek = new Date();
	if (thisweek.getDay() > 0) {
		thisweek.setDate(thisweek.getDate() - thisweek.getDay());
	}
	var checkyear = new String(thisweek.getFullYear());
	var checkmonth = thisweek.getMonth();
	if (++checkmonth < 10) {
		checkmonth = '0' + checkmonth.toString();
	}
	var checkday = thisweek.getDate();
	if (checkday < 10) {
		checkday = '0' + checkday.toString();
	}
	re = /index\.html/gi;
	myPath = myPath.replace(re, '');

	var filename=myPath.split("/");
	for(i=0;i<filename.length;i++) {
		file=filename[i];
	}

	myPath = myPath.replace (file, '');

	if (myPath.indexOf('month') != -1) {
		var thisMonth = new Date();
		var checkmonth =  thisMonth.getMonth();
		if (++month < 10) {
			checkmonth = '0' + month.toString();
		}
		myPath += checkyear + checkmonth + '.html';
	} else if (myPath.indexOf('week') != -1) {
		myPath += checkyear + checkmonth + checkday + '.html';
	} else {
		myPath += 'week/' + checkyear + checkmonth + checkday + '.html';
	}
	
	var nowPath = location.href;
	var re = /http:\/\/.*\.apple\.com/gi;
	nowPath = nowPath.replace(re,'');
	
	if (myPath == nowPath) {
		document.getElementById(idName).getElementsByTagName("th")[0].style.backgroundColor = '#E7F4FF';
	}
}
