function IsValidChar(pValue, pValidChars)
{
  if (pValue == "") { return false; }
  if (pValidChars == "") { return false; }
  
	var result = true;
  var c;
	
	for (i = 0; i < pValue.length && result == true; i++) {
		c = pValue.charAt(i);
		if (pValidChars.indexOf(c) == -1) {
		  result = false;
		}
  }
	  
  return result;
}

function isInt(pValue)
{
	return IsValidChar(pValue, '0123456789');
}

function checkValidEmail(pValue)
{
	var x = pValue;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) return true;
	else return false;
}
