/* ******************************************************************* */
// Imagine Développement
// Julien MARTIN

/* ******************************************************************* */	

// appel de script par AJAX
  
// retourne false en cas d'erreur ou une valeur type entier ou booleen qui sera traitée par le prg  
function iAjaxQuestionSimple (fichier)
{
	xhr_object = getHTTPObject()
		
	xhr_object.open("GET", fichier, false);
	xhr_object.send(null);
	var returnValue;
	if (xhr_object.readyState == 4) 
	{
		if (xhr_object.status == 200) 
		{
			returnValue = xhr_object.responseText;
			//alert (returnValue);
		} 
		else 
		{
			alert('Un problème est survenu avec la requête.');
		}

		return(xhr_object.responseText);
	}
	else 
		return(false);
}

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;
}




