Fixed bugs and moved all javascript to tenders.js