function StripInvalidChars(strText, strValidChars){
   var strResult = '';

   for (i = 0; i < strText.length; i++){ 
       if (strValidChars.indexOf(strText.charAt(i)) != -1)
          {
          strResult += strText.charAt(i);
       }
   }
   return strResult;
}

function IsEmpty(strText){
   if (strText == ''){
      return true;
   }
   else {
      return false;
   }
}

function IsFilled(strText){
   if (strText != ''){
      return true;
   }
   else {
      return false;
   }
}

function IsEmail(strText){
   var regEx = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
   if (regEx.test(strText)){
      return true;
   }
   else {
      return false;
   }
}

function IsValue(strText, strValue){
   if (strText == strValue){
      return true;
   }
   else {
      return false;
   }
}

function IsSmaller(strSmaller, strText){
   if (strSmaller < strText){
      return true;
   }
   else {
      return false;
   }
}

function IsLarger(strLarger, strText){
   if (strLarger > strText){
      return true;
   }
   else {
      return false;
   }
}

function IsEqual(strEqual, strText){
   if (strEqual == strText){
      return true;
   }
   else {
      return false;
   }
}

function IsUnEqual(strUnEqual, strText){
   if (strUnEqual != strText){
      return true;
   }
   else {
      return false;
   }
}

function IsNumeric(strText){
   var ValidChars = '0123456789';
   var IsNumber=true;

   for (i = 0; i < strText.length; i++){ 
       if (ValidChars.indexOf(strText.charAt(i)) == -1){
          IsNumber = false;
          break;
       }
   }
   return IsNumber;
}

function IsSE(strText){
   if (IsNumeric(strText) && strText.length == 8){
      checksum  = strText.charAt(0) * 2; 
      checksum += strText.charAt(1) * 7; 
      checksum += strText.charAt(2) * 6; 
      checksum += strText.charAt(3) * 5; 
      checksum += strText.charAt(4) * 4; 
      checksum += strText.charAt(5) * 3; 
      checksum += strText.charAt(6) * 2; 
      checksum = checksum % 11; 
      if (checksum != 0){
         checksum = 11 - checksum;
      }
      if (checksum == strText.charAt(7)){
         return true;
      }
      else {
         return false;
      }
   }
   return false; 
}

function IsEAN(strText){
   if (IsNumeric(strText) && strText.length == 13){
      return true;
   }
   else {
      return false;
   }
}
