﻿$(function() {

    var date = document.getElementById("selectedDate").value;
    $("#datepicker").datepicker(
    {
        onSelect: dateSelected,
        defaultDate: new Date(date)        
    }
    );
});

function dateSelected(dateText, inst) {

    /*var newLocation = "/Events/" + $get('Country').value + "/" + $get('City').value + "/" + inst.selectedYear + "/" + GetMonth(inst.selectedMonth) + "/" + inst.selectedDay;
    if (window.location.pathname != newLocation) {
        window.location = newLocation;
    }*/
    __doPostBack('eventCalendar',dateText);
}

/*
function GetMonth(month) {
    switch (month) {
        case 0:
            return "January";
        case 1:
            return "February";
        case 2:
            return "March";
        case 3:
            return "April";
        case 4:
            return "May";
        case 5:
            return "June";
        case 6:
            return "July";
        case 7:
            return "August";
        case 8:
            return "September";
        case 9:
            return "October";
        case 10:
            return "November";
        case 11:
            return "December";
    }
}*/
