////////////////////////////////////////////////////////////////////////

var baseURL="map.php";

function gotoCountry(countryName){
	loadXMLDoc(baseURL+"?country="+countryName);
	//alert(baseURL+"?countryName="+countryName);
	//ajax_get_data('map.php?country='+countryName,document.getElementById('fordata'));
	//document.getElementById("fordata").innerHTML=countryName;
}
////

////////////////////////////////////////////////////////////////////////


if(ActiveXObject){
var req = new ActiveXObject("Microsoft.XMLHTTP");// (для IE)
}else{
var req = new XMLHttpRequest();//  (Для всего остального)
}


function loadXMLDoc(url) {
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send();
        }
    }
}
var reqTimeOut;
function processReqChange()
{
    // only if req shows "complete"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
		res = req.responseText;
        } else {
		res=("У нас виникла Велика проблема з отриманням даних:\n" + req.statusText);
        }
		document.getElementById("fordata").innerHTML=res;
    }
}


