// http://www.devx.com/DevX/Tip/17500
// http://www.javascriptkit.com/jsref/ajax.shtml
function getHTTPObject() {

  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 = getHTTPObject(); // We create the HTTP Object

/* EXAMPLE
function response()
{
	if (http.readyState == 4) 
	{	
		if (http.status != 200) 
		{
			return;
		}
		// get response text
		var response = (http.ResponseText)?http.ResponseText:http.responseText;		
		response = unescape(response);
		window.status = response;
	}
}

function update()
{

// for debug, open in new window   
// var newwin = window.open("page?variable=data");	
// return;
	// send 
	http.open('POST',"http://www.URL",true);
	http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
	http.setRequestHeader('Connection','close'); //STUPID 400 FF ERROR FIX  // not needed ? http://beta.twelvestone.com/forum_thread/view/25052 
	http.onreadystatechange = response;  	
	http.send("variable=data");		
}

// reading only code:
  var xmlDoc = null ;
  function load() {
	if (typeof window.ActiveXObject != 'undefined' ) {
	  xmlDoc = new ActiveXObject("Microsoft.XMLHTTP");
	  xmlDoc.onreadystatechange = process ;
	}
	else {
	  xmlDoc = new XMLHttpRequest();
	  xmlDoc.onload = process ;
	}
	xmlDoc.open( "GET", filename, true );
	xmlDoc.send( null );
  }

  function process() {
	if ( xmlDoc.readyState != 4 ) return ;
	var raw= xmlDoc.responseText;
	document.getElementById('pipermail').innerHTML= raw; 		
	reformat();
  }  
*/