function fnModeSubmit( mode, keyname, keyid )
{
  switch( mode ) {
  case 'delete':
    if ( !window.confirm( '一度削除したデータは、元に戻せません。\n削除しても宜しいですか？' ) ) {
      return;
    }
    break;
  case 'confirm':
    if ( !window.confirm( '登録しても宜しいですか' ) ) {
      return;
    }
    break;
  case 'delete_all':
    if ( !window.confirm( '検索結果をすべて削除しても宜しいですか' ) ) {
      return;
    }
    break;
  default:
    break;
  }
  document.form1['mode'].value = mode;
  if ( keyname != "" && keyid != "" ) {
    document.form1[keyname].value = keyid;
  }
  document.form1.submit();
}

function fnChangeAction( url )
{
  document.form1.action = url;
}

function changeContact( n )
{
  var kind = n;
  if ( kind == undefined ) kind = $("kind").value;
  if ( kind == 1 ) {
    $("shop_name").disabled       = true;
    $("artist_handling").disabled = true;
    $("artist_sample").disabled   = false;
    $("shop_name").value          = '';
    $("artist_handling").value    = '';
    $("shop_name").style.backgroundColor       ='#cccccc';
    $("artist_handling").style.backgroundColor ='#cccccc';
    $("artist_sample").style.backgroundColor   ='#ffffff';
    $("contact_shop_name1").style.display       = 'none';
    $("contact_shop_name2").style.display       = 'none';
    $("contact_artist_handling1").style.display = 'none';
    $("contact_artist_handling2").style.display = 'none';
    $("contact_artist_sample1").style.display   = 'block';
    $("contact_artist_sample2").style.display   = 'block';
  } else if ( kind == 2 ) {
    $("shop_name").disabled       = false;
    $("artist_handling").disabled = false;
    $("artist_sample").disabled   = true;
    $("artist_sample").value      = '';
    $("shop_name").style.backgroundColor       ='#ffffff';
    $("artist_handling").style.backgroundColor ='#ffffff';
    $("artist_sample").style.backgroundColor   ='#cccccc';
    $("contact_shop_name1").style.display       = 'block';
    $("contact_shop_name2").style.display       = 'block';
    $("contact_artist_handling1").style.display = 'block';
    $("contact_artist_handling2").style.display = 'block';
    $("contact_artist_sample1").style.display   = 'none';
    $("contact_artist_sample2").style.display   = 'none';
  } else if ( kind == 3 || kind == kind == 4 ) {
    $("shop_name").disabled       = true;
    $("artist_handling").disabled = true;
    $("artist_sample").disabled   = true;
    $("shop_name").value          = '';
    $("artist_handling").value    = '';
    $("artist_sample").value      = '';
    $("shop_name").style.backgroundColor       ='#cccccc';
    $("artist_handling").style.backgroundColor ='#cccccc';
    $("artist_sample").style.backgroundColor   ='#cccccc';
    $("contact_shop_name1").style.display       = 'none';
    $("contact_shop_name2").style.display       = 'none';
    $("contact_artist_handling1").style.display = 'none';
    $("contact_artist_handling2").style.display = 'none';
    $("contact_artist_sample1").style.display   = 'none';
    $("contact_artist_sample2").style.display   = 'none';
  } else {
    $("shop_name").disabled       = false;
    $("artist_handling").disabled = false;
    $("artist_sample").disabled   = false;
    $("shop_name").style.backgroundColor       ='#ffffff';
    $("artist_handling").style.backgroundColor ='#ffffff';
    $("artist_sample").style.backgroundColor   ='#ffffff';
    $("contact_shop_name1").style.display       = 'block';
    $("contact_shop_name2").style.display       = 'block';
    $("contact_artist_handling1").style.display = 'block';
    $("contact_artist_handling2").style.display = 'block';
    $("contact_artist_sample1").style.display   = 'block';
    $("contact_artist_sample2").style.display   = 'block';
  }
}

function changeImage( name ) {
  document.getElementById("mainImage").src = name;
}

function setThumbClassById( target, value, value2, num ) {
  if ( document.getElementById ) {
    for ( i = 1; i <= num; i++ ) {
      var elem = "thumb_" + i;
      var obj = document.getElementById( elem );
      if ( obj ) {
        obj.className = value2;
      }
    }
    var elem = "thumb_" + target;
    var obj = document.getElementById( elem );
    if ( obj ) {
      obj.className = value;
    }
  }
}

function changeFlash( n )
{
  var kind = n;
  if ( kind == 1 ) {
    $("player1").style.display = 'block';
    $("player2").style.display = 'none';
    $("tab1").className = "tab tabMusic active";
    $("tab2").className = "tab tabMovie";
  } else if ( kind == 2 ) {
    $("player1").style.display = 'none';
    $("player2").style.display = 'block';
    $("tab1").className = "tab tabMusic";
    $("tab2").className = "tab tabMovie active";
  } else {
    $("player1").style.display = 'block';
    $("player2").style.display = 'none';
    $("tab1").className = "tab tabMusic active";
    $("tab2").className = "tab tabMovie";
  }
}

function changeFlash2( n )
{
  var kind = n;
  if ( kind == 1 ) {
    $("player1").style.display = 'block';
    $("player2").style.display = 'none';
    $("tab1").className = "tab tabImage active";
    $("tab2").className = "tab tabMovie";
  } else if ( kind == 2 ) {
    $("player1").style.display = 'none';
    $("player2").style.display = 'block';
    $("tab1").className = "tab tabImage";
    $("tab2").className = "tab tabMovie active";
  } else {
    $("player1").style.display = 'block';
    $("player2").style.display = 'none';
    $("tab1").className = "tab tabImage active";
    $("tab2").className = "tab tabMovie";
  }
}

