// 定数
var status_str = 'TheWebTypingTrialStatus';
var last_level_str = 'TheWebTypingLastLevel';
var name_str = 'TheWebTypingName';
var rank_status_str = 'TheWebTypingRankingStatus';

// ページを切り替える
function jumpPage(url)
{
	location.href = url;
}

// ログを表示
function jumpLog(manth)
{
	if (manth) jumpPage('ranking_log.cgi?' + manth);
}

// クッキーを取得
function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3)
{
	tmp1 = " " + document.cookie + ";";
	xx1 = xx2 = 0;
	len = tmp1.length;
	while (xx1 < len) {
		xx2 = tmp1.indexOf(";", xx1);
		tmp2 = tmp1.substring(xx1 + 1, xx2);
		xx3 = tmp2.indexOf("=");
		if (tmp2.substring(0, xx3) == key) {
			return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
		}
		xx1 = xx2 + 1;
	}
	return("");
}

// クッキーをセット
function setCookie(key, val, tmp)
{
	tmp = key + "=" + escape(val) + "; ";
	// tmp += "path=" + location.pathname + "; ";
	tmp += "expires=Fri, 31-Dec-2030 23:59:59; ";
	document.cookie = tmp;
}

// クッキーをクリア
function clearCookie(key)
{
	document.cookie = key + "=" + "xx; expires=1-Jan-1997 00:00:00;";
}

// ヘルプを開く
function openHelp(file)
{
	twt_help = open('help/index.cgi?'+file, 'TWTHELP', 'width=600,height=480,location=no,status=no,toolbar=yes,resizable=yes');
}

