mapimages = new Array();
sel_airport = '';


function findFieldValueIndex( fld, value)
{
  for( i = 0; i < fld.options.length; i++) {
    if( fld.options[i].value == value) {
      return i;
    }
  }

  return -1;
}

function SN_hide()
{
  if( sel_airport == '') {
    document.images['streckennetz_uebersicht'].src = map_src_prefix+'fg.gif';
  } else if( mapimages[sel_airport]) {
  	document.images['streckennetz_uebersicht'].src = mapimages[sel_airport].src;
  }
}

function SN_show( airport, clicked)
{

    if( clicked != 2 && document.lowcost_search2) {
      if(findArrayPos(routes[sel_airport],airport) < 0) {
      
    }
    sel_airport = airport;
  }
  return false;
}

function updateDestination2()
{
  var idx  = document.lowcost_search2.origin.selectedIndex;
  var orig = document.lowcost_search2.origin[idx].value;

  var idx  = document.lowcost_search2.destin.selectedIndex;
  var dest = document.lowcost_search2.destin[idx].value;

  if( !document.lowcost_search2) {
    return;
  }

  document.lowcost_search2.destin.length = 1;

  var sel = 0;
  if( orig != '' && routes[orig]) {
    for( i = 0; orig != '' && i < routes[orig].length; i++) {
      var code = routes[orig][i];
      var name = airport[code];

      document.lowcost_search2.destin.options[i+1] = new Option( name, code);

      if( code == dest) {
        sel = i+1;
      }
    }
  }

  document.lowcost_search2.destin.selectedIndex = sel;
  SN_show( orig, 2);
}
