function httpPostRequest(url, elm) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', url, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            var str = self.xmlHttpReq.responseText;
            var targetElm = document.getElementById(elm);
            if (targetElm) {
               targetElm.innerHTML = str;
            }
            ajaxReady = true;
        }
    }
    self.xmlHttpReq.send();
}

function getAd() {
    httpPostRequest('/ajax/getAd.php', 'adBannier');
}

function getProductAd(procat) {
    httpPostRequest('/ajax/getProductAd.php?procat=' + procat, 'productAd');
}

function getProductInfo(proid) {
    httpPostRequest('/ajax/getProductInfo.php?proid=' + proid, 'productInfoDiv');
}
