merged appavailability into dn.js and put it on document ready