<SCRIPT LANGUAGE="JavaScript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

function checkreceiveaddr()
{
   if(checkspace(document.receiveaddr.receipt.value)) {
	document.receiveaddr.receipt.focus();
    alert("对不起，请填写收货人姓名！");
	return false;
  }
  if(checkspace(document.receiveaddr.city.value)) {
	document.receiveaddr.city.focus();
    alert("对不起，请填写收货人所在省市！");
	return false;
  }
  if(checkspace(document.receiveaddr.address.value)) {
	document.receiveaddr.address.focus();
    alert("对不起，请填写收货人详细收货地址！");
	return false;
  }
  if(checkspace(document.receiveaddr.postcode.value)) {
	document.receiveaddr.postcode.focus();
    alert("对不起，请填写邮编！");
	return false;
  }
 
    if(checkspace(document.receiveaddr.usertel.value)) {
	document.receiveaddr.usertel.focus();
    alert("对不起，请留下您的电话！");
	return false;
  }
      if(checkspace(document.receiveaddr.deliverymethord.value)) {
	document.receiveaddr.deliverymethord.focus();
    alert("对不起，您还没有选择送货方式！");
	return false;
  }
      if(checkspace(document.receiveaddr.paymethord.value)) {
	document.receiveaddr.paymethord.focus();
    alert("对不起，您还没有选择支付方式！");
	return false;
  }
}

	function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}

function checkuserinfo()
{
 if(document.userinfo.useremail.value.length!=0)
  {
    if (document.userinfo.useremail.value.charAt(0)=="." ||        
         document.userinfo.useremail.value.charAt(0)=="@"||       
         document.userinfo.useremail.value.indexOf('@', 0) == -1 || 
         document.userinfo.useremail.value.indexOf('.', 0) == -1 || 
         document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 || 
         document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
     {
      alert("Email地址格式不正确！");
      document.userinfo.useremail.focus();
      return false;
      }
   }
 else
  {
   alert("Email不能为空！");
   document.userinfo.useremail.focus();
   return false;
   }
}

function check0()
{
   if(checkspace(document.shop0.username.value)) {
	document.shop0.username.focus();
    alert("请输入您的用户名！");
	return false;
  }
  }
  function check1()
{
   if(checkspace(document.shop1.UserAnswer.value)) {
	document.shop1.UserAnswer.focus();
    alert("请填写密码答案！");
	return false;
  }
  }
   function check2()
{
   if(checkspace(document.shop2.UserPassword1.value)) {
	document.shop2.UserPassword1.focus();
    alert("请输入新密码！");
	return false;
  }
  if(checkspace(document.shop2.UserPassword2.value)) {
	document.shop2.UserPassword2.focus();
    alert("请输入确认密码！");
	return false;
  }
  if(document.shop2.UserPassword1.value != document.shop2.UserPassword2.value) {
	document.shop2.UserPassword1.focus();
	document.shop2.UserPassword1.value = '';
	document.shop2.UserPassword2.value = '';
    alert("两次输入的密码不同，请重新输入！");
	return false;
  }
}

function checkrepass()
{
   if(checkspace(document.userpass.UserPassword.value)) {
	document.userpass.UserPassword.focus();
    alert("对不起，请填写您的原密码！");
	return false;
  }
     if(checkspace(document.userpass.UserPassword1.value)) {
	document.userpass.UserPassword1.focus();
    alert("对不起，您还没有填新密码！");
	return false;
  }
     if(checkspace(document.userpass.UserPassword2.value)) {
	document.userpass.UserPassword2.focus();
    alert("对不起，您还没有填确认密码！");
	return false;
  }
   if(document.userpass.UserPassword1.value != document.userpass.UserPassword2.value) {
	document.userpass.UserPassword1.focus();
	document.userpass.UserPassword1.value = '';
	document.userpass.UserPassword2.value = '';
    alert("两次输入的密码不同，请重新输入！");
	return false;
  }
}

  function checkuu()
{
    if(checkspace(document.loginfo.username.value)) {
	document.loginfo.username.focus();
    alert("用户名不能为空！");
	return false;
  }
    if(checkspace(document.loginfo.UserPassword.value)) {
	document.loginfo.UserPassword.focus();
    alert("密码不能为空！");
	return false;
  }
    if(checkspace(document.loginfo.passcode.value)){
	document.loginfo.passcode.focus();
	alert("验证码不能为空");
	return false;
	}
	
  }

//-->
</script> 