Short js file to swap links from a document