Javascript ideas, methods used etc