getHttp=function(id,url,func,indicator)
{ 
	if (indicator!=null)
		schowDiv(indicator,'show');
    var xhrequest; 
    try {xhrequest = new XMLHttpRequest(); }                 
    catch(e) 
    {    
      xhrequest = new ActiveXObject("Microsoft.XMLHTTP");
    } 

    xhrequest.onreadystatechange  = function()
    { 
         if(xhrequest.readyState  == 4)
         {
			if (indicator!=null)
				schowDiv(indicator);          	
              if(xhrequest.status  == 200){ 
				setInnerHTML(document.getElementById(id), xhrequest.responseText);
				if (func!=null) {try{ func(id);} catch(e){alert('no');}}
				 }
              else 
                 document.getElementById(id).innerHTML="Erreur " + xhrequest.status;
           
         }
    }; 
   xhrequest.open( "GET", url,  true); 
   xhrequest.send(null);
} 
getValueOf=function(str,cle){
var deb=str.indexOf(cle)+cle.length;
var fin=str.lastIndexOf(cle);
var retour=str.substring(deb,fin);

return retour; 
}
postHttp=function(id,url,params,func,indicator)
{ 
	if (indicator!=null)
		schowDiv(indicator,'show');	
    var xhrequest; 
    try {xhrequest = new XMLHttpRequest(); }                 
    catch(e) 
    {    
      xhrequest = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xhrequest.open( "POST", url,  true);      
	xhrequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
	xhrequest.setRequestHeader("Content-length", params.length);
	xhrequest.setRequestHeader("Connection", "close");
    xhrequest.onreadystatechange  = function()
    { 
         if(xhrequest.readyState  == 4)
         {
         	if (indicator!=null)
				schowDiv(indicator); 
              if(xhrequest.status  == 200){
					setInnerHTML(document.getElementById(id),xhrequest.responseText);
					if (func!=null) {try{ func(id);} catch(e){alert('no');}}
				 }
              else 
                 document.getElementById(id).innerHTML="Erreur " + xhrequest.status;
		}
    }; 

   xhrequest.send(params);
} 
setInnerHTML=function(divContent, HTML) {
if(divContent!=null){
  divContent.innerHTML=HTML; 
  var All=divContent.getElementsByTagName("*");
  for (var i=0; i<All.length; i++) {
    All[i].id=All[i].getAttribute("id")
    All[i].name=All[i].getAttribute("name")
    All[i].className=All[i].getAttribute("class")
  }
  var AllScripts=divContent.getElementsByTagName("script")
  for (var i=0; i<AllScripts.length; i++) {
     var s=AllScripts[i];
     if (s.src && s.src!="") {
        // Précédement asynchrone, mis en synchrone pour éviter des problèmes de dépendances de scripts
        eval(getFileContent(s.src))
     }
     else {
        eval(s.innerHTML)
     }
  }
}
}
    // Retourne un nouvel objet XmlHttpRequest
    var GetXmlHttpRequest_AXO=null
    var GetXmlHttpRequest=function () {
	    if (window.XMLHttpRequest) {
		    return new XMLHttpRequest()
	    }
	    else if (window.ActiveXObject) {
		    if (!GetXmlHttpRequest_AXO) {
			    GetXmlHttpRequest_AXO=pickRecentProgID(["Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]);
		    }
		    return new ActiveXObject(GetXmlHttpRequest_AXO)
	    }
	    return false;
    }

getFileContent=function getFileContent(url) {
       var Xhr=GetXmlHttpRequest();
       Xhr.open("GET",url,false);
       Xhr.send(null);
       return Xhr.responseText;
    }
getCheckedValue=function(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
getCheckedValues=function(checkedObj) {
	var ret="";
	if(!checkedObj)
		ret= "";
	var checkedLength = checkedObj.length;
	if(checkedLength == undefined)
		if(checkedObj.checked)
			ret= checkedObj.value;
		else
			ret="";
	for(var i = 0; i < checkedLength; i++) {
		if(checkedObj[i].checked) {
			ret+=","+checkedObj[i].value;
		}
	}
	return ret;
}
show=function(id,method){
	if (method==true)
		schowDiv(document.getElementById(id),'show');
	else
		schowDiv(document.getElementById(id),'hide');
}
schowDiv=function(itm,method){
	if (itm.style)
	{if ( method == 'show' )
		{itm.style.display = "";}
		else
		{itm.style.display = "none";}
	}
	else
	{itm.visibility = "show";}
}
addSheet=function(aSheet){
	var cssheet = document.createElement('link');
	cssheet.setAttribute('rel','stylesheet');
	cssheet.setAttribute('type','text/css');
	cssheet.setAttribute('href',aSheet);
	cssheet.setAttribute('media','all'); // éventuellement.
	document.getElementsByTagName('head').appendChild(cssheet);
	}