function showLoginArea() {
	var parts = document.cookie.split(/\s*;\s*/);
	var keyValue, key, value;
	var i;
	
	for(i=0;i<parts.length;i++) {
		keyValue = parts[i].split('=');
		key = keyValue[0];
		value = keyValue[1];
		
		if(key == 'playername') break;
	}
	
	if(i >= parts.length) {
		document.write('<a id="login" href="https://www.novelgames.com/players/?l=sc">游戏玩家登入</a>');
	} else {
		document.write('<div id="welcome">');
		document.write('	<div id="text">欢迎回来 ' + value + '！</div>');
		document.write('	<div id="bar1">|</div>');
		document.write('	<a id="changePassword" href="https://www.novelgames.com/players/changePasswordPage.php?l=sc">更改密码</a>');
		document.write('	<div id="bar2">|</div>');
		document.write('	<a id="logout" href="https://www.novelgames.com/players/logout.php?l=sc">登出</a>');
		document.write('</div>');
	}
}

function setAsHomePage(theForm) {
	if(navigator.appName == 'Microsoft Internet Explorer') {
		theForm.style.behavior = 'url(#default#homepage)';
		theForm.setHomePage(document.location.href);
	} else {
		alert('要把此页设定为本页，请参考您的浏览器的求助挡。');
	}
}

function addToFavorites() {
	if(navigator.appName == 'Microsoft Internet Explorer') {
		window.external.AddFavorite(document.location.href, document.title);
	} else {
		alert('要把此页加到书签内，请参考您的浏览器的求助挡。');
	}
}

function searchBoxOnFocus(box) {
	if(box.className == 'searchBoxActive') return;
	
	box.className = "searchBoxActive";
	box.value = '';
}