if (typeof com == "undefined") {com = {};};
if (typeof com.parolemanager == "undefined") {com.parolemanager = {};};
if (typeof com.parolemanager.javascript == "undefined") {com.parolemanager.javascript = {};};

if (typeof com.parolemanager.javascript.RemoteAccountLogins == "undefined") {
 com.parolemanager.javascript.RemoteAccountLogins = function() {} 
 com.parolemanager.javascript.RemoteAccountLogins.prototype = new  com.oclib.javascript.lang.Root();

 com.parolemanager.javascript.RemoteAccountLogins.prototype.className = "RemoteAccountLogins"; 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.classNamespace = "com.parolemanager.javascript.RemoteAccountLogins"; 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.classCreated = "20070312"; 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.classCreator = "http://www.parolemanager.com/"; 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.classLocation = "http://www.parolemanager.com/library/com/parolemanager/javascript/RemoteAccountLogins.js"; 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.classIndexLocation = "http://www.parolemanager.com/library/com/parolemanager/javascript/remoteAccountLogins/"; 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.classVersion = "20070312"; 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.classVersionLocation = "http://www.parolemanager.com/library/com/parolemanager/javascript/remoteAccountLogins/20070312/RemoteAccountLogins.js"; 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.classVersionIndexLocation = "http://www.parolemanager.com/library/com/parolemanager/javascript/remoteAccountLogins/20070312/"; 

 com.parolemanager.javascript.RemoteAccountLogins.prototype.accounts= new Array();
  com.parolemanager.javascript.RemoteAccountLogins.prototype.getAccounts = function () {return this.accounts;};
  com.parolemanager.javascript.RemoteAccountLogins.prototype.setAccounts = function (accounts) {this.accounts = accounts; return 1;};
 com.parolemanager.javascript.RemoteAccountLogins.prototype.accountsNecessary= new Array();
  com.parolemanager.javascript.RemoteAccountLogins.prototype.getAccountsNecessary = function () {return this.accountsNecessary;};
  com.parolemanager.javascript.RemoteAccountLogins.prototype.setAccountsNecessary = function (accountsNecessary) {this.accountsNecessary = accountsNecessary; return 1;};
 com.parolemanager.javascript.RemoteAccountLogins.prototype.accountsTest= new Array();
  com.parolemanager.javascript.RemoteAccountLogins.prototype.getAccountsTest = function () {return this.accountsTest;};
  com.parolemanager.javascript.RemoteAccountLogins.prototype.setAccountsTest = function (accountsTest) {this.accountsTest = accountsTest; return 1;};
 com.parolemanager.javascript.RemoteAccountLogins.prototype.method = "POST";
  com.parolemanager.javascript.RemoteAccountLogins.prototype.getMethod = function () {return this.method;};
  com.parolemanager.javascript.RemoteAccountLogins.prototype.setMethod = function (method) {this.method = method; return 1;};
 com.parolemanager.javascript.RemoteAccountLogins.prototype.url;
  com.parolemanager.javascript.RemoteAccountLogins.prototype.getUrl = function () {return this.url;};
  com.parolemanager.javascript.RemoteAccountLogins.prototype.getURL = function () {return this.getUrl();};
  com.parolemanager.javascript.RemoteAccountLogins.prototype.setUrl = function (url) {this.url = url; return 1;};
  com.parolemanager.javascript.RemoteAccountLogins.prototype.setURL = function (url) {return this.setUrl(url);};

 com.parolemanager.javascript.RemoteAccountLogins.prototype.addPassword = function(domain, uid, password, doIfSuccess, doIfError) {
  if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.addPassword is runing...");};
  var data = "action=addPassword"
             +"&url="+escape(domain)
             +"&uid="+escape(uid)
             +"&password="+escape(password);
  if(this.mustDebug()) {this.getLog().println("RemoteAccountLogins.addPassword data="+data);};
  var loader = new com.oclib.javascript.util.Loader();
  loader.setDebugging(this.getDebugging());
  loader.setLog(this.getLog());
  loader.setTracing(this.getTracing());
  loader.setDoIfError(doIfError);
  var the = this;
  var thisDoIfSuccess = function() {the.addPasswordParseResponse(doIfSuccess, doIfError, loader);};
  loader.setDoIfSuccess(thisDoIfSuccess);
  loader.makeRequest(this.method, this.url, data);
  return 1;
 };
 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.addPasswordParseResponse = function(doIfSuccess, doIfError, loader) {
  if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.addPasswordParseResponsee is runing...");};
  var responseXML = loader.xml;  
  if(responseXML.getElementsByTagName("status") && responseXML.getElementsByTagName("status").item(0) && responseXML.getElementsByTagName("status").item(0).firstChild) {
   var status = responseXML.getElementsByTagName("status").item(0).firstChild.data;
   if(this.mustDebug()) {this.getLog().println("RemoteAccountLogins.addPasswordParseResponse: status="+status);};
   if(status == "success") {
    doIfSuccess();
   } else {
    doIfError();
   };
  };
  return 1;
 };
 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.getPasswords = function(domain, doIfSuccess, doIfError) {
  if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.getPasswords is runing...");};
  var data = "action=getPasswords"
             +"&url="+escape(domain);
  if(this.mustDebug()) {this.getLog().println("RemoteAccountLogins.getPasswords data="+data);};
  var loader = new com.oclib.javascript.util.Loader();
  loader.setDebugging(this.getDebugging());
  loader.setLog(this.getLog());
  loader.setTracing(this.getTracing());
  loader.setDoIfError(doIfError);
  var the = this;
  var thisDoIfSuccess = function() {the.getPasswordsParseResponse(doIfSuccess, doIfError, loader);};
  loader.setDoIfSuccess(thisDoIfSuccess);
  loader.makeRequest(this.method, this.url, data);
  return 1;
 };

 com.parolemanager.javascript.RemoteAccountLogins.prototype.getPasswordsParseResponse = function(doIfSuccess, doIfError, loader) {
  if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.getPasswordsParseResponse is runing...");};
  var responseXML = loader.xml;  
  if(responseXML.getElementsByTagName("status") && responseXML.getElementsByTagName("status").item(0) && responseXML.getElementsByTagName("status").item(0).firstChild) {
   var status = responseXML.getElementsByTagName("status").item(0).firstChild.data;
   if(this.mustDebug()) {this.getLog().println("RemoteAccountLogins.getPasswordsParseResponse: status="+status);};
   if(status == "success") {
    if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.getPasswordsParseResponse: success...");};
    if(responseXML.getElementsByTagName("account")) {
	 var accounts = new Array();
     var i = 0;
     while(responseXML.getElementsByTagName("account").item(i)) {
      var account = new Array();
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("id")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("id").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("id").item(0).firstChild) {
       account["id"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("id").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url").item(0).firstChild) {
       account["url"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("uid")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("uid").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("uid").item(0).firstChild) {
       account["uid"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("uid").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("password")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("password").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("password").item(0).firstChild) {
       account["password"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("password").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("good")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("good").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("good").item(0).firstChild) {
       account["good"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("good").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("bad")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("bad").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("bad").item(0).firstChild) {
       account["bad"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("bad").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("votes")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("votes").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("votes").item(0).firstChild) {
       account["votes"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("votes").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("res")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("res").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("res").item(0).firstChild) {
       account["res"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("res").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("date")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("date").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("date").item(0).firstChild) {
       account["date"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("date").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("searcher")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("searcher").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("searcher").item(0).firstChild) {
       account["searcher"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("searcher").item(0).firstChild.data);
	  };
	  accounts[i] = account;
      i++;
	 };
	};
	this.accounts = accounts;
    doIfSuccess();
   } else {
    doIfError();
   };
  };
  return 1;
 };
 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.getNecessaryPasswords = function(doIfSuccess, doIfError) {
  if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.getNecessaryPasswords is runing...");};
  var data = "action=getNecessaryPasswords";
  if(this.mustDebug()) {this.getLog().println("RemoteAccountLogins.getNecessaryPasswords data="+data);};
  var loader = new com.oclib.javascript.util.Loader();
  loader.setDebugging(this.getDebugging());
  loader.setLog(this.getLog());
  loader.setTracing(this.getTracing());
  loader.setDoIfError(doIfError);
  var the = this;
  var thisDoIfSuccess = function() {the.getNecessaryPasswordsParseResponse(doIfSuccess, doIfError, loader);};
  loader.setDoIfSuccess(thisDoIfSuccess);
  loader.makeRequest(this.method, this.url, data);
  return 1;
 };

 com.parolemanager.javascript.RemoteAccountLogins.prototype.getNecessaryPasswordsParseResponse = function(doIfSuccess, doIfError, loader) {
  if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.getNecessaryPasswordsParseResponse is runing...");};
  var responseXML = loader.xml;  
  if(responseXML.getElementsByTagName("status") && responseXML.getElementsByTagName("status").item(0) && responseXML.getElementsByTagName("status").item(0).firstChild) {
   var status = responseXML.getElementsByTagName("status").item(0).firstChild.data;
   if(this.mustDebug()) {this.getLog().println("RemoteAccountLogins.getNecessaryPasswordsParseResponse: status="+status);};
   if(status == "success") {
    if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.getNecessaryPasswordsParseResponse: success...");};
    if(responseXML.getElementsByTagName("account")) {
	 var accounts = new Array();
     var i = 0;
     while(responseXML.getElementsByTagName("account").item(i)) {
      var account = new Array();
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url").item(0).firstChild) {
       account["url"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url").item(0).firstChild.data);
	  };
	  accounts[i] = account;
      i++;
	 };
	};
	this.accountsNecessary = accounts;
    doIfSuccess();
   } else {
    doIfError();
   };
  };
  return 1;
 };
 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.getTestPasswords = function(doIfSuccess, doIfError) {
  if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.getTestPasswords is runing...");};
  var data = "action=getTestPasswords";
  if(this.mustDebug()) {this.getLog().println("RemoteAccountLogins.getTestPasswords data="+data);};
  var loader = new com.oclib.javascript.util.Loader();
  loader.setDebugging(this.getDebugging());
  loader.setLog(this.getLog());
  loader.setTracing(this.getTracing());
  loader.setDoIfError(doIfError);
  var the = this;
  var thisDoIfSuccess = function() {the.getTestPasswordsParseResponse(doIfSuccess, doIfError, loader);};
  loader.setDoIfSuccess(thisDoIfSuccess);
  loader.makeRequest(this.method, this.url, data);
  return 1;
 };

 com.parolemanager.javascript.RemoteAccountLogins.prototype.getTestPasswordsParseResponse = function(doIfSuccess, doIfError, loader) {
  if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.getTestPasswordsParseResponse is runing...");};
  var responseXML = loader.xml;  
  if(responseXML.getElementsByTagName("status") && responseXML.getElementsByTagName("status").item(0) && responseXML.getElementsByTagName("status").item(0).firstChild) {
   var status = responseXML.getElementsByTagName("status").item(0).firstChild.data;
   if(this.mustDebug()) {this.getLog().println("RemoteAccountLogins.getTestPasswordsParseResponse: status="+status);};
   if(status == "success") {
    if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.getTestPasswordsParseResponse: success...");};
    if(responseXML.getElementsByTagName("account")) {
	 var accounts = new Array();
     var i = 0;
     while(responseXML.getElementsByTagName("account").item(i)) {
      var account = new Array();
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("id")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("id").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("id").item(0).firstChild) {
       account["id"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("id").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url").item(0).firstChild) {
       account["url"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("url").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("uid")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("uid").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("uid").item(0).firstChild) {
       account["uid"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("uid").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("password")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("password").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("password").item(0).firstChild) {
       account["password"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("password").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("good")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("good").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("good").item(0).firstChild) {
       account["good"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("good").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("bad")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("bad").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("bad").item(0).firstChild) {
       account["bad"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("bad").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("votes")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("votes").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("votes").item(0).firstChild) {
       account["votes"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("votes").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("res")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("res").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("res").item(0).firstChild) {
       account["res"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("res").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("date")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("date").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("date").item(0).firstChild) {
       account["date"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("date").item(0).firstChild.data);
	  };
      if(responseXML.getElementsByTagName("account").item(i).getElementsByTagName("searcher")
         && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("searcher").item(0)
		 && responseXML.getElementsByTagName("account").item(i).getElementsByTagName("searcher").item(0).firstChild) {
       account["searcher"] = (responseXML.getElementsByTagName("account").item(i).getElementsByTagName("searcher").item(0).firstChild.data);
	  };
	  accounts[i] = account;
      i++;
	 };
	};
	this.accountsTest = accounts;
    doIfSuccess();
   } else {
    doIfError();
   };
  };
  return 1;
 };

 com.parolemanager.javascript.RemoteAccountLogins.prototype.votePassword = function(pid, vote, doIfSuccess, doIfError) {
  if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.votePassword is runing...");};
  var data = "action=votePasswords"
             +"&pid="+escape(pid)
             +"&vote="+escape(vote);
  if(this.mustDebug()) {this.getLog().println("RemoteAccountLogins.votePassword data="+data);};
  var loader = new com.oclib.javascript.util.Loader();
  loader.setDebugging(this.getDebugging());
  loader.setLog(this.getLog());
  loader.setTracing(this.getTracing());
  loader.setDoIfError(doIfError);
  var the = this;
  var thisDoIfSuccess = function() {the.addPasswordParseResponse(doIfSuccess, doIfError, loader);};
  loader.setDoIfSuccess(thisDoIfSuccess);
  loader.makeRequest(this.method, this.url, data);
  return 1;
 };
 
 com.parolemanager.javascript.RemoteAccountLogins.prototype.votePasswordParseResponse = function(doIfSuccess, doIfError, loader) {
  if(this.mustTrace()) {this.getLog().println("RemoteAccountLogins.votePasswordParseResponsee is runing...");};
  var responseXML = loader.xml;  
  if(responseXML.getElementsByTagName("status") && responseXML.getElementsByTagName("status").item(0) && responseXML.getElementsByTagName("status").item(0).firstChild) {
   var status = responseXML.getElementsByTagName("status").item(0).firstChild.data;
   if(this.mustDebug()) {this.getLog().println("RemoteAccountLogins.votePasswordParseResponse: status="+status);};
   if(status == "success") {
    doIfSuccess();
   } else {
    doIfError();
   };
  };
  return 1;
 };
};
