////////////////////////////////////////////////////////////////////////////////

// Copyright (C) Yorutomo-Net(http://www.yorutomo.net/)

// 本ソフトウェアに関する全ての権利は「よるともネット」が所有していますので

// 無断使用・複製を禁止します。

// このシステムをご利用したい場合はwebmaster@yorutomo.netまでご連絡下さい。

////////////////////////////////////////////////////////////////////////////////

//基本デレクトリ

var FoundDir = "images/prpr/";



tDIR 	= new Array();

IDX 	= 0;

tDIR[0] = FoundDir + "clubH/01/";

tDIR[1] = FoundDir + "umedahimitsu/01/";

tDIR[2] = FoundDir + "tsumaten/01/";

tDIR[3] = FoundDir + "bunny_d_c/01/";

tDIR[4] = FoundDir + "loveoku/01/";

tDIR[5] = FoundDir + "sakuran/01/";

tDIR[6] = FoundDir + "mukitamago/01/";

tDIR[7] = FoundDir + "o-ikeokujyu/01/";

tDIR[8] = FoundDir + "hitodumasyoukaijyo/01/";

tDIR[9] = FoundDir + "piass/01/";

tDIR[10] = FoundDir + "chinden/01/";

tDIR[11] = FoundDir + "yanneko/01/";

tDIR[12] = FoundDir + "gekiyasu/01/";

tDIR[13] = FoundDir + "anshop/01/";

tDIR[14] = FoundDir + "shinosakahimitsu/01/";

tDIR[15] = FoundDir + "tanimachihimitsu/01/";

tDIR[16] = FoundDir + "tsumamigui/01/";



tBNR 	= new Array();

tBNR[0] = FoundDir + "clubH/ss.gif";

tBNR[1] = FoundDir + "umedahimitsu/ss.gif";

tBNR[2] = FoundDir + "tsumaten/ss.gif";

tBNR[3] = FoundDir + "bunny_d_c/ss.gif";

tBNR[4] = FoundDir + "loveoku/ss.gif";

tBNR[5] = FoundDir + "sakuran/ss.gif";

tBNR[6] = FoundDir + "mukitamago/ss.gif";

tBNR[7] = FoundDir + "o-ikeokujyu/ss.gif";

tBNR[8] = FoundDir + "hitodumasyoukaijyo/ss.gif";

tBNR[9] = FoundDir + "piass/ss.gif";

tBNR[10] = FoundDir + "chinden/ss.gif";

tBNR[11] = FoundDir + "yanneko/ss.gif";

tBNR[12] = FoundDir + "gekiyasu/ss.gif";

tBNR[13] = FoundDir + "anshop/ss.gif";

tBNR[14] = FoundDir + "shinosakahimitsu/ss.gif";

tBNR[15] = FoundDir + "tanimachihimitsu/ss.gif";

tBNR[16] = FoundDir + "tsumamigui/ss.gif";



tLNK 	= new Array();

tLNK[0] ="/jump/kanban/jump.php?http://www.clubh-group.com/";

tLNK[1] ="/jump/kanban/jump.php?http://www.umedahimitu.net/";

tLNK[2] ="/jump/kanban/jump.php?http://www.osaka-0930.com/nishinaka/";

tLNK[3] ="/jump/kanban/jump.php?http://www.bunny-deri.com/";

tLNK[4] ="/jump/kanban/jump.php?http://www.love-oku.jp/";

tLNK[5] ="/jump/kanban/jump.php?http://www.sakulan.jp/";

tLNK[6] ="/jump/kanban/jump.php?http://www.mukitamago.jp/";

tLNK[7] ="/jump/kanban/jump.php?http://ikenai.jp";

tLNK[8] ="/jump/kanban/jump.php?http://www.hitoduma-syokaijo.com/";

tLNK[9] ="/jump/kanban/jump.php?http://www.piass.net/sm/";

tLNK[10] ="/jump/kanban/jump.php?http://www.chinden.net/";

tLNK[11] ="/jump/kanban/jump.php?http://www.yanneko.net/";

tLNK[12] ="/jump/kanban/jump.php?http://geki-yasu-group.com/";

