    
    XMLHttp = function() {
        try  { // for IE 7.0/ firefox and other browsers etc
            XmlHttp = new XMLHttpRequest();
            return XmlHttp;
        }  catch(e)  {
            // check Microsoft Ajax ActiveX Object IE 5.5, IE 6.0 etc
            var MicrosoftAjaxObject = new Array("Msxml2.XMLHTTP.6.0",
                                                "Msxml2.XMLHTTP.5.0",
                                                "Msxml2.XMLHTTP.4.0",
                                                "Msxml2.XMLHTTP.3.0",
                                                "Msxml2.XMLHTTP",
                                                "Microsoft.XMLHTTP");
                                            
            for (var i=0; i < MicrosoftAjaxObject.length; i++){     
                try {
                        // try to create the XMLHttpRequest object
                        var XmlHttp = new ActiveXObject(MicrosoftAjaxObject[i]);
                        return XmlHttp;
                } catch(e){ }
            }   // end of for
            
            throw new Error('XMLHttp (AJAX) not supported');  
        
        }  // end of catch e
    } // end of function XMLHttp
   
	function makeRequest(XmlHttp, method, serverPage, parameter, objID, echoTo, runjs) {      // Ajax server file request function 

//		if (objID != '') {
			var obj = document.getElementById(objID);  // find Target TAG 
    	    document.getElementById('wait').style.visibility = 'visible';
//			}
        
        XmlHttp.open(method, serverPage, true);     // make a request using method 
        
        // following lines required to fix the cache bug of IE
		XmlHttp.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 1990 00:00:00 GMT');
        XmlHttp.setRequestHeader('Cache-Control', 'no-cache');
		
		// following line is required to send encoded POST requests
        XmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");  
        
        if (method == 'post' && parameter != '') {   
            XmlHttp.setRequestHeader("Content-length", parameter.length);
        }
        
        XmlHttp.setRequestHeader ("Connection", "close");  
        XmlHttp.onreadystatechange = function() {
//			alert(XmlHttp.status);
            if (XmlHttp.readyState == 4 && XmlHttp.status == 200) {   //4 - request complete, 200 - No error response OK
				if (echoTo == 'value') { obj.value = trim(XmlHttp.responseText); }
				else if (echoTo == 'innerHTML') { obj.innerHTML = XmlHttp.responseText; }
				else if (echoTo == 'src') { obj.src = XmlHttp.responseText; }
				document.getElementById('wait').style.visibility = 'hidden';
				if (runjs == "true") { ajaxcompleted(); }
            }	
        }
        
        if (method == 'post' && parameter != '') {     
             XmlHttp.send(parameter);      
        } else {      
            XmlHttp.send(null);
        }
		
         
    } 
	 
	function trim(stringToTrim) {
		return stringToTrim.replace(/^\s+|\s+$/g,"");
	}
