var lBrowser = {};
lBrowser.agt = navigator.userAgent.toLowerCase();
lBrowser.isW3C = document.getElementById ? true:false;
lBrowser.isIE = ((lBrowser.agt.indexOf("msie") != -1) && (lBrowser.agt.indexOf("opera") == -1) && (lBrowser.agt.indexOf("omniweb") == -1));
lBrowser.isNS6 = lBrowser.isW3C && (navigator.appName=="Netscape") ;
lBrowser.isOpera = lBrowser.agt.indexOf("opera") != -1;
lBrowser.isGecko = lBrowser.agt.indexOf("gecko") != -1;
lBrowser.ieTrueBody =function (){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
};
//为Firefox下的DOM对象增加innerText属性
if(lBrowser.isNS6){ //firefox innerText define
 HTMLElement.prototype.__defineGetter__( "innerText", 
 function(){ 
 return this.textContent; 
 } 
 ); 
 HTMLElement.prototype.__defineSetter__( "innerText", 
function(sText){ 
 this.textContent=sText; 
 } 
 ); 
}

function font(obj)
{
  var fontlength=reallength(trim(obj.value));
  document.getElementById("fontcount").innerHTML=fontlength;
  if(fontlength>500)
     alert("只能输入500个字符！");
  return false;
}

function reallength(s){
  return s.replace(/[^\x00-\xff]/gi,'xu').length;
}

function trim(inputString){
  return inputString.replace(/(^\s*)|(\s*$)/g, "");
}

function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

function checkpl() 
{
  if(checkspace(document.comment.name.value)) {
	document.comment.name.focus();
    alert("请输入你的大名!");
	return false;
  }
  if(checkspace(document.comment.Users_Code.value)) {
	document.comment.Users_Code.focus();
    alert("请填写随机号码 !");
	return false;
   }
  if(checkspace(document.comment.content.value)) {
	document.comment.content.focus();
    alert("请输入需要咨询的内容!");
	return false;
  }
}

function checkLogin()
{
  if(checkspace(document.Login.user_name.value)) {
	document.Login.user_name.focus();
    alert("请输入您的登录帐号!");
	return false;
  }
  if(checkspace(document.Login.user_pass.value)) {
	document.Login.user_pass.focus();
    alert("请输入您的登录密码!");
	return false;
  }
  if(checkspace(document.Login.user_pass.value) || document.Login.user_pass.value.length < 6) {
	document.Login.user_pass.focus();
    alert("请输入正确的登录密码!");
	return false;
  }
}

function opendiv(ss)
{
ss.style.display="";
}
function closediv(ss)
{
ss.style.display="none";
}

function checkSubform() 
{
var sel = 0;
 for (var i = 0; i < document.subform.Jifen_BuyOn.length; i++)
 　{
  　　if(document.subform.Jifen_BuyOn[i].checked)
  　　　{
   　　　　sel = document.subform.Jifen_BuyOn[i].value;
  　　}
 　} 
if (document.subform.Users_TureName.value=="")
	{
	  alert("收货姓名不能为空 !")
	  document.subform.Users_TureName.focus()
	  return false
	 }
else if(document.subform.Users_Tel.value=="")
	{
	  alert("联系电话不能为空 !")
	  document.subform.Users_Tel.focus()
	  return false
	 }
else if(document.subform.Users_Adr.value=="")
	{
	  alert("收货地址不能为空 !")
	  document.subform.Users_Adr.focus()
	  return false
	 }
else if(document.subform.Users_Code.value=="")
	{
	  alert("邮政编码不能为空 !")
	  document.subform.Users_Code.focus()
	  return false
	 }
else if(sel== 2)
 　　{
      if(checkspace(document.subform.Jifen_BuyNum.value)) {
	  document.subform.Jifen_BuyNum.focus();
      alert("请输入需要使用的积分 !");
	  return false;
     }
 　　}
else
    {
	  if(confirm('下单后你的购物车信息将被清除，所有的购物信息将不能修改 ! 你确定下单吗？')){
      return true;
      }else return false;
	}
}

