﻿if (!window.Default) {
    Default = {};
}

function getDateString(date)
{
    switch(date)
    {
        case 1: 
        case 21: 
        case 31: 
            return date+"st";
        case 2: 
        case 22: 
            return date+"nd";
        case 3: 
        case 23: 
            return date+"rd";
        default: return date+"th";
    }
}

function getMonthString(month)
{
    switch(month)
    {
        case 1: return "January";
        case 2: return "February";
        case 3: return "March";
        case 4: return "April";
        case 5: return "May";
        case 6: return "June";
        case 7: return "July";
        case 8: return "August";
        case 9: return "September";
        case 10: return "October";
        case 11: return "November";
        case 12: return "December";
    }
}

$().ready(function(){
    var d = new Date();        
    var today= getMonthString(d.getMonth()+1)+"&nbsp;"+getDateString(d.getDate());

    $("#todaystr").html(today);
    d = d.getFullYear()+"/"+(d.getMonth()+1)+"/"+d.getDate();
    $.ajax({
        cache: false,
        type: "get",
        url: "/home/GetTwitterContent.jsp",
        data: {date: d },
        success: function(data){
            $("#twittercontent").html(data);
        }
    })
})