How could I make 3 statements into if/else depending on p1 and p2? Only 1 of the 3 conditions will be true. if(p1=1) { pagetxtnx=href+p1+'">Next</a> '; }; if(p1>1 && p1<p2) pagetxtbk=href+(p1-2)+'">Back</a> '; pagetxtnx=href+(p1+2)+'">Next</a> '; }; if(p1=p2) { pagetxtbk=href+(p1-2)+'">Back</a> '; }; Thanks Teck