// ランダム広告
//  hit[184] = 1; adv[184] = '<A href="http://minnaga.com/shinryoumaru/" target="_blank"><IMG src="shop_random/shop/f-f-sinryou.gif" width="185" height="206" border="0"alt="慎漁丸"></A>';
//  hit[171] = 1; adv[171] = '<A href="http://minnaga.com/akiomaru/" target="_blank"><IMG src="shop_random/shop/f-wc-akio.gif" width="185" height="206" border="0"alt="あきお丸"></A>';
//
//
function randomAdv3() {
  m = 0, x = 0, y = 0;
  ad  = new Array();
  adv = new Array();
  hit = new Array();

  // hitには相対確率を入れる
  // 完全にランダムにするなら全部"1"にする
  // advには、広告のタグを入れる。改行はしないようにする
  // 広告を増やしたりする場合は、"[ ]"の数字が0から順になるようにする
  hit[0] = 1; adv[0] = '<br><IMG src="top_random/t_001.gif" width="140" height="100" border="1"> <IMG src="top_random/t_032.gif" width="140" height="100" border="1"> <IMG src="top_random/t_003.gif" width="140" height="100" border="1">';
  hit[1] = 1; adv[1] = '<br><IMG src="top_random/t_011.gif" width="140" height="100" border="1"> <IMG src="top_random/t_022.gif" width="140" height="100" border="1"> <IMG src="top_random/t_016.gif" width="140" height="100" border="1">';
  hit[2] = 1; adv[2] = '<br><IMG src="top_random/t_023.gif" width="140" height="100" border="1"> <IMG src="top_random/t_038.gif" width="140" height="100" border="1"> <IMG src="top_random/t_019.gif" width="140" height="100" border="1">';
  hit[3] = 1; adv[3] = '<br><IMG src="top_random/t_029.gif" width="140" height="100" border="1"> <IMG src="top_random/t_001.gif" width="140" height="100" border="1"> <IMG src="top_random/t_022.gif" width="140" height="100" border="1">';
  hit[4] = 1; adv[4] = '<br><IMG src="top_random/t_033.gif" width="140" height="100" border="1"> <IMG src="top_random/t_004.gif" width="140" height="100" border="1"> <IMG src="top_random/t_015.gif" width="140" height="100" border="1">';
  hit[5] = 1; adv[5] = '<br><IMG src="top_random/t_006.gif" width="140" height="100" border="1"> <IMG src="top_random/t_017.gif" width="140" height="100" border="1"> <IMG src="top_random/t_008.gif" width="140" height="100" border="1">';
  hit[6] = 1; adv[6] = '<br><IMG src="top_random/t_009.gif" width="140" height="100" border="1"> <IMG src="top_random/t_020.gif" width="140" height="100" border="1"> <IMG src="top_random/t_031.gif" width="140" height="100" border="1">';

  for(i=0; i<=hit.length - 1; i++) {
    m += hit[i];
  }
  n = Math.floor(Math.random() * m);
  n++;
  for(i=0; i<=hit.length - 1; i++) {
    x = y;
    y += hit[i];
    if(x<n && n<=y) ad = adv[i];
  }
  document.write(ad);
}