function checkdata2()<!--邮件号判断-->
{
	var bool;
	var str;
	var len;
	var i;
	var charsets;

	bool="true";
	charnum="0123456789";
	charsets="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

	str=this.document.frm.mailid.value;

	len=str.length;

	if (str=="") {
		bool="false1";
	}
	else{
		if (len!=13) {
			bool="false2";
		}
		else {
			if ((charsets.indexOf(str.substring(0,1))==-1)||(charsets.indexOf(str.substring(1,2))==-1)) {bool="false3";}
			for(i=2;i<11;i++) {
			 	//alert(charnum.indexOf(ch,0));
				if (charnum.indexOf(str.substring(i,i+1),0)<0) {bool="false4";}
			}
			if ((charsets.indexOf(str.substring(11,12))==-1)||(charsets.indexOf(str.substring(12,13))==-1)) {bool="false5";}
		}
	}

	if (bool!="true") {
		if (bool=="false1") {alert("用户查询的输入值不能为空！");bool="true";return false;}
		if (bool=="false2") {alert("输入值必须为13位！");bool="true";return false;}
		if (bool=="false3") {alert("输入值前两位必须为字符！");bool="true";return false;}
		if (bool=="false4") {alert("输入值第3位至第11位必须为数字123456789！");bool="true";frm.mailid.value="";frm.mailid.focus();return false}
		if (bool=="false5") {alert("输入值后两位必须为字符！");bool="true";return false;}

	}
	else {
		bool="true";
		//frm.action="chaxun.jsp";
		//frm.submit();return true;
               window.open("http://www.ems.com.cn/ems/chaxun.jsp?mailid="+frm.mailid.value)
               return true;
	}
}
<!-- hide
var win;
var msie3=false;

browserVer=parseInt( navigator.appVersion );
if( browserVer == 2 && navigator.appName == "Microsoft Internet Explorer" ) {
  browserVer++;
  msie3=true;
}

function winclose() {
  if( browserVer <= 2 )
    return true;
  if( msie3 != true && typeof( win ) == 'object' && !win.closed )
    win.close();
  return true;
}

