var CountryCity = new Object();

CountryCity.create = function () {

CountryCity.country = document.getElementById("CountryCity_country");
CountryCity.city = document.getElementById("CountryCity_city");

CountryCity.getCity = function ()
  {    if(CountryCity.country.selectedIndex == 0)
      {
        CountryCity.city .selectedIndex = 0;
        CountryCity.city .disabled = "disabled";
        return;
      }
    CountryCity.country.disabled = "disabled";
    CountryCity.city.disabled = "disabled";

    var value = CountryCity.country.options[CountryCity.country.selectedIndex].value;

    httpRequest.go ('POST','/country_city/','country='+value,CountryCity,'CountryCity.loadCity()');
  }

CountryCity.loadCity = function ()
  {    eval(CountryCity.responseText);
    CountryCity.city.innerHTML = '';
    for(i=0;i<value.length;i++)
      {
        var opt = document.createElement("option");
        var txt = document.createTextNode(text[i]);
        opt.appendChild(txt);
        opt.value = value[i];
        CountryCity.city.appendChild(opt);
      }
    CountryCity.country.disabled = '';
    CountryCity.city.disabled = '';
  }

}