function XMLHTTPObject()
{
	var xmlhttp;
  	/*@cc_on
  	@if (@_jscript_version >= 5)
    	try {
      		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    	} catch (e) {
      		try {
        		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      		} catch (E) {
        		xmlhttp = false;
      		}
    	}
 	@else
  	xmlhttp = false;
 	@end @*/
  	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    		try {
      			xmlhttp = new XMLHttpRequest();
    		} catch (e) {
      			xmlhttp = false;
    		}
  	}
  return xmlhttp;
}

var http = XMLHTTPObject();

function http_error()
{
	alert("Error loading page\n"+http.status+": "+http.statusText); 
}

function load(url)
{
	with (http) {
		open("POST", "pages/"+url, true);
  		onreadystatechange = http_get;
  		send(null);
	}
}

function http_get()
{
	if (http.readyState == 4) {
		if(http.status == 200) { 
			with (document) {
				getElementById('content').innerHTML = http.responseText;
			}				
        	} else { 
            		http_error();
        	} 
	}
}
