moving javascript to seperate file