/***********************************************************
*** Logic Borrowed from the Tubes, OO wrapping done by
*** Chris Heiland
*** Date: February 24, 2009
***********************************************************/
function UWDate()
{
    this.days = new Array("Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday");
    this.months = new Array("January", "February", "March", 
"April", "May", "June", "July", "August", "September", 
"October", "November", "December");
    this.date;
    this.sup;
    this.currentDay;
    this.currentDate;
    this.currentMonth;
    this.currentYear;

    this.parseMe = function(strDate)
    {
        this.date = new Date(strDate);
        this.currentDay = this.date.getDay();
        this.currentDate = this.date.getDate();
                    
        if (this.currentDate == 1 || this.currentDate == 21 || this.currentDate ==31)
        {
           this.sup = "st";
        }
        else if (this.currentDate == 2 || this.currentDate == 22)
        {
            this.sup = "nd";
        }
        else if (this.currentDate == 3 || this.currentDate == 23)
        {
            this.sup = "rd";
        }
        else
        {
            this.sup = "th";
        }
        this.currentMonth = this.date.getMonth();
        this.currentYear = this.date.getFullYear();
        
        return this.days[this.currentDay] + ", " + this.months[this.currentMonth] + " " + this.currentDate + "" + this.sup + " " + " " + this.currentYear;
    }
}
