 function sendRequest (url,callback,postData)
  {
	  var req = createXMLHTTPObject ();
	  if (!req) return;
	  var method = (postData) ? "POST" : "GET";
	  req.open(method,url,true);
	  req.setRequestHeader ('User-Agent','XMLHTTP/1.0');
	  if (postData)
	   {
		   req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded; charset=utf-8;");
    }
  	req.onreadystatechange = function ()
    {
	   	if (req.readyState != 4) return;
		   if (req.statusText != "OK")	return;
		   callback(req);
  	 }
  	if (req.readyState == 4) return;
	   req.send(postData);
  }

  function XMLHttpFactories ()
   {
	   return [function () {return new XMLHttpRequest()},
		          function () {return new ActiveXObject("Msxml2.XMLHTTP")},
		          function () {return new ActiveXObject("Msxml3.XMLHTTP")},
		          function () {return new ActiveXObject("Microsoft.XMLHTTP")}
	          ];
  }

 function createXMLHTTPObject ()
  {
	  var xmlhttp = false;
	  var factories = XMLHttpFactories();
	  for (var i=0;i<factories.length;i++)
    {
		   try
      {
			    xmlhttp = factories[i]();
		    }
		   catch (e)
		    {
			    continue;
		    }
		   break;
	   }
	  return xmlhttp;
  }

 function input_verification (input, action_type, module_path)
  {
   if (!is_object (input)) return;

   var postdata = "ajax=1&action=" + (is_string (action_type)?action_type:'') + 
                  "&input_name=" + escape (input.name) + 
                  "&input_value=" + escape (input.value);
                  
   sendRequest (module_path, input_evaluation, postdata);
  }

 function user_identification (input_login, input_password, action_type, module_path)
  {
   if (!is_object (input_login) || !is_object (input_password)) return false;

   var postdata = "ajax=1&action=" + (is_string (action_type)?action_type:'') + 
                  "&input_name=" + escape (input_login.value) + 
                  "&input_value=" + escape (input_password.value);

   sendRequest (module_path, user_evaluation, postdata);
  }

 function password_verification (input, input_second, action_type, module_path)
  {
   if (!is_object (input) || !is_object (input_second)) return false;

   var postdata = "ajax=1&action=" + (is_string (action_type)?action_type:'') + 
                  "&input_name=" + escape (input.name) + 
                  "&input_value=" + escape (input.value) +
                  "&input_second=" + escape (input_second.value);
   sendRequest (module_path, input_evaluation, postdata);
  }

 function user_logout (module_path)
  {
   sendRequest (module_path, function (e) { document.location.href = "/"; }, "ajax=1&action=logout");
  }

 function user_evaluation (xmlHttp)
  {
   if (xmlHttp.responseText)
    {
     if (xmlHttp.responseText == "&nbsp;")
      {
       document.location.href = ""; 
      }
     else
      {
       document.getElementById ("module_login001-form-row-submit-alert").innerHTML = xmlHttp.responseText;
       document.getElementById ("form_login_login").value = "";
       document.getElementById ("form_login_password").value = "";
      } 
    }
  }

 function input_evaluation (xmlHttp)
  {
   if (xmlHttp.responseText)
    if (document.getElementById (xmlHttp.responseText.split("##")[0]))
     document.getElementById (xmlHttp.responseText.split("##")[0]).innerHTML = xmlHttp.responseText.split("##")[1];
  }