function checkSubformGuest() 
{
if (document.SubformGuest.Users_TureName.value=="")
	{
	  alert("收货姓名不能为空 !")
	  document.SubformGuest.Users_TureName.focus()
	  return false
	 }
if(document.SubformGuest.Users_Tel.value=="")
	{
	  alert("联系电话不能为空 !")
	  document.SubformGuest.Users_Tel.focus()
	  return false
	 }
if(document.SubformGuest.Users_Adr.value=="")
	{
	  alert("收货地址不能为空 !")
	  document.SubformGuest.Users_Adr.focus()
	  return false
	 }
if(document.SubformGuest.Users_Code.value=="")
	{
	  alert("邮政编码不能为空 !")
	  document.SubformGuest.Users_Code.focus()
	  return false
	 }
else
    {
	  if(confirm('下单后你的购物车信息将被清除，所有的购物信息将不能修改 ! 你确定下单吗？')){
      return true;
      }else return false;
	}
}

function checkModPass() 
{
  if(checkspace(document.ModPass.oldpass.value)) {
	document.ModPass.oldpass.focus();
    alert("请输入旧的管理密码!");
	return false;
  }
  if(checkspace(document.ModPass.pass1.value)) {
	document.ModPass.pass1.focus();
    alert("请输入新的管理密码!");
	return false;
  }
  if(checkspace(document.ModPass.pass1.value) || document.ModPass.pass1.value.length < 6) {
	document.ModPass.pass1.focus();
    alert("新的管理密码长度不能小于6，请重新输入!");
	return false;
  }
  if(checkspace(document.ModPass.pass2.value)) {
	document.ModPass.pass2.focus();
    alert("请再输入一次新的管理密码!");
	return false;
  }
  if(document.ModPass.pass1.value != document.ModPass.pass2.value) {
	document.ModPass.pass1.focus();
	document.ModPass.pass1.value = '';
	document.ModPass.pass2.value = '';
    alert("两次输入的密码不同，请重新输入!");
	return false;
  }
}

function checkModUser() 
{
  if(checkspace(document.ModUser.Users_TureName.value)) {
	document.ModUser.Users_TureName.focus();
    alert("请输入个人姓名!");
	return false;
  }
  if(checkspace(document.ModUser.Users_Tel.value)) {
	document.ModUser.Users_Tel.focus();
    alert("请输入联系电话!");
	return false;
  }
  if(checkspace(document.ModUser.Users_Adr.value)) {
	document.ModUser.Users_Adr.focus();
    alert("请输入联系地址!");
	return false;
  }
  if(checkspace(document.ModUser.Users_Code.value)) {
	document.ModUser.Users_Code.focus();
    alert("请输入邮政编码!");
	return false;
  }
}

function checkComplaints() 
{
  if(document.Complaints.Order_TousuContent.value=='请输入投诉问题 !') {
	document.Complaints.Order_TousuContent.focus();
	alert("请输入投诉的内容!");
	document.getElementById("Order_TousuContent").value = '';
	return false;
  }
  if(checkspace(document.Complaints.Order_TousuContent.value)) {
	document.Complaints.Order_TousuContent.focus();
    alert("请输入投诉的内容!");
	return false;
  }
}

function OtherCheck()
{
  var a = document.getElementsByTagName("input");
  m = 0;
  for (var i=0; i<a.length; i++)
  {
	if (a[i].type == "radio")
	{
		if (a[i].checked == true) {n = 1;}
	}
	
	if (a[i].type == "checkbox")
	{
		if (a[i].checked == true) {m = 1;}
	}
  }
 
 if (m==0) { alert("请你选中需要操作的信息!"); return false;}
}

function DelCheck()
{
  var a = document.getElementsByTagName("input");
  m = 0;
  for (var i=0; i<a.length; i++)
  {
	if (a[i].type == "radio")
	{
		if (a[i].checked == true) {n = 1;}
	}
	
	if (a[i].type == "checkbox")
	{
		if (a[i].checked == true) {m = 1;}
	}
  }
 
 if (m==0) { alert("请你选中需要操作的信息!"); return false;}
 
 if(!confirm('一旦删除，这些信息将无法恢复。你确定这样做吗？')) return false;
}

