﻿// JScript File
function IsValid(strString, strValidChars)
{
  var strChar;
  var blnResult = true;  

  if (strString.length == 0)
    return false;
  for (i = 0; i < strString.length && blnResult == true; i++)
  {
    strChar = strString.charAt(i);
    if (strValidChars.indexOf(strChar) == -1)
    {
      blnResult = false;
    }
  }
  return blnResult;
}		

function IsValidEmail(email)
{
  if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1))
    return false;
  else
    return true;  
}

function LTrim(value)
{
  var re = /\s*((\S+\s*)*)/;
  return value.replace(re, "$1");
}
function RTrim(value)
{
  var re = /((\s*\S+)*)\s*/;
  return value.replace(re, "$1");
}
function Trim(value)
{
  return LTrim(RTrim(value));
}
