-// Set module
-$GLOBALS['module'] = 'autoreg';
-$GLOBALS['output_mode'] = '1';
-$GLOBALS['header_sent'] = 3;
+/*
+ * Set output to "AJAX mode", proper module and prevent HTML headers/footers
+ * being sent.
+ */
+$GLOBALS['__output_mode'] = -2;
+$GLOBALS['__module'] = 'autoreg';
+$GLOBALS['__header_sent'] = 2;
+$GLOBALS['__footer_sent'] = 2;