tabs.js modified[removed Js code,optimised queries and used chaining wherever possible]