String.prototype.replaceAll = function(strTarget, strSubString){
  var strText = this;
  var intIndexOfMatch = strText.indexOf(strTarget);
  while (intIndexOfMatch != -1){
    strText = strText.replace(strTarget, strSubString);
    intIndexOfMatch = strText.indexOf(strTarget);
  }
  return(strText);
}

function GET_XMLHTTPRequest() {
    var request;
    try {
        request = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(ex1) {
        try {
            request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch(ex2) {
            request = null;
        }
    }
    if (!request && typeof XMLHttpRequest != "undefined") {
        request = new XMLHttpRequest();
    }

    return request;
}

function ajax(url, target) {
    var req = GET_XMLHTTPRequest();
    if (req) {
        req.open("GET", url, true);
	    req.onreadystatechange = function (aEvt) {
    		if(req.readyState == 4){
        		document.getElementById(target).innerHTML = req.responseText;
		    }
	    };
        req.send(null);
    } else {
//        alert("Ajax error!");
    }
}
