Added javascript to detect root directory on server.