var req=null;
var consoly=null;

function sendRequest(url,params,HttpMethod){
 if (!HttpMethod){
    HttpMethod="GET";
  }
  req=initXMLHTTPRequest();
  if (req){
    req.onreadystatechange=onReadyState;
    req.open(HttpMethod,url,true);
    req.setRequestHeader("Content-Type",  "application/x-www-form-urlencoded");
    req.send(params);
  }
}

function initXMLHTTPRequest(){
 var xRequest=null;
 if (window.XMLHttpRequest){
   xRequest=new XMLHttpRequest();
  } else if (window.ActiveXObject){
   xRequest=new ActiveXObject("Microsoft.XMLHTTP");
  }
  return xRequest;
}

function onReadyState(){
  var ready=req.readyState;
  var data="<strong>Идет получение данных ...</strong>";
  if (ready==4){
  data=req.responseText;
  } else {
   toConsole("<strong>Идет получение данных ...</strong>");
  }
  toConsole(data);
}

function toConsole(data){
  if (consoly!=null){
     consoly.innerHTML = data;
  }
}

function GetList(){
 var s = document.getElementById("country_id").value;
 consoly = document.getElementById("resorts_div");
 sendRequest("test.php?s="+s);
}
function GetList2(){
 var s = document.getElementById("country_id2").value;
 consoly = document.getElementById("resorts_div2");
 sendRequest("test1.php?s="+s);
}