(I am a newby here)

I bought a used iPhone 3g not under any warranty (jailbroken and unlocked) and when I got it, I noticed the person I bought it from left their accounts active on it. Since I am still new to the jailbroken and unlocked phone thing, I made a huge boo-boo and did a factory reset. It showed a low battery symbol (which I did buy and instal a new battery). I then tried to update it through iTunes, and now I get the error 23 and it will not do anything show the iTunes restore screen.

My question is: how is the best way to get it back to being a functional phone? What software is best and easiest to use.

Factory or jailbroken, doesnt matter to me. I just want this phone to work. :o(