function doLogin(form){
	if(form.UserLoginName.value == ""){
		alert("请输入用户名");
		form.UserLoginName.focus();
		return false;
	}
	else if(form.UserPassword.value == ""){
		alert("请输入密码");
		form.UserPassword.focus();
		return false;
	}
	return true;
}
function loginOut(){
	if(confirm("你确定要退出登录?")){
		window.location.href = "/users/LoginOut.cfm";
	}
}
function buyProduct(productID){
	var input = document.getElementById("BuyCount_" + productID);
	if(input.value.search(/^[0-9]{1,2}$/) < 0){
		alert("请输入正确的购买数量");
		input.focus();
		input.value = 1;
	}
	else if(parseInt(input.value) > 50){
		alert("一次购买的量请不要超过50张");
		input.focus();
		input.value = 50;
	}
	else window.location.href = "/Product/ShoppingCart.cfm?ProductId=" + productID + "&BuyCount=" + input.value;
}
function checkCount(input){
	if(input.value != "" && input.value.search(/^[0-9]{1,3}$/) < 0){
		alert("请输入正确的数量");
		input.value = 1;
	}
	else if(parseInt(input.value) > 50){
		alert("每次的购买量请不要超过50张");
		input.focus();
		input.value = 50;
	}
}