function getNoOfDays(serverDate, podcastDate, targetDiv)
{

//	alert(podcastDate);
//	target = document.getElementById(targetDiv).innerHtml;
	userDate = new Date();
	
	if((serverDate - userDate) > 43200000 || (serverDate - userDate) < -43200000)
	{
		userDate = serverDate;
	}
	difference = serverDate - userDate;
	
	
	podcastUserDate = new Date(podcastDate - difference);
//	alert(podcastUserDate);
	
//		alert(serverDate);
//		alert(userDate);
	
	
	podcastUserDate = dateNoon(podcastUserDate);
	userDate = dateNoon(userDate);
	
	timetopodcast = podcastUserDate - userDate;
	
//	alert(timetopodcast);
	if(timetopodcast >= (86400000 *2))
	{
		target = parseInt((timetopodcast / 86400000)) + " days";
	}
	else if(timetopodcast >= 86400000)
	{
//		tomorrowDate = new Date(userDate + 86400000)
//		if(podcastUserDate.getDay() < tomorrowDate.getDay())
//		{
//			target = "<span style=\"font-size:80%\">Tomorrow</span>";
//		}
//		else
//		{
//			target = "2 days";
//		}
		target = "<span style=\"font-size:28px\">Tomorrow</span>&nbsp;";
		
	}
	else
	{
//		if(podcastUserDate.getDay() == userDate.getDay())
//		{
//			target = "Today";
//		}
//		else
//		{
//			target = "<span style=\"font-size:80%\">Tomorrow</span>";
//		}
		target = "Today";
	}
	document.write(target);
	
}

function dateNoon(theDate)
{
	theDate.setHours(0);
	theDate.setMinutes(0);
	theDate.setSeconds(0);
	theDate.setMilliseconds(0);
	return theDate;
}

function getHeaderNoOfDays(serverDate, podcastDate, targetDiv)
{

//	alert(podcastDate);
//	target = document.getElementById(targetDiv).innerHtml;
	userDate = new Date();
	
	if((serverDate - userDate) > 43200000 || (serverDate - userDate) < -43200000)
	{
		userDate = serverDate;
	}
	difference = serverDate - userDate;
	
	
	podcastUserDate = new Date(podcastDate - difference);
//	alert(podcastUserDate);
	
//		alert(serverDate);
//		alert(userDate);
	
	
	podcastUserDate = dateNoon(podcastUserDate);
	userDate = dateNoon(userDate);
	
	timetopodcast = podcastUserDate - userDate;
	
//	alert(timetopodcast);
	if(timetopodcast >= (86400000 *2))
	{
		target = "Next Podcast <br />available in";
	}
	else if(timetopodcast >= 86400000)
	{
//		tomorrowDate = new Date(userDate + 86400000)
//		if(podcastUserDate.getDay() < tomorrowDate.getDay())
//		{
//			target = "Tomorrow";
//		}
//		else
//		{
//			target = "2 days";
//		}
		target = "Next Podcast <br />available";
		
	}
	else
	{
//		if(podcastUserDate.getDay() == userDate.getDay())
//		{
//			target = "Today";
//		}
//		else
//		{
//			target = "Tomorrow";
//		}
		target = "Next Podcast <br />available";
	}
	document.write(target);
	
}
