var xmlHttp = createXmlHttpRequestObject();

function createXmlHttpRequestObject() {
    var xmlHttp;

    if(window.ActiveXObject) {
        try {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {
            xmlHttp = false;
        }
    } else {
        try {
            xmlHttp = new XMLHttpRequest();
        } catch (e) {
            xmlHttp = false;
        }
    }

    if(!xmlHttp)
        alert("Error creating the XMLHttpRequest object.");
    else
        return xmlHttp;
}

function get_data() {
    if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0) {
        //name = encodeURIComponent( document.getElementById("myName").value);
        xmlHttp.open("GET", "getDealData.php", true);
        xmlHttp.onreadystatechange = handleServerResponse;
        xmlHttp.send(null);
    }

    setTimeout('get_data()', 60000);
}

function handleServerResponse() {
}
/*
function handleServerResponse() {
    if(xmlHttp.readyState == 4) {
        if(xmlHttp.status == 200) {
            //var xmlDoc=xmlHttp.responseXML.documentElement;
            var xmlDoc = xmlHttp.responseXML;
            var showElements = xmlDoc.getElementsByTagName("product");

            for(var i=0; i<showElements.length; i++) {
                //alert(showElements[i].childNodes[0].value);
                var products_id = xmlDoc.getElementsByTagName("products_id")[i].childNodes[0].nodeValue;

                discount_current_price_str = "discount_current_price_" + products_id;
                document.getElementById(discount_current_price_str).innerHTML = xmlDoc.getElementsByTagName("discount_current_price")[i].childNodes[0].nodeValue;
            }
        } else {
            alert("There was a problem accessing the server: " + xmlHttp.statusText);

        }
    }
}
*/

