{
	$migration = new Migration\MigrationProcess();
	$migration->hideNotifier();

	// action: process ajax
	if(isset($_REQUEST['AJAX_MODE']))
	{
		$data = array();

		if($_REQUEST['step'] == 0)
			$migration->reset();

		try
		{
			$data['PERCENT'] = $migration->performStage();
			$data['NEXT_STAGE'] = $migration->getStageCode();
		}
		catch(Main\SystemException $e)
		{
			$result = false;
			$errors[] = $e->getMessage();
		}

		header('Content-Type: application/x-javascript; charset='.LANG_CHARSET);
		print(CUtil::PhpToJSObject(array(
			'result' => $result,
			'errors' => $errors,
			'data' => $data
		), false, false, true));

		die();