tLNK[13] ="/jump/kanban/jump.php?http://www.an13.net/";

tLNK[14] ="/jump/kanban/jump.php?http://www.himitu.net";

tLNK[15] ="/jump/kanban/jump.php?http://www.himitu.org/main/";

tLNK[16] ="/jump/kanban/jump.php?http://www.tsumamigui.tv/";



tRM = new Array();



var gNumBnr  = 17; /* バナー件数を設定 */

var gTimerID;

var gState		= true;

var gTimeInit = 100000;

var gTimeAll	= 20000;	 /* 一枚張表示時間 */

var gTimeAL2	= 15000;	 /* 通常バナー表示時間 */

var gTimeOne	= 50;

var gTimeRtn	= 30;

var gNumDir 	= 0;

var gNumOne 	= 0;

var gNumRtn 	= 0;

var gNumRan 	= 0;

var gMaxBnr		= 17;





function Loading(theEvent){

//乱数セット

	toSet = 0;

	do{

		for (i=0;i<gNumBnr+1;i++){

			swSet = 0;

			toRandom = Math.floor(Math.random()*(gNumBnr));

			for (j=0;j<gNumBnr+1;j++){

				if (tRM[j] == toRandom){

					swSet = 1;

					break;

				}

			}

			if (swSet == 0){

				tRM[toSet] = toRandom;

				toSet++;

			}

		}

	}while(toSet < gNumBnr)



	if (gNumBnr < gMaxBnr){

		for (j=gNumBnr;j<gMaxBnr;j++){

			tRM[j] = j;

		}

	}



 document.b01.src = tBNR[tRM[0]];

 document.b02.src = tBNR[tRM[1]];

 document.b03.src = tBNR[tRM[2]];

 document.b04.src = tBNR[tRM[3]];

 document.b05.src = tBNR[tRM[4]];

 document.b06.src = tBNR[tRM[5]];

 document.b07.src = tBNR[tRM[6]];

 document.b08.src = tBNR[tRM[7]];

 document.b09.src = tBNR[tRM[8]];

 document.b10.src = tBNR[tRM[9]];

 document.b11.src = tBNR[tRM[10]];

 document.b12.src = tBNR[tRM[11]];

 document.b13.src = tBNR[tRM[12]];

 document.b14.src = tBNR[tRM[13]];

 document.b15.src = tBNR[tRM[14]];

 document.b16.src = tBNR[tRM[15]];

 document.b17.src = tBNR[tRM[16]];

 document.links[0].href  = tLNK[tRM[0]];

 document.links[1].href  = tLNK[tRM[1]];

 document.links[2].href  = tLNK[tRM[2]];

 document.links[3].href  = tLNK[tRM[3]];

 document.links[4].href  = tLNK[tRM[4]];

 document.links[5].href  = tLNK[tRM[5]];

 document.links[6].href  = tLNK[tRM[6]];

 document.links[7].href  = tLNK[tRM[7]];

 document.links[8].href  = tLNK[tRM[8]];

 document.links[9].href  = tLNK[tRM[9]];

 document.links[10].href = tLNK[tRM[10]];

 document.links[11].href = tLNK[tRM[11]];

 document.links[12].href = tLNK[tRM[12]];

 document.links[13].href = tLNK[tRM[13]];

 document.links[14].href = tLNK[tRM[14]];

 document.links[15].href = tLNK[tRM[15]];

 document.links[16].href = tLNK[tRM[16]];



 for (i=0;i<16;i++){

	 if ( document.links[i].href == "s_regist/regst.html"){

			 document.links[i].target = "stage";

	 }

	 else if ( document.links[i].href == "shop/o-koala/"){

			 document.links[i].target = "stage";

	 }

	 else{

		 document.links[i].target = "_blank";

	 }

 }



 gTimerID = setTimeout("BnrSetting()",gTimeInit);

}





function BnrSetting(){

 clearTimeout(gTimerID);

 if (gState == true){

	 gTimerID = setTimeout("OneSheet()",gTimeOne);

	 if (gNumDir == gNumBnr){

		 gNumDir = 0;

	 }

	 gState = false;

 }

 else{

	 gTimerID = setTimeout("BnrReturn()",gTimeRtn);

	 gState = true;

 }

}



