<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
 -
 -  $Id$
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -
 -  Copyright (C) 1998-2018 OpenLink Software
 -
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -
 -
-->
  <?vsp
    declare N integer;
  declare vHost, vHostUrl, vUrl, vParams, vResult, vRequest, vRespond any;
  declare tmp, suffix, vValidate, vSid, vRealm, vUserName, vError, vForm, vFormTab, vFormTab2, vFormMode, vXml, vAcl, xAcl, vLists, vList, items any;
  declare vHostLinks, vUserLinks any;

  vUserLinks := '';
  vHost := http_request_header (http_request_header () , 'Host' , null , sys_connected_server_address ());
  if (isstring (vHost) and strchr (vHost , ':') is null)
      {
        declare hp varchar;
        declare hpa any;

        hp := sys_connected_server_address ();
        hpa := split_and_decode ( hp , 0 , '\0\0:');
        if (hpa [1] <> '80')
      vHost := vHost || ':' || hpa [1];
      }
    if (is_https_ctx ())
    {
    if (vHost not like 'https://%')
      vHost := 'https://' || vHost;
    } else {
    if (vHost not like 'http://%')
      vHost := 'http://' || vHost;
    }
  vHostUrl := vHost || '/ods/api';
    vRequest := null;
    vRespond := null;

    declare exit handler for sqlstate '*'
    {
      -- dbg_obj_print ('', __SQL_STATE, __SQL_MESSAGE);
      vForm := 'login';
      goto _end;
    };

    vError := '';
    vValidate := 0;
    vSid := get_keyword ('sid', params, '');
    vRealm := 'wa';
    if (vSid <> '')
    {
      vUrl := sprintf ('%s/user.validate?sid=%s&realm=%s', vHostUrl, vSid, vRealm);
      commit work;
      vResult := http_client_ext (
                   vUrl,
                   http_method=>'GET',
                   http_headers=>vRequest,
                   headers=>vRespond
                 );
      if (vRespond[0] like 'HTTP/1._ 2__ %')
      {
        vXml := xml_tree_doc (vResult);
        if (xpath_eval ('/result/code', vXml))
          vValidate := 1;
      }
    }
    vUserName := get_keyword ('userName', params);
    if (get_keyword ('oid-form', params) = 'lf')
    {
      vForm := 'login';
    }
    else if (get_keyword ('oid-form', params) = 'rf')
    {
      vForm := 'register';
    }
    else
    {
      vForm := get_keyword ('form', params);
      if (isnull (vForm))
      {
        if (isnull (vUserName))
        {
          vForm := 'login';
        } else {
          vForm := 'user';
        }
      }
    }
    vFormTab := atoi(get_keyword ('formTab', params, '0'));
    vFormTab2 := atoi(get_keyword ('formTab2', params, '0'));
    vFormMode := get_keyword ('formMode', params, '');
    xAcl := vector ('public', '1', 'acl', '2', 'private', '3');

    if (vForm = 'login')
    {
      if (get_keyword ('lf_register', params, '') <> '')
      {
        vForm := 'register';
      }
    }

    if (vForm = 'profile')
    {
      if (get_keyword ('pf_update051', params, '') <> '')
      {
        vUrl := sprintf (
                         '%s/user.owns.%s?sid=%U&realm=%U&id=%U&flag=%U&name=%U&comment=%U&properties=%U',
                         vHostUrl,
                         vFormMode,
                         vSid,
                         vRealm,
                         get_keyword ('pf051_id', params, ''),
                         get_keyword ('pf051_flag', params, ''),
                         get_keyword ('pf051_name', params, ''),
                         get_keyword ('pf051_comment', params, ''),
                         get_keyword ('items', params, '')
                        );
        commit work;
        vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
        if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
        {
          vError := vRespond[0];
          vForm := 'login';
        }
        else
        {
          vXml := xml_tree_doc (vResult);
          if (xpath_eval ('/failed/message', vXml))
          {
            vError := xpath_eval ('string (/failed/message)', vXml);
            if (xpath_eval ('string (/failed/code)', vXml) <> '23023')
              vForm := 'login';
          }
        }
        vFormMode := '';
      }
      else if (get_keyword ('pf_update052', params, '') <> '')
      {
        vUrl := sprintf (
                         '%s/user.favorites.%s?sid=%U&realm=%U&id=%U&flag=%U&label=%U&uri=%U&properties=%U',
                         vHostUrl,
                         vFormMode,
                         vSid,
                         vRealm,
                         get_keyword ('pf052_id', params, ''),
                         get_keyword ('pf052_flag', params, ''),
                         get_keyword ('pf052_label', params, ''),
                         get_keyword ('pf052_uri', params, ''),
                         get_keyword ('items', params, '[]')
                        );
        commit work;
        vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
        if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
        {
          vError := vRespond[0];
          vForm := 'login';
        }
        else
        {
          vXml := xml_tree_doc (vResult);
          if (xpath_eval ('/failed/message', vXml))
          {
            vError := xpath_eval ('string (/failed/message)', vXml);
            if (xpath_eval ('string (/failed/code)', vXml) <> '23023')
              vForm := 'login';
          }
        }
        vFormMode := '';
      }
      if (get_keyword ('pf_update053', params, '') <> '')
      {
        vUrl := sprintf (
                         '%s/user.mades.%s?sid=%U&realm=%U&id=%U&property=%U&url=%U&description=%U',
                         vHostUrl,
                         vFormMode,
                         vSid,
                         vRealm,
                         get_keyword ('pf053_id', params, ''),
                         get_keyword ('pf053_property', params, ''),
                         get_keyword ('pf053_url', params, ''),
                         get_keyword ('pf053_description', params, '')
                        );
        commit work;
        vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
        if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
        {
          vError := vRespond[0];
          vForm := 'login';
        }
        else
        {
          vXml := xml_tree_doc (vResult);
          if (xpath_eval ('/failed/message', vXml))
          {
            vError := xpath_eval ('string (/failed/message)', vXml);
            if (xpath_eval ('string (/failed/code)', vXml) <> '23023')
            vForm := 'login';
          }
        }
        vFormMode := '';
      }
      else if (get_keyword ('pf_update054', params, '') <> '')
      {
        vUrl := sprintf (
                         '%s/user.offers.%s?sid=%U&realm=%U&id=%U&flag=%U&name=%U&comment=%U&properties=%U',
                         vHostUrl,
                         vFormMode,
                         vSid,
                         vRealm,
                         get_keyword ('pf054_id', params, ''),
                         get_keyword ('pf054_flag', params, ''),
                         get_keyword ('pf054_name', params, ''),
                         get_keyword ('pf054_comment', params, ''),
                         get_keyword ('items', params, '')
                        );
        commit work;
        vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
        if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
        {
          vError := vRespond[0];
          vForm := 'login';
        }
        else
        {
          vXml := xml_tree_doc (vResult);
          if (xpath_eval ('/failed/message', vXml))
          {
            vError := xpath_eval ('string (/failed/message)', vXml);
            if (xpath_eval ('string (/failed/code)', vXml) <> '23023')
            vForm := 'login';
          }
        }
        vFormMode := '';
      }
      else if (get_keyword ('pf_update055', params, '') <> '')
      {
        vUrl := sprintf (
                         '%s/user.seeks.%s?sid=%U&realm=%U&id=%U&flag=%U&name=%U&comment=%U&properties=%U',
                         vHostUrl,
                         vFormMode,
                         vSid,
                         vRealm,
                         get_keyword ('pf055_id', params, ''),
                         get_keyword ('pf055_flag', params, ''),
                         get_keyword ('pf055_name', params, ''),
                         get_keyword ('pf055_comment', params, ''),
                         get_keyword ('items', params, '')
                        );
        commit work;
        vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
        if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
        {
          vError := vRespond[0];
          vForm := 'login';
        }
        else
        {
          vXml := xml_tree_doc (vResult);
          if (xpath_eval ('/failed/message', vXml))
          {
            vError := xpath_eval ('string (/failed/message)', vXml);
            if (xpath_eval ('string (/failed/code)', vXml) <> '23023')
            vForm := 'login';
          }
        }
        vFormMode := '';
      }
      else if (get_keyword ('pf_update056', params, '') <> '')
      {
        vUrl := sprintf (
                         '%s/user.likes.%s?sid=%U&realm=%U&id=%U&flag=%U&uri=%U&type=%U&name=%U&comment=%U&properties=%U',
                         vHostUrl,
                         vFormMode,
                         vSid,
                         vRealm,
                         get_keyword ('pf056_id', params, ''),
                         get_keyword ('pf056_flag', params, ''),
                         get_keyword ('pf056_uri', params, ''),
                         get_keyword ('pf056_type', params, 'L'),
                         get_keyword ('pf056_name', params, ''),
                         get_keyword ('pf056_comment', params, ''),
                         get_keyword ('items', params, '')
                        );
        commit work;
        vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
        if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
        {
          vError := vRespond[0];
          vForm := 'login';
        }
        else
        {
          vXml := xml_tree_doc (vResult);
          if (xpath_eval ('/failed/message', vXml))
          {
            vError := xpath_eval ('string (/failed/message)', vXml);
            if (xpath_eval ('string (/failed/code)', vXml) <> '23023')
              vForm := 'login';
          }
        }
        vFormMode := '';
      }
      else if (get_keyword ('pf_update057', params, '') <> '')
      {
        declare suffix, flag, uri, label varchar;
        declare N, items any;

        items := vector ();
        if (vFormMode <> 'import')
        {
          items := vector_concat (items,
                                  vector (vector (get_keyword ('pf057_id', params, ''),
                                                  get_keyword ('pf057_flag', params, ''),
                                                  get_keyword ('pf057_uri', params, ''),
                                                  get_keyword ('pf057_label', params, '')
                                                 )
                                          )
                                 );

        } else {
          for (N := 0; N < length (params); N := N + 2)
          {
            if (params [N] like 'k_fld_1_%')
            {
              suffix := replace (params [N], 'k_fld_1_', '');
              flag :=  trim (params [N+1]);
              uri :=  trim (get_keyword ('k_fld_2_'||suffix, params, ''));
              label :=  trim (get_keyword ('k_fld_3_'||suffix, params, ''));
              items := vector_concat (items, vector (vector ('', flag, uri, label)));
            }
          }
          vFormMode := 'new';
        }
        foreach (any item in items) do
        {
          vUrl := sprintf (
                           '%s/user.knows.%s?sid=%U&realm=%U&id=%U&flag=%U&uri=%U&label=%U',
                           vHostUrl,
                           vFormMode,
                           vSid,
                           vRealm,
                           item[0],
                           item[1],
                           item[2],
                           item[3]
                          );
          commit work;
          vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
          if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
          {
            vError := vRespond[0];
            vForm := 'login';

            goto _exit057;
          }
          else
          {
            vXml := xml_tree_doc (vResult);
            if (xpath_eval ('/failed/message', vXml))
            {
              vError := xpath_eval ('string (/failed/message)', vXml);
              if (xpath_eval ('string (/failed/code)', vXml) <> '23023')
              {
                vForm := 'login';
                goto _exit057;
              }
            }
          }
        }
      _exit057:;
        vFormMode := '';
      }
      else if (get_keyword ('pf_update26', params, '') <> '')
      {
      if (get_keyword ('pf26_importFile', params, '0') = '0')
      {
        tmp := get_keyword ('pf26_certificate', params, '');
      }
      else
      {
        tmp := get_keyword ('pf26_file', params, '');
      }
        vUrl := sprintf (
                         '%s/user.certificates.%s?sid=%U&realm=%U&id=%U&certificate=%U&enableLogin=%U',
                         vHostUrl,
                         vFormMode,
                         vSid,
                         vRealm,
                         get_keyword ('pf26_id', params, ''),
                       tmp,
                         get_keyword ('pf26_enableLogin', params, '0')
                        );
        commit work;
        vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
        if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
        {
          vError := vRespond[0];
          vForm := 'login';
        }
        else
        {
          vXml := xml_tree_doc (vResult);
          if (xpath_eval ('/failed/message', vXml))
          {
            vError := xpath_eval ('string (/failed/message)', vXml);
            if (xpath_eval ('string (/failed/code)', vXml) <> '23023')
              vForm := 'login';
          }
        }
        vFormMode := '';
      }
      else if (get_keyword ('pf_cancel2', params, '') <> '')
      {
        vFormMode := '';
      }
      else if ((get_keyword ('pf_update', params, '') <> '') or (get_keyword ('pf_next', params, '') <> '') or (get_keyword ('pf_clear', params, '') <> ''))
      {
        vFormMode := '';
        if (((vFormTab = 0) and (vFormTab2 = 3)) or ((vFormTab = 1) and (vFormTab2 = 2)))
        {
          declare accountType, prefix any;

          accountType := 'P';
          prefix := 'x4';
          if ((vFormTab = 1) and (vFormTab2 = 2))
          {
            accountType := 'B';
            prefix := 'y1';
          }
          vUrl := vHostUrl || '/user.onlineAccounts.delete?sid=' || vSid || '&realm=' || vRealm || '&type=' || accountType;
          commit work;
          vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
          if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
          {
            vError := vRespond[0];
            vForm := 'login';
          }
          else
          {
            vXml := xml_tree_doc (vResult);
            if (xpath_eval ('/failed/message', vXml))
            {
              vError := xpath_eval ('string (/failed/message)', vXml);
              vForm := 'login';
            }
          }
          if (vForm <> 'login')
          {
            for (N := 0; N < length (params); N := N + 2)
            {
              if ((params [N] like prefix||'_fld_1_%') and (trim (params [N+1]) <> ''))
              {
                suffix := replace (params [N], prefix||'_fld_1_', '');
                vUrl := vHostUrl || '/user.onlineAccounts.new?sid=' || vSid || '&realm=' || vRealm || '&type=' || accountType ||
                      sprintf ('&name=%U&url=%U&uri=%U', trim (params [N+1]), trim (get_keyword (prefix||'_fld_2_'||suffix, params, '')), trim (get_keyword (prefix||'_fld_3_'||suffix, params, '')));
                commit work;
                vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
                if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
                {
                  vError := vRespond[0];
                  vForm := 'login';
                }
                else
                {
                  vXml := xml_tree_doc (vResult);
                  if (xpath_eval ('/failed/message', vXml))
                  {
                    vError := xpath_eval ('string (/failed/message)', vXml);
                    vForm := 'login';
                  }
                }
              }
            }
          }
        }
        else if ((vFormTab = 0) and (vFormTab2 = 5))
        {
          vUrl := vHostUrl || '/user.bioEvents.delete?sid=' || vSid || '&realm=' || vRealm || '&type=P';
          commit work;
          vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
          if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
          {
            vError := vRespond[0];
            vForm := 'login';
          }
          else
          {
            vXml := xml_tree_doc (vResult);
            if (xpath_eval ('/failed/message', vXml))
            {
              vError := xpath_eval ('string (/failed/message)', vXml);
              vForm := 'login';
            }
          }
          if (vForm <> 'login')
          {
            for (N := 0; N < length (params); N := N + 2)
            {
              if ((params [N] like 'x5_fld_1_%') and (trim (params [N+1]) <> ''))
              {
                suffix := replace (params [N], 'x5_fld_1_', '');
                vUrl := vHostUrl || '/user.bioEvents.new?sid=' || vSid || '&realm=' || vRealm || '&type=P' ||
                        sprintf ('&event=%U&date=%U&place=%U', trim (params [N+1]), trim (get_keyword ('x5_fld_2_'||suffix, params, '')), trim (get_keyword ('x5_fld_3_'||suffix, params, '')));
                commit work;
                vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
                if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
                {
                  vError := vRespond[0];
                  vForm := 'login';
                }
                else
                {
                  vXml := xml_tree_doc (vResult);
                  if (xpath_eval ('/failed/message', vXml))
                  {
                    vError := xpath_eval ('string (/failed/message)', vXml);
                    vForm := 'login';
                  }
                }
              }
            }
          }
        }
        else if ((vFormTab = 2) and (vFormTab2 = 0))
        {
          if (get_keyword ('pf_newPassword', params, '') <> get_keyword ('pf_newPassword2', params, ''))
          {
            vError := 'Bad new password. Please retype!';
          } else {
            vUrl := vHostUrl  || '/user.password_change?' ||
                    'sid=' || vSid ||
                    '&realm=' || vRealm ||
                    '&old_password=' || sprintf ('%U', get_keyword ('pf_oldPassword', params, '')) ||
                    '&new_password=' || sprintf ('%U', get_keyword ('pf_newPassword', params, ''));
            commit work;
            vResult := http_client_ext (vUrl, http_method=>'GET', http_headers=>vRequest, headers=>vRespond);
            if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
            {
              vError := vRespond[0];
              vForm := 'login';
            }
            else
            {
              vXml := xml_tree_doc (vResult);
              if (xpath_eval ('/failed/message', vXml))
              {
                vError := xpath_eval ('string (/failed/message)', vXml);
                if (xpath_eval ('string (/failed/code)', vXml) <> '23023')
                  vForm := 'login';
              }
            }
          }
        }
        else
        {
          vUrl := vHostUrl  || '/user.update.fields';
          vParams := 'sid=' || vSid || '&realm=' || vRealm;
          if (vFormTab = 0)
      {
            if (vFormTab2 = 0)
            {
              -- Import
              if (get_keyword ('cb_item_i_photo', params, '') = '1')
                vParams := vParams || sprintf ('&photo=%U', get_keyword ('i_photo', params, ''));
              if (get_keyword ('cb_item_i_name', params, '') = '1')
                vParams := vParams || sprintf ('&nickName=%U', get_keyword ('i_nickName', params, ''));
              if (get_keyword ('cb_item_i_title', params, '') = '1')
                vParams := vParams || sprintf ('&title=%U', get_keyword ('i_title', params, ''));
              if (get_keyword ('cb_item_i_firstName', params, '') = '1')
                vParams := vParams || sprintf ('&firstName=%U', get_keyword ('i_firstName', params, ''));
              if (get_keyword ('cb_item_i_lastName', params, '') = '1')
                vParams := vParams || sprintf ('&lastName=%U', get_keyword ('i_lastName', params, ''));
              if (get_keyword ('cb_item_i_fullName', params, '') = '1')
                vParams := vParams || sprintf ('&fullName=%U', get_keyword ('i_fullName', params, ''));
              if (get_keyword ('cb_item_i_gender', params, '') = '1')
                vParams := vParams || sprintf ('&gender=%U', get_keyword ('i_gender', params, ''));
              if (get_keyword ('cb_item_i_mail', params, '') = '1')
                vParams := vParams || sprintf ('&mail=%U', get_keyword ('i_mail', params, ''));
              if (get_keyword ('cb_item_i_birthday', params, '') = '1')
                vParams := vParams || sprintf ('&birthday=%U', get_keyword ('i_birthday', params, ''));
              if (get_keyword ('cb_item_i_homepage', params, '') = '1')
                vParams := vParams || sprintf ('&homepage=%U', get_keyword ('i_homepage', params, ''));
              if (get_keyword ('cb_item_i_icq', params, '') = '1')
                vParams := vParams || sprintf ('&icq=%U', get_keyword ('i_icq', params, ''));
              if (get_keyword ('cb_item_i_aim', params, '') = '1')
                vParams := vParams || sprintf ('&aim=%U', get_keyword ('i_aim', params, ''));
              if (get_keyword ('cb_item_i_yahoo', params, '') = '1')
                vParams := vParams || sprintf ('&yahoo=%U', get_keyword ('i_yahoo', params, ''));
              if (get_keyword ('cb_item_i_msn', params, '') = '1')
                vParams := vParams || sprintf ('&msn=%U', get_keyword ('i_msn', params, ''));
              if (get_keyword ('cb_item_i_skype', params, '') = '1')
                vParams := vParams || sprintf ('&skype=%U', get_keyword ('i_skype', params, ''));
              if (get_keyword ('cb_item_i_homelat', params, '') = '1')
                vParams := vParams || sprintf ('&homeLatitude=%U', get_keyword ('i_homelat', params, ''));
              if (get_keyword ('cb_item_i_homelng', params, '') = '1')
                vParams := vParams || sprintf ('&homeLongitude=%U', get_keyword ('i_homelng', params, ''));
              if (get_keyword ('cb_item_i_homePhone', params, '') = '1')
                vParams := vParams || sprintf ('&homePhone=%U', get_keyword ('i_homePhone', params, ''));
            if (get_keyword ('cb_item_i_homeCountry', params, '') = '1')
              vParams := vParams || sprintf ('&homeCountry=%U', get_keyword ('i_homeCountry', params, ''));
            if (get_keyword ('cb_item_i_homeState', params, '') = '1')
              vParams := vParams || sprintf ('&homeState=%U', get_keyword ('i_homeState', params, ''));
            if (get_keyword ('cb_item_i_homeCity', params, '') = '1')
              vParams := vParams || sprintf ('&homeCity=%U', get_keyword ('i_homeCity', params, ''));
            if (get_keyword ('cb_item_i_homeCode', params, '') = '1')
              vParams := vParams || sprintf ('&homeCode=%U', get_keyword ('i_homeCode', params, ''));
            if (get_keyword ('cb_item_i_homeAddress1', params, '') = '1')
              vParams := vParams || sprintf ('&homeAddress1=%U', get_keyword ('i_homeAddress1', params, ''));
            if (get_keyword ('cb_item_i_homeAddress2', params, '') = '1')
              vParams := vParams || sprintf ('&homeAddress2=%U', get_keyword ('i_homeAddress2', params, ''));
              if (get_keyword ('cb_item_i_businessOrganization', params, '') = '1')
                vParams := vParams || sprintf ('&businessOrganization=%U', get_keyword ('i_businessOrganization', params, ''));
              if (get_keyword ('cb_item_i_businessHomePage', params, '') = '1')
                vParams := vParams || sprintf ('&businessHomePage=%U', get_keyword ('i_businessHomePage', params, ''));
              if (get_keyword ('cb_item_i_summary', params, '') = '1')
                vParams := vParams || sprintf ('&summary=%U', get_keyword ('i_summary', params, ''));
              if (get_keyword ('cb_item_i_tags', params, '') = '1')
                vParams := vParams || sprintf ('&tags=%U', get_keyword ('i_tags', params, ''));
              if (get_keyword ('cb_item_i_sameAs', params, '') = '1')
                vParams := vParams || sprintf ('&webIDs=%U', get_keyword ('i_sameAs', params, ''));
              if (get_keyword ('cb_item_i_topicInterests', params, '') = '1')
                vParams := vParams || sprintf ('&topicInterests=%U', get_keyword ('i_topicInterests', params, ''));
              if (get_keyword ('cb_item_i_interests', params, '') = '1')
                vParams := vParams || sprintf ('&interests=%U', get_keyword ('i_interests', params, ''));
              if (get_keyword ('cb_item_i_onlineAccounts', params, '') = '1')
                vParams := vParams || sprintf ('&onlineAccounts=%U', get_keyword ('i_onlineAccounts', params, ''));
            }
            if (vFormTab2 = 1)
            {
              -- Main
              vParams := vParams ||
                  '&nickName=' ||               sprintf ('%U', get_keyword ('pf_nickName', params, '')) ||
                '&mail=' ||                   sprintf ('%U', get_keyword ('pf_mail', params, '')) ||
                '&title=' ||                  sprintf ('%U', get_keyword ('pf_title', params, '')) ||
                '&firstName=' ||              sprintf ('%U', get_keyword ('pf_firstName', params, '')) ||
                '&lastName=' ||               sprintf ('%U', get_keyword ('pf_lastName', params, '')) ||
                '&fullName=' ||               sprintf ('%U', get_keyword ('pf_fullName', params, '')) ||
                '&gender=' ||                 sprintf ('%U', get_keyword ('pf_gender', params, '')) ||
                '&birthday=' ||               sprintf ('%U', get_keyword ('pf_birthday', params, '')) ||
                '&homepage=' ||               sprintf ('%U', get_keyword ('pf_homepage', params, '')) ||
                  '&mailSignature=' ||          sprintf ('%U', get_keyword ('pf_mailSignature', params, '')) ||
                  '&summary=' ||       sprintf ('%U', get_keyword ('pf_summary', params, '')) ||
                  '&appSetting=' ||    sprintf ('%U', get_keyword ('pf_appSetting', params, '0')) ||
                  '&spbEnable=' ||     sprintf ('%U', get_keyword ('pf_spbEnable', params, '0')) ||
                  '&inSearch=' ||      sprintf ('%U', get_keyword ('pf_inSearch', params, '0')) ||
                  '&showActive=' ||    sprintf ('%U', get_keyword ('pf_showActive', params, '0')) ||
                  '&photo=' ||         sprintf ('%U', get_keyword ('pf_photo', params, '')) ||
                  '&photoContent=' ||  sprintf ('%U', get_keyword ('pf_photoContent', params, '')) ||
                  '&audio=' ||         sprintf ('%U', get_keyword ('pf_audio', params, '')) ||
                  '&audioContent=' ||  sprintf ('%U', get_keyword ('pf_audioContent', params, ''));

              tmp := '';
              for (N := 0; N < length (params); N := N + 2)
              {
                if ((params [N] like 'x1_fld_1_%') and (trim (params [N+1]) <> ''))
                {
                  suffix := replace (params [N], 'x1_fld_1_', '');
                  tmp := tmp || trim (params [N+1]) || ';' || trim (get_keyword ('x1_fld_2_'||suffix, params, '')) || '\n';
                }
              }
              vParams := vParams || sprintf ('&webIDs=%U', tmp);
              tmp := '';
              for (N := 0; N < length (params); N := N + 2)
              {
                if ((params [N] like 'x2_fld_1_%') and (trim (params [N+1]) <> ''))
                {
                  suffix := replace (params [N], 'x2_fld_1_', '');
                  tmp := tmp || trim (params [N+1]) || ';' || trim (get_keyword ('x2_fld_2_'||suffix, params, '')) || '\n';
                }
              }
              vParams := vParams || sprintf ('&topicInterests=%U', tmp);
              tmp := '';
              for (N := 0; N < length (params); N := N + 2)
              {
                if ((params [N] like 'x3_fld_1_%') and (trim (params [N+1]) <> ''))
                {
                  suffix := replace (params [N], 'x3_fld_1_', '');
                  tmp := tmp || trim (params [N+1]) || ';' || trim (get_keyword ('x3_fld_2_'||suffix, params, '')) || '\n';
                }
              }
              vParams := vParams || sprintf ('&interests=%U', tmp);
            }
            if (vFormTab2 = 2)
            {
              vParams := vParams ||
                '&homeDefaultMapLocation=' || sprintf ('%U', get_keyword ('pf_homeDefaultMapLocation', params, '')) ||
                '&homeCountry=' ||            sprintf ('%U', get_keyword ('pf_homecountry', params, '')) ||
                '&homeState=' ||              sprintf ('%U', get_keyword ('pf_homestate', params, '')) ||
                '&homeCity=' ||               sprintf ('%U', get_keyword ('pf_homecity', params, '')) ||
                '&homeCode=' ||               sprintf ('%U', get_keyword ('pf_homecode', params, '')) ||
                '&homeAddress1=' ||           sprintf ('%U', get_keyword ('pf_homeaddress1', params, '')) ||
                '&homeAddress2=' ||           sprintf ('%U', get_keyword ('pf_homeaddress2', params, '')) ||
                '&homeTimezone=' ||           sprintf ('%U', get_keyword ('pf_homeTimezone', params, '')) ||
                '&homeLatitude=' ||           sprintf ('%U', get_keyword ('pf_homelat', params, '')) ||
                '&homeLongitude=' ||          sprintf ('%U', get_keyword ('pf_homelng', params, '')) ||
                '&homePhone=' ||              sprintf ('%U', get_keyword ('pf_homePhone', params, '')) ||
                  '&homePhoneExt=' ||           sprintf ('%U', get_keyword ('pf_homePhoneExt', params, '')) ||
                  '&homeMobile=' ||             sprintf ('%U', get_keyword ('pf_homeMobile', params, ''));
            }
            if (vFormTab2 = 4)
            {
              vParams := vParams ||
                  '&icq=' ||                    sprintf ('%U', get_keyword ('pf_icq', params, '')) ||
                  '&skype=' ||                  sprintf ('%U', get_keyword ('pf_skype', params, '')) ||
                  '&yahoo=' ||                  sprintf ('%U', get_keyword ('pf_yahoo', params, '')) ||
                  '&aim=' ||                    sprintf ('%U', get_keyword ('pf_aim', params, '')) ||
                  '&msn=' ||                    sprintf ('%U', get_keyword ('pf_msn', params, ''));
              tmp := '';
              for (N := 0; N < length (params); N := N + 2)
              {
                if ((params [N] like 'x6_fld_1_%') and (trim (params [N+1]) <> ''))
                {
                  suffix := replace (params [N], 'x6_fld_1_', '');
                  tmp := tmp || trim (params [N+1]) || ';' || trim (get_keyword ('x6_fld_2_'||suffix, params, '')) || '\n';
                }
              }
              vParams := vParams || sprintf ('&messaging=%U', tmp);
            }
          }
          if (vFormTab = 1)
          {
            if (vFormTab2 = 0)
            {
              vParams := vParams ||
                '&businessIndustry=' ||       sprintf ('%U', get_keyword ('pf_businessIndustry', params, '')) ||
                '&businessOrganization=' ||   sprintf ('%U', get_keyword ('pf_businessOrganization', params, '')) ||
                '&businessHomePage=' ||       sprintf ('%U', get_keyword ('pf_businessHomePage', params, '')) ||
                '&businessJob=' ||            sprintf ('%U', get_keyword ('pf_businessJob', params, '')) ||
                  '&businessRegNo=' ||          sprintf ('%U', get_keyword ('pf_businessRegNo', params, '')) ||
                  '&businessCareer=' ||         sprintf ('%U', get_keyword ('pf_businessCareer', params, '')) ||
                  '&businessEmployees=' ||      sprintf ('%U', get_keyword ('pf_businessEmployees', params, '')) ||
                  '&businessVendor=' ||         sprintf ('%U', get_keyword ('pf_businessVendor', params, '')) ||
                  '&businessService=' ||        sprintf ('%U', get_keyword ('pf_businessService', params, '')) ||
                  '&businessOther=' ||          sprintf ('%U', get_keyword ('pf_businessOther', params, '')) ||
                  '&businessNetwork=' ||        sprintf ('%U', get_keyword ('pf_businessNetwork', params, '')) ||
                  '&businessResume=' ||         sprintf ('%U', get_keyword ('pf_businessResume', params, ''));
            }
            if (vFormTab2 = 1)
            {
              vParams := vParams ||
                '&businessCountry=' ||        sprintf ('%U', get_keyword ('pf_businesscountry', params, '')) ||
                '&businessState=' ||          sprintf ('%U', get_keyword ('pf_businessstate', params, '')) ||
                '&businessCity=' ||           sprintf ('%U', get_keyword ('pf_businesscity', params, '')) ||
                '&businessCode=' ||           sprintf ('%U', get_keyword ('pf_businesscode', params, '')) ||
                '&businessAddress1=' ||       sprintf ('%U', get_keyword ('pf_businessaddress1', params, '')) ||
                '&businessAddress2=' ||       sprintf ('%U', get_keyword ('pf_businessaddress2', params, '')) ||
                '&businessTimezone=' ||       sprintf ('%U', get_keyword ('pf_businessTimezone', params, '')) ||
                '&businessLatitude=' ||       sprintf ('%U', get_keyword ('pf_businesslat', params, '')) ||
                '&businessLongitude=' ||      sprintf ('%U', get_keyword ('pf_businesslng', params, '')) ||
                '&businessPhone=' ||          sprintf ('%U', get_keyword ('pf_businessPhone', params, '')) ||
                  '&businessPhoneExt=' ||  sprintf ('%U', get_keyword ('pf_businessPhoneExt', params, '')) ||
                  '&businessMobile=' ||         sprintf ('%U', get_keyword ('pf_businessMobile', params, ''));
            }
            if (vFormTab2 = 3)
            {
              vParams := vParams ||
                  '&businessIcq=' ||            sprintf ('%U', get_keyword ('pf_businessIcq', params, '')) ||
                  '&businessSkype=' ||          sprintf ('%U', get_keyword ('pf_businessSkype', params, '')) ||
                  '&businessYahoo=' ||          sprintf ('%U', get_keyword ('pf_businessYahoo', params, '')) ||
                  '&businessAim=' ||            sprintf ('%U', get_keyword ('pf_businessAim', params, '')) ||
                  '&businessMsn=' ||            sprintf ('%U', get_keyword ('pf_businessMsn', params, ''));
              tmp := '';
              for (N := 0; N < length (params); N := N + 2)
              {
                if ((params [N] like 'y2_fld_1_%') and (trim (params [N+1]) <> ''))
                {
                  suffix := replace (params [N], 'y2_fld_1_', '');
                  tmp := tmp || trim (params [N+1]) || ';' || trim (get_keyword ('y2_fld_2_'||suffix, params, '')) || '\n';
                }
              }
              vParams := vParams || sprintf ('&businessMessaging=%U', tmp);
            }
          }
          if (vFormTab = 2)
          {
            -- Passrord recovery
            if (vFormTab2 = 1)
              vParams := vParams ||
                  '&securitySecretQuestion=' || sprintf ('%U', get_keyword ('pf_securitySecretQuestion', params, '')) ||
                  '&securitySecretAnswer=' || sprintf ('%U', get_keyword ('pf_securitySecretAnswer', params, ''));

            -- OpenID
            if (vFormTab2 = 2)
              vParams := vParams || '&securityOpenID=' || sprintf ('%U', get_keyword ('pf_openID', params, ''));

            -- Limits
          if (vFormTab2 = 3)
              vParams := vParams || '&securitySiocLimit=' || sprintf ('%U', get_keyword ('pf_securitySiocLimit', params, ''));

          }
        commit work;
        vResult := http_client_ext (
                     vUrl,
                       http_method=>'POST',
                     http_headers=>vRequest,
                       body=>vParams,
                     headers=>vRespond
                   );
        if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
        {
          vError := vRespond[0];
          vForm := 'login';
        }
        else
        {
          vXml := xml_tree_doc (vResult);
          if (xpath_eval ('/failed/message', vXml))
          {
            vError := xpath_eval ('string (/failed/message)', vXml);
            vForm := 'login';
            }
          }
          vUrl := vHostUrl  || '/user.acl.update';
          tmp := '';
          for (N := 0; N < length (params); N := N + 2)
          {
            if (params [N] like 'pf_acl_%')
              tmp := tmp || replace (params [N], 'pf_acl_', '') || '=' || trim (params [N+1]) || '&';
          }
          vParams := 'sid=' || vSid || '&realm=' || vRealm || sprintf ('&acls=%U', rtrim (tmp, '&'));
          commit work;
          vResult := http_client_ext (
                       vUrl,
                       http_method=>'POST',
                       http_headers=>vRequest,
                       body=>vParams,
                       headers=>vRespond
                     );
          if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
          {
            vError := vRespond[0];
            vForm := 'login';
          }
          else
          {
            vXml := xml_tree_doc (vResult);
            if (xpath_eval ('/failed/message', vXml))
            {
              vError := xpath_eval ('string (/failed/message)', vXml);
              vForm := 'login';
            }
          }
        }
        if (get_keyword ('pf_next', params, '') <> '')
        {
          vFormTab2 := vFormTab2 + 1;
          if (
              ((vFormTab = 1) and (vFormTab2 > 3)) or
            ((vFormTab = 2) and (vFormTab2 > 5))
             )
          {
            vFormTab := vFormTab + 1;
            vFormTab2 := 0;
          }
          if (vFormTab > 2)
            vFormTab := 0;
        }
      }
      else if (get_keyword ('pf_cancel', params, '') <> '')
      {
        vForm := 'user';
      }
    }

    if (vForm = 'user')
    {
      if (get_keyword ('uf_profile', params, '') <> '')
      {
        vFormTab := 0;
        vFormTab2 := 0;
        vForm := 'profile';
    }
    }

    if ((vForm = 'user') or (vForm = 'profile'))
    {
      vUrl := sprintf ('%s/user.info?sid=%s&realm=%s', vHostUrl, vSid, vRealm);
      if ((vForm = 'user') and not isnull (vUserName))
        vUrl := vUrl || sprintf ('&name=%s', vUserName);
      commit work;
      vResult := http_client_ext (
                   vUrl,
                   http_method=>'GET',
                   http_headers=>vRequest,
                   headers=>vRespond
                 );
      if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
      {
        vError := vRespond[0];
        vForm := 'login';
        goto _end;
      }
        vXml := xml_tree_doc (vResult);
        if (xpath_eval ('/failed/message', vXml))
        {
          vError := xpath_eval ('string (/failed/message)', vXml);
          vForm := 'login';
        goto _end;
        }
      if (vForm = 'profile')
        {
        vUrl := sprintf ('%s/user.acl.info?sid=%s&realm=%s', vHostUrl, vSid, vRealm);
        commit work;
        vResult := http_client_ext (
                     vUrl,
                     http_method=>'GET',
                     http_headers=>vRequest,
                     headers=>vRespond
                   );
        if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
        {
          vError := vRespond[0];
          vForm := 'login';
          goto _end;
        }
        vAcl := xml_tree_doc (vResult);
        if (xpath_eval ('/failed/message', vAcl))
        {
          vError := xpath_eval ('string (/failed/message)', vAcl);
          vForm := 'login';
          goto _end;
        }

          declare tmp, listItems any;

        items := vector (vector ('Industry', ''), vector ('Country', ''));
          vLists := vector ();
          foreach (any item in items) do
          {
            vUrl := sprintf ('%s/lookup.list?key=%s&param=%s', vHostUrl, item[0], item[1]);
            commit work;
            vResult := http_client_ext (
                         vUrl,
                         http_method=>'GET',
                         http_headers=>vRequest,
                         headers=>vRespond
                       );
            if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
            {
              vError := vRespond[0];
              vForm := 'login';
              goto _end;
            }
            vList := vector ();
            tmp := xml_tree_doc (vResult);
            listItems := xpath_eval ('/items/item', tmp, 0);
            foreach (any listItem in listItems) do
              vList := vector_concat (vList, vector (cast (listItem as varchar)));

            vLists := vector_concat (vLists, vector (vList));
          }
        }
      }
  _end:;
    if (vForm = 'login')
    {
      vSid := '';
      vRealm := '';
    }
  vHostLinks := replace (
    '    <link rel="openid.server" title="OpenID Server" href="[HOST]/openid" />\n' ||
    '    <link rel="openid2.provider" title="OpenID v2 Server" href="[HOST]/openid" />',
    '[HOST]',
    vHost);

  vUserLinks := '';
  if (not isnull (vUserName))
  {
    vUserLinks :=
      '\n' ||
      '    <link rel="meta" type="application/rdf+xml" title="SIOC" href="[HOST]/dataspace/[USER]/sioc.rdf" />\n' ||
      '    <link rel="meta" type="application/rdf+xml" title="FOAF" href="[HOST]/dataspace/person/[USER]/foaf.rdf" />\n' ||
      '    <link rel="meta" type="text/rdf+n3" title="FOAF" href="[HOST]/dataspace/person/[USER]/foaf.n3" />\n' ||
      '    <link rel="meta" type="application/json" title="FOAF" href="[HOST]/dataspace/person/[USER]/foaf.json" />\n' ||
      '    <link rel="http://xmlns.com/foaf/0.1/primaryTopic"  title="About" href="[HOST]/dataspace/person/[USER]#this" />\n' ||
      '    <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />\n' ||
      '    <meta name="dc.language" content="en" scheme="rfc1766" />\n' ||
      '    <meta name="dc.creator" content="[USER]" />\n' ||
      '    <meta name="dc.description" content="ODS HTML [USER]''s page" />\n' ||
      '    <meta name="dc.title" content="ODS HTML [USER]''s page" />\n' ||
      '    <link rev="describedby" title="About" href="[HOST]/dataspace/person/[USER]#this" />\n' ||
      '    <link rel="schema.geo" href="http://www.w3.org/2003/01/geo/wgs84_pos#" />\n' ||
      '    <meta http-equiv="X-XRDS-Location" content="[HOST]/dataspace/[USER]/yadis.xrds" />\n' ||
      '    <meta http-equiv="X-YADIS-Location" content="[HOST]/dataspace/[USER]/yadis.xrds" />\n' ||
      '    <link rel="meta" type="application/xml+apml" title="APML 0.6" href="[HOST]/dataspace/[USER]/apml.xml" />\n' ||
      '    <link rel="alternate" type="application/atom+xml" title="OpenSocial Friends" href="[HOST]/feeds/people/[USER]/friends" />';
    vUserLinks := replace (vUserLinks, '[HOST]', vHost);
    vUserLinks := replace (vUserLinks, '[USER]', vUserName);
  }
  ?>
