moving javascript to external file