function OneSheet(){

//乱数セット

 if ((gNumDir == 0) && (gNumOne == 0)){

	 toSet = 0;

	 tRAND = new Array();



	 do{

		for (i=0;i<gNumBnr+1;i++){

		 randomset();

		}

	 }while(toSet < gNumBnr)

 }



 gNumOne++;

 idx = tRAND[gNumDir]

 clearTimeout(gTimerID);



 if(gNumOne==1) {document.b01.src = tDIR[idx]+"01.gif";}

 if(gNumOne==2) {document.b02.src = tDIR[idx]+"02.gif";}

 if(gNumOne==3) {document.b03.src = tDIR[idx]+"03.gif";}

 if(gNumOne==4) {document.b04.src = tDIR[idx]+"04.gif";}

 if(gNumOne==5) {document.b05.src = tDIR[idx]+"05.gif";}

 if(gNumOne==6) {document.b06.src = tDIR[idx]+"06.gif";}

 if(gNumOne==7) {document.b07.src = tDIR[idx]+"07.gif";}

 if(gNumOne==8) {document.b08.src = tDIR[idx]+"08.gif";}

 if(gNumOne==9) {document.b09.src = tDIR[idx]+"09.gif";}

 if(gNumOne==10){document.b10.src = tDIR[idx]+"10.gif";}

 if(gNumOne==11){document.b11.src = tDIR[idx]+"11.gif";}

 if(gNumOne==12){document.b12.src = tDIR[idx]+"12.gif";}

 if(gNumOne==13){document.b13.src = tDIR[idx]+"13.gif";}

 if(gNumOne==14){document.b14.src = tDIR[idx]+"14.gif";}

 if(gNumOne==15){document.b15.src = tDIR[idx]+"15.gif";}

 if(gNumOne==16){document.b16.src = tDIR[idx]+"16.gif";}

 if(gNumOne==17){document.b17.src = tDIR[idx]+"17.gif";}



 for (i=0;i<17;i++){

	if ( document.links[i].href == "shop/o-koala/"){

			 document.links[i].target = "stage";

	 }

		else{

		 document.links[i].target = "_blank";

		}

 }



 document.links[gNumOne-1].href = tLNK[idx];



 if(gNumOne==17){

//*** 複数バナー対応 2003.05.31 ADD -------------------*

	 PluralitySetting();

//-----------------------------------------------------*



/*** 6/6 ADD よるともインフォメーション ***************/

	gNumOne	= 0;

	gNumDir++;

	if (gNumDir == gNumBnr){

	 gTimerID = setTimeout("Infomation()",gTimeAL2);

	}

	else{

	 gTimerID = setTimeout("BnrSetting()",gTimeAll);

	}



/*** 6/6 *****

	 gNumOne	= 0;

	 gNumDir++;

	 gTimerID = setTimeout("BnrSetting()",gTimeAll);

**************/

 }

 else{

	 gTimerID = setTimeout("OneSheet()",gTimeOne);

 }



}



//////////////////////////////////////

function randomset(){

 swSet = 0;

 toRandom = Math.floor(Math.random()*(gNumBnr));

 for (j=0;j<gNumBnr+1;j++){

	if (tRAND[j] == toRandom){

		swSet = 1;

		break;

	}

 }

 if (swSet == 0){

	 tRAND[toSet] = toRandom;

	 toSet++;

 }

}

//////////////////////////////////////

//////////////////////////////////////

