function loadXMLDoc(method,url){
   if(window.ActiveXObject){
		//alert("tt2");
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if(req){
            req.onreadystatechange = processReqChange;
            req.open(method, url, true);
            req.send(null);
        }
    }else if(window.XMLHttpRequest){
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open(method, url, true);
        req.send(null);
		//alert("tt1");
    }
}
// Функция, выполняемая при изменении статуса
// запроса, если статус  равен 200, данные получены.
function processReqChange(){
    if(req.readyState == 4){
        if(req.status == 200){
			//alert("qq");
			getColors(req.responseXML.documentElement);
			//alert("qq");
        }else{
            alert("There was a problem retrieving the XML data:\\n" + req.statusText);
        }
    }
}
function onChange(_this){
	//alert(11);
	var url = "/sem_ajax.php?meet="+encodeURIComponent(document.getElementById("meet").value)+"&airport="+encodeURIComponent(document.getElementById("airport").value)+"&district="+encodeURIComponent(document.getElementById("district").value);
	loadXMLDoc("get",url);
}

function parse(str) {
  var xml = new ActiveXObject("Microsoft.XMLDOM");
  xml.loadXML(str);
  xml.async = false;
  return xml;
}

function getColors(xml){
	var colors = xml.getElementsByTagName("time");
	var _select = document.getElementById("price_a");
	_select.innerHTML = "&nbsp;"; // Удаляем всех потомков.
	// Создаем список с доступными цветами.
	for(var i=0;i<colors.length;i++){
		if(colors[i].text)_select.innerHTML = colors[i].text;
		else _select.appendChild(colors[i]);
		_select.innerHTML += " руб";
	}
	
}
