function check_email( email_address ) {

     var specialchars = ' !#%^&*()=|\/<>?`,:;';
     var status=true;
     atPos = email_address.indexOf('@');
     ldotPos = email_address.lastIndexOf('.');

     if ( email_address == '' )
	  	return false;

     //  if no @, if @ is first char, atleast 4 chars after the @, no multiple @ signs allowed
     if ( (atPos == -1) || ((atPos+1) < 2) ||  ( (atPos+1) > (email_address.length - 4) ) )
     	return false;

        // . is the first char, no more than one @ in the field, atleast 2 chars after the last  .
	  if( email_address.indexOf('.',0) == 0 || (ldotPos+1) > (email_address.length - 2) )
		return false;

	//check for consecutive dots
	dotPos1 = 0;
	for(i=0; (i < email_address.length) && status == true; i++)
	{
	  dotPos1 = email_address.indexOf('.', i)
	  if( email_address.charAt(dotPos1 + 1) == '.' )
			return false;
	}

   if( (email_address.indexOf('@', atPos + 1) != -1 ) && status == true  )
		return false;

   for( i=0; (i < specialchars.length) && status==true; i++ )
	   if( email_address.indexOf(specialchars.charAt(i)) !=  -1 )
			return false;

   return true;
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
	  
   return blnResult;
   }

