I want to add some documents to my tree but am not able.
That "attach" button is grayed out when there are index entries associated with the image. It is one of the clearest (and most annoying!) manifestations of FamilySearch's index-centric structure.
There are several ways you can proceed: you can attach the source citation using the index, using your source box, or using the URL.
To attach (a pointer to) the document using the index, open the Index Information tab at the bottom (if it isn't already open), find the entry you need, and click the piece-of-paper icon at the left of that line. On the resulting index detail page, use the "attach" button at the top of the right-hand column to invoke Source Linker.
To attach the document using your source box, you may want to open the document in two tabs, because the "Add to My Source Box" dialog obscures the image, meaning you have to either fill out the citation fields from memory, or you have to look at it in another tab. On one of the tabs, click the Source Box button, and choose Add to My Source Box to create the citation, then use your favorite method/direction to attach the citation to the profile(s).
To attach the document using the URL, as if it were a non-FS source, copy the URL, then go to the profile's Sources tab, choose Add Source, then Add New Source. Paste the URL into the Web Page URL field, add a title, and fill in the rest of the fields as you see fit. (The title is the only required bit.)