function tr_bgcolor(c){
 var tr = c.parentNode.parentNode;
 tr.rowIndex % 2 == 0 ? tr.style.backgroundColor = c.checked ? '#F3F3F3' : '' : tr.style.backgroundColor = c.checked ? '#F3F3F3' : '';
}
function selall(obj){
 for (var i=0; i<obj.form.elements.length; i++)
 if (obj.form.elements[i].type == 'checkbox' && obj.form.elements[i] != obj){
  obj.form.elements[i].checked = obj.checked;
  tr_bgcolor(obj.form.elements[i]);
 }
}

function MM_findObj(n, d) { //v4.0
var p,i,x;if(!d) d=document;if((p=n.indexOf("?"))>0 && parent.frames.length){
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n]) && d.all) x=d.all[n]; for (i=0;!x && i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x && d.layers && i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x  &&  document.getElementById) x=document.getElementById(n); return x;}
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }}

function mOvr(src, cOvr) 
{if (!src.contains(event.fromElement)) {src.style.cursor = "default";src.bgColor = cOvr;}}
function mOut(src, cOut) 
{if (!src.contains(event.toElement)) {src.style.cursor = "default";src.bgColor = cOut;}}

function checkAddOrderBuy()
{
  if(checkspace(document.OrderBuy.OrderBuy_Goods.value)) {
	document.OrderBuy.OrderBuy_Goods.focus();
    alert("采购型号不能为空 !");
	return false;
  } 	 
  if(checkspace(document.OrderBuy.OrderBuy_Color.value)) {
	document.OrderBuy.OrderBuy_Color.focus();
    alert("采购颜色不能为空 !");
	return false;
  }
  if(checkspace(document.OrderBuy.OrderBuy_Origin.value)) {
	document.OrderBuy.OrderBuy_Origin.focus();
    alert("商品产地不能为空 !");
	return false;
  }
  if(checkspace(document.OrderBuy.OrderBuy_Color.value)) {
	document.OrderBuy.OrderBuy_Color.focus();
    alert("采购数量不能为空 !");
	return false;
  }
    if(checkspace(document.OrderBuy.OrderBuy_Name.value)) {
	document.OrderBuy.OrderBuy_Name.focus();
    alert("联系姓名不能为空 !");
	return false;
  }
    if(checkspace(document.OrderBuy.OrderBuy_Tel.value)) {
	document.OrderBuy.OrderBuy_Tel.focus();
    alert("联系电话不能为空 !");
	return false;
  }
  if(document.OrderBuy.OrderBuy_Email.value.length!=0)
  {
    if (document.OrderBuy.OrderBuy_Email.value.charAt(0)=="." ||        
         document.OrderBuy.OrderBuy_Email.value.charAt(0)=="@"||       
         document.OrderBuy.OrderBuy_Email.value.indexOf('@', 0) == -1 || 
         document.OrderBuy.OrderBuy_Email.value.indexOf('.', 0) == -1 || 
         document.OrderBuy.OrderBuy_Email.value.lastIndexOf("@")==document.OrderBuy.OrderBuy_Email.value.length-1 || 
         document.OrderBuy.OrderBuy_Email.value.lastIndexOf(".")==document.OrderBuy.OrderBuy_Email.value.length-1)
     {
      alert("电子邮箱地址格式不正确 !");
      document.OrderBuy.OrderBuy_Email.focus();
      return false;
      }
   }
  else
  {
   alert("电子邮箱不能为空 !");
   document.OrderBuy.OrderBuy_Email.focus();
   return false;
   }	
}

function checknote() 
{
   if(checkspace(document.notewrite.Message_Name.value)) {
	document.notewrite.Message_Name.focus();
    alert("请填写您的大名 !");
	return false;
   }  
   if(checkspace(document.notewrite.Message_Tel.value)) {
	document.notewrite.Message_Tel.focus();
    alert("请填写您的联系电话 !");
	return false;
   }
   if(document.notewrite.Message_Mail.value.length!=0)
  {
    if (document.notewrite.Message_Mail.value.charAt(0)=="." ||        
         document.notewrite.Message_Mail.value.charAt(0)=="@"||       
         document.notewrite.Message_Mail.value.indexOf('@', 0) == -1 || 
         document.notewrite.Message_Mail.value.indexOf('.', 0) == -1 || 
         document.notewrite.Message_Mail.value.lastIndexOf("@")==document.notewrite.Message_Mail.value.length-1 || 
         document.notewrite.Message_Mail.value.lastIndexOf(".")==document.notewrite.Message_Mail.value.length-1)
     {
      alert("电子邮箱地址格式不正确 !");
      document.notewrite.Message_Mail.focus();
      return false;
      }
   }
  else
  {
   alert("请填写您的电子邮箱 !");
   document.notewrite.Message_Mail.focus();
   return false;
   }	
  if(checkspace(document.notewrite.Users_Code.value)) {
	document.notewrite.Users_Code.focus();
    alert("请填写随机号码 !");
	return false;
   }
  if(checkspace(document.notewrite.content.value)) {
	document.notewrite.content.focus();
    alert("请填写您咨询的内容 !");
	return false;
   }
  if(checkspace(document.notewrite.content.value) || document.notewrite.content.value.length < 10) {
	document.notewrite.content.focus();
    alert("咨询的内容不能少于10个字 !");
	return false;
  } 	 
}

