// JavaScript Document
// ランダム広告
function randomAdv(){
var hit = new Array();
var adv = new Array();
var nBox = new Array();
var i, j, m;

// hitには相対確率を入れる
// 完全にランダムにするなら全部"1"にする　dote46860white.gif
// advには、広告のタグを入れる。改行はしないようにする
// 広告を増やしたりする場合は、"[ ]"の数字が0から順になるようにする
  hit[0] = 1; adv[0] = '<img src="../upload/genre/1127424200853_1.jpg" style="width:90px; max-height:120px;" alt="白山まみ" />';
  
  hit[1] = 1; adv[1] = '<img src="../upload/item/item_314_1300244771731.jpg" style="width:90px; max-height:120px;" alt="白山まみ" />';/**/
  
  hit[2] = 1; adv[2] = '<img src="../upload/genre/3127374487161_1.jpg" style="width:90px; max-height:120px;" alt="くぅ" />';
  
  hit[3] = 1; adv[3] = '<img src="../upload/item/item_73_1283955141101.jpg" style="width:90px; max-height:120px;" alt="くぅ" />';
  
  hit[4] = 1; adv[4] = '<img src="../upload/genre/28127634930286_1.jpg" style="width:90px; max-height:120px;" alt="cocoro" />';
  
  hit[5] = 1; adv[5] = '<img src="../upload/item/item_58_1276362876391.jpg" style="width:90px; max-height:120px;" alt="cocoro" />';/**/
  
  hit[6] = 1; adv[6] = '<img src="../upload/genre/5127507916116_1.jpg" style="width:90px; max-height:120px;" alt="リサ" />';
  
  hit[7] = 1; adv[7] = '<img src="../upload/item/item_54_127591119931.jpg" style="width:90px; max-height:120px;" alt="リサ" />';
  
  hit[8] = 1; adv[8] = '<img src="../upload/genre/9127425555452_1.jpg" style="width:90px; max-height:120px;" alt="ひかる" />';

  hit[9] = 1; adv[9] = '<img src="../upload/item/item_194_1293704752281.jpg" style="width:90px; max-height:120px;" alt="ひかる" />';
  
  hit[10] = 1; adv[10] = '<img src="../upload/genre/61131790443728_1.jpg" style="width:90px; max-height:120px;" alt="あゆみ" />';/*最新おまけ*/

  hit[11] = 1; adv[11] = '<img src="../upload/genre/109131461755390_1.jpg" style="width:90px; max-height:120px;" alt="かのん" />';

  hit[12] = 1; adv[12] = '<img src="../upload/item/item_445_1314618472501.jpg" style="width:90px; max-height:120px;" alt="かのん" />';/**/
  
  hit[13] = 1; adv[13] = '<img src="../upload/genre/88130328728298_1.jpg" style="width:90px; max-height:120px;" alt="雛" />';
  
  hit[14] = 1; adv[14] = '<img src="../upload/item/item_384_1305280967571.jpg" style="width:90px; max-height:120px;" alt="雛" />';/**/
  
  hit[15] = 1; adv[15] = '<img src="../upload/genre/123132416471996_1.jpg" style="width:90px; max-height:120px;" alt="さぁ～にゃん" />';
  
  hit[16] = 1; adv[16] = '<img src="../upload/item/item_531_1324167771492.jpg" style="width:90px; max-height:120px;" alt="さぁ～にゃん" />';/**/

  hit[17] = 1; adv[17] = '<img src="../upload/genre/35128719803020_1.jpg" style="width:90px; max-height:120px;" alt="うさびっち" />';

  hit[18] = 1; adv[18] = '<img src="../upload/item/item_90_1287201444931.jpg" style="width:90px; max-height:120px;" alt="うさびっち" />';/**/

  hit[19] = 1; adv[19] = '<img src="../upload/genre/41128919216693_1.jpg" style="width:90px; max-height:120px;" alt="ナナミ" />';

  hit[20] = 1; adv[20] = '<img src="../upload/item/item_196_1294062389871.jpg" style="width:90px; max-height:120px;" alt="ナナミ" />';/**/

  hit[21] = 1; adv[21] = '<img src="../upload/genre/130132767599137_1.jpg" style="width:90px; max-height:120px;" alt="あぃな" />';

  hit[22] = 1; adv[22] = '<img src="../upload/item/item_594_1327675201851.jpg" style="width:90px; max-height:120px;" alt="あぃな" />';/**/

  hit[23] = 1; adv[23] = '<img src="../upload/genre/11213217998596_1.jpg" style="width:90px; max-height:120px;" alt="みぃ＾ω＾ﾁｬﾝ" />';

  hit[24] = 1; adv[24] = '<img src="../upload/genre/112_20111120_1321798784_1.jpg" style="width:90px; max-height:120px;" alt="みぃ＾ω＾ﾁｬﾝ" />';/**/

  hit[25] = 1; adv[25] = '<img src="../upload/genre/117131937773791_1.jpg" style="width:90px; max-height:120px;" alt="saeko" />';

  hit[26] = 1; adv[26] = '<img src="../upload/item/item_492_1319380391691.jpg" style="width:90px; max-height:120px;" alt="saeko" />';/**/

  hit[27] = 1; adv[27] = '<img src="../upload/genre/90130488601516_1.jpg" style="width:90px; max-height:120px;" alt="ともこ" />';

  hit[28] = 1; adv[28] = '<img src="../upload/item/item_381_1304888059871.jpg" style="width:90px; max-height:120px;" alt="ともこ" />';/*90*/

  hit[29] = 1; adv[29] = '<img src="../upload/genre/11413181515472_1.jpg" style="width:90px; max-height:120px;" alt="りか" />';

  hit[30] = 1; adv[30] = '<img src="../upload/item/item_478_1318403978222.jpg" style="width:90px; max-height:120px;" alt="りか" />';/**/

  hit[31] = 1; adv[31] = '<img src="../upload/genre/61131297452072_1.jpg" style="width:90px; max-height:120px;" alt="あゆみ" />';

  hit[32] = 1; adv[32] = '<img src="../upload/item/item_172_1291993157821.jpg" style="width:90px; max-height:120px;" alt="あゆみ" />';/**/

  hit[33] = 1; adv[33] = '<img src="../upload/genre/118132081339048_1.jpg" style="width:90px; max-height:120px;" alt="あ～にゃん" />';

  hit[34] = 1; adv[34] = '<img src="../upload/item/item_506_1320815482161.jpg" style="width:90px; max-height:120px;" alt="あ～にゃん" />';/**/

  hit[35] = 1; adv[35] = '<img src="../upload/genre/70129252238374_1.jpg" style="width:90px; max-height:120px;" alt="KANAE" />';

  hit[36] = 1; adv[36] = '<img src="../upload/item/item_198_1294065866401.jpg" style="width:90px; max-height:120px;" alt="KANAE" />';/**/

  hit[37] = 1; adv[37] = '<img src="../upload/genre/71129293666391_1.jpg" style="width:90px; max-height:120px;" alt="そら" />';

  hit[38] = 1; adv[38] = '<img src="../upload/item/item_191_1293428272871.jpg" style="width:90px; max-height:120px;" alt="そら" />';/**/

  hit[39] = 1; adv[39] = '<img src="../upload/genre/76130280101099_1.jpg" style="width:90px; max-height:120px;" alt="つん" />';

  hit[40] = 1; adv[40] = '<img src="../upload/item/item_179_1293037653621.jpg" style="width:90px; max-height:120px;" alt="つん" />';/**/

  hit[41] = 1; adv[41] = '<img src="../upload/genre/82129811803275_1.jpg" style="width:90px; max-height:120px;" alt="☆むあ☆" />';

  hit[42] = 1; adv[42] = '<img src="../upload/item/item_246_1298116599651.jpg" style="width:90px; max-height:120px;" alt="☆むあ☆" />';/**/

  hit[43] = 1; adv[43] = '<img src="../upload/genre/91130476314395_1.jpg" style="width:90px; max-height:120px;" alt="さゆか" />';

  hit[44] = 1; adv[44] = '<img src="../upload/item/item_382_1304905715694.jpg" style="width:90px; max-height:120px;" alt="さゆか" />';/**/

  hit[45] = 1; adv[45] = '<img src="../upload/genre/124132296030492_1.gif" style="width:90px; max-height:120px;" alt="Chocola★" />';

  hit[46] = 1; adv[46] = '<img src="../upload/item/item_520_1322952531202.jpg" style="width:90px; max-height:120px;" alt="Chocola★" />';/**/
  
  hit[47] = 1; adv[47] = '<img src="../upload/genre/129132486352322_1.jpg" style="width:90px; max-height:120px;" alt="しぃ" />';

  hit[48] = 1; adv[48] = '<img src="../upload/item/item_561_1324881973721.jpg" style="width:90px; max-height:120px;" alt="しぃ" />';/**/
  
  hit[49] = 1; adv[49] = '<img src="../upload/item/item_439_131303921224.jpg" style="width:90px; max-height:120px;" alt="れんか" />';/**/

//  hit[50] = 0; adv[50] = '<img src="../upload/item/●●" style="width:90px; max-height:120px;" alt="●●" />';/**/
  



m = 0;
for( i = 0; i < hit.length; i++ ){
m += hit[i];
nBox[i] = -1;
}

j = 0;
nBox[j] = randomNum( hit, m, nBox );
document.getElementById("pix1").innerHTML = adv[ nBox[j++] ];

nBox[j] = randomNum( hit, m, nBox );
document.getElementById("pix2").innerHTML = adv[ nBox[j++] ];

nBox[j] = randomNum( hit, m, nBox );
document.getElementById("pix3").innerHTML = adv[ nBox[j++] ];

nBox[j] = randomNum( hit, m, nBox );
document.getElementById("pix4").innerHTML = adv[ nBox[j++] ];

nBox[j] = randomNum( hit, m, nBox );
document.getElementById("pix5").innerHTML = adv[ nBox[j++] ];

nBox[j] = randomNum( hit, m, nBox );
document.getElementById("pix6").innerHTML = adv[ nBox[j++] ];

}

function randomNum( hit, m, nBox ){
var flag, x, y, n, i, j, num;

do{
flag = false;
x = 0; y = 0;
n = Math.floor( Math.random() * m ) + 1;

for( i = 0; i < hit.length; i++ ){
x = y;
y += hit[i];
if( x < n && n <= y ){
num = i; break;
}
}

for( j = 0; j < nBox.length; j++){
if( nBox[j] == num ){
flag = true; break;
}
}

}while( flag );

return num;
}

//window.onload
//@cc_on
window./*@if(@_jscript_version<=5.8)
attachEvent('on'+ @else @*/ addEventListener(/*@end @*/
'load', randomAdv, false );
