The chiral potts model and its associated link invariant