var xmlHttp = false;
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}

function RegisterName() {
  if(checkspace(document.register.user_name.value)){
  document.getElementById('Namecheck').innerText = '请输入一个3-20位字符的用户名';
  document.getElementById('Namecheck').className = 'register2-3-e';
  }
  else if(checkspace(document.register.user_name.value) || document.register.user_name.value.length < 3) {
  document.getElementById('Namecheck').innerText = '请输入正确的用户名';
  document.getElementById('Namecheck').className = 'register2-3-e';
  }
  else if(checkspace(document.register.user_name.value) || document.register.user_name.value.length > 20) {
  document.getElementById('Namecheck').innerText = '请输入正确的用户名';
  document.getElementById('Namecheck').className = 'register2-3-e';
  }
  else{	
  var user_name = document.getElementById("user_name").value;
  if ((user_name == null) || (user_name == "")) return;
  var url = "NameXML.asp?name=" + escape(user_name);
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = updatePage;
  xmlHttp.send(null); }
}

function updatePage() {
  if (xmlHttp.readyState < 4) {
	Namecheck.innerHTML="loading...";
  }
  if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText;
	if(response == 1){
  document.getElementById('Namecheck').innerText = '.';
  document.getElementById('Namecheck').className = 'register2-3-r';
	}
	else{
  document.getElementById('Namecheck').innerText = '该用户名已被注册，请使用其他用户名注册';
  document.getElementById('Namecheck').className = 'register2-3-e';
	}
  }
}

function RegisterPass(){
  if(checkspace(document.register.user_pass.value)){
  document.getElementById('passcheck').innerText = '请输入一个6-16位字符的密码';
  document.getElementById('passcheck').className = 'register2-3-e';
  }
  else if(checkspace(document.register.user_pass.value) || document.register.user_pass.value.length < 6) {
  document.getElementById('passcheck').innerText = '密码必须是6-16位字符，请正确输入';
  document.getElementById('passcheck').className = 'register2-3-e';
  }
  else{
  document.getElementById('passcheck').innerText = '.';
  document.getElementById('passcheck').className = 'register2-3-r';
  }
}

function RegisterPass1(){
  if(checkspace(document.register.user_pass2.value)){
  document.getElementById('passcheck1').innerText = '请再输一次你的密码';
  document.getElementById('passcheck1').className = 'register2-3-e';
  }
  else if(document.register.user_pass.value != document.register.user_pass2.value) {
  document.getElementById('passcheck1').innerText = '你两次输入的密码不一致，请重新输入';
  document.getElementById('passcheck1').className = 'register2-3-e';
  }
  else{
  document.getElementById('passcheck1').innerText = '.';
  document.getElementById('passcheck1').className = 'register2-3-r';
  }
}

function RegisterEmail(){
   if(document.register.user_mail.value.length!=0){
     if (document.register.user_mail.value.charAt(0)=="." ||        
         document.register.user_mail.value.charAt(0)=="@"||       
         document.register.user_mail.value.indexOf('@', 0) == -1 || 
         document.register.user_mail.value.indexOf('.', 0) == -1 || 
         document.register.user_mail.value.lastIndexOf("@")==document.register.user_mail.value.length-1 || 
         document.register.user_mail.value.lastIndexOf(".")==document.register.user_mail.value.length-1)
     {
         document.getElementById('emailcheck').innerText = '请输入正确的电子邮件地址';
         document.getElementById('emailcheck').className = 'register2-3-e';
		 return false;
      }
   }
   else
  {
        document.getElementById('emailcheck').innerText = '请输入你的电子邮件地址';
        document.getElementById('emailcheck').className = 'register2-3-e';
		return false;
   }
        document.getElementById('emailcheck').innerText = '.';
        document.getElementById('emailcheck').className = 'register2-3-r';
		return false;
}

