function print_rndadv(pos)
{

  num = 6;

  ad = new Array();
  for(i = 0; i < num; i++) {
    ad[i] = new Array();
  }

  ad[0][0] = "sec2sc.gif";
  ad[0][1] = "sec2sc.gif";
  ad[0][2] = "人妻専用ライブチャット<br />セカンドハウス<br /><br />";
  ad[0][3] = "若妻から熟女まで全国の人妻がお相手。<br />そそられる魅惑のエロ妻と出会い放題！";
  ad[0][4] = "http://advcnt.nan.co.jp/r_out.cgi?2sc01";
  ad[0][5] = "3-1.jpg";
  ad[0][6] = "3-2.jpg";
  ad[0][7] = "3-3.jpg";
  ad[0][8] = "3-4.jpg";

  ad[1][0] = "dmmchat01.jpg";
  ad[1][1] = "dmmchat02.jpg";
  ad[1][2] = "ＤＭＭライブチャット<br />初回最大20分無料！<br />アダルト＆ノンアダルト";
  ad[1][3] = "アジア最大級のアダルトサイトＤＭＭで安心して遊べるライブチャット！";
  ad[1][4] = "http://advcnt.nan.co.jp/r_out.cgi?2sc07";
  ad[1][5] = "4-1.jpg";
  ad[1][6] = "4-2.jpg";
  ad[1][7] = "4-3.jpg";
  ad[1][8] = "4-4.jpg";

  ad[2][0] = "100_100pia.gif";
  ad[2][1] = "100_100pia.gif";
  ad[2][2] = "老舗の人妻専門<br />ライブチャットなら<br />チャットピア!!";
  ad[2][3] = "5000名以上の人妻が在籍！高画質なリアル映像でムフフ度120％!!もちろん覗きもOK!!!";
  ad[2][4] = "http://advcnt.nan.co.jp/r_out.cgi?2sc06";
  ad[2][5] = "5-1.jpg";
  ad[2][6] = "5-2.jpg";
  ad[2][7] = "5-3.jpg";
  ad[2][8] = "5-4.jpg";

  ad[3][0] = "sf100.gif";
  ad[3][1] = "sf100.gif";
  ad[3][2] = "エッチな出会い特集<br>女がエッチがしたいとき使う出会い系はココ！";
  ad[3][3] = "女性が選ぶアダルト出会い系サイトを選ばれたポイントと一緒にご紹介します。";
  ad[3][4] = "http://advcnt.nan.co.jp/r_out.cgi?cr02";
  ad[3][5] = "t01.gif";
  ad[3][6] = "t01.gif";
  ad[3][7] = "t01.gif";
  ad[3][8] = "t01.gif";

  ad[4][0] = "s-girl.gif";
  ad[4][1] = "s-girl.gif";
  ad[4][2] = "アダルトライブチャット<br />ジュエル";
  ad[4][3] = "今なら新規登録で3000円無料体験実施中！！";
  ad[4][4] = "http://advcnt.nan.co.jp/r_out.cgi?2sc03";
  ad[4][5] = "3-1.jpg";
  ad[4][6] = "3-2.jpg";
  ad[4][7] = "3-3.jpg";
  ad[4][8] = "3-4.jpg";

  ad[5][0] = "angellive_.gif";
  ad[5][1] = "angellive.gif";
  ad[5][2] = "老舗の<br>アダルトライブチャット<br>エンジェルライブ";
  ad[5][3] = "女の子の質と量は業界老舗のこのサイトならでは！アイドル並の美少女があなたに言われるままにあんなことやこんなことを・・・♪";
  ad[5][4] = "http://advcnt.nan.co.jp/r_out.cgi?2sc05";
  ad[5][5] = "1-1.jpg";
  ad[5][6] = "1-2.jpg";
  ad[5][7] = "1-3.jpg";
  ad[5][8] = "1-4.jpg";

  

  rnum = Math.floor(Math.random()*4) + 5;

  x = new Array();
  y = new Array();

  up_dummy_num = 0;
  ud_dummy_num = 0;


  if(pos == 1) {   // 上段

    for(k = 0; k < 3 - up_dummy_num; k++) {
      x.push(k);
    }

    for(l = 0; l < 3 - up_dummy_num; l++) {
      r = Math.floor(Math.random()*x.length);
      y.push(x[r]);
      x.splice(r,1);
    }

    // 通常広告
    for (i = 0; i < y.length; i++) {

      document.write("\n\n");
      document.write("<div class=k2scbg>\n");
      document.write("  <div class=k2sc00>\n");
      document.write("    <a href=" + ad[y[i]][4] + " target=_blank><img src=http://img01.nantv.com/rndchatadvimg/" + ad[y[i]][0] + " class=k2scimg01></a>\n");
      document.write("    <div class=k2sc01>\n");
      document.write("      <a href=" + ad[y[i]][4] + " target=_blank><img src=http://img01.nantv.com/rndchatadvimg/" + "gosite.png class=alphafilter></a>\n");
      document.write("    </div>\n  </div>\n");
      document.write("  <div class=k2sc02>\n");
      document.write("    <div class=k2sc03>\n");
      document.write("      <a href=" + ad[y[i]][4] + " target=_blank>" + ad[y[i]][2] + "</a>\n    </div>\n");
      document.write("    <div class=k2sc04>" + ad[y[i]][3] + "\n    </div>\n");
      document.write("    <div class=k2sc05>\n");
      document.write("      <a href=" + ad[y[i]][4] + " target=_brank><img src=http://img01.nantv.com/pickupsam/" + ad[y[i]][rnum] + " class=k2scimg02></a>\n");
      document.write("    </div>\n  </div>\n</div>\n");

    }

    // ダミー(広告募集中)
    for(i = up_dummy_num; i > 0; i--) {

      document.write("\n\n");
      document.write("<div class=k2scbg>\n");
      document.write("  <div class=k2sc00>\n");
      document.write("    <a href=http://www.nan.co.jp/koukoku/gentei.html target=_blank><img src=http://img01.nantv.com/rndchatadvimg/dummy.gif class=k2scimg01></a>\n");
      document.write("    <div class=k2sc01>\n");
      document.write("      <a href=http://www.nan.co.jp/koukoku/gentei.html target=_blank><img src=http://img01.nantv.com/rndchatadvimg/" + "gosite.png class=alphafilter></a>\n");
      document.write("    </div>\n  </div>\n");
      document.write("  <div class=k2sc02>\n");
      document.write("    <div class=k2sc03>\n");
      document.write("      <a href=http://www.nan.co.jp/koukoku/gentei.html target=_blank>広告募集中<br /><br /><br /></a>\n    </div>\n");
      document.write("    <div class=k2sc04>空きがございます。\n    </div>\n");
      document.write("    <div class=k2sc05>\n");
      document.write("      <a href=http://www.nan.co.jp/koukoku/gentei.html target=_brank><img src=http://img01.nantv.com/pickupsam/aki.jpg class=k2scimg02></a>\n");
      document.write("    </div>\n  </div>\n</div>\n");

    }


  } else {    // 下段

    for(k = 3; k < 6 - ud_dummy_num; k++) {
      x.push(k);
    }

    for(l = 3; l < 6 - ud_dummy_num; l++){
      r = Math.floor(Math.random()*x.length);
      y.push(x[r]);
      x.splice(r,1);
    }

    // 通常広告
    for (i = 0; i < y.length; i++) {

      document.write("\n\n");
      document.write("<div class=k2scbg>\n");
      document.write("  <div class=k2sc00>\n");
      document.write("    <a href=" + ad[y[i]][4] + " target=_blank><img src=http://img01.nantv.com/rndchatadvimg/" + ad[y[i]][0] + " class=k2scimg01></a>\n");
      document.write("    <div class=k2sc01>\n");
      document.write("      <a href=" + ad[y[i]][4] + " target=_blank><img src=http://img01.nantv.com/rndchatadvimg/" + "gosite.png class=alphafilter></a>\n");
      document.write("    </div>\n  </div>\n");
      document.write("  <div class=k2sc02>\n");
      document.write("    <div class=k2sc03>\n");
      document.write("      <a href=" + ad[y[i]][4] + " target=_blank>" + ad[y[i]][2] + "</a>\n    </div>\n");
      document.write("    <div class=k2sc04>" + ad[y[i]][3] + "\n    </div>\n");
      document.write("    <div class=k2sc05>\n");
      document.write("      <a href=" + ad[y[i]][4] + " target=_brank><img src=http://img01.nantv.com/pickupsam/" + ad[y[i]][rnum] + " class=k2scimg02></a>\n");
      document.write("    </div>\n  </div>\n</div>\n");

    }

    // ダミー(広告募集中)
    for(i = ud_dummy_num; i > 0; i--) {

      document.write("\n\n");
      document.write("<div class=k2scbg>\n");
      document.write("  <div class=k2sc00>\n");
      document.write("    <a href=http://www.nan.co.jp/koukoku/gentei.html target=_blank><img src=http://img01.nantv.com/rndchatadvimg/dummy.gif class=k2scimg01></a>\n");
      document.write("    <div class=k2sc01>\n");
      document.write("      <a href=http://www.nan.co.jp/koukoku/gentei.html target=_blank><img src=http://img01.nantv.com/rndchatadvimg/" + "gosite.png class=alphafilter></a>\n");
      document.write("    </div>\n  </div>\n");
      document.write("  <div class=k2sc02>\n");
      document.write("    <div class=k2sc03>\n");
      document.write("      <a href=http://www.nan.co.jp/koukoku/gentei.html target=_blank>広告募集中<br /><br /><br /></a>\n    </div>\n");
      document.write("    <div class=k2sc04>空きがございます。\n    </div>\n");
      document.write("    <div class=k2sc05>\n");
      document.write("      <a href=http://www.nan.co.jp/koukoku/gentei.html target=_brank><img src=http://img01.nantv.com/pickupsam/aki.jpg class=k2scimg02></a>\n");
      document.write("    </div>\n  </div>\n</div>\n");

    }

  }

}
