function CreateDateString(TheDate)
{
	
	MonthCorrected = TheDate.getMonth() + 1
	return MonthCorrected + '/' + TheDate.getDate() + '/' + TheDate.getFullYear()

}


function GetDaysInMonth(TheMonth,TheYear)
{

	TheMonth++
	
	if (TheMonth == 1 || TheMonth == 3 || TheMonth == 5 || TheMonth == 7 || TheMonth == 8 || TheMonth == 10 || TheMonth == 12)
	{return 31}
	
	else if (TheMonth == 4 || TheMonth == 6 || TheMonth == 9 || TheMonth == 11)
	{return 30}
	
	else
	{
		
		if (TheYear % 4 == 0)
		{return 29}
		
		else
		{return 28}
	
	}

}


function AdjustYear(TheDate)
{

	if (TheDate.getMonth() - 1 < 0)
	{return TheDate.getFullYear() - 1}

	else
	{return TheDate.getFullYear()}

}


function AdjustMonth(TheDate)
{

	if (TheDate.getMonth() - 1 < 0)
	{return 11}
	
	else
	{return TheDate.getMonth() - 1}
	
}


function GetToday()
{

	oDate = new Date()
	
	return CreateDateString(oDate)

}


function GetYesterday()
{

	oDate = new Date()

	TheDate = new Date( oDate.setDate(oDate.getDate() - 1) )
	
	return CreateDateString(TheDate)
	
}


function GetCurrentWeekStart()
{

	oDate = new Date()

	TheDate = new Date( oDate.setDate(oDate.getDate() - oDate.getDay()) )
	
	return CreateDateString(TheDate)

}


function GetCurrentWeekEnd()
{

	oDate = new Date()

	TheDate = new Date( oDate.setDate(oDate.getDate() - oDate.getDay() + 6) )
	
	return CreateDateString(TheDate)

}


function GetLastWeekStart()
{

	oDate = new Date()
	
	TheDate = new Date( oDate.setDate(oDate.getDate() - oDate.getDay() - 7) )
	
	return CreateDateString(TheDate)
	
}


function GetLastWeekEnd()
{

	oDate = new Date()
	
	TheDate = new Date( oDate.setDate(oDate.getDate() - oDate.getDay() - 1) )
	
	return CreateDateString(TheDate)
	
}


function GetCurrentMonthStart()
{

	oDate = new Date()
	
	TheDate = new Date( oDate.setMonth(oDate.getMonth(),1,oDate.getFullYear()) )
	
	return CreateDateString(TheDate)
	
}


function GetCurrentMonthEnd()
{

	oDate = new Date()
	
	TheDate = new Date( oDate.setMonth(oDate.getMonth(),GetDaysInMonth(oDate.getMonth(),oDate.getFullYear())) )

	return CreateDateString(oDate)
	
}


function GetLastMonthStart()
{

	oDate = new Date()
	
	TheDate = new Date( oDate.setMonth(oDate.getMonth()-1,1,AdjustYear(oDate)) )
	
	return CreateDateString(TheDate)
	
}


function GetLastMonthEnd()
{
	
	oDate = new Date()
	
	TheYear = AdjustYear(oDate)
	TheMonth = AdjustMonth(oDate)
	
	TheDate = new Date( oDate.setMonth(TheMonth,GetDaysInMonth(TheMonth,TheYear),TheYear) )
	
	return CreateDateString(TheDate)

}