function GetDay(intDay){
  var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", 
                       "Thursday", "Friday", "Saturday")
  return DayArray[intDay]
}

function GetMonth(intMonth){
  var MonthArray = new Array("January", "February", "March",
                             "April", "May", "June",
                             "July", "August", "September",
                             "October", "November", "December") 
  if (intMonth == 12) intMonth = 0
  return MonthArray[intMonth] 	  	 
  }

function getThisMonth(){
	var today = new Date()
	return GetMonth(today.getMonth())
}

function getNextMonth(){
	var today = new Date()
	return GetMonth( (today.getMonth() + 1 ))
}

function getThisYear() {
    var today = new Date()
    var year = today.getYear()
	if(year<1000) year+=1900
	return year  
}

function getDateStrWithDOW(){
  var today = new Date()
  var year = today.getYear()
  if(year<1000) year+=1900
  var todayStr = GetDay(today.getDay()) + ", "
  todayStr += GetMonth(today.getMonth()) + " " + today.getDate()
  todayStr += ", " + year
  return todayStr
  }

function getLastDayInMonth() {
	var today = new Date()
	return ( daysInMonth( today.getMonth(), today.getYear ) )
}

function daysInMonth(month,year){
	// determine the correct number of days for the month
	if ( month == 1 ) // Jan = 0 , Feb = 1
	{
		if ( year % 4 == 0 )
			return(29);
		else
			return(28);
	}
	else if ( ( month == 4 ) || ( month == 6 ) || ( month == 9 ) || ( month == 11 ) )
		return(30);
	else
	    return(31)
}
