//
// filter directory
//

var searchcity = "*"
var searchtype = "*"
function findCity( city ) {
  searchcity = city
  showsearch( searchcity, searchtype )
}
function findType( type ) {
  searchtype = type
  showsearch( searchcity, searchtype )
}
function showsearch( city, type ) {
  var keywords = ""
  var num = 0
  if( city != "*" ) { keywords += city + " "; num++ }
  if( type != "*" ) { keywords += type + " "; num++ }
  var el, id, i, j; j = 0
  for( i = 1; i < 1000; i++ ) {
  id = 'row' + i
    el = document.getElementById( id )
    if( el ) {
      if( !num || hittest( el.title, keywords, num ) ) el.className = 'tr-' + ((++j%2)? 'odd' : 'even')
      else el.className = 'divoff'
    }
    else break
  }
}

function SelectCity( city )
{
  var el, id, i;
  for( i = 0; i < 100; i++ ) {
    id = 'div-' + i;
    el = document.getElementById( id );
    if( el ) el.className = ( city != "*" && el.title.indexOf( city ) == -1 ) ? 'div-off' : 'div-on';
    else break;
  }
}