function BnrReturn(){

 clearTimeout(gTimerID);

 gNumRtn++;

 switch (gNumRtn){

 case 1:

		document.b01.src = tBNR[tRM[0]];

		document.b17.src = tBNR[tRM[16]];

		break;

 case 2:

		document.b02.src = tBNR[tRM[1]];

		document.b16.src = tBNR[tRM[15]];

		break;

 case 3:

		document.b03.src = tBNR[tRM[2]];

		document.b15.src = tBNR[tRM[14]];

		break;

 case 4:

		document.b04.src = tBNR[tRM[3]];

		document.b14.src = tBNR[tRM[13]];

		break;

 case 5:

		document.b05.src = tBNR[tRM[4]];

		document.b13.src = tBNR[tRM[12]];

		break;

 case 6:

		document.b06.src = tBNR[tRM[5]];

		document.b12.src = tBNR[tRM[11]];

		break;

 case 7:

		document.b07.src = tBNR[tRM[6]];

		document.b11.src = tBNR[tRM[10]];

		break;

 case 8:

		document.b08.src = tBNR[tRM[7]];

		document.b10.src = tBNR[tRM[9]];

		break;

 case 9:

		document.b09.src = tBNR[tRM[8]];

		document.b09.src = tBNR[tRM[8]];

		break;

 case 10:

		document.b08.src = tBNR[tRM[7]];

		break;

 }



 if (gNumRtn == 10){

	 for (i=0;i<17;i++){

		if ( document.links[i].href == "s_regist/regst.html"){

			 document.links[i].target = "stage";

		}

//		else if ( document.links[i].href == "shop/mascotgirl/"){

//			 document.links[i].target = "stage";

//		}

		else{

		 document.links[i].target = "_blank";

		}

	 }

	 document.links[gNumRtn-1].href = tLNK[tRM[gNumRtn-1]];

	 gNumRtn	= 0;

	 gTimerID = setTimeout("BnrSetting()",gTimeAL2);

 }

 else{

	 document.links[gNumRtn-1].href  = tLNK[tRM[gNumRtn-1]];

	 document.links[17-gNumRtn].href = tLNK[tRM[17-gNumRtn]];

	 gTimerID = setTimeout("BnrReturn()",gTimeRtn);

 }

}

//////////////////////////////////////

//////////////////////////////////////

function listing(No){

 BnNumber = tRM[No];

 if (tDIR[BnNumber] == ""){

		return;

 }

 else{

	document.b01.src = tDIR[BnNumber]+"01.gif";

	document.b02.src = tDIR[BnNumber]+"02.gif";

	document.b03.src = tDIR[BnNumber]+"03.gif";

	document.b04.src = tDIR[BnNumber]+"04.gif";

	document.b05.src = tDIR[BnNumber]+"05.gif";

	document.b06.src = tDIR[BnNumber]+"06.gif";

	document.b07.src = tDIR[BnNumber]+"07.gif";

	document.b08.src = tDIR[BnNumber]+"08.gif";

	document.b09.src = tDIR[BnNumber]+"09.gif";

	document.b10.src = tDIR[BnNumber]+"10.gif";

	document.b11.src = tDIR[BnNumber]+"11.gif";

	document.b12.src = tDIR[BnNumber]+"12.gif";

	document.b13.src = tDIR[BnNumber]+"13.gif";

	document.b14.src = tDIR[BnNumber]+"14.gif";

	document.b15.src = tDIR[BnNumber]+"15.gif";

	document.b16.src = tDIR[BnNumber]+"16.gif";

	document.b17.src = tDIR[BnNumber]+"17.gif";

 }



 clearTimeout(gTimerID);

 gTimerID = setTimeout("BnrReturn()",8000);

}

/*****************************************/

/***** 複数バナー対応 2003.05.31 ADD *****/

/*****************************************/

