Added JavaScript to load documents dynamically