$.datepicker._selectDateObsolete = $.datepicker._selectDate;
$.datepicker._selectDate = function(id, dateStr) {
  var target = $(id);
  var inst = this._getInst(target[0]);
  dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
  if (inst.input)
    inst.input.val(dateStr);
  this._updateAlternate(inst);
  var onSelect = this._get(inst, 'onSelect');
  if (onSelect)
    onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
  else if (inst.input)
    inst.input.trigger('change'); // fire the change event
  if (inst.inline)
    this._updateDatepicker(inst);
  else {
    this._hideDatepicker();
    this._lastInput = inst.input[0];
    $.datepicker._setLastInputNullAfterFocusInst = this;
    inst.input.focus(); // restore focus

    var self = this;
    setTimeout(function() {
      self._lastInput = null;
    }, 0);
//    this._lastInput = null;
  }
};

if (typeof $.fn.dataTableExt != 'undefined') {
  $.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource, fnCallback, bStandingRedraw )
  {
    if ( typeof sNewSource != 'undefined' && sNewSource != null )
    {
      oSettings.sAjaxSource = sNewSource;
    }
    this.oApi._fnProcessingDisplay( oSettings, true );
    var that = this;
    var iStart = oSettings._iDisplayStart;

    oSettings.fnServerData( oSettings.sAjaxSource, [], function(json) {
      /* Clear the old information from the table */
      that.oApi._fnClearTable( oSettings );

      /* Got the data - add it to the table */
      for ( var i=0 ; i<json[oSettings.sAjaxDataProp].length ; i++ )
      {
        that.oApi._fnAddData( oSettings, json[oSettings.sAjaxDataProp][i] );
      }

      oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
      that.fnDraw();

      if ( typeof bStandingRedraw != 'undefined' && bStandingRedraw === true )
      {
        oSettings._iDisplayStart = iStart;
        that.fnDraw( false );
      }

      that.oApi._fnProcessingDisplay( oSettings, false );

      /* Callback user function - for event handlers etc */
      if ( typeof fnCallback == 'function' && fnCallback != null )
      {
        fnCallback( oSettings );
      }
    }, oSettings );
  }
}
