function check()
{
	if(regform.company.value.length<1)	
	{
		alert("Please input Company!") ;
		regform.company.focus() ;
		return false;
	}
	if(!validstr(regform.contact))	return false ;

	  if (document.regform.tel.value=="")
  {
    alert("Please input Tel!");
    document.regform.tel.focus();
    return false;
  }
     if (document.regform.tel.value!="")
   {       var i,bHZ,nLen,name,tempValue;
        name = document.regform.tel.value;
        nLen = name.length;
        bHZ = false;
        tempValue="";
		 for(i=0;i<nLen;i++)
 {
	var ch,j,ch1;
	ch1 = document.regform.tel.value.charCodeAt(i);
	ch = document.regform.tel.value.charAt(i);
	
	if(eval(ch1 - 0x80) >= 0) 
		{   
		alert("Please input effectual tel!");
	    document.regform.tel.focus();
	    return false;	
		}
		else
		{
		if ((ch < '0' || ch > '9')&&ch!='-'&&ch!='_')
			{
			alert("Please input effectual tel!");
	        document.regform.tel.focus();
	        return false;
			}
			else
			{
			}
		}
  }  
    }
	if(ValidEmail(regform.email.value))	// 判断邮件地址
	{
		alert("Please input effectual email!") ;
		regform.email.focus() ;
		return false ;
	}
	return true;
}
function validstr(str)
{
  var s,i,j;

  if (str.value.length <1)
  {
	alert("Please input Contact!");
	str.focus();
    return false;
  }
  s=" +=|'#&<>%*`^/\\\";,.";
  str1=str.value.toString();
  for (i=0; i<str1.length; i++)
  {
	for(j=0;j<s.length;j++)
	{
	  if (str1.charAt(i) == s.charAt(j))
      {
		alert("联系人名字中不能包含特殊字符: +=|'#&<>%*`^/\\\";,.空格");
 		str.focus();
    	return false;
   	  }
	}
  }
  return true;
}
function ValidEmail(item){
var etext
var elen
var i
var aa
etext=item
elen=etext.length
if (elen<5)
 return true;
i= etext.indexOf("@",0)
if (i==0 || i==-1 || i==elen-1)
 return true;
else
 {if (etext.indexOf("@",i+1)!=-1)
  return true;}
if (etext.indexOf("..",i+1)!=-1)
 return true;
i=etext.indexOf(".",0)
if (i==0 || i==-1 || etext.charAt(elen-1)=='.')
 return true;
if ( etext.charAt(0)=='-' ||  etext.charAt(elen-1)=='-')
 return true;
if ( etext.charAt(0)=='_' ||  etext.charAt(elen-1)=='_')
 return true;
for (i=0;i<=elen-1;i++)
{ aa=etext.charAt(i)
  if (!((aa=='.') || (aa=='@') || (aa=='-') ||(aa=='_') || (aa>='0' && aa<='9') || (aa>='a' && aa<='z') || (aa>='A' && aa<='Z')))
   return true;
}
return false;
}
