// JavaScript Document

function checktext(text)
{
		allValid = true;
		for (i = 0;  i < text.length;  i++)
		{
			if (text.charAt(i) != " ")
			{
				allValid = false;
				break;
			}
		}
return allValid;
}

function gbcount(message,total,used,remain)
{
	var max;
	max = total.value;
	if (message.value.length > max) {
	message.value = message.value.substring(0,max);
	used.value = max;
	remain.value = 0;
	alert("留言不能超过 200 个字!");
	}
	else {
	used.value = message.value.length;
	remain.value = max - used.value;
	}
}


/*......................以下是邮寄信息验证...................................*/

function check_Information2(){
		
		if(document.formInformation2.username.value.length > 10){
          alert("收货人姓名输入不合理");
          return false;
        }
		if(document.formInformation2.useremail.value.length > 35){
          alert("电子邮箱输入不合理");
          return false;
        }
		if(document.formInformation2.userphone.value.length > 15){
          alert("电话输入不合理");
          return false;
        }
		if(document.formInformation2.userzip.value.length > 10){
          alert("邮编输入不合理");
          return false;
        }
		if(document.formInformation2.useraddress.value.length > 50){
          alert("地址输入不合理");
        return false;
        }
	return true;	
}


/*..............................以上是邮寄信息验证.......................................*/


// 以下实现根据邮紡获取城市

function zipcity()
{ getajax();
  var zip = document.getElementById("userzip").value;
if(!objRequest&&typeof XMLHttpRequest!="undefined")
   {objRequest=new XMLHttpRequest();}
var url="InputInfor_zip_do.asp?zip="+unescape(zip);
   if(objRequest!=null) 
     {
       objRequest.onreadystatechange = nameProcess2;
       objRequest.open("GET",url,true);
	  
       objRequest.send(null);
     }
}
function nameProcess2()
{
var objname = document.getElementById("useraddress");

  if(objRequest.readyState<4){
objname.value="正在为您检索……";
  }
  else if(objRequest.readyState == 4){
   var response = objRequest.responseText;
objname.value=unescape(response);
  }
   else{
objname.value = "Error:"+objRequest.statusText;
  }
} 
//////////////////////////以上实现根据邮紡获取城市 end///////////////////////////////////