There should be a "key synchronization" procedure in the owner's manual--On mine you take the keyless which won't work (the one you put the new battery in) and be outside the car with the doors unlocked. Press the "lock" button on the keyless then flip the key out and lock the driver's door (turn key toward rear or the car) The key should now be programmed. You can also do it the other way, start with locked vehicle, press unlock on keyless then unlock driver's door with key.
As far as I know, don't buy a keyless fob off ebay for a 4.0 / 4.6 RR. They cannot be reprogrammed unless you have the BeCM from the donor ivehicle as well. (Someone could buy a key for $50 off ebay, copy the VIN off a 2002 HSE at the mall, follow that RR home so they know where they live, have the ebay key programmed to that VIN, and steal they car easily)