function gook() {
	var S;

	S = document.getElementById("usernameshow");
	if (S.value == "")
	{
		alert("用户名不可为空");
		S.focus();
		return ;
	}

	S = document.getElementById("pwshow");
	if (S.value == "")
	{
		alert("密码不可为空");
		S.focus();
		return ;
	}


	S = document.getElementById("usernameshow");
	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));
	
	S = document.getElementById("cssType");
	document.f1.csspath.value = S.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;
}

function $( id ){return document.getElementById( id );}


	function fEvent(sType,oInput){
		switch (sType){
			case "focus" :
				oInput.isfocus = true;
			case "mouseover" :
				oInput.style.borderColor = '#9ecc00';
				break;
			case "blur" :
				oInput.isfocus = false;
			case "mouseout" :
				if(!oInput.isfocus){
					oInput.style.borderColor='#84a1bd';
				}
				break;
		}
	}

/*可选代码开始：有些邮局用户不带域名，则不需要自动完成域名。否则提示用户名密码错误。解决方法即删除下面代码。*/
function remendinput(oInput) {
		if (oInput!="admin" && oInput.length>0){
		if (oInput.indexOf("@")< 0){
		document.getElementById("usernameshow").value=oInput + "@xyrs.gov.cn";
		}  
		}
                  
}	 
/*可选代码结束*/
function quxiao(){
        document.getElementById("usernameshow").value='';
		document.getElementById("pwshow").value='';
}

