function getReady(country,city) {
  /*getCountrySelectbox(country);*/
  getCitySelectbox(country,city);
}

function updateCityList() {
  var country = document.fw.country.value;

  getCitySelectbox(country,'');
}

function getCountrySelectbox(country) {
  new Ajax.Request("/ajax/server.cgi?action=getCountrySelectbox&country="+encodeURI(country), {
    method: "GET",
    onComplete:function(xhr) {
      document.getElementById('countryList').innerHTML = xhr.responseText;   
    }
  });
  /*$("#country").load("/ajax/server.cgi",{action: "getCountrySelectbox"});*/

}

function getCitySelectbox(country,city) {
  if(city) {
    new Ajax.Request("/ajax/server.cgi?action=getCitySelectbox&country="+encodeURI(country)+"&city="+encodeURI(city), {
      method: "GET",
      onComplete:function(xhr) {
        document.getElementById('cityList').innerHTML = xhr.responseText;
      }
    });
  } else {
    new Ajax.Request("/ajax/server.cgi?action=getCitySelectbox&country="+encodeURI(country), {
      method: "GET",
      onComplete:function(xhr) {
        document.getElementById('cityList').innerHTML = xhr.responseText;
      }
    });
  }
}
