function send_request(xSync, xUrl, xId) {
// xSync param added to specify whether request should be synchronous (true) or asynchronous (false). 

  var xmlhttp = 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 {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
   }

  /*@end @*/

	if(!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	if(!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}
	//sets asynchronous param to opposite of xSync param
	xmlhttp.open("GET", xUrl, !xSync);
	//if asynchronous is required, set up the call back function.
	if ( !xSync ) {
		xmlhttp.onreadystatechange = function() {
			if(xmlhttp.readyState==4 && xId && xmlhttp.responseText) {
        		var div = document.getElementById(xId);
				div.innerHTML = '';
				div.innerHTML = xmlhttp.responseText;
				var x = div.getElementsByTagName("script"); 
				for(var i=0;i<x.length;i++)
				{
				   eval(x[i].text);
				}
			}
	  	}
	}

	xmlhttp.send(null);
	//if synchronous and something needs updating ... do the update
	if ( xSync && xId && xmlhttp.responseText) {
        	var div = document.getElementById(xId);
			div.innerHTML = '';
			div.innerHTML = xmlhttp.responseText;
			var x = div.getElementsByTagName("script"); 
		    for(var i=0;i<x.length;i++)
		    {
			   eval(x[i].text);
		    }
	}
}
