function MM_jumpMenu() {
    
document.events_calendar.action=document.events_calendar.select_calendar.value;
    document.events_calendar.submit();
}
var months_short = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", 
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
var Today_Date = new Date();
Today_Date = new Date(Today_Date.getFullYear(), Today_Date.getMonth(), 
Today_Date.getDate());
var Current_Date = Today_Date;
function dateToString(format, date) {
    var Y = date.getFullYear();
    var M = date.getMonth()+1;
    var d = date.getDate();
    M = M < 10 ? "0"+M : M;
    d = d < 10 ? "0"+d : d;
    var sDate = format;
    sDate = sDate.replace(/Y/, Y);
    sDate = sDate.replace(/M/, M);
    sDate = sDate.replace(/d/, d);
    return  sDate;
}
function Make_Calendar(refreshId) {
  var weeks = new Array(6);
    for (var i = 0; i < 6; i++) {
        weeks[i] = new Array(7);
    }
    var Month = Current_Date.getMonth();
    var Year = Current_Date.getFullYear();
    var w, d;
    var s_date;
    var day;
    var html_code = " "+months_short[Month]+" "+Year+" ";
    var s_today = dateToString("M-d-Y", Today_Date);
    document.getElementById("currMonth_"+refreshId).innerHTML = 
html_code;
    for (w = 0, day = new Date(Year, Month, 1); day.getMonth() == Month; 
day = new Date(day.getFullYear(), day.getMonth(), day.getDate()+1)) {
        weeks[w][day.getDay()] = day;
    if (day == Today_Date) {
            alert(day);
        }
        w += parseInt(day.getDay()/6);
    }
    html_code = '<table id="calendar_right" cellspacing="0" cellpadding="0" border="0">' +
    '<tbody><tr class="days">'+
    '<td class="day">S</td>'+
    '<td class="day">M</td>'+
    '<td class="day">T</td>'+
    '<td class="day">W</td>'+
    '<td class="day">T</td>'+
    '<td class="day">F</td>'+
    '<td class="day">S</td>'+
    '</tr>';
    for (w = 0; w < 6; w++) {
        html_code += '<tr class="dates">';
        for (d = 0; d < 7; d++) {
            if (weeks[w][d] != undefined) {
                s_date = dateToString("M-d-Y", weeks[w][d]);
                if (s_date == s_today) {
                    html_code += '<td class="dayON today"><a href="/calendar/'+s_date+'" class="today">'+weeks[w][d].getDate()+'</a></td>';
                } else {
                    html_code += '<td class="date"><a href="/calendar/'+s_date+'">'+weeks[w][d].getDate()+'</a></td>';
                }
            } else {
                html_code += "<td class='blank'>&nbsp;</td>";
            }
        }
        html_code += "</tr>";
    }
    html_code += "</tbody></table>";
    table = document.getElementById("calendar_"+refreshId);
    container = table.parentNode;
    container.removeChild(table);
    container.innerHTML += html_code;
}
function Skip_Months(months, refreshId) {
    Current_Date = new Date(Current_Date.getFullYear(), 
Current_Date.getMonth()+months, Current_Date.getDate());
    Make_Calendar(refreshId);
}

