/*
 * the・Search用JavaScript
 */

function category_go_selector( id ){
  ids = new Array("web", "image", "map");
  keyword = document.getElementById( 'search' );
  if (id.value != 'search') {
    sb_selector( id, ids );
  }
  if( keyword.value != '' ) {
    document.search_area.submit();
  }
}

function check_keyword() {
  keyword = document.getElementById( 'search' );
  if( keyword.value != '' ) {
    return( true );
  } else {
    return( false );
  }
}

function top_start(){
  ids = new Array("web", "image", "map");
  id = document.getElementById( 'category' ).value;
  sb_selector( id, ids );
  window.scrollTo(0,1);
}

function sb_selector( id, ids ) {
  for (i = 0; i < ids.length; i++) {
    if( id == ids[i] ) {
      document.getElementById( ids[i] + "_link" ).style.display = "none";
      document.getElementById( ids[i] + "_text" ).style.display = "inline";
      document.getElementById( "category" ).value = id
    } else {
      document.getElementById( ids[i] + "_link" ).style.display = "inline";
      document.getElementById( ids[i] + "_text" ).style.display = "none";
    }
  }
}

