// JavaScript Document

//▼▽▼200px×200px
function randomAdv200() {
  m = 0, x = 0, y = 0;
  ad  = new Array();
  adv = new Array();
  hit = new Array();

  // hitには相対確率を入れる
  // 完全にランダムにするなら全部"1"にする
  // advには、テキストを入れる。改行はしないようにする
  // テキストを増やしたりする場合は、"[ ]"の数字が0から順になるようにする
//  hit[0] = 1; adv[0] = '<a href="◆" target="_self"><img src="http://www.gyonet.jp/common_files/images/house_ads/200/◆" width="200" height="200" alt="◆" /></a>';
  hit[0] = 1; adv[0] = '<a href="http://www.gyonet.jp/wiki/index.php/%E3%82%AB%E3%83%AC%E3%82%A4%E3%81%AE%E3%81%95%E3%81%B0%E3%81%8D%E6%96%B9" target="_self"><img src="http://www.gyonet.jp/common_files/images/house_ads/200/wiki-karei_200.gif" width="200" height="200" alt="カレイのさばき方" /></a>';
  hit[1] = 1; adv[1] = '<a href="http://www.gyonet.jp/entry/spots-preopen/" target="_self"><img src="http://www.gyonet.jp/common_files/images/house_ads/200/catch-bnr_200.jpg" width="200" height="200" alt="会員登録で釣果が見れます" /></a>';
  hit[2] = 1; adv[2] = '<a href="http://www.gyonet.jp/entry/spots-preopen/" target="_self"><img src="http://www.gyonet.jp/common_files/images/house_ads/200/friend-bnr_200.jpg" width="200" height="200" alt="会員登録で友達が増やせます" /></a>';
  hit[3] = 1; adv[3] = '<a href="http://www.gyonet.jp/entry/spots-preopen/" target="_self"><img src="http://www.gyonet.jp/common_files/images/house_ads/200/new-member_200.gif" width="200" height="200" alt="会員登録で釣り場情報が届きます" /></a>';
  hit[4] = 1; adv[4] = '<a href="http://www.gyonet.jp/wiki/index.php/%E6%96%B0%E3%81%97%E3%81%84%E3%83%9A%E3%83%BC%E3%82%B8%E3%81%AE%E4%BD%9C%E3%82%8A%E6%96%B9" target="_self"><img src="http://www.gyonet.jp/common_files/images/house_ads/200/wiki-minnade_200.gif" width="200" height="200" alt="みんなで作る釣り事典" /></a>';
  hit[5] = 1; adv[5] = '<a href="http://www.gyonet.jp/wiki/index.php/%E6%9C%80%E5%BC%B7%E7%B5%90%E3%81%B3" target="_self"><img src="http://www.gyonet.jp/common_files/images/house_ads/200/wiki-saikyou_200.jpg" width="200" height="200" alt="最強結びできますか" /></a>';
  hit[6] = 5; adv[6] = '<a href="http://www.gyonet.jp/gyotacky/"><img alt="写真から実寸の魚拓を制作" src="http://www.gyonet.jp/common_files/images/house_ads/200/gyotaku.jpg"></a>';
  hit[7] = 5; adv[7] = '<a href="http://www.gyonet.jp/gyotacky/"><img alt="写真から実寸の魚拓を制作" src="http://www.gyonet.jp/common_files/images/house_ads/200/gyotaku-2.jpg"></a>';
  hit[8] = 5; adv[8] = '<a href="http://www.gyonet.jp/gyotacky/"><img alt="写真から実寸の魚拓を制作" src="http://www.gyonet.jp/common_files/images/house_ads/200/gyotaku-3.jpg"></a>';
  hit[9] = 5; adv[9] = '<a href="http://www.gyonet.jp/gyotacky/"><img alt="写真から実寸の魚拓を制作" src="http://www.gyonet.jp/common_files/images/house_ads/200/gyotaku-4.jpg"></a>';
  hit[10] = 5; adv[10] = '<a href="http://www.gyonet.jp/gyotacky/"><img alt="写真から実寸の魚拓を制作" src="http://www.gyonet.jp/common_files/images/house_ads/200/gyotaku-5.jpg"></a>';


  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);
}
