
function daysUntil(justify)
{

/* this basic function came from Netscapes Developers edge as a calculation to get
	the number of days until the end of the year.  I altered it get rid of the same
	year specific nature of the code.
	
		This is Netscapes original code...
		today = new Date()
		endYear = new Date("December 31, 1990") // Set day and month
		endYear.setYear(today.getYear()) // Set year to this year
		msPerDay = 24 * 60 * 60 * 1000 // Number of milliseconds per day
		daysLeft = (endYear.getTime() - today.getTime()) / msPerDay
		daysLeft = Math.round(daysLeft)
		document.write("Number of days left in the year: " + daysLeft)
	
	 */
		
	today = new Date();
	tourneyDate = new Date("April 1, 2005"); // Set day and month
	msPerDay = 24 * 60 * 60 * 1000; // Number of milliseconds per day
	daysLeft = (tourneyDate.getTime() - today.getTime()) / msPerDay;
	daysLeft = Math.round(daysLeft) + 1;
	
	switch (justify){
			case 0 :
						if (daysLeft == 0)
						{
							document.write("<br><br><div align='center'><font face='Tahoma, Arial, Helvetica' color='blue' size = '-2'><b>The 2005 NHGA Tournament is TODAY!</b></font></div><br>");
							return(0);
						}
						
						if (daysLeft == 1)
						{
							document.write("<br><br><div align='center'><font face='Tahoma, Arial, Helvetica' color='blue' size = '-2'><b>Only " + daysLeft + " day until the<br>2005 NHGA Tournament!</b></font></div><br>");
							return(0);
						}
						
						if (daysLeft > 1)
						{
							document.write("<br><br><div align='center'><font face='Tahoma, Arial, Helvetica' color='blue' size = '-2'><b>Only " + daysLeft + " days until the<br>2005 NHGA Tournament!</b></font></div><br>");
							return(0);
						}
			
				break;
			case 1 :
						if (daysLeft == 0)
					{
						document.write("<br><font face='Tahoma, Arial, Helvetica' color='blue' size = '-2'>The 2005 NHGA Tournament is TODAY!</b></font>");
						return(0);
					}
					
					if (daysLeft == 1)
					{
						document.write("<br><font face='Tahoma, Arial, Helvetica' color='blue' size = '-2'><b>Only " + daysLeft + " day until the 2005 NHGA Tournament!</b></font>");
						return(0);
					}
					
					if (daysLeft > 1)
					{
						document.write("<br><font face='Tahoma, Arial, Helvetica' color='blue' size = '-2'><b>Only " + daysLeft + " days until the 2005 NHGA Tournament!</b></font>");
						return(0);
					}
			
				break;
		} //end of switch (justify) statement


}// end of daysUntil function
