if (top.location !== self.location) {
top.location=self.location;
}

function webgook() {
	if (usernameshow.value == "")
	{
		alert("请输入您的网站管理平台用户名！");
		usernameshow.focus();
		return ;
	}
	if (pwshow.value == "")
	{
		alert("请输入您的网站管理平台密码！");
		pwshow.focus();
		return ;
	}

	f2.username.value = usernameshow.value ;
	f2.password.value = pwshow.value
	f2.submit();
}

function gook() {
	if (usernameshow.value == "")
	{
		alert("请输入您的邮箱用户名！");
		usernameshow.focus();
		return ;
	}
	if (pwshow.value == "")
	{
		alert("请输入您的邮箱密码！");
		pwshow.focus();
		return ;
	}

	f1.username.value = usernameshow.value ;
	f1.pwhidden.value = encode(pwshow.value, parseInt(f1.picnum.value));
	f1.SecEx.value = "on";
	f1.submit();
}

function schoolmate() {
	if (usernameshow.value == "")
	{
		alert("请输入您的同学录用户名！");
		usernameshow.focus();
		return ;
	}
	if (pwshow.value == "")
	{
		alert("请输入您的同学录密码！");
		pwshow.focus();
		return ;
	}

	f3.fyuser.value = usernameshow.value ;
	f3.fypwd.value = pwshow.value
	f3.submit();
}

function encode(datastr, bassnum) {
	var tempstr;
	var tchar;
	var newdata = "";

	for (var i = 0; i < datastr.length; i++)
	{
		tchar = 65535 + bassnum - datastr.charCodeAt(i);
		tchar = tchar.toString();

		while(tchar.length < 5)
		{
			tchar = "0" + tchar;
		}

		newdata = newdata + tchar;
	}

	return newdata;
}

function cancel() {
	usernameshow.value="";
	usernameshow.focus();
	pwshow.value=""
}
