title: code for disable not working in firefox but in chrome and IE
body: <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  
      &lt;head&gt;
          &lt;meta charset="utf-8" /&gt;
          &lt;title&gt;jQuery UI Datepicker&lt;/title&gt;
          &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"
          /&gt;
          &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"&gt;
  
          &lt;/script&gt;
          &lt;script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;
  
          &lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              var disabledToolBefore = new Date();
              disabledToolBefore.setDate(disabledToolBefore.getDate() - 1);
              var disabledToolAfter = new Date();
              disabledToolAfter.setDate(disabledToolAfter.getDate() + 33);
  
              $(function () {
                  $("#datepicker").datepicker({
                      minDate: -0,
                      maxDate: "+1M +2D",
                      showOn: "button",
                      buttonImage: "calendar.png",
                      buttonImageOnly: true,
                      dateFormat: 'D dd MM yy',
                      showAnim: "clip",
                      beforeShowDay: function (date) {
                          var tooltipDate = "We don&amp;#39;t have a timetable for the date you choose. Please select a date between today and the next 32 days";
                          if (date.getTime() &lt; disabledToolBefore.getTime() || date.getTime() &gt; disabledToolAfter.getTime()) {
                              return [true, '', tooltipDate];
  
                          } else {
                              return [true, '', ''];
                          }
                      }
                  });
                  $("#datepicker").change(function () {
                      updateDate();
                  });
                  $("#addDate").click(function () {
                      addDaysToDate();
                  });
                  $("#subtractDate").click(function () {
                      subtractDaysToDate();
                  });
              });
  
              function updateDate() {
                  var today = new Date();
                  var tomorrow = new Date();
                  var lastDate = new Date();
                  var date2 = $('#datepicker').datepicker('getDate');
  
                  date2.setHours(0, 0, 0, 0);
                  today.setHours(0, 0, 0, 0);
                  tomorrow.setHours(0, 0, 0, 0);
                  lastDate.setHours(0, 0, 0, 0);
                  tomorrow.setDate(today.getDate() + 1);
                  lastDate.setDate(today.getDate() + 33);
                  if (date2.getTime() == today.getTime()) {
                      //alert(date2);
                      $('#datepicker').val($('#datepicker').val() + " (TODAY)");
                      $('#subtractDate').attr("disabled", true);
                      $('#addDate').attr("disabled", false);
                      $('#subtractDate').attr("src", "datedecrementer_gray.png");
                      $('#addDate').attr("src", "dateincrementer.png");
                  } else if (date2.getTime() == tomorrow.getTime()) {
  
                      $('#datepicker').val($('#datepicker').val() + " (TOMORROW)");
                      $('#subtractDate').attr("disabled", false);
                      $('#addDate').attr("disabled", false);
                      $('#subtractDate').attr("src", "datedecrementer.png");
                      $('#addDate').attr("src", "dateincrementer.png");
  
                  } else if (date2.getTime() == lastDate.getTime()) {
  
                      //alert(lastDate);
                      //$('#addDate').addClass('newClass');
                      $('#addDate').attr("disabled", true);
                      $('#subtractDate').attr("disabled", false);
                      $('#addDate').attr("src", "dateincrementer_gray.png");
                      $('#subtractDate').attr("src", "datedecrementer.png");
                  } else {
  
                      $('#addDate').attr("disabled", false);
                      $('#subtractDate').attr("disabled", false);
                      $('#subtractDate').attr("src", "datedecrementer.png");
                      $('#addDate').attr("src", "dateincrementer.png");
                  }
  
              }
  
              function addDaysToDate() {
                  var date2 = $('#datepicker').datepicker('getDate');
                  date2.setDate(date2.getDate() + 1);
                  $('#datepicker').datepicker('setDate', date2);
                  $('#datepicker').change();
              }
  
              function subtractDaysToDate() {
                  var date2 = $('#datepicker').datepicker('getDate');
                  date2.setDate(date2.getDate() - 1);
                  $('#datepicker').datepicker('setDate', date2);
                  $('#datepicker').change();
              }
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;input type="image" id="subtractDate" src="datedecrementer.png" /&gt;
          &lt;input type="text" id="datepicker" style="width:220px;border:0" /&gt;
          &lt;input type="image" id="addDate" src="dateincrementer.png" /&gt;
          &lt;div id="dialog-message" title="Message" style="display:none"&gt;
              &lt;p&gt; &lt;span style="float: left; margin: 0 7px 50px 0;"&gt;
        &lt;/span&gt; We don&amp;#39;t have a timetable for the date you chose. Please
                  select a date between today and the next 2 months.&lt;/p&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>