Encode and Decode JavaScript