function disconnect(){
    if (confirm('Are you sure you want to exit the application ?')) {
        location.href = 'http://submission.eurointervention.org/exec/disconnect.php';
    }
}

function sendHTTPObject(){
    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';
                }
            }
        }
    }
    return xmlhttp;
}

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