function LoadFlash(url,wmode,width,Height)
{ 
document.write(
  '<embed src="' + url + '" wmode=' + wmode +
  ' quality="high" pluginspage=http://www.macromedia.com/go/getflashplayer type="application/x-shockwave-flash" width="' + width + 
  '" height="' + Height + '"></embed>');   
}

function gook() {
	var S;

	S = document.getElementById("usernameshow");
	if (S.value == "")
	{
		alert("用户名不可为空");
		S.focus();
		return false;
	}

	S = document.getElementById("pwshow");
	if (S.value == "")
	{
		alert("密码不可为空");
		S.focus();
		return false;
	}

	S = document.getElementById("usernameshow");
	if(document.getElementById("AdminLogin").checked==false){
		document.f1.username.value = S.value + "@" + document.getElementById("domain").value;
		//alert(document.f1.username.value);
	}
	else{
		document.f1.username.value = S.value
	}

	S = document.getElementById("showsaveUser");
	document.f1.saveUser.value = S.checked;

	S = document.getElementById("showSecEx");
	document.f1.SecEx.value = S.checked;

	S = document.getElementById("pwshow");
	document.f1.pwhidden.value = encode(S.value, parseInt(document.f1.picnum.value));

	document.f1.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;
}
