function XmlGetAndReplace()
{
	this.receiveidValueOk = false;
	this.value = "";
	this.XmlHttp = false;
	this.CreateXmlHttp();
}

/**
 * Replace the innerHTML of an element (identified by his id) on the document
 * with the content of a file.
 */
XmlGetAndReplace.prototype.ReplaceElementContent = function(id, url)
{
	document.getElementById(id).innerHTML = this.GetPageContent(url);
}

/**
 * Get the content of a file on the same server (Depends on security settings).
 * Warning: If a network error apears, it could hang...
 *
 * @return The file content as a String
 */
XmlGetAndReplace.prototype.GetPageContent = function(url)
{
	this.XmlHttp.open("GET", url, false);
	this.XmlHttp.send(null);
	return this.XmlHttp.responseText;
}

/**
 * Special code who create the componenent via window.XMLHttpRequest() for
 * mozilla and safari (opera?) and via ActiveX for Internet Explorer.
 * 
 * Note: Code taken from
 *       http://developer.apple.com/internet/webcontent/xmlhttpreq.html
 */
XmlGetAndReplace.prototype.CreateXmlHttp = function()
{
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	 try {
	  this.XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
	   this.XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
	   this.XmlHttp = false;
	  }
	 }
	@end @*/
	if ((this.XmlHttp === false) && window.XMLHttpRequest) {
	  this.XmlHttp = new window.XMLHttpRequest();
	}
}
