//################################################################################################//
//     インフォメーション関数郡                                                                   //
//                                                                                                //
//################################################################################################//

//************************************************************************************************//
//     01 - ツアーデータロード関数郡                                                              //
//                                                                                                //
//************************************************************************************************//
function info_load()
{
	t_count = 0;
	i_count = 0;

	info = "<FONT class=nomal><BR></FONT><HR style='border-top-width : 1px;border-top-style : solid;border-top-color : black;height : 0px;'>";

	for(ssc = 0 ; ssc < S_CODE.length ; ssc++)
	{
		info = information((S_CODE[ssc]) , info);

		_nowloading(ssc , S_CODE.length - 1);
	}

	_show_date();
}

//************************************************************************************************//
//     02 - 各ツアーインフォメーション                                                            //
//                                                                                                //
//     :code ツアーナンバー                                                                       //
//     :info インフォメーション用の文字列を格納する変数                                           //
//************************************************************************************************//
function information(code , info)
{
	i_error = _ini(code);

	x = 0;
	count  = 0;
	code_a = 0;
	code_b = 0;


	if(i_error != 999)
	{
		do
		{
			if(xdays[x] == 0) x++;
			if(xdays[x] == null) break;

			count = Math.ceil((xdays[x].getTime() - now.getTime()) / (24*60*60*1000));

			// まだ締切日で無いもの
			if(count >= 0)
			{
				// 満席or中止の場合
				if(people[x] == 9 || people[x] == 8)
				{
					x++;
				}
				else
				{
					break;
				}
			}
			else
			{
				x++;
			}
		}while(xdays[x + 1] != null)

		// コード作成
		code_a = code_make(code,number);

		// インフォメーションフィールドに描画する文字郡
		if(xdays[x + 1] != null && count >= 0)
		{
			//info += "<FONT class=nomal><B><A href=" + address + " target=_blank>" + code_a + "</A>　＜" + schedule +"＞";
			//info +="<BR><IMG src=img/tree1.gif width=14 height=14 border=0 align=top>" + title + "";

			info += "<FONT class=nomal><B><A href=" + address + " target=_blank>" + code_a + "</A>　＜" + schedule +"＞<BR><IMG src=img/tree1.gif width=14 height=14 border=0 align=top>" + title;

			// 日付作成(function.js)
			month_day_add(add_date , months , days);

			if(code != "09007")
			{
				info +="<BR><IMG src=img/tree1.gif width=14 height=14 border=0 align=top>旅行期日：" + add_date[x] + "<BR><IMG src=img/tree1.gif width=14 height=14 border=0 align=top>";
			}
			else
			{
				if(S_DATA[x].slice(3,4) == "○")
				{
					info +="<BR><IMG src=img/tree1.gif width=14 height=14 border=0 align=top>旅行期日：" + add_date[x] + "　vs" + S_DATA[x].slice(0,2) + " デーゲーム<BR><IMG src=img/tree1.gif width=14 height=14 border=0 align=top>";
				}
				else
				{
					info +="<BR><IMG src=img/tree1.gif width=14 height=14 border=0 align=top>旅行期日：" + add_date[x] + "　vs" + S_DATA[x].slice(0,2) + " ナイター<BR><IMG src=img/tree1.gif width=14 height=14 border=0 align=top>";
				}
			}

			// 料金変更関数
			money = _EXC_(code , x);

			if(money[1] >= 0 && money[1] < 4)
			{
				if(money[1] == 0) info += "旅行代金：" + money[0];
				if(money[1] == 1) info += "旅行代金：" + money[0] +"〜";
				if(money[1] == 2) info += "旅行代金：" + money[0] +"　子供料金有";
				if(money[1] == 3) info += "旅行代金：" + money[0] +"　他料金有";
			}
			else if(moneys[x] != null)
			{
				info += "旅行代金：" + moneys[x];
			}

			info +="<BR><IMG src=img/tree2.gif width=14 height=14 border=0 align=top>";

			if(count == 0)
			{
				if(xdays[x + 2] == null)
				{
					info += "<FONT color=#00ef00>最終締切日は今日です。</B></FONT></FONT>";
				}
				else
				{
					info += "<FONT color=#00cc00>次回締切日は今日です。</B></FONT></FONT>";
				}
			}
			else if(people[x] == 7)
			{
				info += "<FONT color=#aaaa00><B>出発確定日です。</B></FONT>"
			}
			else if(count > 0 && count <= 9)
			{
				count = _multi_conv[count].slice(1,2);
				if(xdays[x + 2] == null)
				{
					info += "<FONT color=#ef0000>最終締切日まであと" + count + "日です。</B></FONT></FONT>";
				}
				else
				{
					info += "<FONT color=#cc0000>次回締切日まであと" + count + "日です。</B></FONT></FONT>";
				}
			}
			else
			{
				info += "<FONT color=#0000ff>現在募集中です。</B></FONT></FONT>";
			}

			info += "</FONT><BR><HR style='border-top-width : 1px;border-top-style : solid;border-top-color : black;height : 0px;'>";
			t_count ++;
		}

		number   = "";
		schedule = "";
		address  = "";
		title    = "";
		code_a   = "";
		code_b   = "";

		i_count ++;
	}
	i_error = 0;

	_refresh();

	return info;
}