//design by Lliz www.faxinad.com

   function Check(theForm){	
	if(theForm.姓名.value == "") {
		alert("您的姓名不能为空,请你重新填写!");
        theForm.姓名.focus();
		return false;
	   }
	   
	if(theForm.公司.value == "") {
		alert("公司名称不能为空,请您重新填写!");
        theForm.公司.focus();
		return false;
	   }
	   
	if(theForm.区号.value == "") {
		alert("联系电话的区号不能为空,请您重新填写!");
        theForm.区号.focus();
		return false;
	   }

         qqq=theForm.区号.value;
	 if(fucCheckNUM(qqq)==0){
	    alert("您输入的区号有误,请核对!")
            theForm.区号.focus();
		return false;
		}
	   	
	if(theForm.电话.value == "") {
		alert("联系电话不能为空,请您重新填写!");
        theForm.电话.focus();
		return false;
	   }

         ddd=theForm.电话.value;
	 if(fucCheckNUM(ddd)==0){
	    alert("您输入的电话有误,请核对!")
            theForm.电话.focus();
		return false;
		}

	if(theForm.E_mail.value == "") {
		alert("如果没有你的E_mail，将影响你在本站享受的一些服务,请输入您的E_mail!");
        theForm.E_mail.focus();
		return false;
	   }

         aaa=theForm.E_mail.value;
	 if(chkemail(aaa)==0){
	    alert("您输入的E-mail有误,请核对!")
            theForm.E_mail.focus();
		return false;
		}
  
	if(theForm.反馈信息.value == "") {
		alert("订购询价不能为空,请您重新填写!");
        theForm.反馈信息.focus();
		return false;
	   }
	   
   }

   function confirm_reset(theForm){
	if (confirm("重新填写？")){
          theForm.select2.focus();
		return true;
	}
	return false;
	}


function chkspc(a)
{
 // return 1;
 fibdn = new Array ("'" ,"\\", "、", ",", ";", "/", " ", ",");
 i=fibdn.length;
 j=a.length;
 for (ii=0;ii<i;ii++)
 { for (jj=0;jj<j;jj++)
  { temp1=a.charAt(jj);
   temp2=fibdn[ii];
   if (temp1==temp2)
   { return 0; }
  }
 }
 return 1;

}

function chkother(a)
{
 // return 1;
 fibdn = new Array (" ", "*");
 i=fibdn.length;
 j=a.length;
 for (ii=0;ii<i;ii++)
 { for (jj=0;jj<j;jj++)
  { temp1=a.charAt(jj);
   temp2=fibdn[ii];
   if (temp1==temp2)
   { return 0; }
  }
 }
 return 1;

}


function chkemail(a)
{ var i=a.length;
 var temp = a.indexOf('@');
 var tempd = a.indexOf('.');
 if (temp > 1) {
  if ((i-temp) > 3){
   
    if ((i-tempd)>0){
     return 1;
    }
   
  }
 }
 return 0;
}//opt1 小数     opt2   负数
//当opt2为1时检查num是否是负数
//当opt1为1时检查num是否是小数
//返回1是正确的，0是错误的
function chknbr(num,opt1,opt2)
{
 var i=num.length;
 var staus;
//staus用于记录.的个数
 status=0;
 if ((opt2!=1) && (num.charAt(0)=='-'))
 {
  //alert("You have enter a invalid number.");
  return 0;
 
 }
//当最后一位为.时出错
 if (num.charAt(i-1)=='.')
 {
  //alert("You have enter a invalid number.");
  return 0;
 }

 for (j=0;j<i;j++)
 {
  if (num.charAt(j)=='.')
  {
   status++;
  }
  if (status>1) 
  {
  //alert("You have enter a invalid number.");
  return 0;  
  }
  if (num.charAt(j)<'0' || num.charAt(j)>'9' )
  {
   if (((opt1==0) || (num.charAt(j)!='.')) && (j!=0)) 
   {
    //alert("You have enter a invalid number.");
    return 0;
   }
  }
 }
 return 1;
}

function fucCheckNUM(TEL)
{
 var i,j,strTemp;
 strTemp="0123456789-()# ";
 for (i=0;i<TEL.length;i++)
 {
  j=strTemp.indexOf(TEL.charAt(i)); 
  if (j==-1)
  {
  //说明有字符不合法
   return 0;
  }
 }
 //说明合法
 return 1;
}
