Javascript for dynamic behaviour; may not be fully functional