replaced js log2 (does not exist outside firefox yet)