//var xmlhttp = false;

function _el(id){
    return document.getElementById(id);
}

function initRequest(){

    var xmlhttptemp = false;

    if(window.XMLHttpRequest) {
        try {
            xmlhttptemp = new XMLHttpRequest();
        } catch(e) {
            xmlhttptemp = false;
            alert('Failed to create XMLHttpRequest');
        }
    } else if(window.ActiveXObject) {
        try {
            xmlhttptemp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch(e) {
            try {
                xmlhttptemp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch(e) {
                xmlhttptemp = false;
                alert('Failed to create XMLHTTP');
            }
        }
    }
    return xmlhttptemp;
}

function checkTown(town_id,value) {
    var xmlhttp = initRequest();
    xmlhttp.open("GET", siteurl + '/script/checkTown.php?town_id='+escape(town_id).replace(/\+/g,'%2B')+'&value='+escape(value).replace(/\+/g,'%2B'), true);
    xmlhttp.send(null);
}
