 function addcom(klist,klistdiv,hidform) {
   kl=document.getElementById(klist); 
   di=document.getElementById(klistdiv);
   hi=document.getElementById(hidform); 
   i=kl.selectedIndex;
   if (hi.value.indexOf(' '+kl.options[i].value+' ')==-1) {
     hi.value=hi.value+" "+kl.options[i].value+" ";
	show("comitediv"+kl.options[i].value,"inline");
   }
   kl.focus();
 }

function removecom(i,klist,klistdiv,hidform) {
   kl=document.getElementById(klist); 
   di=document.getElementById(klistdiv);
   hi=document.getElementById(hidform);
   for(j=0;j<kl.options.length;j++) {
     if (kl.options[j].value==i) {
       var tt=' '+kl.options[j].value+' ';
       if ((k=hi.value.indexOf(tt))!=-1) {
                hi.value=hi.value.substr(0,k)+hi.value.substr(k+tt.length);
        }
	hide("comitediv"+kl.options[j].value);
     }
   }
}


function removealert(id) {
  xmlhttp.open("GET", "alerte_liste.php?action=del&id="+id,true);
  xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4) {
      	co=document.getElementById('alertlist');
		co.innerHTML=xmlhttp.responseText;	
    }
  }
  xmlhttp.send(null);	
}
function addalert(key) {
  xmlhttp.open("GET", "alerte_liste.php?action=add&key="+document.getElementById(key).value,true);
  xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4) {
      	co=document.getElementById('alertlist');
		co.innerHTML=xmlhttp.responseText;	
    }
  }
  xmlhttp.send(null);	
}



/*******************************************************/
/* XMLHTTPREQUEST compatible IE/Mozilla. */

var xmlhttp=false;
var group=false;

/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
} 
