function getHTTPObject(theDiv){
    var xmlhttp = false;

    /* Compilation conditionnelle d'IE */
    /*@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;
        }
    }
    if (xmlhttp) {
        xmlhttp.onreadystatechange = function(){
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
                    //document.getElementById("wait").style.visibility = 'hidden';
                    document.getElementById(theDiv).innerHTML = xmlhttp.responseText;
                    return xmlhttp.responseText;
                }
            }
        }
    }
    return xmlhttp;
}

function ajaxSend(url){
    var xmlhttp = sendHTTPObject();
    xmlhttp.open("GET", url, true);
    xmlhttp.send(null);
}

function ajaxGet(url, div){
    var xmlhttp = getHTTPObject(div);
    xmlhttp.open("GET", url, true);
    xmlhttp.send(null);
    xmlhttp = undefined;
}

function ajaxCheck(url){
    var xmlhttp = sendHTTPObject();
    xmlhttp.open("GET", url, false);
    xmlhttp.send(null);
    return xmlhttp.responseText;
}

function allowOnlyNumbers(event) {
    // Compatibilité IE / Firefox
    if(!event&&window.event) {
        event=window.event;
    }
    // IE
    if((event.keyCode < 48 || event.keyCode > 57) && event.keyCode != 9 && event.keyCode != 37 && event.keyCode != 39) {
        event.returnValue = false;
        event.cancelBubble = true;
    }
    // DOM
    if((event.which < 48 || event.which > 57) && event.which != 8 && event.which != 0) {
        event.preventDefault();
        event.stopPropagation();
    }
}

window.onload = showMenu;
function showMenu(id){
  var d = document.getElementById(id);
    for (var i = 1; i<=10; i++){
      if (document.getElementById('smenu'+i)) {
        document.getElementById('smenu'+i).style.display='none';
      }
    }
    if (d) {
      d.style.display='block';
    }
}
