
// isEven and isOdd checks for rowss, generically.
function isOdd(num) { return !isEven(num); }
function isEven(num) { return !(num % 2); }


// selectGame (unused) will show a comment div 
function selectGame(whichComment) {
	partA = document.getElementById('game'+whichComment+'a');
	partB= document.getElementById('game'+whichComment+'b');
	partC = document.getElementById('comment'+whichComment);
	
	if (partA.className != 'selectedGame') {
  		// partA.className = 'selectedGame';  
  		// partB.className = 'selectedGame';  
  	} 
  	else
 {
  		// partA.className = 'game';  
  		// partB.className = 'game';  
  	} 
  	
 }

// pickDay for toolbar flips
function pickDay(whichDay) {
	var dayCells = document.getElementsByTagName('td');
	for (i=0; i<dayCells.length; i++){
		if (dayCells[i].className=='active') { dayCells[i].className = ''; }
	}
	theDayCell = document.getElementById('dayCell'+whichDay);
	theDayCell.className = 'active';
	theDayCellClone = document.getElementById('dayCellClone'+whichDay);
	theDayCellClone.className = 'active';
	var dayElements = document.getElementsByTagName('div');
	for (i=0; i<dayElements.length; i++){
		if (dayElements[i].className=='dayTable') { dayElements[i].style.display = 'none'; }
	}
	theDayTable = document.getElementById('day'+whichDay);
	theDayTable.style.display = 'block';
	window.scrollTo(0,0);
	}


/* openDefaults loads the right day div, calls it "Today", etc. */
/* defaults to today unless it's 21h00 or later browser-local, in which case picks tomorrow. */
function openDefaults(theTodayDate,theHour) {
	if (theHour > 20) { pickDay(theTodayDate+1); }
	else { pickDay(theTodayDate); }
	todaysCell = document.getElementById('dayCell'+theTodayDate);
	todaysCellClone = document.getElementById('dayCellClone'+theTodayDate);
	todaysHTML = todaysCell.innerHTML;
	todaysCell.innerHTML = '<b>' + theTodayDate + '<\/b>&nbsp;' + 'Today&nbsp;&nbsp;&nbsp;';
	todaysCellClone.innerHTML = '<b>' + theTodayDate + '<\/b>&nbsp;' + 'Today&nbsp;&nbsp;&nbsp;';
	}


