//tobbszoros include:
if (typeof FORMSESSION != "undefined") {
  alert("FORMSESSION multiple insert!");
}
FORMSESSION=true;

xmlRpcLoc=location.protocol+"//"+location.host+"/core/xmlrpc/";

function Session() {
}

Session.addForm = function (formName) {
  if (typeof (this.forms) == "undefined" || this.forms == null) {
    this.forms=new Array();
  }
  this.forms[this.forms.length]=formName;
}

Session.keepAlive = function () {
  var config={
    functionName: "keepSessionAlive",
    functionParams: [this.forms[0]],
    url: xmlRpcLoc,
    asyncFlag: true,
    timeoutLimit: 3,                 //3 s timeout
    onError: function (e,xmlhttp) {
      //alert("onError: "+e.message);
    },
    callback: function (response) {
      //alert("callback: "+response+" form:"+Session.forms[0]);
      //relationGroup.showResults(response);
    }
  };
  XmlRpc.call(config);        
}

Session.formsKeepAlive = function() {
  if (typeof (this.forms) != "undefined"
      && this.forms != null
      && this.forms.length > 0) { 
    this.keepAlive();
    //setTimeout("formsKeepAlive()",300000);
  }
}

