If the glass panes are loose from the frame, the seal between the panes has probably failed also. To properly repair the window you will probably have to go to one of the companies that specialize in repairing thermal pane windows in RVs.
If you just want an adhesive that will hold the glass to metal, automotive urethane glass sealer (what auto windshields are installed with) is available at most parts houses and any auto glass shop, and it will hold although it can be messy and if you get it on fabric it will not come out.
Gerald