//-----------------------------------------------------------------------------
// Output the number of days until Sturgis
//-----------------------------------------------------------------------------
function daysUntilSturgis()
{
	sturgisDate = new Date( "August 08, 2011 12:00:00 AM" );
	document.write( "" + calcDaysLeft(sturgisDate) );
}

//-----------------------------------------------------------------------------
// Output the number of days until the next Laconia Bike Week
//-----------------------------------------------------------------------------
function daysLeft()
{
	lbwDate = new Date( "June 11, 2011 12:00:00 AM" );
	document.write( "" + calcDaysLeft(lbwDate) );
}

//-----------------------------------------------------------------------------
// Calculate the number of days until the event
//-----------------------------------------------------------------------------
function calcDaysLeft( nextEventDate )
{
	today     = new Date();
	msPerDay  = 24 * 60 * 60 * 1000;
	daysLeft  = ( nextEventDate.getTime() - today.getTime() ) / msPerDay;
	daysLeft  = Math.round( daysLeft );
    
    if ( daysLeft < 0 ) {
        daysLeft = 0;
    }

	return daysLeft;
}

