     $(document).ready(function(){
			
             $(".day").not('.past').hover(
               function () {
                 $(this).fadeTo(100, 0.5);
               }, 
               function () {
                 $(this).fadeTo(300, 1);
               }
             );
              $(".calendarNavNext").hover(
                       function () {
                         $(this).parent().fadeTo(100, 0.5);
                       }, 
                       function () {
                         $(this).parent().fadeTo(300, 1);
                       }
                     );
             $(".calendarNavPrev").hover(
                     function () {
                             $(this).parent().fadeTo(100, 0.5);
                     }, 
                     function () {
                             $(this).parent().fadeTo(300, 1);
                     }
             );
         
             $(".day").click(function() {
               var name = $(this).find('input:first').attr('name');
               var day =  $(this).find('input:first').attr('value');
               var token = $("input:hidden[name = authenticity_token]").val();
               var admincode = $("#admincode").val();
               var id = $(this).attr('id');

               $.post($(this).parents('form').attr("action") + '.js',
                              { date : name, authenticity_token : token, admincode : admincode},
                              function(data) {
                                  var last=$('.date:last');
                                  //alert($(last).text());
                                  //$(last).after(data);
                                  //var newDiv=$(document.createElement("div")).attr("class","date").text("blub"); 
                                  var newPlace=$(data).insertBefore(last);
                                  if (data.length > 10) {
                                    $('#' + id).addClass('selected');
                                    //var newLast=$('.date:last');
                                    $(newPlace).children('.sliderContainer').children('select').selectToUISlider({
                                      labels: 5.5
                                    });
                                    $(newPlace).find('.deleteContainer a').click(function() {
                                        $.post($(this).attr('href'),
                                        {'_method' : 'delete', admincode : adminCode, format : 'js' },
                                        null,
                                        "script");
                                        return false; 
                                    });
                                  };
                              } , "html");

               return false;
             });


             /*  s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', 'f7tymQ1NAkwy/mYSDdTQwqyb2QOI1WT2bampJRfAljM=');  */
             $('.deleteContainer a').click(function() {
               $.post($(this).attr('href'),
                      {'_method' : 'delete', admincode : adminCode, format : 'js' },
                      null,
                      "script");
               return false;        
             });


      });
