This JS code is to swap links