<!--
//Javascript countdown function
//Date goes in target_date
//Text to display when done goes into target_reached_text
//call function goforit() in the page to start the counter
//text is placed in a div named countdown.
//don't forget to <script language="JavaScript" src="countdown.js" type="text/javascript"></script> on the page
//credits - somewhere on the internet, modified by Tavis

function checkleapyear(datea)
{
	datea = parseInt(datea);

	if(datea%4 == 0)
	{
		if(datea%100 != 0)
		{
		return true;
		}
		else
		{
			if(datea%400 == 0)
				return true;
			else
				return false;
		}
	}
		return false;
}
		
function countdown() {
				target_date= "July 04, 2008 08:00:00"; 
				target_reached_text="The 2008 Stampede Parade has Started";
				
				today = new Date();
				 BigDay = new Date(target_date)
				 msPerDay = 24 * 60 * 60 * 1000 ;
				 
				 if (checkleapyear(BigDay.getYear())){
				  BigDay.setDate(BigDay.getDate() + 1);		
		 
				 }
				 
				 timeLeft = (BigDay.getTime() - today.getTime());
				 
				 e_daysLeft = timeLeft / msPerDay;
				 daysLeft = Math.floor(e_daysLeft);
				 e_hrsLeft = (e_daysLeft - daysLeft)*24;
				 hrsLeft = Math.floor(e_hrsLeft);
				 e_minsLeft = (e_hrsLeft - hrsLeft)*60
				 minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
				 secsLeft = Math.floor((e_minsLeft - minsLeft)*60);

			if (daysLeft>=0){			
	
				if (daysLeft==1){
					day_text=" day, ";
				} else {
					day_text=" days, ";
				}

				if (hrsLeft==1){
					hour_text=" hour, ";
				} else {
					hour_text=" hours, ";
				}

				if (minsLeft==1){
					min_text=" minute, and ";
				} else {
					min_text=" minutes, and ";
				}

				if (secsLeft==1){
					sec_text=" second left";
				} else {
					sec_text=" seconds left";
				}
				
				//what will be displayed
				cdate =  "" + daysLeft + day_text + hrsLeft + hour_text + minsLeft + min_text + secsLeft + sec_text;

			} else {

				cdate=target_reached_text;

			}
				if (document.all){
					document.all.countdown.innerHTML=cdate;
				} else if (document.getElementById){
					document.getElementById("countdown").innerHTML=cdate;
				} else {
					document.write(cdate);
				}
				}


	if (!document.all&&!document.getElementById){
				countdown()
			}

			function goforit(){
				if (document.all||document.getElementById){
					countdown();
					setInterval("countdown()",1000);
				}
			}


// -->
