var nExpTime = 30*24*60*60*1000; //�N�b�L�[�̗L����

//�t�H���g�T�C�Y��擾����
var strSize = getCookie("FontSize");

if(strSize != ""){
	document.open();
	document.write('<style type="text/css">');
	document.write('<!--');
	document.write('body {font-size:'+strSize+'}');
	document.write('-->');
	document.write('</style>');
	document.close();
	//alert(strSize);
}


//�N�b�L�[��擾����֐�
function getCookie(strName)
{
	var nReturn = 0;
	var nLoop = 0;
	var nLength = 0;
	var strNameEx = strName + "=";
	var strTemp = "";
	//���[�v�ň�̒l�����݂��邩�ǂ�����`�F�b�N���܂��B
	while (nLoop < document.cookie.length)
	{
		nLength = nLoop + strNameEx.length;
		//���݂���΂��̒l�𔻒f���߂��܂��B
		if (document.cookie.substring(nLoop, nLength) == strNameEx)
		{
			strTemp = document.cookie.indexOf(";", nLength);
			if (strTemp == -1){
				nReturn = document.cookie.substring(nLength, document.cookie.length);
			}else{
				nReturn = document.cookie.substring(nLength, strTemp);
			}
			break;
		}
		//���݂��Ȃ���Ύ��ցA�Ȃ���ΏI��
		nLoop = document.cookie.indexOf(" ", nLoop) + 1;
		if (nLoop == 0){
			break;
		}
	}
	return nReturn;
}

//�N�b�L�[��Z�b�g����֐�
function setCookie(strName, strValue)
{
	//�L���̌v�Z
	var dtExpire = new Date();
	dtExpire.setTime(dtExpire.getTime() + nExpTime);
	//�N�b�L�[��Z�b�g
	document.cookie = strName + "=" + strValue + "; path=/; expires=" + dtExpire.toGMTString();
}

//�t�H���g�T�C�Y��Z�b�g����֐�
function saveFontSize(strValue)
{
	//���݂̉�ʃt�H���g�T�C�Y��ύX
	document.body.style.fontSize = strValue;
	//�ۑ�����
	setCookie("FontSize", strValue);
}

