/* NamcoArcade.info Site */
/* 21 Jun 2005 - Version 1.00 - Final production version */
/* by Jim Snyder */
/* Copyright (C) 2005 Namco Cybertainment Inc. */

/* Start JavaScript Function Include - Keystroke Limiter */

function limitKey(limKeyPress, limitMode)
{
var limKey;
var limKeyChar;

if (window.event)
	limKey = window.event.keyCode;
else if (limKeyPress)
	limKey = limKeyPress.which;
else
	return true;
	
limKeyChar = String.fromCharCode(limKey);
limKeyChar = limKeyChar.toLowerCase();

if (limitMode == "alpha")
	limStrSet = "abcdefghijklmnopqrstuvwxyz";
else if (limitMode == "alphanumeric")
	limStrSet = "abcdefghijklmnopqrstuvwxyz01234567890 -_.";
else if (limitMode == "numeric")
	limStrSet = "01234567890";
else if (limitMode == "numericplus")
	limStrSet = "01234567890.";
else if (limitMode == "decimal")
	limStrSet = "01234567890.-\+=\/\*";
else if (limitMode == "dollars")
	limStrSet = "01234567890.\$";
else if (limitMode == "email")
	limStrSet = "abcdefghijklmnopqrstuvwxyz01234567890-_.@";
else if (limitMode == "extended")
	limStrSet = "abcdefghijklmnopqrstuvwxyz01234567890-_.@()";
else if (limitMode == "limited")
	limStrSet = "abcdefghijklmnopqrstuvwxyz01234567890-_/ #'";
else if (limitMode == "open")
	limStrSet = "abcdefghijklmnopqrstuvwxyz01234567890-_/ #'\&,@()\$.";
else if (limitMode == "search")
	limStrSet = "abcdefghijklmnopqrstuvwxyz01234567890 -_.,";
else if (limitMode == "date")
	limStrSet = "0123456789/";
else if (limitMode == "datim")
	limStrSet = "0123456789/apm: ";
else if (limitMode == "web")
	limStrSet = "abcdefghijklmnopqrstuvwxyz01234567890-_.+=:%\/\&\*\[\]\?";
else
	limStrSet = "abcdefghijklmnopqrstuvwxyz01234567890 -_.";

if ((limKey == null) || (limKey == 0) || (limKey == 8) || (limKey == 9) || (limKey == 13) || (limKey == 27))
	return true;
else if (((limStrSet).indexOf(limKeyChar) > -1))
	return true;
else
	return false;
}


