javascript only called when needed using pics and quiz directories