function XML_HTTP_Conn(){
  var xmlhttp, bComplete = false;
	
	// get XMLHTTPReq by browser implementation
	try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { 
	  	try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
		catch (e) { 
		  	try { xmlhttp = new XMLHttpRequest(); }
			catch (e) { xmlhttp = false; }
		}
	}
	
  if (!xmlhttp) return null;
  
  this.connect = function(URL, method, vars, callbackFuncName) {

    if (!xmlhttp) return false;

    bComplete = false;

    method = method.toUpperCase();
	
    try {
      if (method == "GET"){
        xmlhttp.open(method, URL+"?"+vars, true);
        vars = "";
      } else{
        xmlhttp.open(method, URL, true);
        xmlhttp.setRequestHeader("Method", "POST "+URL+" HTTP/1.1");
        xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
      }

      xmlhttp.onreadystatechange = function(){
        if (xmlhttp.readyState == 4 && !bComplete){
          bComplete = true;
          if(callbackFuncName != null) callbackFuncName(xmlhttp);
        }
      };

      xmlhttp.send(vars);
    }
    catch(z) { return false; }
    return true;
  };
  
  return this;
}

