﻿   
    var http;
    
    function initAjaxRequest(){
        // code for Mozilla, etc.
		try {
			http=new XMLHttpRequest();
		} catch (e) {
			// code for IE
			try {
				http=new ActiveXObject("MSXML2.XMLHTTP.4.0");
			} catch (e) {
				http=new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
    }
    var ReturnedAjaxData="";
    function ExecHTTP(url, params, endFunctions){
        initAjaxRequest();
        
        http.open("POST", url, true);

        http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        http.setRequestHeader("Content-length", params.length);
        http.setRequestHeader("Connection", "close");

        http.onreadystatechange = function() {
	        if(http.readyState == 4 && http.status == 200) {
		        ReturnedAjaxData = http.responseText;
		        if(endFunctions){
		            eval(endFunctions);
		        }
	        }
        }
        http.send(params);
    }