// ランダム広告
function randomAdv() {
  m = 0, x = 0, y = 0;
  ad  = new Array();
  adv = new Array();
  hit = new Array();

  // hitには相対確率を入れる
  // 完全にランダムにするなら全部"1"にする
  // advには、広告のタグを入れる。改行はしないようにする
  // 広告を増やしたりする場合は、"[ ]"の数字が0から順になるようにする
  hit[0] = 2; adv[0] = '<a href="http://click.linksynergy.com/fs-bin/click?id=I7M/o2N60jU&offerid=98726.10000010&type=4&subid=5"><IMG  width="468" height="60" alt="バナー " border="0" src="https://store.willcom-inc.com/share/ec/common/images/dynamic/linkshare/b468x60.gif"></a><IMG border="0" width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=I7M/o2N60jU&bids=98726.10000010&type=4&subid=5">';
  hit[1] = 2; adv[1] = '<a href="http://click.linksynergy.com/fs-bin/click?id=I7M/o2N60jU&offerid=98726.10000054&type=4&subid=5"><IMG  width="468" height="60" alt="バナー " border="0" src="https://store.willcom-inc.com/share/ec/common/images/dynamic/linkshare/g_468_60.gif"></a><IMG border="0" width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=I7M/o2N60jU&bids=98726.10000054&type=4&subid=5">';
  hit[2] = 2; adv[2] = '<a href="http://click.linksynergy.com/fs-bin/click?id=I7M/o2N60jU&offerid=98726.10000057&type=4&subid=5"><IMG  width="468" height="60" alt="バナー " border="0" src="https://store.willcom-inc.com/share/ec/common/images/dynamic/linkshare/a_468_60.gif"></a><IMG border="0" width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=I7M/o2N60jU&bids=98726.10000057&type=4&subid=5">';
  hit[3] = 2; adv[3] = '<a href="http://click.linksynergy.com/fs-bin/click?id=I7M/o2N60jU&offerid=98726.10000065&type=4&subid=5"><IMG  width="468" height="60" alt="バナー " border="0" src="https://store.willcom-inc.com/share/ec/common/images/dynamic/linkshare/b_468_60.gif"></a><IMG border="0" width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=I7M/o2N60jU&bids=98726.10000065&type=4&subid=5">';
  hit[4] = 2; adv[4] = '<a href="http://click.linksynergy.com/fs-bin/click?id=I7M/o2N60jU&offerid=101893.10000153&type=4&subid=0"><IMG alt="【期間限定】おためしセット_468-60_1" border="0" src="http://www.oisix.com/tokubetsu/image/oi_051201_468_01.gif"></a><IMG border="0" width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=I7M/o2N60jU&bids=101893.10000153&type=4&subid=0">';
  hit[5] = 2; adv[5] = '<a href="http://click.linksynergy.com/fs-bin/click?id=I7M/o2N60jU&offerid=37172.10001034&type=4&subid=0"><IMG alt="ニッセン" border="0" src="http://www.nissen.co.jp/other_site/banner/2006midsum/sale_b.gif"></a><IMG border="0" width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=I7M/o2N60jU&bids=37172.10001034&type=4&subid=0">';
  hit[6] = 2; adv[6] = '<a href="http://px.a8.net/svt/ejp?a8mat=1I4OOR+8S5702+M7Q+5YRHD" target="_blank"><img border="0" width="468" height="60" alt="" src="http://www24.a8.net/svt/bgt?aid=090917883531&wid=001&eno=01&mid=s00000002879001002000&mc=1"></a><img border="0" width="1" height="1" src="http://www16.a8.net/0.gif?a8mat=1I4OOR+8S5702+M7Q+5YRHD" alt="">';
  hit[7] = 2; adv[7] = '<a href="http://click.linksynergy.com/fs-bin/click?id=uZAFzNuLE/c&offerid=98799.10000008&type=4&subid=0"><IMG alt="価格.com ブロードバンド" border="0" src="http://kakaku.com/ad/linkshare/bb_468_60.gif"></a><IMG border="0" width="1" height="1" src="http://ad.linksynergy.com/fs-bin/show?id=uZAFzNuLE/c&bids=98799.10000008&type=4&subid=0">';
  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);
}