﻿function ReadXMLRemainingFunds() {
    var xhttp
    if (window.XMLHttpRequest) {
        xhttp=new XMLHttpRequest();
    }
    else {
        xhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (String(window.location).indexOf("http://www.nyapplianceswapout.com") != -1) {
        xmlFile = "https://www.nysmart.org/xmlRemainingFunds.ashx"
    }
    else if (String(window.location).indexOf("http://staging-nyapplianceswapout.lmbps.com") != -1) {
        xmlFile = "https://staging-nysmart.lmbps.com/xmlRemainingFunds.ashx"
    }
    else {
        xmlFile = "http://dev-nysmart.lmbps.com/Test.xml"
    }
    xhttp.open("GET",xmlFile,false);
    xhttp.send("");
    xmlDoc=xhttp.responseXML;
    document.getElementById("Option1").innerHTML    =   xmlDoc.getElementsByTagName("Option1")[0].childNodes[0].nodeValue;
    document.getElementById("Option2").innerHTML    =   xmlDoc.getElementsByTagName("Option2")[0].childNodes[0].nodeValue;
    document.getElementById("TotalFunds").innerHTML =   xmlDoc.getElementsByTagName("TotalFunds")[0].childNodes[0].nodeValue;
}

