var postDate = new Array(-1); var defaultDate = new Date(2012,02,"1");jQuery(window).bind("load",function() {
            jQuery("#contentblock_calendar").datepicker({
            
                //defaultDate: defaultDate,
                //maxDate: "D",
                
                onSelect: function(dateText, inst) {
                    document.location.href="/events/viewevent/date/"+dateText;
                 },
                 beforeShowDay: setBlogDays
            });
             function setBlogDays(date) {
                var postExist = false;
                if (postDate.length > 0) {
                    for (i=0;i<postDate.length;i++) {
                        postdateArray = postDate[i].split("-");
                        if (date.getMonth()==postdateArray[1]-1 && date.getDate()==postdateArray[2] && date.getFullYear()==postdateArray[0]) { 
                             //return [true,date];
                             postExist = "EXIST";
                        }
                        
                    }
                }
                if (postExist == "EXIST") {
                    return [true,postExist];
                }
                else { 
                    return [false,""];
                }             
             } 
                  
        });
