function isValidCharacterSet
(theElement, theElementName)
{
  var s = theElement.value;
var validChars = "0123456789,/@.'#&*abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ///-";
    
     var invalidChar = "";
     for ( var i = new Number(0); i < s.length; i++ ) {
          if (validChars.indexOf(s.substring(i,i+1)) == -1) {
               invalidChar = s.substring(i,i+1);
               if(invalidChar  !=null || invalidChar  != "" )
                   break;
               if (invalidChar.charCodeAt(0) == 10) invalidChar = "";          }
     }
     if (invalidChar == " ") invalidChar = "(space)";

 if(invalidChar != null && invalidChar != "" && invalidChar !=" ")
    {
    alert("The character "+ invalidChar +" is not allowed in the "+ theElementName);
     theElement.focus();
     theElement.select();
return false;
    } 

return true;
}
