function GetXmlHttpObject(){
        if(window.XMLHttpRequest){
            // code for IE7+, Firefox, Chrome, Opera, Safari
            return new XMLHttpRequest();
        }
        else if (window.ActiveXObject){
            // code for IE6, IE5
            return new ActiveXObject("Microsoft.XMLHTTP");
        }
            else{
                return null;
        }
    }

    function ajax(condition,file,span_layer,loading){

        var obj_ajax=GetXmlHttpObject();
        if(obj_ajax==null){
            alert("Your browser does not support XMLHTTP!");
            return;
        }
        if(condition==""){
            condition="null";
        }
        var url=file+'.php?'+condition;
        //alert(condition+' - '+file+' - '+span_layer+' - '+url);
        obj_ajax.open("get",url,true);
        obj_ajax.onreadystatechange=function add(){
        if (obj_ajax.readyState==4){
            if(span_layer!==""){
                document.getElementById(span_layer).innerHTML=obj_ajax.responseText;
            }else{
                document.getElementById('tmp_').innerHTML=obj_ajax.responseText;
            }
        }else{
            if(span_layer!==""){
                if(loading!=""){
                    document.getElementById(span_layer).innerHTML=loading;
                }
                //document.getElementById(span_layer).innerHTML=obj_ajax.responseText;
            }else{
                document.getElementById('tmp_').innerHTML='';
            }

        }
        };
        obj_ajax.send(null);
    }
