Top does not need to be replaced. Go to Advance Auto
Parts, get the tube of polyurethane windshield adhesive
and glue it back up. Try not to get any on the fabric
because it won't be coming off; some blue masking tape
is your friend. Consider doing the less messed up inside
part first, and the outside the next day so you have
something to press against.
Be sure to clean the glass very well (like Windex followed
by acetone or xylene) and wipe the old glue surface a
few times with the solvent too.
Mine came apart like yours a few months back. All better
now, except I have a couple of glue blobs to razor off
the glass still. At least it's back to watertight.