function checkRegister() 
{
if(checkspace(document.register.user_name.value)) {
	document.register.user_name.focus();
    RegisterName();
	return false;
   }
if(checkspace(document.register.user_name.value) || document.register.user_name.value.length < 3) {
	document.register.user_name.focus();
    RegisterName();
	return false;
  }
if(checkspace(document.register.user_name.value) || document.register.user_name.value.length > 20) {
	document.register.user_name.focus();
    RegisterName();
	return false;
  }
if(checkspace(document.register.user_pass.value)) {
	document.register.user_pass.focus();
    RegisterPass();
	return false;
   }
if(checkspace(document.register.user_pass.value) || document.register.user_pass.value.length < 6) {
	document.register.user_pass.focus();
    RegisterPass();
	return false;
  }
if(checkspace(document.register.user_pass2.value)) {
	document.register.user_pass2.focus();
    RegisterPass1();
	return false;
   }
if(document.register.user_pass.value != document.register.user_pass2.value) {
	document.register.user_pass.focus();
	document.register.user_pass.value = '';
	document.register.user_pass2.value = '';
    RegisterPass1();
	return false;
  }
if(document.register.user_mail.value.length!=0)
  {
    if (document.register.user_mail.value.charAt(0)=="." ||        
         document.register.user_mail.value.charAt(0)=="@"||       
         document.register.user_mail.value.indexOf('@', 0) == -1 || 
         document.register.user_mail.value.indexOf('.', 0) == -1 || 
         document.register.user_mail.value.lastIndexOf("@")==document.register.user_mail.value.length-1 || 
         document.register.user_mail.value.lastIndexOf(".")==document.register.user_mail.value.length-1)
     {
      RegisterEmail();
      document.register.user_mail.focus();
      return false;
      }
   }
 else
  {
   RegisterEmail();
   document.register.user_mail.focus();
   return false;
   }	
if(document.register.Accepted.checked == false) {
    alert("你必须同意注册协议才能注册 !");
    return false;
   }
}

function checkAfter() 
{
if(checkspace(document.After.Goodsreg_IME.value)) {
	document.After.Goodsreg_IME.focus();
    alert("请输入需要查询的手机IME串号 !");
	return false;
   }
if(checkspace(document.After.Goodsreg_IME.value) || document.After.Goodsreg_IME.value.length < 14) {
	document.After.Goodsreg_IME.focus();
    alert("你好，请输入正确的手机IME串号 !");
	return false;
  }	 
}