function PluralitySetting(){

 for (i=0;i<15;i++){

// ホテルバカ一代 2種類

	 if(tDIR[i] == "images/prpr/o-baka1/001/"){

		 tDIR[i] = "images/prpr/o-baka1/002/";

	 }

	 else if(tDIR[i] == "images/prpr/o-baka1/002/"){

		 tDIR[i] = "images/prpr/o-baka1/001/";

	 }

// SPARK 2種類

	 if(tDIR[i] == "images/prpr/spark/001/"){

		 tDIR[i] = "images/prpr/spark/002/";

	 }

	 else if(tDIR[i] == "images/prpr/spark/002/"){

		 tDIR[i] = "images/prpr/spark/001/";

	 }

// パイの実 2種類

	 if(tDIR[i] == "images/prpr/painomi/001/"){

		 tDIR[i] = "images/prpr/painomi/002/";

	 }

	 else if(tDIR[i] == "images/prpr/painomi/002/"){

		 tDIR[i] = "images/prpr/painomi/001/";

	 }

// クレイジーダック 2種類

	 if(tDIR[i] == "images/prpr/crazy/001/"){

		 tDIR[i] = "images/prpr/crazy/002/";

	 }

	 else if(tDIR[i] == "images/prpr/crazy/002/"){

		 tDIR[i] = "images/prpr/crazy/001/";

	 }

// 新大阪秘密倶楽部 2種類

	 if(tDIR[i] == "images/prpr/himitu_s/001/"){

		 tDIR[i] = "images/prpr/himitu_s/002/";

	 }

	 else if(tDIR[i] == "images/prpr/himitu_s/002/"){

		 tDIR[i] = "images/prpr/himitu_s/001/";

	 }

// 谷町秘密倶楽部 2種類

	 if(tDIR[i] == "images/prpr/himitu_t/001/"){

		 tDIR[i] = "images/prpr/himitu_t/002/";

	 }

	 else if(tDIR[i] == "images/prpr/himitu_t/002/"){

		 tDIR[i] = "images/prpr/himitu_t/001/";

	 }

// ギャルズネットワーク 2種類

	 if(tDIR[i] == "images/prpr/galsnetwork/001/"){

		 tDIR[i] = "images/prpr/galsnetwork/002/";

	 }

	 else if(tDIR[i] == "images/prpr/galsnetwork/002/"){

		 tDIR[i] = "images/prpr/galsnetwork/001/";

	 }

// ペロリン娘 2種類

	 if(tDIR[i] == "images/prpr/perorinco/001/"){

		 tDIR[i] = "images/prpr/perorinco/002/";

	 }

	 else if(tDIR[i] == "images/prpr/perorinco/002/"){

		 tDIR[i] = "images/prpr/perorinco/001/";

	 }

// 難波秘密倶楽部 2種類

	 if(tDIR[i] == "images/prpr/o-nanbahimitu/001/"){

		 tDIR[i] = "images/prpr/o-nanbahimitu/002/";

	 }

	 else if(tDIR[i] == "images/prpr/o-nanbahimitu/002/"){

		 tDIR[i] = "images/prpr/o-nanbahimitu/001/";

	 }

 }

}

/////////////////////////////////////////////

// よるともインフォメーションバナー表示

/////////////////////////////////////////////

function Infomation(){

 gNumOne++;

 clearTimeout(gTimerID);



 if(gNumOne==1) {document.b01.src = FoundDir + "info/01.gif";}

 if(gNumOne==2) {document.b02.src = FoundDir + "info/02.gif";}

 if(gNumOne==3) {document.b03.src = FoundDir + "info/03.gif";}

 if(gNumOne==4) {document.b04.src = FoundDir + "info/04.gif";}

 if(gNumOne==5) {document.b05.src = FoundDir + "info/05.gif";}

 if(gNumOne==6) {document.b06.src = FoundDir + "info/06.gif";}

 if(gNumOne==7) {document.b07.src = FoundDir + "info/07.gif";}

 if(gNumOne==8) {document.b08.src = FoundDir + "info/08.gif";}

 if(gNumOne==9) {document.b09.src = FoundDir + "info/09.gif";}

 if(gNumOne==10){document.b10.src = FoundDir + "info/10.gif";}

 if(gNumOne==11){document.b11.src = FoundDir + "info/11.gif";}

 if(gNumOne==12){document.b12.src = FoundDir + "info/12.gif";}

 if(gNumOne==13){document.b13.src = FoundDir + "info/13.gif";}

 if(gNumOne==14){document.b14.src = FoundDir + "info/14.gif";}

 if(gNumOne==15){document.b15.src = FoundDir + "info/15.gif";}

 if(gNumOne==16){document.b16.src = FoundDir + "info/16.gif";}

 if(gNumOne==17){document.b17.src = FoundDir + "info/17.gif";}

 



 for (i=0;i<17;i++){

	 document.links[i].target = "_self";

 }

 document.links[gNumOne-1].href = "#";



 if(gNumOne==17){

	 gNumOne	= 0;

	 gTimerID = setTimeout("BnrSetting()",gTimeAL2);

 }

 else{

	 gTimerID = setTimeout("Infomation()",gTimeOne);

 }

}


