			var navColor = "ffffff";
			
			// set default values
			var tzPref = "EST";
			var tzCookie = "CNtimezonepref";
			
			// get today's date and make a JS date object
			var dateString = monthName + " " + tdate + ", " + tyear;
			var todaysDate = new Date(dateString);
			
			// check for a timezone preference cookie
			if (document.cookie.lastIndexOf(tzCookie) > -1) {
				tzPref = readCookie(tzCookie);
			}
			// offset the server time (Easter) by the correct number of hours
			// for the preferred timezone; also hand daylight savings
			if (tzPref == "HST") {
				if (serverTime.indexOf('EDT') > -1) {
					timeOffset = -5;
				} else {
					timeOffset = -6;
				}
			} else if (tzPref == "PST") {
				timeOffset = -3;
			} else if (tzPref == "MST") {
				timeOffset = -2;
			} else if (tzPref == "CST") {
				timeOffset = -1;
			} else {
				timeOffset = 0;
			}

			// make a date string that matches the data service's expectations
			var offsetHour = parseFloat(clockSplit[0]) + timeOffset;
			if (offsetHour < 10) {
				offsetHour = "0" + offsetHour;
			}
			if (parseInt(clockSplit[1]) >= 30) {
				clockMinutes = "30";
			} else {
				clockMinutes = "00";
			}

			// get the initial data set
			var initXMLURL = "/cnschedule/xmlServices/" + tdate + "." + tzPref+ ".xml";
			var initXpath = "allshows/show[@military >= '" + offsetHour + ":" + clockMinutes + "']"

			// determine and populate dates for the next 6 days
			var dayMScds = todaysDate.valueOf();							// get today in milliseconds
			var dayLimit = todaysDate.getDay();								// get today's date
			var allDays = new Array ();										// create an array to hold all the displayed days
			allDays[1] = todaysDate;										// insert values for today into the array at position 1 (position 0 is empty after rebuildy)
			for (i = 2; i < 8; i++) {										// insert valuse for the next 6 days into the array
				var nextDay = dayMScds + (86400000 * (i -1));						// next day is today in ms plus 1 day of ms multiplied by the counter
				allDays[i] = new Date(nextDay);
			}

			// determine what the column header weekdays should be and return them
			// as a string
			function returnWeekdayText (positionNum) {
				var weekDay = allDays[positionNum].getDay();
				if (weekDay == 0) retDay = "Sunday";
				if (weekDay == 1) retDay = "Monday";
				if (weekDay == 2) retDay = "Tuesday";
				if (weekDay == 3) retDay = "Wednesday";
				if (weekDay == 4) retDay = "Thursday";
				if (weekDay == 5) retDay = "Friday";
				if (weekDay == 6) retDay = "Saturday";
				return retDay;
			}
			// determine what the column header dates should be and return them
			// as a string
			function returnDateText (positionNum) {
				var dateString = allDays[positionNum].getMonth();
				if (dateString == 0) retMonth = "January";
				if (dateString == 1) retMonth = "February";
				if (dateString == 2) retMonth = "March";
				if (dateString == 3) retMonth = "April";
				if (dateString == 4) retMonth = "May";
				if (dateString == 5) retMonth = "June";
				if (dateString == 6) retMonth = "July";
				if (dateString == 7) retMonth = "August";
				if (dateString == 8) retMonth = "September";
				if (dateString == 9) retMonth = "October";
				if (dateString == 10) retMonth = "November";
				if (dateString == 11) retMonth = "December";
				retDay = allDays[positionNum].getDate();
				return retMonth + " " + retDay;
			}

			// reset and reload the xpath and source url for the data based 
			// on the selected column
			var currentPosition = todaysDate.getDay();
			function setNewDataURL (positionNum) {
				if (todaysDate.getDate() == allDays[positionNum].getDate()) {
					scheduleSet.setURL("/cnschedule/xmlServices/" + tdate + "." + tzPref + ".xml");
					scheduleSet.setXPath(initXpath);
				} else {
					newXPath = "allshows/show[@military >= '06:00']";
					scheduleSet.setURL("/cnschedule/xmlServices/" + allDays[positionNum].getDate() + "." + tzPref + ".xml");
					scheduleSet.setXPath("allshows/show[@military >= '06:00']");
				}
				swimBlockSet = false;
				currentPosition = positionNum;
				scheduleSet.loadData();
				setDayHighlight(positionNum);
			}

			// highlight the selected column
			var currentHighlightDay = "day1";
			function setDayHighlight (targetDay) {
				var targetDayBtn = "day" + targetDay;
				document.getElementById(currentHighlightDay).className = "dayWrapper";
				document.getElementById(targetDayBtn).className = "dayWrapperOn";
				currentHighlightDay = targetDayBtn;
			}

			// determine which ratings graphic to use
			function getRatingGfx (region, lookupFunc) {
				ratingString = unescape(lookupFunc("{@rating}"));
				if ((ratingString == "") || (ratingString == " ") || (ratingString == "  ")) {
					return "pixel";
				} else {
					return lookupFunc("{@rating}");
				}
			}

			// do a simple replacement on the meridian to match the desired format
			function replaceMeridian (region, lookupFunc) {
				var mString = lookupFunc("{@time}");
				mString = mString.replace(/\sa.m./gi, "a");
				mString = mString.replace(/\sAM/gi, "a");
				mString = mString.replace(/\sp.m./gi, "p");
				mString = mString.replace(/\sPM/gi, "p");
				return mString;
			}

			// do a simple replacement on the escaped apostrophes to match the desired format
			function replaceApostrophe (region, lookupFunc) {
				var rString = lookupFunc("{@title}");
				rString = rString.replace(/'/gi, "%39");
				return rString;
			}

			// open and display all showsing for a specific show
			var activeRevealID = "";
			var activeRevealImg = "";
			function revealAllShowings (targetID,targetImg,targetShow,targetShowID) {
				targetShow = targetShow.replace(/%39/gi, "'");
				var showXpath = "/cnschedule/xmlServices/ScheduleServices?methodName=getAllShowings&showId=" + targetShowID + "&title=" + targetShow + "&name=" + targetShow + "&timezone=EST"
				singleShowSet.setURL(showXpath);
				singleShowSet.loadData();
				if ((activeRevealID != "") && (targetID != activeRevealID)) {
					document.getElementById(activeRevealID).className = "showRevealWrapperOff";
					document.getElementById(activeRevealImg).src = "/tools/img/schedule/arrowDown.png";
					document.getElementById(targetID).className = "showRevealWrapperOn";
					document.getElementById(targetImg).src = "/tools/img/schedule/arrowUp.png";
					activeRevealID = targetID;
					activeRevealImg = targetImg;
				} else if (targetID == activeRevealID) {
					document.getElementById(targetID).className = "showRevealWrapperOff";
					document.getElementById(targetImg).src = "/tools/img/schedule/arrowDown.png";
					activeRevealID = "";
					activeRevealImg = "";
				} else {
					document.getElementById(targetID).className = "showRevealWrapperOn";
					document.getElementById(targetImg).src = "/tools/img/schedule/arrowUp.png";
					activeRevealID = targetID;
					activeRevealImg = targetImg;
				}
				;
			}

			// spry region observer that determines if the hidden region's data has fully loaded
			// and rendered before rewriting the inner HTML set of the visible dive
			var showXMLObs = {
				onPostUpdate:function (notifier,data) {
					if (activeRevealID != "") {
						document.getElementById(activeRevealID).innerHTML = document.getElementById('singleShowLoader').innerHTML
					}
				}
			}

			// find, mark, and display the adult swim block
			var swimBlockSet = false;
			function useBlockTab (region, lookupFunc) {
				var rowNumber = parseInt(lookupFunc('{ds_RowNumber}'));
				var imgStr;
				if ((rowNumber == 0) && (todaysDate.getDate() == allDays[currentPosition].getDate())) {
					imgStr = '<img src="/tools/img/schedule/tab_on.png" width="71" height="25" alt="" border="0">';
				} else if (rowNumber > 0) {
					if ((lookupFunc('{@blockName}') == "AdultSwim") && (swimBlockSet == false)) {
						imgStr = '<img src="/tools/img/schedule/tab_as.png" width="71" height="25" alt="" border="0">';
						swimBlockSet = true;
					}
				} else {
					imgStr = '<img src="http://i.cdn.turner.com/toon/tools/img/pixel.gif" width="71" height="25" alt="" border="0">';
				}
				return imgStr;
			}

			// handler for selecting a new time zone
			function changeTimeZone (targetZone) {
				var tzDivs = new Array ('m_EST','m_CST','m_MST','m_PST','m_HST');
				var targetDiv = "m_" + targetZone;
				for (i = 0; i < tzDivs.length; i++) {
					if (tzDivs[i] == targetDiv) {
						document.getElementById(tzDivs[i]).style.display = "block";
					} else {
						document.getElementById(tzDivs[i]).style.display = "none";
					}
				}
				if (targetZone != tzPref) {										//if the selected timezone is different from the cookied pref, reset the cookie
					tzPref = targetZone;
					setNewDataURL (currentPosition);
					setCookie(tzCookie, tzPref, 86400, 'cartoonnetwork.com');
					location.reload();
				}
			}

			// truncate really long episode names in the daily schedule;
			// using this instead of CSS because current FF does not recognize the CSS
			function shortEpisodes (region, lookupFunc) {
				var epiString = lookupFunc("{@episodeName}");
				if (epiString.length > 90) {
					epiString = epiString.substring(0,87) + "...";
				}
				return epiString;
			}

			// truncate really long episode names in the show specific schedule;
			// using this instead of CSS because current FF does not recognize the CSS;
			// duplicated effort because data sets use different attribute names
			// for the same data
			function shorterEpisodes (region, lookupFunc) {
				var epiString = lookupFunc("{@episode}");
				if (epiString.length > 90) {
					epiString = epiString.substring(0,87) + "...";
				}
				return epiString;
			}
