/*
function clientSideInclude(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("Bad id " + id +
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
}
*/
/*
function inclureFichier1(id, url) {
  var req = false;
  try {
     req = new XMLHttpRequest();
  } catch (e) {
     req = false;
  }

  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
	req.setRequestHeader("Content-Type", "text/html;charset=iso-8859-1");
	//text/html;charset=iso-8859-1
	//text/plain;charset=UTF-8
    req.send(null);
	id.innerHTML = req.responseText;
  } else {
    id.innerHTML =
      "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
}

function traiteInclusions1(){
	var descendants = document.getElementsByTagName('SPAN');
	for( i=0 ; i<descendants.length ; i++ ){
	    if(descendants[i].id.substring(0,8)=="inclure:"){
//			alert(descendants[i].id.substring(8,descendants[i].id.length));
			inclureFichier(descendants[i],descendants[i].id.substring(8,descendants[i].id.length));
        }
	}
}
*/

function inclureFichiers() {
  var req = false;
/*  try {
     req = new XMLHttpRequest();
  } catch (e) {
     req = false;
  }
*/
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }

  if (req) {	  
	var descendants = document.getElementsByTagName('SPAN');
	for( i=0 ; i<descendants.length ; i++ ){
	    if(descendants[i].id.substring(0,8)=="inclure:"){
           // Synchronous request, wait till we have it all
           req.open('GET', descendants[i].id.substring(8,descendants[i].id.length), false);
           req.send(null);
	       descendants[i].innerHTML = req.responseText;
        }
	 }	
  }
}

/*
function inclureFichiers() {
	alert("toto");
	var descendants = document.getElementsByTagName('SPAN');
	for( i=0 ; i<descendants.length ; i++ ){
	    if(descendants[i].id.substring(0,8)=="inclure:"){
alert(descendants[i]);
alert(descendants[i].id.substring(8,descendants[i].id.length)s);
//		   new Ajax.Updater(descendants[i], 
//			descendants[i].id.substring(8,descendants[i].id.length), {method: 'get', });
        }
	 }	
}
*/

window.onload = function() {inclureFichiers()};
//window.onCreate = function() {inclureFichiers()};



/*
<script type="text/javascript">
new Ajax.Request('publications/tome64/pierre_gresser.html',
  {
    method:'get',
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      alert("Success! \n\n" + response);
    },
    onFailure: function(){ alert('Something went wrong...') }
  });

var url = encodeURIComponent('http://www.google.com/search?q=Prototype');
// notice the use of a proxy to circumvent the Same Origin Policy.

new Ajax.Request(url, {
  method: 'get',
  onSuccess: function(transport) {
    var notice = $('notice');
    if (transport.responseText.match(/href="http:\/\/prototypejs.org/))
      notice.update('Yeah! You are in the Top 10!').setStyle({ background: '#dfd' });
    else
      notice.update('Damn! You are beyond #10...').setStyle({ background: '#fdd' });
  }
});
</script>

<div id="notice">loading...</div> 
 <script>
//	function getHTML()
	{
		var url = 'publications/tome64/pierre_gresser.html';
		
		var myAjax = new Ajax.Updater(
			'placeholder', 
			url, 
			{
				method: 'get', 
			});
		
	}
</script>


<input type="button" value="GetHtml" onclick="getHTML()"/>
<div id="placeholder">loading...</div>
       
*/

