// 芸能ブログ ランダム広告
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] = '<div align="center"><a href="http://www.yoyuu.com/t1/t/and-pola-whi.html" target="_blank"><img border="0" width="120" height="120" alt="ポーラ　ホワイティシモ" src="http://www21.a8.net/svt/bgt?aid=101206702985&amp;wid=019&amp;eno=01&amp;mid=s00000010774002014000&amp;mc=1" /><br /><span style="font-size: 100%;color: #990000;font-weight:bold; background-color: #FFFF99;">発売３ヶ月で４５万本突破<br />ポーラの美白化粧品！</span></a></div>';//POLA美白化粧品
  hit[1] = 1; adv[1] = '<div align="center"><a href="http://www.yoyuu.com/t1/t/and-suumo.html" target="_blank"><img src="http://www.wj-pro.com/img/suumo120120.gif" width="120" height="120" alt="SUUMO スーモ" border="0" /></a></div>';//スーモ
  hit[2] = 1; adv[2] = '<div align="center"><a href="http://www.yoyuu.com/t1/t/and-missparis-diet.html" target="_blank"><img src="http://www.accesstrade.net/at/r.html?rk=01003oa6002flc" alt="ミスパリ　ダイエットセンター" border="0" /></a></div>';//ミスパリエステ
  hit[3] = 1; adv[3] = '<div align="center"><a href="http://www.yoyuu.com/t1/t/and-ellesene-skini.html" target="_blank"><img src="http://www.accesstrade.net/at/r.html?rk=01006ut6002flc" alt="" border="0" /></a></div>';//エルセーヌ
  hit[4] = 1; adv[4] = '<div align="center"><a href="http://www.yoyuu.com/t1/t/and-bglen-camp.html" target="_blank"><img src="http://www.accesstrade.net/at/r.html?rk=010071ta002flc" alt="" border="0" /></a></div>';//ビーグレンキャンペーン

  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);
}
