+//-----------------------------------------------------------------------------------
+// Ajax updates
+//
+if (get_post('SearchOrders'))
+{
+ $Ajax->activate('dim_table');
+} elseif (get_post('_OrderNumber_changed'))
+{
+ $disable = get_post('OrderNumber') !== '';
+
+ $Ajax->addDisable(true, 'FromDate', $disable);
+ $Ajax->addDisable(true, 'ToDate', $disable);
+ $Ajax->addDisable(true, 'type_', $disable);
+ $Ajax->addDisable(true, 'OverdueOnly', $disable);
+ $Ajax->addDisable(true, 'OpenOnly', $disable);
+
+ if ($disable) {
+// $Ajax->addFocus(true, 'OrderNumber');
+ set_focus('OrderNumber');
+ } else
+// $Ajax->addFocus(true, 'StockLocation');
+ set_focus('type_');
+
+ $Ajax->activate('dim_table');
+}