function dhl_alert(name, text, height)
{    	    

  if( typeof( height) == "undefined" )
    height = 200;
  winclose();
  win=open( "", "dhl_alert", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=" + height);
  if( msie3 == true )
    while( typeof( win.document ) == "undefined" );

  win.document.write( "<HTML><HEAD><TITLE>"+ name +"</TITLE></HEAD>\n")
  win.document.write( "<script language=\"JavaScript\"> \n <!-- \n")

  win.document.write( "\nfunction private_MouseOver() \n")
  win.document.write( "{\nif (document.images) { eval(\"document.\" + this.stImageName + \".src=\\\'\" + this.stOverImage + \"\\\'\");}\n}\n")

  win.document.write( "\nfunction private_MouseOut() \n")
  win.document.write( "{\nif (document.images) { eval(\"document.\" + this.stImageName + \".src=\\\'\" + this.stOutImage + \"\\\'\");}\n}\n")

  win.document.write( "\n\nfunction objMouseChangeImg(stImageName, stOverImage, stOutImage) \n")
  win.document.write( "{\nthis.stImageName = stImageName; \n this.stOverImage = stOverImage; \n this.stOutImage = stOutImage; \n")
  win.document.write( " this.MouseOut = private_MouseOut; \n this.MouseOver = private_MouseOver; } \n ")

  win.document.write( "\n\nobjPIC1 = new objMouseChangeImg('PIC1', \'../images/return2.gif\', \'../images/return1.gif\'); ")
  
  win.document.write( "\n // --> </script> \n")

  win.document.write("<BODY BGCOLOR=\"#FFFFFF\">\n" );                                                           

  win.document.write( "<TABLE CELLPADDING=6 WIDTH=\"100\%\" HEIGHT=\"100\%\" BORDER=0><TR><TD BGCOLOR=\"#951314\"><FONT FACE=\"Frutiger, Arial\" COLOR=\"#FFFFFF\" SIZE=\"+1\"><B>" + name +"</B></FONT></TD></TR>" );                          
  win.document.write( "<TR><TD><FONT FACE=\"Frutiger, Arial\" SIZE=2>"+ text +"</FONT></TD></TR>" ); 
  
  win.document.write( "<TR><TD ALIGN=RIGHT><a href=\"javascript:window.close()\" onMouseOver=objPIC1.MouseOver() onMouseOut=objPIC1.MouseOut()><img src=file:///E|/images/return1.gif border=0 name=PIC1></a></td></tr></TABLE>" );                                                                  
  win.document.write( "</BODY></HTML>\n" );                                     
  win.document.close();           

  return false;
}

function strip( instring )
{
  var outstring="";
  var bit="";
  var founddigit=false;

  for( j=0;j<instring.length;j++ ) {
    c=instring.charAt(j);
    if( c != " " && c !="\t" && c !="\n"  && c !="\r" ) {
      if( founddigit == true )
        outstring+=bit;
      bit="";
      outstring+=c;
      founddigit=true;
    }
    else if( founddigit == true )
      bit+=c;
  }
  return outstring;
}

function checkForm(form)
{
  if( browserVer <= 2 )
    return true;
  awb=strip( form.airbill.value );
  var awbs=new Array;
  var tmp="";
  var curr=0;
  for(i=0;i<awb.length;i++) {
    c=awb.charAt( i );
    d=parseInt( c );
    if( ( msie3==true && !( d==0 && c != "0" ) ) || ( msie3==false && !isNaN( d ) ) ) {
      tmp+=c;
    }
    else {
      if( tmp != "" ) {
        awbs[curr]=tmp;
        curr++;
        tmp="";
      }
    }
  }
  if( tmp != "" )
    awbs[curr]=tmp;

  num=awbs.length;

  if( num == 0 )
  {
     dhl_alert( "The Airwaybill No. is missing", "Please enter a 10-digit Airwaybill No.", 180 );
     return false;
  }


  errors="";
  off=0;
  for( i=0 ; i< num ; i++ )
  {
    awbs[i]=strip( awbs[i] );
    if( awbs[i].length == 3 && awbs[i+1] && awbs[i+1].length == 4 && awbs[i+2] && awbs[i+2].length == 3 )
    {
      if( errors == "" )
        errors=""+(i+1);
      else
        errors+=(  ", " + (i+1-off) );
      off+=2;
    }
  }

  if( errors != "" ) {
    if( msie3 == false )
      numbad=errors.split( ", " );
    else
      numbad=new Array(2);
  if( numbad.length == 1 )
      dhl_alert( "Invalid Airwaybill No.", "Airwaybill No. " + numbad[0] + " has been split into 3 groups of digits.<BR>Airwaybill No. should be an unbroken string of 10-digits.<P>Please correct or remove this Airwaybill No.", 230 );
    else
      dhl_alert( "Invalid Airwaybill numbers", "Airwaybill numbers " + errors + " have all been split into 3 groups of digits.<BR>Airwaybill numbers should be an unbroken string of 10-digits.<P>Please correct or remove these Airwaybill numbers.", 230 );

    return false;
  }

  if( num > 10  ) {
     dhl_alert( "More than 10 shipments are input", "Please enter a maximum of 10 shipments.", 180 );
     return false;
  }

  errors="";
  for( i=0 ; i< num ; i++ ) {
    awbs[i]=strip( awbs[i] );
    if( awbs[i].length != 10 && !isNaN( awbs[i] ) ) {
      if( errors == "" )
        errors=""+(i+1);
      else
        errors+=(  ", " + (i+1) );
    }
  }
  if( errors != "" ) {
    if( msie3 == false )
      numbad=errors.split( ", " );
    else
      numbad=new Array(2);

    if( numbad.length == 1 )
      dhl_alert( "Invalid Airwaybill No.", "The Airwaybill No. on row " + numbad[0] + " is not a 10-digit No.<P>Please enter a 10-digit Airwaybill No." );
    else
      dhl_alert( "Invalid Airwaybill numbers", "The Airwaybill numbers on rows " + errors + " are not 10-digit numbers.<P>Please enter 10-digit Airwaybill numbers." );

    return false;
  }

  errors="";
  for( i=0 ; i< num ; i++ ) {
    awbs[i]=strip( awbs[i] );
    check1=awbs[i].substring(9,10);
    tocheck=awbs[i].substring(0,9);
    check2=tocheck % 7;
    if( check1 != check2  && awbs[i] != "" ) {
      if( errors == "" )
        errors=""+(i+1);
      else
        errors+=(  ", " + (i+1) );
    }
  }
  if( errors != "" ) {
    if( msie3 == false )
      numbad=errors.split( ", " );
    else
      numbad=new Array(2);

    if( numbad.length == 1 )
      dhl_alert( "Invalid Airwaybill No.", "The Airwaybill No. on row " + numbad[0] + " is not a valid Airwaybill No.<P>Please correct or remove this Airwaybill No." );
    else
      dhl_alert( "Invalid Airwaybill numbers", "The Airwaybill numbers on rows " + errors + " are not valid airwaybill numbers.<P>Please correct or remove these Airwaybill numbers." );

    return false;
  }

  form.awb.value=awbs[0];

  for( i=1 ; i< num ; i++ )
    form.awb.value+="|"+awbs[i];

  return true;
}

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

function isWhitespace (s)
{   var i;
    var whitespace = " \t\n\r";

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);

        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}

function isEmail(s)
{
   var defaultEmptyOK = false

   if (isEmpty(s)) 
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
   
    // is s whitespace?
    if (isWhitespace(s)) return false;
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

function CheckStmInfo(theContactName, thePhoneNum, theShpEmailAddr)
{
	if (isEmpty(theContactName.value))
	{
		theContactName.focus()
		theContactName.select()
		dhl_alert("The name of the contact person is missing", "Please enter the name of the contact person", 180 );
		return false;	
	}

	if (isEmpty(thePhoneNum.value))
	{
		thePhoneNum.focus()
		thePhoneNum.select()
		dhl_alert("The phone number is missing.", "Please enter your phone number.", 180 );
		return false;	
	}

	if (!isEmail(theShpEmailAddr.value, true))
	{
		theShpEmailAddr.focus()
		theShpEmailAddr.select()
		dhl_alert("Invalid Email Address.", "You have not entered a valid email address.<P>Please enter.", 180 );
		return false;	
	}
	return true;
}

// -->

