// ===================================================================
// Author: BRUCE E WATT
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

/////////////////////////////////////
// RESTRICT SPECIAL CHARACTERS

function kb_acceptKeys_email(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) )
   return false;

// || (key==27) is a comma

// restricted characters
else if ((("'!~$^&|\\?/%#*()+=:;<>{}[]\"").indexOf(keychar) > -1))
   return false;

// ONLY ALLOW numbers
//  else if ((("0123456789 ").indexOf(keychar) > -1))
//    return true;


else
   return true;
}




