
function zone(id, name, ctry_id) {
  this.id = id;
  this.name = name;
  this.ctry_id = ctry_id;
}
function service_point(id, name, zone_id) {
  this.id = id;
  this.name = name;
  this.zone_id = zone_id;
}
function loadZone(ctry_elem, zone_elem) {
  var sel_ctry;
  sel_ctry = ctry_elem.options[ctry_elem.selectedIndex].value;
  zone_elem.options.length = 0;
  for (var i = 0; i < aZone.length; i++) {
    if (aZone[i].ctry_id == sel_ctry) {
      zone_elem.options[zone_elem.options.length] = new Option(aZone[i].name, aZone[i].id);
    }
  }
}
function loadSP(zone_elem, sp_elem) {
  var sel_zone;
  sel_zone = zone_elem.options[zone_elem.selectedIndex].value;
  sp_elem.options.length = 0;
  for (var i = 0; i < aSP.length; i++) {
    if (aSP[i].zone_id == sel_zone) {
      sp_elem.options[sp_elem.options.length] = new Option(aSP[i].name, aSP[i].id);
    }
  }
}
var aZone = new Array(3);
aZone[0] = new zone('7', 'Ibiza', 'ES');
aZone[1] = new zone('8', 'Mallorca', 'ES');
aZone[2] = new zone('9', 'Menorca', 'ES');
var aSP = new Array(6);
aSP[0] = new service_point('52', 'Aeropuerto de Ibiza (Aeropuerto)', '7');
aSP[1] = new service_point('51', 'Aeropuerto de Mallorca (Aeropuerto)', '8');
aSP[2] = new service_point('48', 'Aeropuerto de Menorca (Aeropuerto)', '9');
aSP[3] = new service_point('57', 'Oficina Cala Ratjada (Oficina)', '8');

aSP[4] = new service_point('56', 'Oficina Can Picafort (Oficina)', '8');
aSP[5] = new service_point('54', 'Paseo Marítimo Palma (Oficina)', '8');
//aSP[6] = new service_point('55', 'Oficina Can Pastilla (Oficina)', '8');
//aSP[7] = new service_point('53', 'Oficina Menorca Ciudadela (Oficina)', '9');
