function shinobido()
{
	// 樣式切換
	var cookie = readCookie("style");
	var title = 'imashime';
	if( cookie!=null && cookie!='null' ) { title = cookie; }
	setActiveStyleSheet(title);
	// 選單狀態
	if( checkCookie() == 'true' && readCookie('menuR') != 'null' )
	{
		if( readCookie('style') == 'imashime' || readCookie('style') == 'howda' )
		{
			for( var itr = 1; itr <= 7 ; itr++ )
			{
				if( readCookie('mg'+itr) == 'none' )
				{
					document.getElementById('mg_' + itr).style.display = 'none';
				}
			}
		}
	}
}

function toogleMenuGroup(mgid)
{
	var mGroup = document.getElementById('mg_' + mgid);
	if( mGroup.style.display == 'none' ) { mGroup.style.display = 'list-item'; }
	else { mGroup.style.display = 'none'; }
	if( checkCookie() == 'true' )
	{
		createCookie( 'mg' + mgid, mGroup.style.display, 640, '/' );
	}
}

function rememberMenu()
{
	if( checkCookie() == 'true' )
	{
		createCookie( 'menuR', '1', 640, '/' );
		for( var itr = 1; itr <= 7 ; itr++ )
		{
			if( document.getElementById('mg_' + itr).style.display != '' )
			{ createCookie( 'mg' + itr, document.getElementById('mg_' + itr).style.display, 640, '/' ); }
		}
		alert('已設定相關的 Cookies.');
	}
	else { alert('糟糕，無法進行設定。\n你可能沒啟用瀏覽器的 Cookies 功能。'); }
}
function forgetMenu()
{
	if( checkCookie() == 'true' && readCookie('menuR') != 'nuul' )
	{
		for( var itr = 1; itr <= 7 ; itr++ )
		{
			if( readCookie('mg'+itr) != 'null' ) { deleteCookie('mg'+itr, '/'); }
		}
		deleteCookie('menuR', '/');
		alert('已清除相關的 Cookies.\n\n下次瀏覽時，所有的選單都會展開。');
	}
	else { alert('糟糕，無法清除 Cookies.\n\n\n可能根本沒設定過。'); }
}