function checkCampus() 
{
if(checkspace(document.Campus.Campus_Name.value)) {
	document.Campus.Campus_Name.focus();
    alert("您好 ! 请填写你的姓名 !");
	return false;
   }
if(checkspace(document.Campus.Campus_Dx.value)) {
	document.Campus.Campus_Dx.focus();
    alert("您好 ! 请填写你的学校 !");
	return false;
   } 
if(checkspace(document.Campus.Campus_Xy.value)) {
	document.Campus.Campus_Xy.focus();
    alert("您好 ! 请填写你的院校 !");
	return false;
   }  
if(checkspace(document.Campus.Campus_Zy.value)) {
	document.Campus.Campus_Zy.focus();
    alert("您好 ! 请填写你的专业 !");
	return false;
   } 
if(checkspace(document.Campus.Campus_Zw.value)) {
	document.Campus.Campus_Zw.focus();
    alert("您好 ! 请填写你的职务 !");
	return false;
   } 
if(checkspace(document.Campus.Campus_Tel.value)) {
	document.Campus.Campus_Tel.focus();
    alert("您好 ! 请填写你的联系电话 !");
	return false;
   } 
if(document.Campus.Campus_Mail.value.length!=0)
  {
    if (document.Campus.Campus_Mail.value.charAt(0)=="." ||        
         document.Campus.Campus_Mail.value.charAt(0)=="@"||       
         document.Campus.Campus_Mail.value.indexOf('@', 0) == -1 || 
         document.Campus.Campus_Mail.value.indexOf('.', 0) == -1 || 
         document.Campus.Campus_Mail.value.lastIndexOf("@")==document.Campus.Campus_Mail.value.length-1 || 
         document.Campus.Campus_Mail.value.lastIndexOf(".")==document.Campus.Campus_Mail.value.length-1)
     {
      alert("电子邮箱地址格式不正确 !");
      document.Campus.Campus_Mail.focus();
      return false;
      }
   }
  else
  {
   alert("您好 ! 请填写你的电子邮箱 !");
   document.Campus.Campus_Mail.focus();
   return false;
   }
if(checkspace(document.Campus.Campus_QQ.value)) {
	document.Campus.Campus_QQ.focus();
    alert("您好 ! 请填写你的QQ !");
	return false;
   } 
if(checkspace(document.Campus.dz.value)) {
	document.Campus.dz.focus();
    alert("您好 ! 请填写你的地址 !");
	return false;
   }
if(checkspace(document.Campus.Campus_Xadr.value)) {
	document.Campus.Campus_Xadr.focus();
    alert("您好 ! 请填写你的学校地址 !");
	return false;
   } 
if(checkspace(document.Campus.Campus_Ly.value)) {
	document.Campus.Campus_Ly.focus();
    alert("您好 ! 请填写你的代理理由 !");
	return false;
   } 
if(checkspace(document.Campus.Campus_Yq.value)) {
	document.Campus.Campus_Yq.focus();
    alert("您好 ! 请填写你的代理要求 !");
	return false;
   }    
}

function checkOrdinary() 
{
if(checkspace(document.Ordinary.Ordinary_Name.value)) {
	document.Ordinary.Ordinary_Name.focus();
    alert("您好 ! 请填写你的姓名 !");
	return false;
   }
if(checkspace(document.Ordinary.Ordinary_Ss.value)) {
	document.Ordinary.Ordinary_Ss.focus();
    alert("您好 ! 请填写你的省份/城市 !");
	return false;
   } 
if(checkspace(document.Ordinary.Ordinary_Age.value)) {
	document.Ordinary.Ordinary_Age.focus();
    alert("您好 ! 请填写你的年龄 !");
	return false;
   }  
if(checkspace(document.Ordinary.Ordinary_Me.value)) {
	document.Ordinary.Ordinary_Me.focus();
    alert("您好 ! 请填写你的婚姻状况 !");
	return false;
   } 
if(checkspace(document.Ordinary.Ordinary_Sf.value)) {
	document.Ordinary.Ordinary_Sf.focus();
    alert("您好 ! 请填写你的身份证号码 !");
	return false;
   } 
if(checkspace(document.Ordinary.Ordinary_Tel.value)) {
	document.Ordinary.Ordinary_Tel.focus();
    alert("您好 ! 请填写你的联系电话 !");
	return false;
   } 
if(document.Ordinary.Ordinary_Mail.value.length!=0)
  {
    if (document.Ordinary.Ordinary_Mail.value.charAt(0)=="." ||        
         document.Ordinary.Ordinary_Mail.value.charAt(0)=="@"||       
         document.Ordinary.Ordinary_Mail.value.indexOf('@', 0) == -1 || 
         document.Ordinary.Ordinary_Mail.value.indexOf('.', 0) == -1 || 
         document.Ordinary.Ordinary_Mail.value.lastIndexOf("@")==document.Ordinary.Ordinary_Mail.value.length-1 || 
         document.Ordinary.Ordinary_Mail.value.lastIndexOf(".")==document.Ordinary.Ordinary_Mail.value.length-1)
     {
      alert("电子邮箱地址格式不正确 !");
      document.Ordinary.Ordinary_Mail.focus();
      return false;
      }
   }
  else
  {
   alert("您好 ! 请填写你的电子邮箱 !");
   document.Ordinary.Ordinary_Mail.focus();
   return false;
   }
if(checkspace(document.Ordinary.Ordinary_QQ.value)) {
	document.Ordinary.Ordinary_QQ.focus();
    alert("您好 ! 请填写你的QQ !");
	return false;
   } 
if(checkspace(document.Ordinary.Ordinary_Adr.value)) {
	document.Ordinary.Ordinary_Adr.focus();
    alert("您好 ! 请填写你的地址 !");
	return false;
   }
if(checkspace(document.Ordinary.Ordinary_Hy.value)) {
	document.Ordinary.Ordinary_Hy.focus();
    alert("您好 ! 请填写你的从事行业 !");
	return false;
   } 
if(checkspace(document.Ordinary.Ordinary_Ly.value)) {
	document.Ordinary.Ordinary_Ly.focus();
    alert("您好 ! 请填写你的加盟理念 !");
	return false;
   } 
if(checkspace(document.Ordinary.Ordinary_Yq.value)) {
	document.Ordinary.Ordinary_Yq.focus();
    alert("您好 ! 请填写你的代理要求 !");
	return false;
   }   
}

