var XML_CLASS_FILE = "classdata.xml";
var XML_GALLERY_FILE = "gallerydata.xml";
var XML_BOOK_FILE = "books.xml";
var XML_NEWS_FILE = "news.xml";

function GetCookie (name)
{
	//alert(" Debug GetCookie");
	var arg  = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
		{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
		}
	return null;
}

function getCookieVal (offset)
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset,endstr));
}

function SetCookie ( strName, strValue )
{
	var nExpirationTime = 31*24*60*60*1000; 	//クッキーの有効期限（31日間）

	//有効期限の計算
	var dtExpiration = new Date();
	dtExpiration.setTime(dtExpiration.getTime() + nExpirationTime);

	//クッキーのセット
	document.cookie = strName + "=" + strValue + "; expires=" + dtExpiration.toGMTString();
}

// OS判定
function isOS ()
{
	//	return "Mac";

	if ( navigator.platform.indexOf('Win') != -1 )
		return "Windows";

	if ( navigator.platform.indexOf('Mac') != -1 )
		return "Mac";

	return "Other";
}

// ブラウザ判定	WindowsのNetscape/7とInternet Explorer 6のみを判定
function isBrowser ()
{
	//alert ("navigator.userAgent="+navigator.userAgent);
	if ( navigator.userAgent.indexOf("Netscape/7") != -1)
		return true;
	if ( navigator.userAgent.indexOf("MSIE 6") != -1)
		return true;
	return false;
}

function DisplayPicture (nNo)
{
	WindowOpen ("../../Gallery/DisplayPicture.html", nNo, "_self");
}

function DisplayBook (nNo)
{
	WindowOpen ("DisplayBook.html", nNo, "_self");
}

function WindowOpen ( strURL, strArg , strStat)
{
	window.open ( strURL+"?"+strArg ,  strStat, "" );
}

/* EOF */

