window.onload = function() {
	
	// isolating the rightside id holding the list items
	var entries = getElementsByClass('entry');
	
	// determining the collection length
	var totalEntries = entries.length;
	
	// adding a class to every other list item to alter its color
	for (var i=1; i<totalEntries; i = i + 2) {
		entries[i].className += ' odd';
	}
}
	
		
function getElementsByClass(searchClass,node,tag) {

    // this array will hold the nodes that have the desired class
    var classElements = [];

    // if we did not pass the node parameter, assume document
    if (node == null) {node = document;}

    // if we did not pass the tag parameter, grab every node
    if (tag == null) {tag = '*';}

    // gather all the element nodes to look through; by default is everything in document
    var els = node.getElementsByTagName(tag);

    // to improve loop performance, determine the length ahead of time
    var elsLen = els.length;

    // establish the pattern to search for within className
    var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)");

    // look through all the class properties to see if there is a match
    // the j variable is the counter variable that increments each time a
    // match is found and becomes the next item in classElements
    for (var i = 0, j = 0; i < elsLen; i++) {
        if (pattern.test(els[i].className)) {
           classElements[j] = els[i];
           j++;
        }
    }

    // send back the array of elements to whatever variable called this function
    return classElements;

}