// ランダム広告
function randomAdv() {
  m = 0, x = 0, y = 0;
  ad  = new Array();
  adv = new Array();
  hit = new Array();

  // hitには相対確率を入れる
  // 完全にランダムにするなら全部"1"にする
  // advには、広告のタグを入れる。改行はしないようにする
  // 広告を増やしたりする場合は、"[ ]"の数字が0から順になるようにする
  hit[0] = 1; adv[0] = '<iframe src="http://flash.affiliate.dtiserv.com/carib/01/index01.html?affid=109262" width=320 height=260 frameborder="no" scrolling="no"></iframe>';
  hit[1] = 1; adv[1] = '<iframe src="http://flash.affiliate.dtiserv.com/10musu/01/index01.html?affid=109262" width=320 height=260 frameborder="no" scrolling="no"></iframe>';
  hit[2] = 1; adv[2] = '<iframe src="http://flash.affiliate.dtiserv.com/1pondo/01/index01.html?affid=109262" width=320 height=260 frameborder="no" scrolling="no"></iframe>';
  hit[3] = 1; adv[3] = '<iframe src="http://flash02.affiliate.dtiserv.com/h0930/01/index01.html?affid=109262" width=320 height=260 frameborder="no" scrolling="no"></iframe>';
  hit[4] = 1; adv[4] = '<iframe src="http://flash.affiliate.dtiserv.com/paco/01/index01.html?affid=109262" width=320 height=260 frameborder="no" scrolling="no"></iframe>';
  hit[5] = 1; adv[5] = '<iframe src="http://flash02.affiliate.dtiserv.com/mesubuta/01/index01.html?affid=109262" width=320 height=260 frameborder="no" scrolling="no"></iframe>';
  hit[6] = 1; adv[6] = '<iframe src="http://flash02.affiliate.dtiserv.com/h4610/01/index01.html?affid=109262" width=320 height=260 frameborder="no" scrolling="no"></iframe>';
  hit[7] = 1; adv[7] = '<iframe src="http://flash02.affiliate.dtiserv.com/c0930/01/index01.html?affid=109262" width=320 height=260 frameborder="no" scrolling="no"></iframe>';

  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);
}