One problem may be the use of the "^" operator. In VBS it does what one would expect, that is, raise a number to a power of. In JS it is a bitwise XOR operator. I think this is correct (?) Dave