  var countries = new Array();
  var counties = new Array();
  var cities = new Array();

  countries[0] = new Array();
  counties[0] = new Array();
  cities[0] = new Array();

  function fillcountry(region_id,countryId,countyId,cityId) {

    country_select = document.getElementById(countryId);

    country_select.length = 0;
    if(countryId.indexOf("To") >= 0)
    {
        country_select.options[0] = new Option( "---Destination----", "0", 1, 1 );
    }
    else
    {
        country_select.options[0] = new Option( "---Departure----", "0", 1, 1 );
    }
    if ( !countries[region_id] ) {
      fillcounty(0,countyId,cityId);
      return;
    }

    for( i=0; i<countries[region_id].length; i++ ) {
      country_select.options[i+1] = new Option( countries[region_id][i][1], countries[region_id][i][0] );
    }

    country_select.options[0].selected = true;

    fillcounty(0,countyId,cityId);
  }

  function fillcounty(country_id,countyId,cityId) {

    county_select = document.getElementById(countyId);

    county_select.length = 0;
    county_select.options[0] = new Option( "---Select----", "0", 1, 1 );

    if ( !counties[country_id] ) {
      fillcity(0,cityId);
      return;
    }

    for( i=0; i<counties[country_id].length; i++ ) {
      county_select.options[i+1] = new Option( counties[country_id][i][1], counties[country_id][i][0] );
    }

    county_select.options[0].selected = true;

    fillcity(0,cityId);
  }

  function fillcity(county_id,cityId) {

    city_select = document.getElementById(cityId);
    city_select.length = 0;

    city_select.options[0] = new Option( "---Select----", "0", 1, 1 );

    if ( !cities[county_id] ) {
      return;
    }

    for( i=0; i<cities[county_id].length; i++ ) {
      city_select.options[i+1] = new Option( cities[county_id][i][1], cities[county_id][i][0] );
    }

    city_select.options[0].selected = true;
  }