function checkCooper() 
{
if(checkspace(document.Cooper.Cooper_Name.value)) {
	document.Cooper.Cooper_Name.focus();
    alert("您好!请填写你的姓名!");
	return false;
   }
if(checkspace(document.Cooper.Cooper_Age.value)) {
	document.Cooper.Cooper_Age.focus();
    alert("您好!请填写你的年龄!");
	return false;
   } 
if(checkspace(document.Cooper.Cooper_Tel.value)) {
	document.Cooper.Cooper_Tel.focus();
    alert("您好!请填写你的电话!");
	return false;
   }  
if(checkspace(document.Cooper.Cooper_Sf.value)) {
	document.Cooper.Cooper_Sf.focus();
    alert("您好!请填写你的身份证号码!");
	return false;
   } 
if(checkspace(document.Cooper.Cooper_Hy.value)) {
	document.Cooper.Cooper_Hy.focus();
    alert("您好!请填写你从事的行业!");
	return false;
   } 
if(checkspace(document.Cooper.Cooper_Hyy.value)) {
	document.Cooper.Cooper_Hyy.focus();
    alert("您好!请填写你的行业经验!");
	return false;
   } 
if(checkspace(document.Cooper.Cooper_ShopAdr.value)) {
	document.Cooper.Cooper_ShopAdr.focus();
    alert("您好!请填写你新店地址!");
	return false;
   } 
if(checkspace(document.Cooper.Cooper_ShopArea.value)) {
	document.Cooper.Cooper_ShopArea.focus();
    alert("您好!请填写你新店面积!");
	return false;
   }
if(checkspace(document.Cooper.Cooper_ShopMonney.value)) {
	document.Cooper.Cooper_ShopMonney.focus();
    alert("您好!请填写你投入的资金!");
	return false;
   } 
if(checkspace(document.Cooper.Cooper_Ln.value)) {
	document.Cooper.Cooper_Ln.focus();
    alert("您好!请填写你的加盟理念!");
	return false;
   } 
if(checkspace(document.Cooper.Cooper_Other.value)) {
	document.Cooper.Cooper_Other.focus();
    alert("您好!请填写你的备注信息!");
	return false;
   }  
}

function checkreset() 
{
if(checkspace(document.forgotPassword.User_Name.value)) {
	document.forgotPassword.User_Name.focus();
    alert("请输入您用户帐号 !");
	return false;
   }	 
}

function checkresetpass() 
{
  if(checkspace(document.resetpass.Users_Pass.value)) {
	document.resetpass.Users_Pass.focus();
    alert("请输入新的管理密码!");
	return false;
  }
  if(checkspace(document.resetpass.Users_Pass.value) || document.resetpass.Users_Pass.value.length < 6) {
	document.resetpass.Users_Pass.focus();
    alert("新的管理密码长度不能小于6，请重新输入!");
	return false;
  }
  if(checkspace(document.resetpass.confirmUsers_Pass.value)) {
	document.resetpass.confirmUsers_Pass.focus();
    alert("请再输入一次新的管理密码!");
	return false;
  }
  if(document.resetpass.Users_Pass.value != document.resetpass.confirmUsers_Pass.value) {
	document.resetpass.Users_Pass.focus();
	document.resetpass.Users_Pass.value = '';
	document.resetpass.confirmUsers_Pass.value = '';
    alert("两次输入的密码不同，请重新输入!");
	return false;
  }
}