<html>
  <head>
    <meta charset="utf-8" />
    <title>ODS user's pages</title>
<?vsp http (vHostLinks); ?><?vsp http (vUserLinks); ?>
    <link rel="stylesheet" type="text/css" href="/ods/users/css/users.css" />
    <link rel="stylesheet" type="text/css" href="/ods/default.css" />
    <link rel="stylesheet" type="text/css" href="/ods/typeahead.css" />
    <link rel="stylesheet" type="text/css" href="/ods/ods-bar.css" />
    <link rel="stylesheet" type="text/css" href="/ods/rdfm.css" />
    <script type="text/javascript" src="/ods/users/js/users.js"></script>
    <script type="text/javascript" src="/ods/common.js"></script>
    <script type="text/javascript" src="/ods/facebook.js"></script>
    <script type="text/javascript" src="/ods/typeahead.js"></script>
    <script type="text/javascript" src="/ods/tbl.js"></script>
    <script type="text/javascript" src="/ods/validate.js"></script>
    <script type="text/javascript">
      // OAT
      var toolkitPath="/ods/oat";
      var featureList = ["ajax", "json", "tab", "combolist", "calendar", "rdfmini", "grid", "graphsvg", "tagcloud", "map", "timeline", "anchor"];
    </script>
    <script type="text/javascript" src="/ods/oat/loader.js"></script>
  </head>
  <body onunload="myCheckLeave (document.forms['page_form'])">
    <div id="fb-root"></div>
    <form name="page_form" id="page_form" method="post" enctype="multipart/form-data">
      <input type="hidden" name="mode" id="mode" value="vsp" />
      <input type="hidden" name="sid" id="sid" value="<?V vSid ?>" />
      <input type="hidden" name="realm" id="realm" value="<?V vRealm ?>" />
      <input type="hidden" name="form" id="form" value="<?V vForm ?>" />
      <input type="hidden" name="formTab" id="formTab" value="<?V vFormTab ?>" />
      <input type="hidden" name="formTab2" id="formTab2" value="<?V vFormTab2 ?>" />
      <input type="hidden" name="formMode" id="formMode" value="<?V vFormMode ?>" />
      <input type="hidden" name="items" id="items" value="" />
      <input type="hidden" name="securityNo" id="securityNo" value="" />
      <div id="ob">
        <div id="ob_left">
          <?vsp
            if (vForm in ('user', 'profile'))
            {
              http (sprintf ('<b>User</b>: %s', xpath_eval ('string (/user/fullName)', vXml)));
              if (vValidate)
                http (sprintf (', <b>Profile</b>: <a href="#" onclick="javascript: return profileSubmit();">Edit</a> / <a href="#" onclick="javascript: return loginUrl();">View</a>'));
            }
          ?>
        </div>
        <div id="ob_right">
        <?vsp
          if (vForm in ('user', 'profile'))
          {
            if (vValidate)
          {
        ?>
          <a href="#" onclick="javascript: return logoutSubmit();">Logout</a>&nbsp;
        <?vsp
            } else {
        ?>
          <a href="#" onclick="javascript: return logoutSubmit();">Login</a>&nbsp;
        <?vsp
            }
          }
        ?>
      </div>
      </div>
      <div id="MD">
        <table cellspacing="0">
          <tr>
            <td valign="top">
              <img class="logo" src="/ods/images/odslogo_200.png" />
            </td>
            <td>
              <?vsp
              if (vForm = 'login')
              {
              ?>
              <div id="lf" class="form">
                <?vsp
                  if (vError <> '')
                    http ('<div class="error">' || vError || '</div>');
                ?>
                <div class="header">
                  Please identify yourself
                </div>
                <ul id="lf_tabs" class="tabs">
                  <li id="lf_tab_0" title="Digest" style="display: none;">Digest</li>
                  <li id="lf_tab_3" title="WebID" style="display: none;">WebID</li>
                  <li id="lf_tab_1" title="OpenID" style="display: none;">OpenID</li>
                  <li id="lf_tab_2" title="Facebook" style="display: none;">Facebook</li>
                  <li id="lf_tab_4" title="Twitter" style="display: none;">Twitter</li>
                  <li id="lf_tab_5" title="LinkedIn" style="display: none;">LinkedIn</li>
                  <li id="lf_tab_6" style="display: none;"></li>
                </ul>
                <div style="min-height: 120px; border: 1px solid #aaa; margin: -13px 5px 5px 5px;">
                  <div id="lf_content"></div>
                  <div id="lf_page_0" class="tabContent" style="display: none;">
                <table class="form" cellspacing="5">
                  <tr>
                        <th width="20%">
                          <label for="lf_uid">User ID</label>
                    </th>
                        <td>
                          <input type="text" name="lf_uid" value="" id="lf_uid" style="width: 150px;" />
                    </td>
                  </tr>
                  <tr>
                    <th>
                      <label for="lf_password">Password</label>
                    </th>
                        <td>
                          <input type="password" name="lf_password" value="" id="lf_password" style="width: 150px;" />
                    </td>
                  </tr>
                    </table>
                  </div>
                  <div id="lf_page_1" class="tabContent" style="display: none;">
                    <table class="form" cellspacing="5">
                  <tr>
                        <th width="20%">
                          <label for="lf_openId">OpenID URL</label>
                    </th>
                        <td>
                          <input type="text" name="lf_openId" value="" id="lf_openId" style="width: 300px;" />
                        </td>
                  </tr>
                    </table>
                  </div>
                  <div id="lf_page_2" class="tabContent" style="display: none;">
                    <table class="form" cellspacing="5">
                  <tr>
                        <th width="20%">
                    </th>
                        <td>
                          <span id="lf_facebookData" style="min-height: 20px;"></span>
                          <br />
                          <fb:login-button autologoutlink="true" xmlns:fb="http://www.facebook.com/2008/fbml"></fb:login-button>
                    </td>
                  </tr>
                </table>
                  </div>
                  <div id="lf_page_3" class="tabContent" style="display: none;">
                    <table id="lf_table_3" class="form" cellspacing="5">
                      <tr id="lf_table_3_throbber">
                        <th width="20%">
                        </th>
                        <td>
                          <img alt="Import WebID Data" src="/ods/images/oat/Ajax_throbber.gif" />
                        </td>
                      </tr>
                    </table>
                  </div>
                  <div id="lf_page_4" class="tabContent" style="display: none;">
                    <table id="lf_table_4" class="form" cellspacing="5">
                      <tr>
                        <th width="20%">
                        </th>
                        <td>
                          <span id="lf_twitter" style="min-height: 20px;"></span>
                          <br />
                          <img id="lf_twitterButton" src="/ods/images/sign-in-with-twitter-d.png" border="0"/>
                        </td>
                      </tr>
                    </table>
                  </div>
                  <div id="lf_page_5" class="tabContent" style="display: none;">
                    <table id="lf_table_5" class="form" cellspacing="5">
                      <tr>
                        <th width="20%">
                        </th>
                        <td>
                          <span id="lf_linkedin" style="min-height: 20px;"></span>
                          <br />
                          <img id="lf_linkedinButton" src="/ods/images/linkedin-large.png" border="0"/>
                        </td>
                      </tr>
                    </table>
                  </div>
                  <div id="lf_page_6" class="tabContent" style="display: none;">
                    <table id="lf_table_6" class="form" cellspacing="5" width="100%">
                      <tr>
                        <td style="text-align: center;">
                          <b>The login is not allowed!</b>
                        </td>
                      </tr>
                    </table>
                  </div>
                </div>
                <div class="footer">
                  <input type="submit" name="lf_login" value="Login" id="lf_login" onclick="javascript: return lfLoginSubmit();" />
                  <input type="submit" name="lf_register" value="Sign Up" id="lf_register" />
                </div>
              </div>
              <?vsp
              }
              if (vForm = 'register')
              {
              ?>
              <div id="rf" class="form">
                <div class="header">
                  User Registration
                </div>
                <ul id="rf_tabs" class="tabs">
                  <li id="rf_tab_0" title="Digest" style="display: none;">Digest</li>
                  <li id="rf_tab_3" title="WebID" style="display: none;">WebID</li>
                  <li id="rf_tab_1" title="OpenID" style="display: none;">OpenID</li>
                  <li id="rf_tab_2" title="Facebook" style="display: none;">Facebook</li>
                  <li id="rf_tab_4" title="Twitter" style="display: none;">Twitter</li>
                  <li id="rf_tab_5" title="LinkedIn" style="display: none;">LinkedIn</li>
                  <li id="rf_tab_6" style="display: none;"></li>
                </ul>
                <div style="min-height: 140px; border: 1px solid #aaa; margin: -13px 5px 5px 5px;">
                  <div id="rf_content"></div>
                  <div id="rf_page_0" class="tabContent" style="display: none;">
                    <table id="rf_table_0" class="form" cellspacing="5">
                      <tr>
                        <th width="20%">
                          <label for="rf_uid_0">Login Name<div style="font-weight: normal; display:inline; color:red;"> *</div></label>
                        </th>
                        <td>
                          <input type="text" name="rf_uid_0" id="rf_uid_0" value="" style="width: 150px;" />
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="rf_email_0">E-mail<div style="font-weight: normal; display:inline; color:red;"> *</div></label>
                        </th>
                        <td>
                          <input type="text" name="rf_email_0" id="rf_email_0" value="" style="width: 300px;" />
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="rf_password">Password<div style="font-weight: normal; display:inline; color:red;"> *</div></label>
                        </th>
                        <td>
                          <input type="password" name="rf_password" value="" id="rf_password" style="width: 150px;" />
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="rf_password2">Password (verify)<div style="font-weight: normal; display:inline; color:red;"> *</div></label>
                        </th>
                        <td>
                          <input type="password" name="rf_password2" value="" id="rf_password2" style="width: 150px;" />
                        </td>
                      </tr>
                    </table>
                  </div>
                  <div id="rf_page_1" class="tabContent" style="display: none;">
                    <table id="rf_table_1" class="form" cellspacing="5">
                      <tr>
                        <th width="20%">
                          <label for="rf_openId">OpenID</label>
                        </th>
                        <td>
                          <input type="text" name="rf_openId" value="" id="rf_openId" style="width: 300px;" />
                        </td>
                      </tr>
                    </table>
                  </div>
                  <div id="rf_page_2" class="tabContent" style="display: none;">
                    <table id="rf_table_2" class="form" cellspacing="5">
                      <tr>
                        <th width="20%">
                        </th>
                        <td>
                          <span id="rf_facebookData" style="min-height: 20px;"></span>
                          <br />
                          <fb:login-button autologoutlink="true" xmlns:fb="http://www.facebook.com/2008/fbml"></fb:login-button>
                        </td>
                      </tr>
                    </table>
                  </div>
                  <div id="rf_page_3" class="tabContent" style="display: none;">
                    <table id="rf_table_3" class="form" cellspacing="5">
                      <tr id="rf_table_3_throbber">
                        <th width="20%">
                        </th>
                        <td>
                          <img alt="Import WebID Data" src="/ods/images/oat/Ajax_throbber.gif" />
                        </td>
                      </tr>
                    </table>
                  </div>
                  <div id="rf_page_4" class="tabContent" style="display: none;">
                    <table id="rf_table_4" class="form" cellspacing="5">
                      <tr>
                        <th width="20%">
                        </th>
                        <td>
                          <span id="rf_twitter" style="min-height: 20px;"></span>
                          <br />
                          <img id="rf_twitterButton" src="/ods/images/sign-in-with-twitter-d.png" border="0"/></a>
                        </td>
                      </tr>
                    </table>
                  </div>
                  <div id="rf_page_5" class="tabContent" style="display: none;">
                    <table id="rf_table_5" class="form" cellspacing="5">
                      <tr>
                        <th width="20%">
                        </th>
                        <td>
                          <span id="rf_linkedin" style="min-height: 20px;"></span>
                          <br />
                          <img id="rf_linkedinButton" src="/ods/images/linkedin-large.png" border="0"/>
                        </td>
                      </tr>
                    </table>
                  </div>
                  <div id="rf_page_6" class="tabContent" style="display: none;">
                    <table id="rf_table_6" class="form" cellspacing="5" width="100%">
                      <tr>
                        <td style="text-align: center;">
                          <b>The registration is not allowed!</b>
                        </td>
                      </tr>
                    </table>
                  </div>
                </div>
                <div>
                  <table class="form" cellspacing="5">
                    <tr>
                      <th width="20%">
                      </th>
                      <td>
                        <input type="checkbox" name="rf_is_agreed" value="1" id="rf_is_agreed"/><label for="rf_is_agreed">I agree to the <a href="/ods/terms.html" target="_blank">Terms of Service</a>.</label>
                      </td>
                    </tr>
                  </table>
                </div>
                <div class="footer" id="rf_login_5">
                  <input type="button" id="rf_check" name="rf_check" value="Check Availabilty" onclick="javascript: return rfCheckAvalability();" />
                  <input type="button" id="rf_signup" name="rf_signup" value="Sign Up" onclick="javascript: return rfSignupSubmit();" />
                </div>
              </div>
              <?vsp
              }
              if (vForm = 'user')
              {
              ?>
              <div id="uf" class="form" style="width: 800px;">
                <div class="header">
                  User profile
                </div>
                <div id="uf_div" style="clear: both;">
                <?vsp
                  declare xt any;

                  vUrl := sprintf ('%s/user.info.webID?webID=%s', vHostUrl, xpath_eval ('string(/user/iri)', vXml));
                  commit work;
                  vResult := http_client_ext (
                               vUrl,
                               http_method=>'GET',
                               http_headers=>vRequest,
                               headers=>vRespond
                             );
                  if (vRespond[0] like 'HTTP/1._ 4__ %' or vRespond[0] like 'HTTP/1._ 5__ %')
                    goto _skip;

                  vXml := xml_tree_doc (vResult);
                  if (xpath_eval ('/failed/message', vXml))
                    goto _skip;

                  xt := xslt ('file://vad/vsp/wa/users/users.xsl', vXml);
                  http_value (xt);
                _skip:;
                ?>
                </div>
              </div>
              <?vsp
              }
              if (vForm = 'profile')
              {
              ?>
              <div id="pf" class="form" style="width: 100%;">
                <?vsp
                  if (vError <> '')
                    http ('<div class="error">' || vError || '</div>');
                ?>
                <div class="header">
                  Update user profile
                </div>
                <ul id="pf_tabs" class="tabs">
                  <li id="pf_tab_0" title="Personal">Personal</li>
                  <li id="pf_tab_1" title="Business">Business</li>
                  <li id="pf_tab_2" title="Security">Security</li>
                </ul>
                <div style="min-height: 180px; border-top: 1px solid #aaa; margin: -13px 5px 5px 5px;">
                  <?vsp
                  if (vFormTab = 0)
                  {
                  ?>
                  <div id="pf_page_0" class="tabContent" style="display:none;">
                    <ul id="pf_tabs_0" class="tabs">
                      <div id="pf_tabs_0_row_0" style="margin-top: 4px;">
                      <li id="pf_tab_0_0">Profile Import</li>
                      <li id="pf_tab_0_1">Main</li>
                      <li id="pf_tab_0_2">Address</li>
                      <li id="pf_tab_0_3">Online Accounts</li>
                      <li id="pf_tab_0_4">Messaging Services</li>
                      <li id="pf_tab_0_5">Biographical Events</li>
                      </div>
                      <div id="pf_tabs_0_row_1" style="margin-top: 4px;">
                      <li id="pf_tab_0_6">Owns</li>
                      <li id="pf_tab_0_7">Favorite Things</li>
                      <li id="pf_tab_0_8">Creator Of</li>
                      <li id="pf_tab_0_9">My Offers</li>
                      <li id="pf_tab_0_10">Offers I Seek</li>
                      <li id="pf_tab_0_11">Likes & DisLikes</li>
                      <li id="pf_tab_0_12">Social Network</li>
                      </div>
                    </ul>
                    <div style="min-height: 180px; min-width: 650px; border-top: 1px solid #aaa; margin: -13px 5px 5px 5px;">
                        <?vsp
                      if (vFormTab2 = 0)
                        {
                        ?>
                      <div id="pf_page_0_0" class="tabContent" style="display:none;">
                    <table class="form" cellspacing="5">
                      <tr>
                            <th>
                              <label for="pf_foaf">Profile Document URL</label>
                            </th>
                            <td>
                              <input type="text" name="pf_foaf" value="" id="pf_foaf" style="width: 400px;" />
                              <input type="button" value="Import" onclick="javascript: pfGetFOAFData($v('pf_foaf')); return false;" class="button" />
                              <img id="pf_import_image" alt="Import FOAF Data" src="/ods/images/oat/Ajax_throbber.gif" style="display: none;" />
                            </td>
                          </tr>
                        </table>
                        <table id="i_tbl" class="listing" style="display: none;">
                          <thead>
                            <tr class="listing_header_row">
                              <th width="1%"><input type="checkbox" name="cb_all" value="Select All" onclick="selectAllCheckboxes(this, 'cb_item')" /></th>
                              <th>Field</th>
                              <th>Value</th>
                            </tr>
                          </thead>
                          <tbody id="i_tbody">
                          </tbody>
                        </table>
                      </div>
                        <?vsp
                      }
                      if (vFormTab2 = 1)
                        {
                        ?>
                      <div id="pf_page_0_1" class="tabContent" style="display:none;">
                        <table class="form" cellspacing="5">
                          <tr>
                            <th>Account deactivation</th>
                            <td>
                              <input type="button" value="Deactivate" onclick="return userDisable('pf_loginName');" />
                            </td>
                          </tr>
                          <tr>
                            <th width="30%">
                              <label for="pf_loginName">Login Name</label>
                            </th>
                            <td>
                              <?V xpath_eval ('string (/user/name)', vXml) ?>
                              <input type="hidden" name="pf_loginName" value="<?V xpath_eval ('string (/user/name)', vXml) ?>" id="pf_loginName" />
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_nickName">Nick Name</label>
                            </th>
                            <td>
                              <input type="text" name="pf_nickName" value="<?V xpath_eval ('string (/user/nickName)', vXml) ?>" id="pf_nickName" style="width: 220px;" />
                            </td>
                          </tr>
                          <tr>
                            <th>
                          <label for="pf_title">Title</label>
                        </th>
                        <td>
                          <select name="pf_title" id="pf_title">
                            <option></option>
                            <?vsp
                                  items := vector ('Mr', 'Mrs', 'Dr', 'Ms', 'Sir');
                              foreach (any item in items) do
                                http (sprintf('<option %s>%s</option>', case when (item = xpath_eval ('string (/user/title)', vXml)) then 'selected="selected"' else '' end, item));
                            ?>
                          </select>
                              <select name="pf_acl_title" id="pf_acl_title">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/title)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_firstName">First Name</label>
                        </th>
                        <td>
                          <input type="text" name="pf_firstName" value="<?V xpath_eval ('string (/user/firstName)', vXml) ?>" id="pf_firstName" style="width: 220px;" />
                              <select name="pf_acl_firstName" id="pf_acl_firstName">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/firstName)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_lastName">Last Name</label>
                        </th>
                        <td>
                          <input type="text" name="pf_lastName" value="<?V xpath_eval ('string (/user/lastName)', vXml) ?>" id="pf_lastName" style="width: 220px;" />
                              <select name="pf_acl_lastName" id="pf_acl_lastName">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/lastName)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_fullName">Full Name</label>
                        </th>
                        <td>
                              <input type="text" name="pf_fullName" value="<?V xpath_eval ('string (/user/fullName)', vXml) ?>" id="pf_fullName" style="width: 400px;" />
                              <select name="pf_acl_fullName" id="pf_acl_fullName">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/fullName)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_mail">E-mail</label>
                        </th>
                        <td>
                          <input type="text" name="pf_mail" value="<?V xpath_eval ('string (/user/mail)', vXml) ?>" id="pf_mail" style="width: 220px;" />
                              <select name="pf_acl_mail" id="pf_acl_mail">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/mail)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_gender">Gender</label>
                        </th>
                        <td>
                          <select name="pf_gender" value="" id="pf_gender">
                            <option></option>
                            <?vsp
                              items := vector ('Male', 'Female');
                              foreach (any item in items) do
                                http (sprintf('<option %s>%s</option>', case when (item = xpath_eval ('string (/user/gender)', vXml)) then 'selected="selected"' else '' end, item));
                            ?>
                          </select>
                              <select name="pf_acl_gender" id="pf_acl_gender">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/gender)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_birthday">Birthday</label>
                        </th>
                        <td>
                          <input name="pf_birthday" id="pf_birthday" value="<?V xpath_eval ('string (/user/birthday)', vXml) ?>" onclick="datePopup('pf_birthday');"/>
                              <select name="pf_acl_birthday" id="pf_acl_birthday">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/birthday)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                            <th valign="top">
                          <label for="pf_homepage">Personal Webpage</label>
                        </th>
                        <td>
                              <input type="text" name="pf_homepage" value="<?V xpath_eval ('string (/user/homepage)', vXml) ?>" id="pf_mail" style="width: 400px;" />
                              <select name="pf_acl_homepage" id="pf_acl_homepage">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/homepage)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                            <th valign="top">
                              <label for="pf_foaf">Other Personal URIs (Web IDs)</label>
                        </th>
                            <td valign="top">
                              <table>
                                <tr>
                                  <td width="500px" style="padding: 0px;">
                                    <table id="x1_tbl" class="listing">
                                      <thead>
                                        <tr class="listing_header_row">
                                          <th>
                                            URI
                                          </th>
                                          <th width="10%">
                                            Access
                                          </th>
                                          <th width="65px">
                                            Action
                                          </th>
                                        </tr>
                                      </thead>
                                      <tr id="x1_tr_no" style="display: none;"><td colspan="2"><b>No Personal URIs</b></td></tr>
                                      <script type="text/javascript">
                                        OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowRows("x1", "<?V replace(cast (xpath_eval ('string (/user/webIDs)', vXml) as varchar), '\n', '\\n') ?>", ["\n", ";"], function(prefix, val1, val2){TBL.createRow(prefix, null, {fld_1: {value: val1, className: '_validate_ _webid_ _canEmpty_'}, fld_2: {mode: 4, value: val2}});});});
                                      </script>
                                    </table>
                                  </td>
                                  <td valign="top" nowrap="nowrap">
                                    <span class="button pointer" onclick="TBL.createRow('x1', null, {fld_1: {className: '_validate_ _webid_ _canEmpty_'}, fld_2: {mode: 4}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Row" title="Add Row" /> Add</span>
                                  </td>
                                </tr>
                              </table>
                        </td>
                      </tr>
                      <tr>
                            <th valign="top">
                              <label for="pf_mailSignature">Mail Signature</label>
                        </th>
                        <td>
                              <textarea name="pf_mailSignature" id="pf_mailSignature" style="width: 400px;"><?vsp xpath_eval ('string (/user/mailSignature)', vXml); ?></textarea>
                        </td>
                      </tr>
                      <tr>
                            <th valign="top">
                              <label for="pf_summary">Summary</label>
                        </th>
                            <td valign="top" >
                              <textarea name="pf_summary" id="pf_summary" style="width: 400px;"><?vsp xpath_eval ('string (/user/summary)', vXml); ?></textarea>
                              <select name="pf_acl_summary" id="pf_acl_summary">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/summary)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                            <th valign="top">
                              <label>Web page URL indicating a topic of interest</label>
                        </th>
                            <td valign="top">
                              <table>
                                <tr>
                                  <td width="500px" style="padding: 0px;">
                                    <table id="x2_tbl" class="listing">
                                      <thead>
                                        <tr class="listing_header_row">
                                          <th>
                                            URL
                                          </th>
                                          <th>
                                            Label
                                          </th>
                                          <th width="65px">
                                            Action
                                          </th>
                                        </tr>
                                      </thead>
                                      <tr id="x2_tr_no" style="display: none;"><td colspan="3"><b>No Topic of Interests</b></td></tr>
                                      <script type="text/javascript">
                                        OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowRows("x2", "<?V replace(cast (xpath_eval ('string (/user/topicInterests)', vXml) as varchar), '\n', '\\n') ?>", ["\n", ";"], function(prefix, val1, val2){TBL.createRow(prefix, null, {fld_1: {value: val1, className: '_validate_ _url_ _canEmpty_'}, fld_2: {value: val2}});});});
                                      </script>
                                    </table>
                                  </td>
                                  <td valign="top" nowrap="nowrap">
                                    <span class="button pointer" onclick="TBL.createRow('x2', null, {fld_1: {className: '_validate_ _url_ _canEmpty_'}, fld_2: {}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Row" title="Add Row" /> Add</span>
                                    <select name="pf_acl_topicInterests" id="pf_acl_topicInterests">
                                      <?vsp
                                        for (N := 0; N < length (xAcl); N := N + 2)
                                          http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/topicInterests)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                      ?>
                                    </select>
                                  </td>
                                </tr>
                              </table>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label>Resource URI indicating thing of interest</label>
                        </th>
                            <td valign="top">
                              <table>
                                <tr>
                                  <td width="500px" style="padding: 0px;">
                                    <table id="x3_tbl" class="listing">
                                      <thead>
                                        <tr class="listing_header_row">
                                          <th>
                                            URL
                                          </th>
                                          <th>
                                            Label
                                          </th>
                                          <th width="65px">
                                            Action
                                          </th>
                                        </tr>
                                      </thead>
                                      <tr id="x3_tr_no" style="display: none;"><td colspan="3"><b>No Thing of Interests</b></td></tr>
                                      <script type="text/javascript">
                                        OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowRows("x3", "<?V replace(cast (xpath_eval ('string (/user/interests)', vXml) as varchar), '\n', '\\n') ?>", ["\n", ";"], function(prefix, val1, val2){TBL.createRow(prefix, null, {fld_1: {value: val1, className: '_validate_ _url_ _canEmpty_'}, fld_2: {value: val2}});});});
                                      </script>
                                    </table>
                                  </td>
                                  <td valign="top" nowrap="nowrap">
                                    <span class="button pointer" onclick="TBL.createRow('x3', null, {fld_1: {className: '_validate_ _url_ _canEmpty_'}, fld_2: {}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Row" title="Add Row" /> Add</span>
                                    <select name="pf_acl_interests" id="pf_acl_interests">
                                      <?vsp
                                        for (N := 0; N < length (xAcl); N := N + 2)
                                          http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/interests)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                      ?>
                                    </select>
                                  </td>
                                </tr>
                              </table>
                        </td>
                      </tr>
                          <tr>
                            <th>
                              <label for="pf_photoContent">Upload Photo</label>
                            </th>
                            <td nowrap="1" class="listing_col">
                              <input type="file" name="pf_photoContent" id="pf_photoContent"onblur="javascript: getFileName(this.form, this, this.form.pf_photo);">
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_photo">Photo</label>
                            </th>
                            <td nowrap="1" class="listing_col">
                              <input type="text" name="pf_photo" id="pf_photo" value="<?V xpath_eval ('string (/user/photo)', vXml) ?>" style="width: 400px;" >
                              <select name="pf_acl_photo" id="pf_acl_photo">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/photo)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_audioContent">Upload Audio</label>
                            </th>
                            <td nowrap="1" class="listing_col">
                              <input type="file" name="pf_audioContent" id="pf_audioContent"onblur="javascript: getFileName(this.form, this, this.form.pf_audio);">
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_audio">Audio</label>
                            </th>
                            <td nowrap="1" class="listing_col">
                              <input type="text" name="pf_audio" id="pf_audio"value="<?V xpath_eval ('string (/user/audio)', vXml) ?>" style="width: 400px;" >
                              <select name="pf_acl_audio" id="pf_acl_audio">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/audio)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_appSetting">Show &lt;a&gt;++ links</label>
                            </th>
                            <td>
                              <select name="pf_appSetting" id="pf_appSetting">
                                <?vsp
                                  items := vector (vector ('0', 'disabled'), vector ('1', 'click'), vector ('2', 'hover'));
                                  foreach (any item in items) do
                                    http (sprintf('<option value="%s" %s>%s</option>', item[0], case when (item[0] = xpath_eval ('string (/user/appSetting)', vXml)) then 'selected="selected"' else '' end, item[1]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                            <td>
                              <label>
                                <?vsp
                                  http (sprintf('<input type="checkbox" id="pf_spbEnable" name="pf_spbEnable" value="1" %s>', case when (xpath_eval ('string (/user/spbEnable)', vXml) = '1') then 'checked="checked"' else '' end));
                                ?>
                                <b>Enable Semantic Pingback for ACLs</b>
                              </label>
                            </td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                            <td>
                             <label>
                                <?vsp
                                  http (sprintf('<input type="checkbox" id="pf_inSearch" name="pf_inSearch" value="1" %s>', case when (xpath_eval ('string (/user/inSearch)', vXml) = '1') then 'checked="checked"' else '' end));
                                ?>
                               <b>Include my profile in search results</b>
                             </label>
                            </td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                            <td>
                             <label>
                                <?vsp
                                  http (sprintf('<input type="checkbox" id="pf_showActive" name="pf_showActive" value="1" %s>', case when (xpath_eval ('string (/user/showActive)', vXml) = '1') then 'checked="checked"' else '' end));
                                ?>
                               <b>Include in User active information</b>
                             </label>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_set_0_1">Set access for all fields as </label>
                            </th>
                            <td>
                              <select name="pf_set_0_1" id="pf_set_0_1" value="0" class="dummy" onchange="javascript: pfSetACLSelects (this)">
                                <option value="0">*no change*</option>
                                <option value="1">public</option>
                                <option value="2">acl</option>
                                <option value="3">private</option>
                              </select>
                            </td>
                          </tr>
                    </table>
                  </div>
                        <?vsp
                      }
                      if (vFormTab2 = 2)
                        {
                        ?>
                      <div id="pf_page_0_2" class="tabContent" style="display:none;">
                    <table class="form" cellspacing="5">
                      <tr>
                        <th width="30%">
                          <label for="pf_homecountry">Country</label>
                        </th>
                            <td>
                          <select name="pf_homecountry" id="pf_homecountry" onchange="javascript: return updateState('pf_homecountry', 'pf_homestate');" style="width: 220px;">
                            <option></option>
                            <?vsp
                              items := vLists[1];
                              foreach (any item in items) do
                                http (sprintf('<option %s>%s</option>', case when (item = xpath_eval ('string (/user/homeCountry)', vXml)) then 'selected="selected"' else '' end, item));
                            ?>
                          </select>
                              <select name="pf_acl_homecountry" id="pf_acl_homecountry">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/homeCountry)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_homeState">State/Province</label>
                        </th>
                            <td>
                          <span id="span_pf_homestate">
                            <script type="text/javascript">
                                  OAT.MSG.attach(OAT, "PAGE_LOADED", function (){updateState("pf_homecountry", "pf_homestate", "<?V xpath_eval ('string (/user/homeState)', vXml) ?>");});
                            </script>
                          </span>
                              <select name="pf_acl_homeState" id="pf_acl_homeState">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/homeState)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_homecity">City/Town</label>
                        </th>
                            <td>
                              <input type="text" name="pf_homecity" value="<?V xpath_eval ('string (/user/homeCity)', vXml) ?>" id="pf_homecity" style="width: 216px;" />
                              <select name="pf_acl_homeCity" id="pf_acl_homeCity">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/homeCity)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_homecode">Zip/Postal Code</label>
                        </th>
                        <td>
                              <input type="text" name="pf_homecode" value="<?V xpath_eval ('string (/user/homeCode)', vXml) ?>" id="pf_homecode" style="width: 216px;" />
                              <select name="pf_acl_homeCode" id="pf_acl_homeCode">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/homeCode)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_homeaddress1">Address1</label>
                        </th>
                            <td>
                              <input type="text" name="pf_homeaddress1" value="<?V xpath_eval ('string (/user/homeAddress1)', vXml) ?>" id="pf_homeaddress1" style="width: 216px;" />
                              <select name="pf_acl_homeAddress1" id="pf_acl_homeAddress1">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/homeAddress1)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_homeaddress2">Address2</label>
                        </th>
                            <td>
                              <input type="text" name="pf_homeaddress2" value="<?V xpath_eval ('string (/user/homeAddress2)', vXml) ?>" id="pf_homeAddress2" style="width: 216px;" />
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_homeTimezone">Time-Zone</label>
                        </th>
                        <td>
                              <select name="pf_homeTimezone" id="pf_homeTimezone" style="width: 114px;" >
                            <?vsp
                              declare N integer;
                              for (N := -12; N <= 12; N := N + 1)
                              {
                                http (sprintf ('<option value="%d" %s>GMT %d:00</option>', N, case when (cast (N as varchar) = xpath_eval ('string (/user/homeTimezone)', vXml)) then 'selected="selected"' else '' end, N));
                              }
                            ?>
                          </select>
                              <select name="pf_acl_homeTimezone" id="pf_acl_homeTimezone">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/homeTimezone)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_homelat">Latitude</label>
                        </th>
                            <td>
                              <input type="text" name="pf_homelat" value="<?V xpath_eval ('string (/user/homeLatitude)', vXml) ?>" id="pf_homelat" style="width: 110px;" />
                              <select name="pf_acl_homeLatitude" id="pf_acl_homeLatitude">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/homeLatitude)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        <td>
                      <tr>
                      <tr>
                        <th>
                          <label for="pf_homelng">Longitude</label>
                        </th>
                        <td>
                              <input type="text" name="pf_homelng" value="<?V xpath_eval ('string (/user/homeLongitude)', vXml) ?>" id="pf_homelng" style="width: 110px;" />
                              <label>
                                <input type="checkbox" name="pf_homeDefaultMapLocation" id="pf_homeDefaultMapLocation" onclick="javascript: setDefaultMapLocation('home', 'business');" />
                                Use as default map location
                              </label>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_homePhone">Phone</label>
                        </th>
                        <td>
                              <input type="text" name="pf_homePhone" value="<?V xpath_eval ('string (/user/homePhone)', vXml) ?>" id="pf_homePhone" style="width: 110px;" />
                              <b>Ext.</b>
                              <input type="text" name="pf_homePhoneExt" value="<?V xpath_eval ('string (/user/homePhoneExt)', vXml) ?>" id="pf_homePhoneExt" style="width: 40px;" />
                              <select name="pf_acl_homePhone" id="pf_acl_homePhone">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/homePhone)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_homeMobile">Mobile</label>
                        </th>
                        <td>
                              <input type="text" name="pf_homeMobile" value="<?V xpath_eval ('string (/user/homeMobile)', vXml) ?>" id="pf_homeMobile" style="width: 110px;" />
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_set_0_2">Set access for all fields as </label>
                            </th>
                            <td>
                              <select name="pf_set_0_2" id="pf_set_0_2" value="0" class="dummy" onchange="javascript: pfSetACLSelects (this)">
                                <option value="0">*no change*</option>
                                <option value="1">public</option>
                                <option value="2">acl</option>
                                <option value="3">private</option>
                              </select>
                        </td>
                      </tr>
                    </table>
                  </div>
                        <?vsp
                      }
                      if (vFormTab2 = 3)
                        {
                        ?>
                      <div id="pf_page_0_3" class="tabContent" style="display:none;">
                        <input type="hidden" name="c_nick" value="<?V xpath_eval ('string (/user/nickName)', vXml) ?>" id="c_nick" />
                    <table class="form" cellspacing="5">
                      <tr>
                            <td width="800px">
                              <table id="x4_tbl" class="listing">
                                <thead>
                                  <tr class="listing_header_row">
                                    <th>
                                      Select from Service List ot Type New One
                        </th>
                                    <th>
                                      Member Home Page URI
                                    </th>
                                    <th>
                                      Account URI
                                    </th>
                                    <th width="65px">
                                      Action
                                    </th>
                                  </tr>
                                </thead>
                                <tr id="x4_tr_no" style="display: none;"><td colspan="3"><b>No Services</b></td></tr>
                                <script type="text/javascript">
                                  OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowOnlineAccounts("x4", "P", function(prefix, val0, val1, val2, val3){TBL.createRow(prefix, null, {id: val0, fld_1: {mode: 10, value: val1}, fld_2: {value: val2, className: '_validate_ _uri_ _canEmpty_'}, fld_3: {value: val3}});});});
                                </script>
                              </table>
                            </td>
                            <td valign="top" nowrap="1">
                              <span class="button pointer" onclick="TBL.createRow('x4', null, {fld_1: {mode: 10}, fld_2: {className: '_validate_ _uri_ _canEmpty_'}, fld_3: {}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Row" title="Add Row" /> Add</span>
                            </td>
                          </tr>
                        </table>
                      </div>
                        <?vsp
                      }
                      if (vFormTab2 = 4)
                        {
                        ?>
                      <div id="pf_page_0_4" class="tabContent" style="display:none;">
                        <table id="x6_tbl" class="form" cellspacing="5">
                          <tr>
                            <th width="30%">
                              <label for="pf_icq">ICQ</label>
                            </th>
                            <td colspan="2">
                              <input type="text" name="pf_icq" value="<?V xpath_eval ('string (/user/icq)', vXml) ?>" id="pf_icq" style="width: 220px;" />
                              <select name="pf_acl_icq" id="pf_acl_icq">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/icq)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_skype">Skype</label>
                            </th>
                            <td colspan="2">
                              <input type="text" name="pf_skype" value="<?V xpath_eval ('string (/user/skype)', vXml) ?>" id="pf_skype" style="width: 220px;" />
                              <select name="pf_acl_skype" id="pf_acl_skype">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/skype)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_yahoo">Yahoo</label>
                            </th>
                            <td colspan="2">
                              <input type="text" name="pf_yahoo" value="<?V xpath_eval ('string (/user/yahoo)', vXml) ?>" id="pf_yahoo" style="width: 220px;" />
                              <select name="pf_acl_yahoo" id="pf_acl_yahoo">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/yahoo)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_aim">AIM</label>
                            </th>
                            <td colspan="2">
                              <input type="text" name="pf_aim" value="<?V xpath_eval ('string (/user/aim)', vXml) ?>" id="pf_aim" style="width: 220px;" />
                              <select name="pf_acl_aim" id="pf_acl_aim">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/aim)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_msn">MSN</label>
                            </th>
                            <td colspan="2">
                              <input type="text" name="pf_msn" value="<?V xpath_eval ('string (/user/msn)', vXml) ?>" id="pf_msn" style="width: 220px;" />
                              <select name="pf_acl_msn" id="pf_acl_msn">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/msn)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>Add other services</th>
                            <td>
                              <span class="button pointer" onclick="TBL.createRow('x6', null, {fld_1: {}, fld_2: {cssText: 'width: 220px;'}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Row" title="Add Row" /> Add</span>
                            </td>
                            <td width="40%">
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_set_0_4">Set access for all fields as </label>
                            </th>
                            <td colspan="2">
                              <select name="pf_set_0_4" id="pf_set_0_4" value="0" class="dummy" onchange="javascript: pfSetACLSelects (this)">
                                <option value="0">*no change*</option>
                                <option value="1">public</option>
                                <option value="2">acl</option>
                                <option value="3">private</option>
                              </select>
                            </td>
                          </tr>
                          <script type="text/javascript">
                            OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowRows("x6", "<?V replace(cast (xpath_eval ('string (/user/messaging)', vXml) as varchar), '\n', '\\n') ?>", ["\n", ";"], function(prefix, val1, val2){TBL.createRow(prefix, null, {fld_1: {value: val1}, fld_2: {value: val2, cssText: 'width: 220px;'}});});});
                          </script>
                        </table>
                      </div>
                        <?vsp
                        }
                      if (vFormTab2 = 5)
                      {
                        ?>
                      <div id="pf_page_0_5" class="tabContent" style="display:none;">
                        <table class="form" cellspacing="5">
                          <tr>
                            <td width="600px">
                              <table id="x5_tbl" class="listing">
                                <thead>
                                  <tr class="listing_header_row">
                                    <th width="15%">
                                      Event
                                    </th>
                                    <th width="15%">
                                      Date
                                    </th>
                                    <th>
                                      Place
                                    </th>
                                    <th width="65px">
                                      Action
                                    </th>
                                  </tr>
                                </thead>
                                <tr id="x5_tr_no" style="display: none;"><td colspan="4"><b>No Biographical Events</b></td></tr>
                                <script type="text/javascript">
                                  OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowBioEvents("x5", function(prefix, val0, val1, val2, val3){TBL.createRow(prefix, null, {id: val0, fld_1: {mode: 11, value: val1}, fld_2: {value: val2}, fld_3: {value: val3}});});});
                                </script>
                              </table>
                            </td>
                            <td valign="top" nowrap="1">
                              <span class="button pointer" onclick="TBL.createRow('x5', null, {fld_1: {mode: 11}, fld_2: {}, fld_3: {}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Row" title="Add Row" /> Add</span>
                            </td>
                          </tr>
                        </table>
                          </div>
                        <?vsp
                        }
                      if (vFormTab2 = 6)
                          {
                          ?>
                      <div id="pf_page_0_6" class="tabContent" style="display:none;">
                            <h3>Owns</h3>
                            <?vsp
                              if (vFormMode = '')
                              {
                        ?>
                            <div id="pf051_list">
                              <div style="padding: 0 0 0.5em 0;">
                                <span onclick="javascript: $('formMode').value = 'new'; $('page_form').submit();" class="button pointer"><img class="button" border="0" title="Add Offer" alt="Add Offer" src="/ods/images/icons/add_16.png"> Add</span>
                              </div>
                          	  <table id="pf051_tbl" class="listing">
                          	    <thead>
                          	      <tr class="listing_header_row">
                            		    <th>Name</th>
                            		    <th>Description</th>
                            		    <th width="1%" nowrap="nowrap">Action</th>
                          	      </tr>
                                </thead>
                          	    <tbody id="pf051_tbody">
                                  <script type="text/javascript">
                                    OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowOwns();});
                                  </script>
                          	    </tbody>
                              </table>
                      </div>
                      <?vsp
                              }
                              else
                      {
                                http (sprintf ('<input type="hidden" id="pf051_id" name="pf051_id" value="%s" />', get_keyword ('pf051_id', params, '0')));
                            ?>
                            <div id="pf051_form">
                              <table class="form" cellspacing="5">
              		        		  <tr>
                                  <th width="25%">
              		                  Access
              		                </th>
              		                <td>
                                    <select name="pf051_flag" id="pf051_flag">
                                      <option value="1">public</option>
                                      <option value="2">acl</option>
                                      <option value="3">private</option>
                                    </select>
                                  </td>
                                </tr>
                                <tr>
                                  <th>
                                    Name
                                  </th>
                                  <td>
                                    <input type="text" name="pf051_name" id="pf051_name" value="" class="_validate_" style="width: 400px;">
                                  </td>
                                </tr>
                                <tr>
                                  <th>
                                    Comment
                                  </th>
                                  <td>
                                    <textarea name="pf051_comment" id="pf051_comment" class="_validate_ _canEmpty_" style="width: 400px;"></textarea>
                                  </td>
                                </tr>
              		        		  <tr>
              		        		    <th valign="top">
              		                  Products
              		                </th>
              		                <td width="800px">
                                    <table id="ow_tbl" class="listing">
                                      <tbody id="ow_tbody">
                                        <tr id="ow_throbber">
                                          <td>
                                            <img src="/ods/images/oat/Ajax_throbber.gif" />
                                          </td>
                                        </tr>
                                      </tbody>
                                    </table>
                                    <input type="hidden" id="ow_no" name="ow_no" value="1" />
                                  </td>
                                </tr>
                              </table>
                              <script type="text/javascript">
                                OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowOwn();});
                              </script>
                              <div class="footer">
                                <input type="submit" name="pf_cancel2" value="Cancel" onclick="needToConfirm = false;"/>
                                <input type="submit" name="pf_update051" value="Save" onclick="myBeforeSubmit(); return validateInputs(this, 'pf051');"/>
                              </div>
                            </div>
                            <?vsp
                              }
                            ?>
                          </div>
                          <?vsp
                          }
                      if (vFormTab2 = 7)
                        {
                      ?>
                      <div id="pf_page_0_7" class="tabContent" style="display:none;">
                        <h3>Favorites</h3>
                        <?vsp
                          if (vFormMode = '')
                        {
                        ?>
                            <div id="pf052_list">
                          <div style="padding: 0 0 0.5em 0;">
                            <span onclick="javascript: $('formMode').value = 'new'; $('page_form').submit();" class="button pointer"><img class="button" border="0" title="Add 'Fovorite'" alt="Add 'Fovorite'" src="/ods/images/icons/add_16.png"> Add</span>
                          </div>
                          	  <table id="pf052_tbl" class="listing">
                                <thead>
                                  <tr class="listing_header_row">
                        		    <th>Label</th>
                        		    <th>URI</th>
                        		    <th width="1%" nowrap="nowrap">Action</th>
                                  </tr>
                                </thead>
                          	    <tbody id="pf052_tbody">
                                  <script type="text/javascript">
                                    OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowFavorites();});
                                  </script>
                                </tbody>
                              </table>
                        </div>
                        <?vsp
                          }
                          else
                          {
                                http (sprintf ('<input type="hidden" id="pf052_id" name="pf052_id" value="%s" />', get_keyword ('pf052_id', params, '0')));
                        ?>
                            <div id="pf052_form">
                          <table class="form" cellspacing="5">
                            <tr>
                              <th width="25%">
              		                  Access
              		                </th>
              		                <td>
                                    <select name="pf052_flag" id="pf052_flag">
                                      <option value="1">public</option>
                                      <option value="2">acl</option>
                                      <option value="3">private</option>
                                    </select>
                                  </td>
                                </tr>
                                <tr>
                                  <th>
                                Label (*)
                              </th>
                              <td>
                                    <input type="text" name="pf052_label" id="pf052_label" value="" class="_validate_" style="width: 400px;">
                            </td>
                            </tr>
                            <tr>
                              <th>
                                External URI
                              </th>
                              <td>
                                    <input type="text" name="pf052_uri" id="pf052_uri" value="" class="_validate_ _url_ _canEmpty_" style="width: 400px;">
                            </td>
                          </tr>
                            <tr>
                              <th valign="top">
                                Item Properties
                              </th>
                  		        <td width="800px">
                                <table id="r_tbl" class="listing">
                                  <tbody id="r_tbody">
                                  </tbody>
                        </table>
                              </td>
                            </tr>
                          </table>
                          <script type="text/javascript">
                            OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowFavorite();});
                          </script>
                          <div class="footer">
                            <input type="submit" name="pf_cancel2" value="Cancel" onclick="needToConfirm = false; "/>
                                <input type="submit" name="pf_update052" value="Save" onclick="myBeforeSubmit(); return validateInputs(this, 'pf052');"/>
                          </div>
                        </div>
                        <?vsp
                        }
                        ?>
                      </div>
                      <?vsp
                        }
                      if (vFormTab2 = 8)
                        {
                      ?>
                      <div id="pf_page_0_8" class="tabContent" style="display:none;">
                        <h3>Creator Of</h3>
                        <?vsp
                          if (vFormMode = '')
                          {
                        ?>
                            <div id="pf053_list">
                          <div style="padding: 0 0 0.5em 0;">
                            <span onclick="javascript: $('formMode').value = 'new'; $('page_form').submit();" class="button pointer"><img class="button" border="0" title="Add 'Creator Of'" alt="Add 'Creator Of'" src="/ods/images/icons/add_16.png"> Add</span>
                          </div>
                          	  <table id="pf053_tbl" class="listing">
                      	    <thead>
                      	      <tr class="listing_header_row">
                        		    <th>Made Property</th>
                        		    <th>Description</th>
                        		    <th width="1%" nowrap="nowrap">Action</th>
                      	      </tr>
                            </thead>
                          	    <tbody id="pf053_tbody">
                              <script type="text/javascript">
                                OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowMades();});
                              </script>
                      	    </tbody>
                          </table>
                        </div>
                        <?vsp
                          }
                          else
                          {
                                http (sprintf ('<input type="hidden" id="pf053_id" name="pf053_id" value="%s" />', get_keyword ('pf053_id', params, '0')));
                        ?>
                            <div id="pf053_form">
                          <table class="form" cellspacing="5">
                            <tr>
                              <th width="25%">
                                Property (*)
                              </th>
                              <td id="if_opt">
                                <script type="text/javascript">
                                  function p_init ()
                                  {
                                    var fld = new OAT.Combolist([]);
                                        fld.input.name = 'pf053_property';
                                    fld.input.id = fld.input.name;
                                    fld.input.style.width = "400px";
                                    $("if_opt").appendChild(fld.div);
                                    fld.addOption("foaf:made");
                                    fld.addOption("dc:creator");
                                    fld.addOption("sioc:owner");
                                  }
                                  OAT.MSG.attach(OAT, "PAGE_LOADED", p_init);
                                </script>
                              </td>
                            </tr>
                            <tr>
                              <th>
                                URI
                              </th>
                              <td>
                                    <input type="text" name="pf053_url" id="pf053_url" value="" class="_validate_ _url_ _canEmpty_" style="width: 400px;">
                              </td>
                            </tr>
                            <tr>
                              <th>
                                Description (*)
                              </th>
                              <td>
                                    <textarea name="pf053_description" id="pf053_description" style="width: 400px;"></textarea>
                              </td>
                            </tr>
                            <tr>
                              <td />
                              <td>
  		                          <b>Note: The fields designated with '*' will be fetched from the source document if empty</b>
                              </td>
                            </tr>
                          </table>
                          <script type="text/javascript">
                            OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowMade();});
                          </script>
                          <div class="footer">
                            <input type="submit" name="pf_cancel2" value="Cancel" onclick="needToConfirm = false; "/>
                                <input type="submit" name="pf_update053" value="Save" onclick="needToConfirm = false; return validateInputs(this, 'pf053');"/>
                          </div>
                        </div>
                        <?vsp
                          }
                        ?>
                      </div>
                      <?vsp
                        }
                      if (vFormTab2 = 9)
                        {
                      ?>
                      <div id="pf_page_0_9" class="tabContent" style="display:none;">
                        <h3>My Offers</h3>
                        <?vsp
                          if (vFormMode = '')
                          {
                        ?>
                            <div id="pf054_list">
                          <div style="padding: 0 0 0.5em 0;">
                            <span onclick="javascript: $('formMode').value = 'new'; $('page_form').submit();" class="button pointer"><img class="button" border="0" title="Add Offer" alt="Add Offer" src="/ods/images/icons/add_16.png"> Add</span>
                          </div>
                          	  <table id="pf054_tbl" class="listing">
                      	    <thead>
                      	      <tr class="listing_header_row">
                        		    <th>Name</th>
                        		    <th>Description</th>
                        		    <th width="1%" nowrap="nowrap">Action</th>
                      	      </tr>
                            </thead>
                          	    <tbody id="pf054_tbody">
                              <script type="text/javascript">
                                OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowOffers();});
                              </script>
                      	    </tbody>
                          </table>
                        </div>
                        <?vsp
                          }
                          else
                          {
                                http (sprintf ('<input type="hidden" id="pf054_id" name="pf054_id" value="%s" />', get_keyword ('pf054_id', params, '0')));
                        ?>
                            <div id="pf054_form">
                          <table class="form" cellspacing="5">
                            <tr>
                              <th width="25%">
              		                  Access
              		                </th>
              		                <td>
                                    <select name="pf054_flag" id="pf054_flag">
                                      <option value="1">public</option>
                                      <option value="2">acl</option>
                                      <option value="3">private</option>
                                    </select>
                                  </td>
                                </tr>
                                <tr>
                                  <th>
                                Name
                              </th>
                              <td>
                                    <input type="text" name="pf054_name" id="pf054_name" value="" class="_validate_" style="width: 400px;">
                              </td>
                            </tr>
                            <tr>
                              <th>
                                Comment
                              </th>
                              <td>
                                    <textarea name="pf054_comment" id="pf054_comment" class="_validate_ _canEmpty_" style="width: 400px;"></textarea>
                              </td>
                            </tr>
                  				  <tr>
                  				    <th valign="top">
                  		          Products
                  		        </th>
                  		        <td width="800px">
                                    <table class="ctl_grp">
                                      <tr>
                                        <td width="800px">
                                <table id="ol_tbl" class="listing">
                                            <thead>
                                              <tr class="listing_header_row">
                                                <th>
                                                  <div style="width: 16px;"><![CDATA[&nbsp;]]></div>
                                                </th>
                                                <th width="100%">
                                                  Ontology
                                                </th>
                                                <th width="80px">
                                                  Action
                                                </th>
                                    </tr>
                                            </thead>
                                            <tbody id="ol_tbody" class="colorize">
                                              <tr id="ol_tr_no"><td colspan="3"><b>No Attached Ontologies</b></td></tr>
                                  </tbody>
                                </table>
                                        </td>
                                        <td valign="top" nowrap="nowrap">
                                          <span class="button pointer" onclick="TBL.createRow('ol', null, {fld_1: {mode: 40, cssText: 'display: none;'}, fld_2: {mode: 41, labelValue: 'Ontology: ', cssText: 'width: 95%;'}, btn_1: {mode: 40}, btn_2: {mode: 41, title: 'Attach'}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Ontology" title="Add Ontology" /> Add</span>
                                        </td>
                                      </tr>
                                    </table>
                                <input type="hidden" id="ol_no" name="ol_no" value="1" />
                              </td>
                            </tr>
                          </table>
                          <script type="text/javascript">
                            OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowOffer();});
                          </script>
                          <div class="footer">
                            <input type="submit" name="pf_cancel2" value="Cancel" onclick="needToConfirm = false;"/>
                                <input type="submit" name="pf_update054" value="Save" onclick="myBeforeSubmit(); return validateInputs(this, 'pf054');"/>
                          </div>
                        </div>
                        <?vsp
                          }
                        ?>
                      </div>
                      <?vsp
                        }
                      if (vFormTab2 = 10)
                        {
                      ?>
                      <div id="pf_page_0_10" class="tabContent" style="display:none;">
                        <h3>Offers I Seek</h3>
                        <?vsp
                          if (vFormMode = '')
                          {
                        ?>
                            <div id="pf055_list">
                          <div style="padding: 0 0 0.5em 0;">
                            <span onclick="javascript: $('formMode').value = 'new'; $('page_form').submit();" class="button pointer"><img class="button" border="0" title="Add Seek" alt="Add Seek" src="/ods/images/icons/add_16.png"> Add</span>
                          </div>
                          	  <table id="pf055_tbl" class="listing">
                      	    <thead>
                      	      <tr class="listing_header_row">
                        		    <th>Name</th>
                        		    <th>Description</th>
                        		    <th width="1%" nowrap="nowrap">Action</th>
                      	      </tr>
                            </thead>
                          	    <tbody id="pf055_tbody">
                              <script type="text/javascript">
                                OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowSeeks();});
                              </script>
                      	    </tbody>
                          </table>
                        </div>
                        <?vsp
                          }
                          else
                          {
                                http (sprintf ('<input type="hidden" id="pf055_id" name="pf055_id" value="%s" />', get_keyword ('pf055_id', params, '0')));
                        ?>
                            <div id="pf055_form">
                          <table class="form" cellspacing="5">
                            <tr>
                              <th width="25%">
              		                  Access
              		                </th>
              		                <td>
                                    <select name="pf055_flag" id="pf055_flag">
                                      <option value="1">public</option>
                                      <option value="2">acl</option>
                                      <option value="3">private</option>
                                    </select>
                                  </td>
                                </tr>
                                <tr>
                                  <th>
                                Name
                              </th>
                              <td>
                                    <input type="text" name="pf055_name" id="pf055_name" value="" class="_validate_" style="width: 400px;">
                              </td>
                            </tr>
                            <tr>
                              <th>
                                Comment
                              </th>
                              <td>
                                    <textarea name="pf055_comment" id="pf055_comment" class="_validate_ _canEmpty_" style="width: 400px;"></textarea>
                              </td>
                            </tr>
                  				  <tr>
                  				    <th valign="top">
                  		          Products
                  		        </th>
                  		        <td width="800px">
                                    <table class="ctl_grp">
                                      <tr>
                                        <td width="800px">
                                <table id="wl_tbl" class="listing">
                                            <thead>
                                              <tr class="listing_header_row">
                                                <th>
                                                  <div style="width: 16px;"><![CDATA[&nbsp;]]></div>
                                                </th>
                                                <th width="100%">
                                                  Ontology
                                                </th>
                                                <th width="80px">
                                                  Action
                                                </th>
                                    </tr>
                                            </thead>
                                            <tbody id="wl_tbody" class="colorize">
                                              <tr id="wl_tr_no"><td colspan="3"><b>No Attached Ontologies</b></td></tr>
                                  </tbody>
                                </table>
                                        </td>
                                        <td valign="top" nowrap="nowrap">
                                          <span class="button pointer" onclick="TBL.createRow('wl', null, {fld_1: {mode: 40, cssText: 'display: none;'}, fld_2: {mode: 41, labelValue: 'Ontology: ', cssText: 'width: 95%;'}, btn_1: {mode: 40}, btn_2: {mode: 41, title: 'Attach'}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Ontology" title="Add Ontology" /> Add</span>
                                        </td>
                                      </tr>
                                    </table>
                                <input type="hidden" id="wl_no" name="wl_no" value="1" />
                              </td>
                            </tr>
                          </table>
                          <script type="text/javascript">
                            OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowSeek();});
                          </script>
                          <div class="footer">
                            <input type="submit" name="pf_cancel2" value="Cancel" onclick="needToConfirm = false;"/>
                                <input type="submit" name="pf_update055" value="Save" onclick="myBeforeSubmit(); return validateInputs(this, 'pf055');"/>
                          </div>
                        </div>
                        <?vsp
                          }
                        ?>
                      </div>
                      <?vsp
                        }
                      if (vFormTab2 = 11)
                        {
                      ?>
                      <div id="pf_page_0_11" class="tabContent" style="display:none;">
                        <h3>Likes & DisLikes</h3>
                        <?vsp
                          if (vFormMode = '')
                          {
                        ?>
                            <div id="pf056_list">
                          <div style="padding: 0 0 0.5em 0;">
                            <span onclick="javascript: $('formMode').value = 'new'; $('page_form').submit();" class="button pointer"><img class="button" border="0" title="Add Like" alt="Add Like" src="/ods/images/icons/add_16.png"> Add</span>
                          </div>
                          	  <table id="pf056_tbl" class="listing">
                      	    <thead>
                      	      <tr class="listing_header_row">
                            		    <th width="10%">Type</th>
                            		    <th width="45%">URI</th>
                            		    <th width="45%">Name</th>
                        		    <th width="1%" nowrap="nowrap">Action</th>
                      	      </tr>
                            </thead>
                          	    <tbody id="pf056_tbody">
                              <script type="text/javascript">
                                OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowLikes();});
                              </script>
                      	    </tbody>
                          </table>
                        </div>
                        <?vsp
                          }
                          else
                          {
                                http (sprintf ('<input type="hidden" id="pf056_id" name="pf056_id" value="%s" />', get_keyword ('pf056_id', params, '0')));
                        ?>
                            <div id="pf056_form">
                          <table class="form" cellspacing="5">
                            <tr>
                              <th width="25%">
              		                  Access
              		                </th>
              		                <td>
                                    <select name="pf056_flag" id="pf056_flag">
                                      <option value="1">public</option>
                                      <option value="2">acl</option>
                                      <option value="3">private</option>
                                    </select>
                                  </td>
                                </tr>
                                <tr>
                                  <th>
                                Type
                              </th>
                              <td>
                                    <select name="pf056_type" id="pf056_type">
                                  <option value="L">Like</option>
                                  <option value="DL">DisLike</option>
                                </select>
                              </td>
                            </tr>
                            <tr>
                              <th>
                                    URI (*)
                              </th>
                              <td>
                                    <input type="text" name="pf056_uri" id="pf056_uri" value="" class="_validate_ _uri_" style="width: 400px;">
                              </td>
                            </tr>
                            <tr>
                              <th>
                                    Name (*)
                              </th>
                              <td>
                                    <input type="text" name="pf056_name" id="pf056_name" value="" class="_validate_" style="width: 400px;">
                              </td>
                            </tr>
                            <tr>
                              <th>
                                Comment
                              </th>
                              <td>
                                    <textarea name="pf056_comment" id="pf056_comment" class="_validate_ _canEmpty_" style="width: 400px;"></textarea>
                              </td>
                            </tr>
                  				  <tr>
                  				    <th valign="top">
		                            Properties
                  		        </th>
                  		        <td width="800px">
                                    <table class="ctl_grp">
                                      <tr>
                                        <td width="800px">
                                <table id="ld_tbl" class="listing">
                                            <thead>
                                              <tr class="listing_header_row">
                                                <th>
                                                  <div style="width: 16px;"><![CDATA[&nbsp;]]></div>
                                                </th>
                                                <th width="100%">
                                                  Ontology
                                                </th>
                                                <th width="80px">
                                                  Action
                                                </th>
                                    </tr>
                                            </thead>
                                            <tbody id="ld_tbody" class="colorize">
                                              <tr id="ld_tr_no"><td colspan="3"><b>No Attached Ontologies</b></td></tr>
                                  </tbody>
                                </table>
                                        </td>
                                        <td valign="top" nowrap="nowrap">
                                          <span class="button pointer" onclick="TBL.createRow('ld', null, {fld_1: {mode: 40, cssText: 'display: none;'}, fld_2: {mode: 41, labelValue: 'Ontology: ', cssText: 'width: 95%;'}, btn_1: {mode: 40}, btn_2: {mode: 41, title: 'Attach'}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Ontology" title="Add Ontology" /> Add</span>
                                        </td>
                                      </tr>
                                    </table>
                                <input type="hidden" id="ld_no" name="ld_no" value="1" />
                              </td>
                            </tr>
                          </table>
                          <script type="text/javascript">
                            OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowLike();});
                          </script>
                          <div class="footer">
                            <input type="submit" name="pf_cancel2" value="Cancel" onclick="needToConfirm = false;"/>
                                <input type="submit" name="pf_update056" value="Save" onclick="myBeforeSubmit(); return validateInputs(this, 'pf056');"/>
                              </div>
                            </div>
                            <?vsp
                              }
                            ?>
                          </div>
                          <?vsp
                          }
                      if (vFormTab2 = 12)
                          {
                          ?>
                      <div id="pf_page_0_12" class="tabContent" style="display:none;">
                            <h3>Social Network</h3>
                            <?vsp
                              if (vFormMode = '')
                              {
                            ?>
                            <div id="pf057_list">
                              <div style="padding: 0 0 0.5em 0;">
                                <span onclick="javascript: $('formMode').value = 'new'; $('page_form').submit();" class="button pointer"><img class="button" border="0" title="Add Knows" alt="Add Knows" src="/ods/images/icons/add_16.png"> Add</span>
                                <span onclick="javascript: $('formMode').value = 'import'; $('page_form').submit();" class="button pointer"><img class="button" border="0" title="Import Knows" alt="Import Knows" src="/ods/images/icons/go_16.png"> Import</span>
                          </div>
                          	  <table id="pf057_tbl" class="listing">
                          	    <thead>
                          	      <tr class="listing_header_row">
                            		    <th width="50%">Label</th>
                            		    <th width="50%">URI</th>
                            		    <th width="1%" nowrap="nowrap">Action</th>
                          	      </tr>
                                </thead>
                          	    <tbody id="pf057_tbody">
                                  <script type="text/javascript">
                                    OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowKnows();});
                                  </script>
                          	    </tbody>
                              </table>
                        </div>
                        <?vsp
                          }
                              else if (vFormMode = 'import')
                              {
                        ?>
                            <div id="pf057_import">
                              <table>
                      				  <tr>
                      				    <th width="100px">
                      		          Source
                      		        </th>
                                  <td>
                                    <input type="text" class="_validate_ _uri_" size="100" value="" id="k_import" name="k_import">
                                    <input type="button" class="button" onclick="javascript: knowsData(); return false;" value="Retrieve">
                                    <img style="display: none;" src="/ods/images/oat/Ajax_throbber.gif" alt="Import knows URIs" id="k_import_image">
                                  </td>
                                </tr>
                                <tr>
                                  <th>
                                  </th><td>
                                    <table class="listing" id="k_tbl">
                                      <thead>
                                        <tr class="listing_header_row">
                                          <th>
                                            Access
                                          </th>
                                          <th width="50%">
                                            URI
                                          </th>
                                          <th width="50%">
                                            Label
                                          </th>
                                          <th width="65px">
                                            Action
                                          </th>
                                        </tr>
                                      </thead>
                                      <tbody>
                                        <tr id="k_tr_no">
                                           <td colspan="3">
                                             <b>No retrieved items</b>
                                           </td>
                                        </tr>
                                      </tbody>
                                    </table>
                                  </td>
                                </tr>
                              </table>
                              <div class="footer">
                                <input type="submit" name="pf_cancel2" value="Cancel" onclick="needToConfirm = false;"/>
                                <input type="submit" name="pf_update057" value="Import" onclick="myBeforeSubmit(); return true;"/>
                              </div>
                      </div>
                      <?vsp
                        }
                        else
                        {
                                http (sprintf ('<input type="hidden" id="pf057_id" name="pf057_id" value="%s" />', get_keyword ('pf057_id', params, '0')));
                            ?>
                            <div id="pf057_form">
                              <table class="form" cellspacing="5">
              		        		  <tr>
                                  <th width="25%">
              		                  Access
              		                </th>
              		                <td>
                                    <select name="pf057_flag" id="pf057_flag">
                                      <option value="1">public</option>
                                      <option value="2">acl</option>
                                      <option value="3">private</option>
                                    </select>
                                  </td>
                                </tr>
                                <tr>
                                  <th>
                                    URI (*)
                                  </th>
                                  <td>
                                    <input type="text" name="pf057_uri" id="pf057_uri" value="" class="_validate_ _uri_" style="width: 400px;">
                                  </td>
                                </tr>
                                <tr>
                                  <th>
                                    Label (*)
                                  </th>
                                  <td>
                                    <input type="text" name="pf057_label" id="pf057_label" value="" class="_validate_" style="width: 400px;">
                                  </td>
                                </tr>
                              </table>
                              <script type="text/javascript">
                                OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowKnow();});
                              </script>
                              <div class="footer">
                                <input type="submit" name="pf_cancel2" value="Cancel" onclick="needToConfirm = false;"/>
                                <input type="submit" name="pf_update057" value="Save" onclick="myBeforeSubmit(); return validateInputs(this, 'pf057');"/>
                              </div>
                            </div>
                            <?vsp
                              }
                            ?>
                          </div>
                          <?vsp
                          }
                          ?>
                        </div>
                    <?vsp
                    if (vFormTab2 < 5)
                    {
                      ?>
                      <div class="footer">
                        <input type="submit" name="pf_cancel" value="Cancel" onclick="needToConfirm = false;"/>
                        <input type="submit" name="pf_update" value="Save" onclick="myBeforeSubmit(); return myValidateInputs(this);"/>
                        <input type="submit" name="pf_next" value="Save & Next" onclick="myBeforeSubmit(); return myValidateInputs(this);"/>
                      </div>
                      <?vsp
                        }
                      ?>
                    </div>
                  <?vsp
                  }
                  if (vFormTab = 1)
                  {
                  ?>
                  <div id="pf_page_1" class="tabContent" style="display:none;">
                    <ul id="pf_tabs_1" class="tabs">
                      <li id="pf_tab_1_0" title="Main">Main</li>
                      <li id="pf_tab_1_1" title="Address">Address</li>
                      <li id="pf_tab_1_2" title="Online Accounts">Online Accounts</li>
                      <li id="pf_tab_1_3" title="Messaging Services">Messaging Services</li>
                    </ul>
                    <div style="min-height: 180px; min-width: 650px; border-top: 1px solid #aaa; margin: -13px 5px 5px 5px;">
                      <?vsp
                      if (vFormTab2 = 0)
                      {
                      ?>
                      <div id="pf_page_1_0" class="tabContent" style="display:none;">
                        <table class="form" cellspacing="5">
                          <tr>
                            <th width="30%">
                              <label for="pf_businessIndustry">Industry</label>
                            </th>
                            <td>
                              <select name="pf_businessIndustry" id="pf_businessIndustry" style="width: 220px;">
                                <option></option>
                                <?vsp
                                  items := vLists[0];
                                  foreach (any item in items) do
                                    http (sprintf('<option %s>%s</option>', case when (item = xpath_eval ('string (/user/businessIndustry)', vXml)) then 'selected="selected"' else '' end, item));
                                ?>
                              </select>
                              <select name="pf_acl_businessIndustry" id="pf_acl_businessIndustry">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessIndustry)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_businessOrganization">Organization</label>
                        </th>
                        <td>
                              <input type="text" name="pf_businessOrganization" value="<?V xpath_eval ('string (/user/businessOrganization)', vXml) ?>" id="pf_businessOrganization" style="width: 216px;" />
                              <select name="pf_acl_businessOrganization" id="pf_acl_businessOrganization">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessOrganization)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_businessHomePage">Organization Home Page</label>
                        </th>
                            <td>
                              <input type="text" name="pf_businessHomePage" value="<?V xpath_eval ('string (/user/businessHomePage)', vXml) ?>" id="pf_businessNetwork" style="width: 216px;" />
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_businessJob">Job Title</label>
                        </th>
                        <td>
                              <input type="text" name="pf_businessJob" value="<?V xpath_eval ('string (/user/businessJob)', vXml) ?>" id="pf_businessJob" style="width: 216px;" />
                              <select name="pf_acl_businessJob" id="pf_acl_businessJob">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessJob)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_businessRegNo">VAT Reg number (EU only) or Tax ID</label>
                            </th>
                            <td>
                              <input type="text" name="pf_businessRegNo" value="<?V xpath_eval ('string (/user/businessRegNo)', vXml) ?>" id="pf_businessRegNo" style="width: 216px;" />
                              <select name="pf_acl_businessRegNo" id="pf_acl_businessRegNo">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessRegNo)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_businessCareer">Career / Organization Status</label>
                            </th>
                            <td>
                              <select name="pf_businessCareer" id="pf_businessCareer" style="width: 220px;">
                                <option></option>
                                <?vsp
                                  items := vector ('Job seeker-Permanent', 'Job seeker-Temporary', 'Job seeker-Temp/perm', 'Employed-Unavailable', 'Employer', 'Agency', 'Resourcing supplier');
                                  foreach (any item in items) do
                                    http (sprintf('<option %s>%s</option>', case when (item = xpath_eval ('string (/user/businessCareer)', vXml)) then 'selected="selected"' else '' end, item));
                                ?>
                              </select>
                              <select name="pf_acl_businessCareer" id="pf_acl_businessCareer">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessCareer)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_businessEmployees">No. of Employees</label>
                            </th>
                            <td>
                              <select name="pf_businessEmployees" id="pf_businessEmployees" style="width: 220px;">
                                <option></option>
                                <?vsp
                                  items := vector ('1-100', '101-250', '251-500', '501-1000', '>1000');
                                  foreach (any item in items) do
                                    http (sprintf('<option %s>%s</option>', case when (item = xpath_eval ('string (/user/businessEmployees)', vXml)) then 'selected="selected"' else '' end, item));
                                ?>
                              </select>
                              <select name="pf_acl_businessEmployees" id="pf_acl_businessEmployees">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessEmployees)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_businessVendor">Are you a technology vendor</label>
                            </th>
                            <td>
                              <select name="pf_businessVendor" id="pf_businessVendor" style="width: 220px;">
                                <option></option>
                                <?vsp
                                  items := vector ('Not a Vendor', 'Vendor', 'VAR', 'Consultancy');
                                  foreach (any item in items) do
                                    http (sprintf('<option %s>%s</option>', case when (item = xpath_eval ('string (/user/businessVendor)', vXml)) then 'selected="selected"' else '' end, item));
                                ?>
                              </select>
                              <select name="pf_acl_businessVendor" id="pf_acl_businessVendor">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessVendor)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_businessService">If so, what technology and/or service do you provide?</label>
                            </th>
                            <td>
                              <select name="pf_businessService" id="pf_businessService" style="width: 220px;">
                                <option></option>
                                <?vsp
                                  items := vector ('Enterprise Data Integration', 'Business Process Management', 'Other');
                                  foreach (any item in items) do
                                    http (sprintf('<option %s>%s</option>', case when (item = xpath_eval ('string (/user/businessService)', vXml)) then 'selected="selected"' else '' end, item));
                                ?>
                              </select>
                              <select name="pf_acl_businessService" id="pf_acl_businessService">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessService)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_businessOther">Other Technology service</label>
                            </th>
                            <td>
                              <input type="text" name="pf_businessOther" value="<?V xpath_eval ('string (/user/businessOther)', vXml) ?>" id="pf_businessOther" style="width: 216px;" />
                              <select name="pf_acl_businessOther" id="pf_acl_businessOther">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessOther)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_businessNetwork">Importance of OpenLink Network for you</label>
                            </th>
                            <td>
                              <input type="text" name="pf_businessNetwork" value="<?V xpath_eval ('string (/user/businessNetwork)', vXml) ?>" id="pf_businessNetwork" style="width: 216px;" />
                              <select name="pf_acl_businessNetwork" id="pf_acl_businessNetwork">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessNetwork)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_businessResume">Resume</label>
                            </th>
                            <td>
                              <textarea name="pf_businessResume" id="pf_businessResume" style="width: 400px;"><?vsp xpath_eval ('string (/user/businessResume)', vXml); ?></textarea>
                              <select name="pf_acl_businessResume" id="pf_acl_businessResume">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessResume)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_set_1_0">Set access for all fields as </label>
                            </th>
                            <td>
                              <select name="pf_set_1_0" id="pf_set_1_0" value="0" class="dummy" onchange="javascript: pfSetACLSelects (this)">
                                <option value="0">*no change*</option>
                                <option value="1">public</option>
                                <option value="2">acl</option>
                                <option value="3">private</option>
                              </select>
                            </td>
                          </tr>
                        </table>
                      </div>
                      <?vsp
                      }
                      if (vFormTab2 = 1)
                      {
                      ?>
                      <div id="pf_page_1_1" class="tabContent" style="display:none;">
                        <table class="form" cellspacing="5">
                          <tr>
                            <th>
                          <label for="pf_businesscountry">Country</label>
                        </th>
                        <td>
                          <select name="pf_businesscountry" id="pf_businesscountry" onchange="javascript: return updateState('pf_businesscountry', 'pf_businessstate');" style="width: 220px;">
                            <option></option>
                            <?vsp
                              items := vLists[1];
                              foreach (any item in items) do
                                http (sprintf('<option %s>%s</option>', case when (item = xpath_eval ('string (/user/businessCountry)', vXml)) then 'selected="selected"' else '' end, item));
                            ?>
                          </select>
                              <select name="pf_acl_businessCountry" id="pf_acl_businessCountry">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessCountry)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_businessstate">State/Province</label>
                        </th>
                        <td>
                          <span id="span_pf_businessstate">
                            <script type="text/javascript">
                                  OAT.MSG.attach(OAT, "PAGE_LOADED", function (){updateState("pf_businesscountry", "pf_businessstate", "<?V xpath_eval ('string (/user/businessState)', vXml) ?>");});
                            </script>
                          </span>
                              <select name="pf_acl_businessState" id="pf_acl_businessState">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessState)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_businesscity">City/Town</label>
                        </th>
                        <td>
                              <input type="text" name="pf_businesscity" value="<?V xpath_eval ('string (/user/businessCity)', vXml) ?>" id="pf_businesscity" style="width: 216px;" />
                              <select name="pf_acl_businessCity" id="pf_acl_businessCity">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessCity)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_businesscode">Zip/Postal Code</label>
                        </th>
                        <td>
                              <input type="text" name="pf_businesscode" value="<?V xpath_eval ('string (/user/businessCode)', vXml) ?>" id="pf_businesscode"  style="width: 216px;" />
                              <select name="pf_acl_businessCode" id="pf_acl_businessCode">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessCode)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_businessaddress1">Address1</label>
                        </th>
                        <td>
                              <input type="text" name="pf_businessaddress1" value="<?V xpath_eval ('string (/user/businessAddress1)', vXml) ?>" id="pf_businessaddress1" style="width: 216px;" />
                              <select name="pf_acl_businessAddress1" id="pf_acl_businessAddress1">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessAddress1)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_businessaddress2">Address2</label>
                        </th>
                        <td>
                              <input type="text" name="pf_businessaddress2" value="<?V xpath_eval ('string (/user/businessAddress2)', vXml) ?>" id="pf_businessaddress2" style="width: 216px;" />
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_businessTimezone">Time-Zone</label>
                        </th>
                        <td>
                              <select name="pf_businessTimezone" id="pf_businessTimezone" style="width: 114px;">
                            <?vsp
                              declare N integer;
                              for (N := -12; N <= 12; N := N + 1)
                                http (sprintf ('<option value="%d" %s>GMT %d:00</option>', N, case when (N = xpath_eval ('string (/user/businessTimezone)', vXml)) then 'selected="selected"' else '' end, N));
                            ?>
                          </select>
                              <select name="pf_acl_businessTimezone" id="pf_acl_businessTimezone">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessTimezone)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_businesslat">Latitude</label>
                        </th>
                        <td>
                              <input type="text" name="pf_businesslat" value="<?V xpath_eval ('string (/user/businessLatitude)', vXml) ?>" id="pf_businesslat" style="width: 110px;" />
                              <select name="pf_acl_businessLatitude" id="pf_acl_businessLatitude">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessLatitude)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        <td>
                      <tr>
                      <tr>
                        <th>
                          <label for="pf_businesslng">Longitude</label>
                        </th>
                        <td>
                              <input type="text" name="pf_businesslng" value="<?V xpath_eval ('string (/user/businessLongitude)', vXml) ?>" id="pf_businesslng" style="width: 110px;" />
                              <label>
                                <input type="checkbox" name="pf_businessDefaultMapLocation" id="pf_businessDefaultMapLocation" onclick="javascript: setDefaultMapLocation('business', 'home');" />
                                Use as default map location
                              </label>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_businessPhone">Phone</label>
                        </th>
                        <td>
                              <input type="text" name="pf_businessPhone" value="<?V xpath_eval ('string (/user/businessPhone)', vXml) ?>" id="pf_businessPhone" style="width: 110px;" />
                              <b>Ext.</b>
                              <input type="text" name="pf_businessPhoneExt" value="<?V xpath_eval ('string (/user/businessPhoneExt)', vXml) ?>" id="pf_businessPhoneExt" style="width: 40px;" />
                              <select name="pf_acl_businessPhone" id="pf_acl_businessPhone">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessPhone)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_businessMobile">Mobile</label>
                        </th>
                        <td>
                              <input type="text" name="pf_businessMobile" value="<?V xpath_eval ('string (/user/businessMobile)', vXml) ?>" id="pf_businessMobile" style="width: 110px;" />
                            </td>
                          </tr>
                          <tr>
                            <th>
                              <label for="pf_set_1_1">Set access for all fields as </label>
                            </th>
                            <td>
                              <select name="pf_set_1_1" id="pf_set_1_1" value="0" class="dummy" onchange="javascript: pfSetACLSelects (this)">
                                <option value="0">*no change*</option>
                                <option value="1">public</option>
                                <option value="2">acl</option>
                                <option value="3">private</option>
                              </select>
                        </td>
                      </tr>
                        </table>
                      </div>
                      <?vsp
                      }
                      if (vFormTab2 = 2)
                      {
                      ?>
                      <div id="pf_page_1_2" class="tabContent" style="display:none;">
                        <table class="form" cellspacing="5">
                      <tr>
                            <td width="600px">
                              <table id="y1_tbl" class="listing">
                                <thead>
                                  <tr class="listing_header_row">
                        <th>
                                      Select from Service List ot Type New One
                        </th>
                        <th>
                                      Member Home Page URI
                        </th>
                                    <th width="65px">
                                      Action
                        </th>
                                  </tr>
                                </thead>
                                <tr id="y1_tr_no" style="display: none;"><td colspan="3"><b>No Services</b></td></tr>
                                <script type="text/javascript">
                                  OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowOnlineAccounts("y1", "B", function(prefix, val0, val1, val2){TBL.createRow(prefix, null, {id: val0, fld_1: {mode: 10, value: val1}, fld_2: {value: val2, className: '_validate_ _uri_ _canEmpty_'}});});});
                                </script>
                              </table>
                            </td>
                            <td valign="top" nowrap="1">
                              <span class="button pointer" onclick="TBL.createRow('y1', null, {fld_1: {mode: 10}, fld_2: {className: '_validate_ _url_ _canEmpty_'}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Row" title="Add Row" /> Add</span>
                        </td>
                      </tr>
                        </table>
                      </div>
                      <?vsp
                      }
                      if (vFormTab2 = 3)
                      {
                      ?>
                      <div id="pf_page_1_3" class="tabContent" style="display:none;">
                        <table id="y2_tbl" class="form" cellspacing="5">
                      <tr>
                            <th width="30%">
                              <label for="pf_businessIcq">ICQ</label>
                        </th>
                            <td colspan="2">
                              <input type="text" name="pf_businessIcq" value="<?V xpath_eval ('string (/user/businessIcq)', vXml) ?>" id="pf_icq" style="width: 220px;" />
                              <select name="pf_acl_businessIcq" id="pf_acl_businessIcq">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessIcq)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_businessSkype">Skype</label>
                        </th>
                            <td colspan="2">
                              <input type="text" name="pf_businessSkype" value="<?V xpath_eval ('string (/user/businessSkype)', vXml) ?>" id="pf_businessSkype" style="width: 220px;" />
                              <select name="pf_acl_businessSkype" id="pf_acl_businessSkype">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessSkype)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_businessYahoo">Yahoo</label>
                        </th>
                            <td colspan="2">
                              <input type="text" name="pf_businessYahoo" value="<?V xpath_eval ('string (/user/businessYahoo)', vXml) ?>" id="pf_businessYahoo" style="width: 220px;" />
                              <select name="pf_acl_businessYahoo" id="pf_acl_businessYahoo">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessYahoo)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_businessAim">AIM</label>
                        </th>
                            <td colspan="2">
                              <input type="text" name="pf_businessAim" value="<?V xpath_eval ('string (/user/businessAim)', vXml) ?>" id="pf_businessAim" style="width: 220px;" />
                              <select name="pf_acl_businessAim" id="pf_acl_businessAim">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessAim)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                        </td>
                      </tr>
                      <tr>
                        <th>
                              <label for="pf_businessMsn">MSN</label>
                        </th>
                            <td colspan="2">
                              <input type="text" name="pf_businessMsn" value="<?V xpath_eval ('string (/user/businessMsn)', vXml) ?>" id="pf_businessMsn" style="width: 220px;" />
                              <select name="pf_acl_businessMsn" id="pf_acl_businessMsn">
                                <?vsp
                                  for (N := 0; N < length (xAcl); N := N + 2)
                                    http (sprintf('<option value="%s" %s>%s</option>', xAcl[N+1], case when (xAcl[N+1] = xpath_eval ('string (/acl/businessMsn)', vAcl)) then 'selected="selected"' else '' end, xAcl[N]));
                                ?>
                              </select>
                            </td>
                          </tr>
                          <tr>
                            <th>Add other services</th>
                            <td>
                              <span class="button pointer" onclick="TBL.createRow('y2', null, {fld_1: {}, fld_2: {cssText: 'width: 220px;'}});"><img class="button" src="/ods/images/icons/add_16.png" border="0" alt="Add Row" title="Add Row" /> Add</span>
                            </td>
                            <td width="40%">
                        </td>
                      </tr>
                          <tr>
                            <th>
                              <label for="pf_set_1_3">Set access for all fields as </label>
                            </th>
                            <td colspan="2">
                              <select name="pf_set_1_3" id="pf_set_1_3" value="0" class="dummy" onchange="javascript: pfSetACLSelects (this)">
                                <option value="0">*no change*</option>
                                <option value="1">public</option>
                                <option value="2">acl</option>
                                <option value="3">private</option>
                              </select>
                            </td>
                          </tr>
                          <script type="text/javascript">
                            OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowRows("y2", "<?V replace(cast (xpath_eval ('string (/user/businessMessaging)', vXml) as varchar), '\n', '\\n') ?>", ["\n", ";"], function(prefix, val1, val2){TBL.createRow(prefix, null, {fld_1: {value: val1}, fld_2: {value: val2, cssText: 'width: 220px;'}});});});
                          </script>
                    </table>
                      </div>
                      <?vsp
                      }
                      ?>
                      <div class="footer">
                        <input type="submit" name="pf_cancel" value="Cancel" onclick="needToConfirm = false;"/>
                        <input type="submit" name="pf_update" value="Save" onclick="myBeforeSubmit(); return myValidateInputs(this);"/>
                        <input type="submit" name="pf_next" value="Save & Next" onclick="myBeforeSubmit(); return myValidateInputs(this);"/>
                      </div>
                    </div>
                  </div>
                  <?vsp
                  }
                  if (vFormTab = 2)
                  {
                  ?>
                  <div id="pf_page_2" class="tabContent" style="display:none;">
                    <ul id="pf_tabs_2" class="tabs">
                      <li id="pf_tab_2_0" title="Password">Password</li>
                      <li id="pf_tab_2_1" title="Password Recovery">Password Recovery</li>
                      <li id="pf_tab_2_2" title="OpenID">OpenID</li>
                      <li id="pf_tab_2_3" title="Limits">Limits</li>
                      <li id="pf_tab_2_4" title="Certificate Generator" style="display:none;">Certificate Generator</li>
                      <li id="pf_tab_2_5" title="X.509 Certificates">X.509 Certificates</li>
                    </ul>
                    <div style="min-height: 180px; min-width: 650px; border-top: 1px solid #aaa; margin: -13px 5px 5px 5px;">
                      <?vsp
                      if (vFormTab2 = 0)
                      {
                      ?>
                      <div id="pf_page_2_0" class="tabContent" style="display:none;">
                        <h2>Change login password</h2>
                        <p class="fm_expln">For your security, please use a password not found in a dictionary, consisting of both letters, and numbers or non-alphanumeric characters.</p>
                    <table class="form" cellspacing="5">
                      <tr>
                        <td align="center" colspan="2">
                          <span id="pf_change_txt"></span>
                        </td>
                      </tr>
                          <?vsp
                          if (xpath_eval ('string (/user/noPassword)', vXml) = '0')
                          {
                          ?>
                      <tr>
                        <th width="30%">
                          <label for="pf_oldPassword">Old Password</label>
                        </th>
                        <td>
                          <input type="password" name="pf_oldPassword" value="" id="pf_oldPassword" />
                        </td>
                      </tr>
                          <?vsp
                          }
                          ?>
                      <tr>
                            <th width="30%">
                          <label for="pf_newPassword">New Password</label>
                        </th>
                        <td>
                          <input type="password" name="pf_newPassword" value="" id="pf_newPassword" />
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_password">Repeat Password</label>
                        </th>
                        <td>
                          <input type="password" name="pf_newPassword2" value="" id="pf_newPassword2" />
                        </td>
                      </tr>
                      <tr>
                        <th>
                        </th>
                      </tr>
                        </table>
                      </div>
                      <?vsp
                      }
                      if (vFormTab2 = 1)
                      {
                      ?>
                      <div id="pf_page_2_1" class="tabContent" style="display:none;">
                        <h2>Password recovery questions</h2>
                        <p class="fm_expln">Manage password recovery procedure. Set verification question / answer.</p>
                        <table class="form" cellspacing="5">
                      <tr>
                        <th>
                          <label for="pf_securitySecretQuestion">Secret Question</label>
                        </th>
                        <td id="td_securitySecretQuestion">
                          <script type="text/javascript">
                            function categoryCombo ()
                            {
                              var cc = new OAT.Combolist([], "<?V xpath_eval ('string (/user/securitySecretQuestion)', vXml) ?>");
                              cc.input.name = "pf_securitySecretQuestion";
                              cc.input.id = "pf_securitySecretQuestion";
                              cc.input.style.cssText = "width: 220px;";
                              $("td_securitySecretQuestion").appendChild(cc.div);
                              cc.addOption("");
                              cc.addOption("First Car");
                              cc.addOption("Mothers Maiden Name");
                              cc.addOption("Favorite Pet");
                              cc.addOption("Favorite Sports Team");
                            }
                            OAT.MSG.attach(OAT, "PAGE_LOADED", categoryCombo);
                          </script>
                        </td>
                      </tr>
                      <tr>
                        <th>
                          <label for="pf_securitySecretAnswer">Secret Answer</label>
                        </th>
                        <td>
                          <input type="text" name="pf_securitySecretAnswer" value="<?V xpath_eval ('string (/user/securitySecretAnswer)', vXml) ?>" id="pf_securitySecretAnswer" style="width: 220px;" />
                        </td>
                      </tr>
                        </table>
                      </div>
                      <?vsp
                      }
                      if (vFormTab2 = 2)
                      {
                      ?>
                      <div id="pf_page_2_2" class="tabContent" style="display:none;">
                        <table class="form" cellspacing="5">
                      <tr>
                        <th>
                              <label for="pf_openID">OpenID URL</label>
                        </th>
                        <td>
                              <input type="text" name="pf_openID" value="<?V xpath_eval ('string (/user/securityOpenID)', vXml) ?>" id="pf_openID" style="width: 220px;" />
                        </td>
                      </tr>
                        </table>
                      </div>
                      <?vsp
                      }
                      if (vFormTab2 = 3)
                      {
                      ?>
                      <div id="pf_page_2_3" class="tabContent" style="display:none;">
                        <table class="form" cellspacing="5">
                      <tr>
                        <th>
                              <label for="pf_securitySiocLimit">SIOC Query Result Limit</label>
                        </th>
                        <td>
                              <input type="text" name="pf_securitySiocLimit" value="<?V xpath_eval ('string (/user/securitySiocLimit)', vXml) ?>" id="pf_securitySiocLimit" />
                        </td>
                      </tr>
                        </table>
                      </div>
                      <?vsp
                      }
                      if (vFormTab2 = 4)
                      {
                      ?>
                      <div id="pf_page_2_4" class="tabContent" style="display:none;">
            	          <iframe id="cert" src="/ods/cert.vsp?sid=<?V vSid ?>" width="650" height="270" frameborder="0" scrolling="no">
            	            <p>Your browser does not support iframes.</p>
            	          </iframe>
                      </div>
                      <?vsp
                      }
                      if (vFormTab2 = 5)
                      {
                      ?>
                      <div id="pf_page_2_5" class="tabContent" style="display:none;">
                        <h3>X.509 Certificates</h3>
                        <?vsp
                          if (vFormMode = '')
                          {
                        ?>
                        <div id="pf26_list">
                          <div style="padding: 0 0 0.5em 0;">
                            <span onclick="javascript: $('formMode').value = 'new'; $('page_form').submit();" class="button pointer"><img class="button" border="0" title="Add 'Fovorite'" alt="Add 'Fovorite'" src="/ods/images/icons/add_16.png"> Add</span>
                          </div>
                      	  <table id="pf26_tbl" class="listing">
                      	    <thead>
                      	      <tr class="listing_header_row">
                        		    <th>Subject</th>
                          		  <th>Created</th>
                          		  <th>Fingerprint</th>
                          		  <th>Login enabled</th>
                        		    <th width="1%" nowrap="nowrap">Action</th>
                      </tr>
                            </thead>
                      	    <tbody id="pf26_tbody">
                              <script type="text/javascript">
                                OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowCertificates();});
                              </script>
                      	    </tbody>
                          </table>
                        </div>
              	      <?vsp
                          }
                          else
                          {
                            http (sprintf ('<input type="hidden" id="pf26_id" name="pf26_id" value="%s" />', get_keyword ('pf26_id', params, '0')));
                        ?>
                        <div id="pf26_form">
                          <table class="form" cellspacing="5">
                            <?vsp
                            if (vFormMode = 'edit')
              	        {
              	      ?>
                      <tr>
                        <th>
                	    	  Subject
                        </th>
                        <td>
                          		  <span id="pf26_subject"></span>
                    		</td>
                      </tr>
                      <tr>
                        <th>
                	    	  Agent ID
                        </th>
                        <td>
                          		  <span id="pf26_agentID"></span>
                          		</td>
                            </tr>
                            <tr>
                              <th>
                      	    	  Fingerprint
                              </th>
                              <td>
                          		  <span id="pf26_fingerPrint"></span>
                    		</td>
                      </tr>
            	        <?vsp
            	          }
            	        ?>
                      <tr>
                              <th width="15%"></th>
                              <td>
                                <label>
                                  <input type="checkbox" name="pf26_importFile" id="pf26_importFile" value="1" onclick="destinationChange(this, {checked: {show: ['pf26_form_3'], hide: ['pf26_form_4']}, unchecked: {hide: ['pf26_form_3'], show: ['pf26_form_4']}});" />
                                  <b>Import from local file</b>
                                </label>
                              </td>
                            </tr>
                            <tr id="pf26_form_3" style="display: none;">
                              <th width="15%">
                                <label for="pf26_file">File to import</label>
                              </th>
                              <td align="left">
                                <input type="file" name="pf26_file" id="pf26_file" />
                              </td>
                            </tr>
                            <tr id="pf26_form_4">
                              <th width="15%" valign="top">
                                <label for="pf26_certificate">Certificate</label>
                        </th>
                        <td>
                                <textarea name="pf26_certificate" id="pf26_certificate" rows="20" style="width: 560px;"></textarea>
                        </td>
                      </tr>
                      <tr>
                        <th></th>
                        <td>
                          <label>
                                  <input type="checkbox" name="pf26_enableLogin" id="pf26_enableLogin" value="1"/>
                                  <b>Enable Automatic WebID Login</b>
                          </label>
                        </td>
                      </tr>
                    </table>
                          <script type="text/javascript">
                            OAT.MSG.attach(OAT, "PAGE_LOADED", function (){pfShowCertificate();});
                          </script>
                          <div class="footer">
                            <input type="submit" name="pf_cancel2" value="Cancel" onclick="needToConfirm = false;"/>
                            <input type="submit" name="pf_update26" value="Save" onclick="needToConfirm = false; return validateInputs(this, 'pf26');"/>
                          </div>
                        </div>
                        <?vsp
                          }
                        ?>
                      </div>
                      <?vsp
                        }
                      if (vFormTab2 < 4)
                        {
                      ?>
                    <div class="footer">
                      <input type="submit" name="pf_cancel" value="Cancel" onclick="needToConfirm = false;"/>
                        <input type="submit" name="pf_update" value="Save" onclick="myBeforeSubmit(); return myValidateInputs(this);"/>
                        <input type="submit" name="pf_next" value="Save & Next" onclick="myBeforeSubmit(); return myValidateInputs(this);"/>
                      </div>
                      <?vsp
                        }
                      ?>
                  </div>
                </div>
                  <?vsp
                  }
                  ?>
                </div>
              </div>
              <?vsp
              }
              ?>
            </td>
          </tr>
        </table>
      </div>
    </form>
    <div id="FT">
      <div id="FT_L">
        <a href="http://www.openlinksw.com/virtuoso"><img alt="Powered by OpenLink Virtuoso Universal Server" src="/ods/images/virt_power_no_border.png" border="0" /></a>
      </div>
      <div id="FT_R">
        <a href="/ods/faq.html">FAQ</a> | <a href="/ods/privacy.html">Privacy</a> | <a href="/ods/rabuse.vspx">Report Abuse</a>
        <div>
          Copyright &copy; 1999-2018 OpenLink Software
        </div>
      </div>
    </div>
  </body>
</html>
