var xmlhttp=false;
function createHTTPHandler()
{ 
  httphandler = false; 
  /*@cc_on @*/ 
  /*@if (@_jscript_version >= 5) 
  // JScript gives us Conditional compilation, we can cope with old IE versions. 
  // and security blocked creation of the objects. 
  try 
  { 
    httphandler = new ActiveXObject("Msxml2.XMLHTTP"); 
  } 
  catch (e)
  { 
    try 
    { 
       httphandler = new ActiveXObject("Microsoft.XMLHTTP"); 
    } 
    catch (E) 
    { 
       httphandler = false; 
    } 
  } 
  @end @*/ 
  if (!httphandler && typeof XMLHttpRequest != 'undefined') 
  { 
     httphandler = new XMLHttpRequest(); 
  } 
  return httphandler; 
} 

function addEvent(obj, eventType,fn, useCapture) 
{ 
  if (obj.addEventListener) 
  { 
     obj.addEventListener(eventType, fn, useCapture); 
    return true; 
  } 
  else 
  { 
     if (obj.attachEvent) 
     { 
        var r = obj.attachEvent("on"+eventType, fn); 
        return r; 
     } 
  } 
}

function sendValues(url,values,requestHandler,async)
{
   if (!xmlhttp)
      ajax_init(); 
   
  if (async === true)
     async = true;
  else
     async = false;
	xmlhttp.open("POST", url, async); //method, target, async (set always true!)
  xmlhttp.setRequestHeader("Cache-Control", "no-cache"); 
  xmlhttp.setRequestHeader("X_USERAGENT", "Ajax"); 
  xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  xmlhttp.setRequestHeader('Connection', 'close');
	xmlhttp.onreadystatechange=requestHandler;
	xmlhttp.send(values);
}

function ajax_init() 
{ 
  xmlhttp = createHTTPHandler();
}
