//表单的reset事件
function  frmreset(){
	form1.reset()
	return false;
}

//判断是否为空
function IsNull(obj,alertStr){
	if(obj.value==""){
		alert(alertStr + "不能为空！");
		obj.focus();
		return true;
	}
	return false;
}
//3、邮件校验isEmail(email)

function isEmail(email) 
{ 
 // valid format "a@b.cd" 
 invalidChars = " /;,:{}[]|*%$#!()`<>?"; 
if (email == "") 
    { 
  return false; 
    } 
for (i=0; i< invalidChars.length; i++) 
    { 
  badChar = invalidChars.charAt(i) 
  if (email.indexOf(badChar,0) > -1) 
         { 
   return false; 
         } 
    } 
atPos = email.indexOf("@",1) 
 // there must be one "@" symbol 
if (atPos == -1) 
    { 
  return false; 
    } 
if (email.indexOf("@", atPos+1) != -1) 
 { 
 // and only one "@" symbol 
  return false; 
 } 
 periodPos = email.indexOf(".",atPos) 
if(periodPos == -1) 
     { 
 // and at least one "." after the "@" 
  return false; 
     } 
if ( atPos +2 > periodPos) 
 // and at least one character between "@" and "." 
 { 
  return false; 
 } 
 if ( periodPos +3 > email.length) 
 { 
  return false; 
 } 
 return true; 
} 

//4、电话号码的校验isTel(tel)

function isTel(tel) 
{ 
 var validchars = "-()1234567890 "; 
 for (i=0;i<tel.length;i++) 
 { 
  telchar=tel.charAt(i); 
  if (validchars.indexOf(telchar, 0) == -1)
	  alert("非法字符");
 return false; 
 } 
 return true; 
}

// 是否数字的校验

function isShu(str)
{ 
 var validchars = "1234567890"; 
 for (i=0;i<str.length;i++) 
 { 
  telchar=str.charAt(i); 
  if (validchars.indexOf(telchar, 0) == -1) 
	  alert("非法字符");
 return false; 
 } 
 return true; 
}

function inspecial(thestring,specstr)//判断参数thestring的字符是否都在参数specstr中。
//如果是返回true,否则返回false
{
var re=true
for(i=0;i<thestring.length;i++)
{
if(specstr.indexOf(thestring.charAt(i))==-1)
{
    re = false;
    break;		
}
}
return re;
}

function insert(){
	alert("SSSSSSSSSS");
}