function countdown() {
	var today;
	var theYear,theMonth,theDate,theDay,theHour,theMinute,theSecond;
	var daysTillFriday,nextFriday;
	var timeToGo,daysToGo,hoursToGo,minutesToGo,secondsToGo;
	var theCountdown;
	
	today = new Date();
	
	theYear = today.getFullYear();
	theMonth = today.getMonth();
	theDate = today.getDate();
	theDay = today.getDay();
	theHour = today.getHours();
	theMinute = today.getMinutes();
	theSecond = today.getSeconds();
	
	
	daysTillFriday = 5 - theDay;
	if(theDay > 5)
		daysTillFriday = Math.abs(daysTillFriday) + 5;
		
	nextFriday = theDate + daysTillFriday;
	nextFriday = new Date(theYear,theMonth,nextFriday,0,0,0);

	timeToGo = Date.parse(nextFriday) - Date.parse(today);

	daysToGo = Math.floor(timeToGo/86400000);
		timeToGo = timeToGo - (daysToGo*86400000);
	hoursToGo = Math.floor(timeToGo/3600000);
		timeToGo = timeToGo - (hoursToGo*3600000);
	minutesToGo = Math.floor(timeToGo/60000);
		timeToGo = timeToGo - (minutesToGo*60000);
	secondsToGo = Math.floor(timeToGo/1000);
	
	if(hoursToGo < 10)
		hoursToGo = '0' + hoursToGo;
	if(minutesToGo < 10)
		minutesToGo = '0' + minutesToGo;
	if(secondsToGo < 10)
		secondsToGo = '0' + secondsToGo;
	
	theCountdown = daysToGo + ' ' + hoursToGo + ' ' + minutesToGo + ' ' + secondsToGo;
	
	document.getElementById('countdown').innerHTML = '0' + theCountdown;
	setTimeout('countdown()',1000);
}

function phrase() {
	var phrases;
	var phrasesCount;
	var random;
	var thePhrase;
	
	phrases = new Array();
	
	phrases.push("Hang in there...");
	phrases.push("You've almost made it...");
	phrases.push("Keep on chugging...");
	phrases.push("Don't give up...");
	phrases.push("You can do it...");
	phrases.push("You can make it...");
	phrases.push("Stay strong...");
	phrases.push("Almost there...");
	phrases.push("Coming soon...");
	phrases.push("Keep going...");
	phrases.push("It'll be here soon...");
	phrases.push("So close...");
	
	phrasesCount = phrases.length;
	random = Math.floor(Math.random()*phrasesCount);
	
	thePhrase = phrases[random];
	document.getElementById('phrase').innerHTML = thePhrase;
}

function isFriday() {
	var today;
	var theDay;
	
	today = new Date();
	theDay = today.getDay();
	
	if (theDay == 5)
		window.location="celebrate"
}
