
var login = {
  ajaxLogin: function (url, user, pw, uiCallback)
  {
    url = url + "?authenticate&login=" + user + "&password=" + hex_md5(pw);
    ajaxCaller.get(url, {}, uiCallback, true, null);
  },

  ajaxLogout: function(url, uiCallback)
  {
    ajaxCaller.get(url, {}, uiCallback, true, null);
  },

  //This is a demonstration of utilizing a webservice self-publishing function to allow developers
  //to determine how a service is to be used...
  getWebServiceCommands: function(url)
  {
    ajaxCaller.get(url, {}, this._processCommandList, true, null);
  },

  /*--------------------------------------------------------------------------------------------------------------------
   * Private methods...
  --------------------------------------------------------------------------------------------------------------------*/

  _processCommandList: function(xml, headers, context)
  {
    var commands = xml.getElementsByTagName("command");
    var commandsHTML = "";
    for (i=0; i<commands.length; i++)
    {
      var cmdName = commands[i].childNodes[0].childNodes[0].nodeValue;
      var cmdDesc = commands[i].childNodes[1].childNodes[0].nodeValue;

      commandsHTML += "command: " + cmdName + " - " + cmdDesc + "\n";
    }

    //$("commandsDiv").innerHTML = commandsHTML;
    alert(commandsHTML);
  },

  _authenticationResponse: function(xml, headers, context)
  {
  }
}
