$smarty->assign('reg_antibot_err', $antibot_err);
        cw_session_unregister("antibot_err");
    }
    $smarty->assign('display_antibot', $display_antibot);
}
$smarty->assign('user', $user);
$smarty->assign('profile_fields', $profile_fields);
$smarty->assign('profile_sections', $profile_sections);
$smarty->assign('additional_fields', $additional_fields);
# assign information for the main address
$smarty->assign('countries', cw_map_get_countries());
$smarty->assign('states', cw_map_get_states());
if ($config['General']['use_counties'] == 'Y') {
    $smarty->assign('titles', cw_map_get_counties());
}
$smarty->assign('memberships', cw_get_memberships($userinfo ? $userinfo['usertype'] : $usertype));
$smarty->assign('salesmen', cw_user_get_salesmans_for_register());
cw_load('warehouse');
$possible_warehouses = cw_get_warehouses();
$smarty->assign('possible_warehouses', $possible_warehouses);
if ($m_usertype == 'B' && $current_area == 'A') {
    $parent_profiles = cw_query("select customer_id, firstname, lastname from {$tables['customers']} where {$tables['customers']}.usertype='B' and customer_id!='{$user}'");
    $smarty->assign('parent_profiles', $parent_profiles);
}
$smarty->assign('fill_error', $fill_error);
if ($fill_error) {
    $userinfo = cw_check_user_field_build_profile($userinfo, $filled_profile, $profile_fields);
}
$fill_error = array();
$smarty->assign('userinfo', $userinfo);
$smarty->assign('userphoto', $userphoto);
function ps_form()
{
    global $smarty;
    if ($_SERVER['REQUEST_METHOD'] != 'GET') {
        ps_redirect(0, 'form', 'details');
    }
    $_offer_data =& cw_session_register('_offer_data');
    if (!empty($_offer_data)) {
        $smarty->assign('offer_data', $_offer_data);
        cw_session_unregister('_offer_data');
    }
    $_ps_bonuses =& cw_session_register('_ps_bonuses');
    if (!empty($_ps_bonuses)) {
        $smarty->assign('ps_bonuses', $_ps_bonuses);
        cw_session_unregister('_ps_bonuses');
    }
    $_ps_bonus =& cw_session_register('_ps_bonus');
    if (!empty($_ps_bonus)) {
        $smarty->assign('ps_bonus', $_ps_bonus);
        cw_session_unregister('_ps_bonus');
    }
    $_ps_conditions =& cw_session_register('_ps_conditions');
    if (!empty($_ps_conditions)) {
        $smarty->assign('ps_conditions', $_ps_conditions);
        cw_session_unregister('_ps_conditions');
    }
    $_ps_conds =& cw_session_register('_ps_conds');
    if (!empty($_ps_conds)) {
        $smarty->assign('ps_conds', $_ps_conds);
        cw_session_unregister('_ps_conds');
    }
    $smarty->assign('ps_coupons', ps_get_coupons());
    $smarty->assign('ps_mans', ps_get_manufacturers());
    $smarty->assign('ps_zones', ps_get_zones());
    $smarty->assign('ps_memberships', cw_get_memberships());
    global $js_tab;
    if (isset($js_tab)) {
        $smarty->assign('ps_offer_js_tab', (string) $js_tab);
    }
    global $app_catalogs, $target, $mode;
    $smarty->assign('ps_url_get_coupons', "{$app_catalogs['admin']}/index.php?target={$target}&mode={$mode}&action=coupons&offer_id=&js_tab=ps_offer_bonuses");
    $smarty->assign('ps_url_add_coupon', "{$app_catalogs['admin']}/index.php?target=coupons");
    $smarty->assign('ps_url_get_zones', "{$app_catalogs['admin']}/index.php?target={$target}&mode={$mode}&action=zones&offer_id=&js_tab=ps_offer_conditions");
    $smarty->assign('ps_url_add_zone', "{$app_catalogs['admin']}/index.php?target=shipping_zones&mode=add");
    global $file_upload_data;
    if (!empty($file_upload_data) && isset($file_upload_data[PS_IMG_TYPE]) && is_array($file_upload_data[PS_IMG_TYPE])) {
        $file_upload_data[PS_IMG_TYPE]['is_redirect'] = false;
    }
    //attributes
    global $attributes;
    global $edited_language;
    $attributes = cw_func_call('cw_attributes_get', array('item_id' => 0, 'item_type' => PS_ATTR_ITEM_TYPE, 'prefilled' => $attributes));
    $smarty->assign('attributes', $attributes);
}