function closeWindow() {
    window = top;
    window.opener = top;
    window.close();
}
function loadDay(day) {
    var year = $('#year').val();
    var month = $('#month').val();
    var date = year + '-' + month + '-' + day;
    var date2 = year + month + day;
    if( $('#'+ date2).length > 0 ) {
    } else {
        $.ajax({
            url: '/calendar/load_day/' + date,
            type: 'POST',
            data: date,
            success: function(response) {
                HTML = '<div id="'+ date2 +'" class="day"/>';
                $('#eventList').append(HTML);
                $('#'+date2).hide()
                    .append(response)
                    .slideDown(400);
            }
        });
    }
}

function remove(day) {
    $('#'+ day).slideUp(400, function() {
        $(this).animate({opacity: 1.0},400)
            .remove();
    });
}

function showEvent(event_id) {
    window.open("/event/"+ event_id, "MyEvent", "location=no,status=yes,scrollbars=auto,toolbar=no,width=550,height=450");
}

// Document Ready
$(function() {

});