function ReplaceSpace(str){  //str is a reference for get the real reference
	str1 = "";
	str2 = "";
	for(i = 0;i<str.length;i++){
		str2 = str.substring(i,i+1).replace(' ','');  //replace the space of the str
		//str2 = str.substring(i,i+1)
		//if (str2 != ' ')
			str1 = str1 + str2;  //replace the space and concat the char which is not equal to ' '
	}
	return str1  //return the result of the string which the space is replaced,if the value is null,the result is falst
}
function chkuser(){ 
	user = document.form1;
	if(ReplaceSpace(user.username.value) == ""){
		alert("请输入用户名");
		user.username.value = '';
		user.username.focus()
		return false;
	}
	if(ReplaceSpace(user.password.value) == ""){
		alert("请输入用户密码");
		user.password.value = '';
		user.password.focus()
		return false;
	}
}
