var n; //　アクセス数（グローバル変数）

setDay = new Date();  //　現在の日時を取得

//--------------------------------------------------------------------------

//　Cookieを参照する関数（Cookieから指定されたデータを抜きだす）

//　成功した時はnull以外、失敗した時はfalseを返す

//--------------------------------------------------------------------------

function getCookie(theName) {

	theName += "="; //　= を追加

	theCookie = document.cookie+";"; //　検索時最終項目で-1になるのを防ぐ

	start = theCookie.indexOf(theName); //　指定されたセクション名を検索する

	if (start != -1)

	{

		end = theCookie.indexOf(";",start); //　データを抜きだす

		return unescape(theCookie.substring(start+theName.length,end));

	}

	return false;

}

//--------------------------------------------------------------------------

//　Cookieを設定する関数（Cookieにデータを保存する）

//　成功した時はtrue、失敗した時はfalseを返す

//--------------------------------------------------------------------------

function setCookie(theName,theValue) {

	if ((theName != null) && (theValue != null))

	{

		expDay = new Date(); //　現在の日時を取得

		expDay.setTime(expDay.getTime()+(theDay*1000*60*60*24)); //　Cookie期限の設定

		expDay = expDay.toGMTString();

		document.cookie = theName + "="+escape(theValue)+";expires="+expDay; // データ保存

		return true;

	}

	return false;

}

function getCount() {

	n = getCookie("count");  //　アクセス回数取得

	theDay = 1;  //　Cookie の保存期間を「1日間」とする

	if (!n) {

		if (setCookie("count",2)) {

			getCount = window.open('intro5.html','subwin1','directories=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');

			getCount.moveTo(0,0);

			getCount.resizeTo(screen.availWidth,screen.availHeight);

		}

	}

}

