function testAjax(){
    var req=false;

    if(document.getElementById("bsajax")){                   
        try{
            req = new XMLHttpRequest();
        }
        catch(e){
            try{
                req = new ActiveXObject("Msxml2.XMLHTTP.5.0");
            }
            catch(e){
                try{
                    req = new ActiveXObject("Msxml2.XMLHTTP.4.0");
                }
                catch(e){
                    try{
                        req = new ActiveXObject("Msxml2.XMLHTTP.3.0");
                    }
                    catch(e){
                        try{
                            req = new ActiveXObject("Microsoft.XMLHTTP.5.0");
                        }
                        catch(e){
                            req = false;
                        }
                    }
                }
            }
        }
        if(req){
            document.getElementById("bsajax").value = "1";
        }else{
            document.getElementById("bsajax").value = "0";
        }
    }
}