var csz_zipPtr = null;
var csz_statePtr = null;
var csz_cityPtr = null;
var req;
function getCSZ(zipPtr, statePtr, cityPtr, countryPtr) {
    var zip = zipPtr.value;
    var country = 1;

    if(countryPtr) { country = countryPtr.value; }

    csz_zipPtr = zipPtr;
    csz_statePtr = statePtr;
    csz_cityPtr = cityPtr;

    if(zip.length <= 0) { return; }

    var url = "/tools2.mp?f=getCSZ&m=check&zip=" + escape(zip) + "&country=" + country;

    if(window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
    }
    else if(window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if(req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send();
        }
    }
}

function processReqChange() {
    if(req.readyState == 4) {
        if(req.status == 200) {
            if(req.responseText.length > 0) {
                var arr = req.responseText.split('|');
                csz_statePtr.value = arr[1];
                csz_cityPtr.value = arr[2];
            }
        }
        else {
        }
    }
}
